25 #include <unordered_set> 29 #include <geos/geom/MultiLineString.h> 30 #include <geos/triangulate/quadedge/QuadEdge.h> 31 #include <geos/triangulate/quadedge/QuadEdgeLocator.h> 32 #include <geos/triangulate/quadedge/QuadEdgeQuartet.h> 33 #include <geos/triangulate/quadedge/Vertex.h> 39 class CoordinateSequence;
40 class GeometryCollection;
41 class MultiLineString;
42 class GeometryFactory;
48 namespace triangulate {
51 class TriangleVisitor;
53 const double EDGE_COINCIDENCE_TOL_FACTOR = 1000;
56 const double FRAME_SIZE_FACTOR = 100;
85 typedef std::vector<QuadEdge*> QuadEdgeList;
95 static void getTriangleEdges(
const QuadEdge& startQE,
103 std::deque<QuadEdgeQuartet> quadEdges;
104 std::array<QuadEdge*, 3> startingEdges;
106 double edgeCoincidenceTolerance;
107 std::array<Vertex, 3> frameVertex;
109 std::unique_ptr<QuadEdgeLocator> locator;
110 bool visit_state_clean;
128 virtual void initSubdiv();
159 inline std::deque<QuadEdgeQuartet>&
175 this->locator = std::move(p_locator);
242 return locator->locate(v);
258 return locator->locate(
Vertex(p));
297 bool isFrameEdge(
const QuadEdge& e)
const;
307 bool isFrameBorderEdge(
const QuadEdge& e)
const;
315 bool isFrameVertex(
const Vertex& v)
const;
349 std::unique_ptr<QuadEdgeList> getPrimaryEdges(
bool includeFrame);
358 typedef std::stack<QuadEdge*> QuadEdgeStack;
359 typedef std::vector<std::unique_ptr<geom::CoordinateSequence>> TriList;
366 std::array<QuadEdge*, 3> m_triEdges;
384 std::array<QuadEdge*, 3>* fetchTriangleToVisit(
QuadEdge* edge, QuadEdgeStack& edgeStack,
bool includeFrame);
392 void getTriangleCoordinates(TriList* triList,
bool includeFrame);
395 class TriangleCoordinatesVisitor;
396 class TriangleCircumcentreVisitor;
446 std::unique_ptr<geom::MultiLineString> getVoronoiDiagramEdges(
const geom::GeometryFactory& geomFact);
459 std::vector<std::unique_ptr<geom::Geometry>> getVoronoiCellPolygons(
const geom::GeometryFactory& geomFact);
472 std::vector<std::unique_ptr<geom::Geometry>> getVoronoiCellEdges(
const geom::GeometryFactory& geomFact);
487 std::unique_ptr<QuadEdgeSubdivision::QuadEdgeList> getVertexUniqueEdges(
bool includeFrame);
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
QuadEdge * locate(const geom::Coordinate &p)
Finds a quadedge of a triangle containing a location specified by a geom::Coordinate, if one exists.
Definition: QuadEdgeSubdivision.h:256
An interface for algorithms which process the triangles in a QuadEdgeSubdivision. ...
Definition: TriangleVisitor.h:33
QuadEdge * locate(const Vertex &v) const
Finds a quadedge of a triangle containing a location specified by a Vertex, if one exists...
Definition: QuadEdgeSubdivision.h:240
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Models a site (node) in a QuadEdgeSubdivision.
Definition: Vertex.h:60
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
std::deque< QuadEdgeQuartet > & getEdges()
Gets the collection of base QuadEdges (one for every pair of vertices which is connected).
Definition: QuadEdgeSubdivision.h:160
A class that contains the QuadEdges representing a planar subdivision that models a triangulation...
Definition: QuadEdgeSubdivision.h:83
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25
const geom::Envelope & getEnvelope() const
Gets the envelope of the Subdivision (including the frame).
Definition: QuadEdgeSubdivision.h:148
void setLocator(std::unique_ptr< QuadEdgeLocator > p_locator)
Sets the QuadEdgeLocator to use for locating containing triangles in this subdivision.
Definition: QuadEdgeSubdivision.h:173
A class that represents the edge data structure which implements the quadedge algebra.
Definition: QuadEdge.h:53
double getTolerance() const
Gets the vertex-equality tolerance value used in this subdivision.
Definition: QuadEdgeSubdivision.h:137