RobustClipEnvelopeComputer.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Envelope.h>
#include <vector>
#include <map>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
class Geometry;
class GeometryCollection;
class Polygon;
class LinearRing;
}
namespace operation {
}
}
namespace geos { // geos.
namespace operation { // geos.operation
namespace overlayng { // geos.operation.overlayng
class GEOS_DLL RobustClipEnvelopeComputer {
using Coordinate = geos::geom::Coordinate;
using Geometry = geos::geom::Geometry;
using GeometryCollection = geos::geom::GeometryCollection;
using Polygon = geos::geom::Polygon;
using LinearRing = geos::geom::LinearRing;
using Envelope = geos::geom::Envelope;
private:
// Members
const Envelope* targetEnv;
Envelope clipEnv;
// Methods
void add(const Geometry* g);
void addCollection(const GeometryCollection* gc);
void addPolygon(const Polygon* poly);
void addPolygonRing(const LinearRing* ring);
void addSegment(const Coordinate& p1, const Coordinate& p2);
bool intersectsSegment(const Envelope* env, const Coordinate& p1, const Coordinate& p2);
public:
RobustClipEnvelopeComputer(const Envelope* p_targetEnv);
static Envelope getEnvelope(const Geometry* a, const Geometry* b, const Envelope* targetEnv);
Envelope getEnvelope();
};
} // namespace geos.operation.overlayng
} // namespace geos.operation
} // namespace geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::geom::GeometryCollection
Represents a collection of heterogeneous Geometry objects.
Definition GeometryCollection.h:51
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::LinearRing
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::geom
Definition Angle.h:26
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38