22 #ifndef GEOS_GEOMGRAPH_GEOMETRYGRAPH_H
23 #define GEOS_GEOMGRAPH_GEOMETRYGRAPH_H
25 #include <geos/export.h>
30 #include <geos/geom/Coordinate.h>
31 #include <geos/geom/CoordinateSequence.h>
32 #include <geos/geomgraph/PlanarGraph.h>
33 #include <geos/geom/LineString.h>
35 #include <geos/inline.h>
39 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
49 class GeometryCollection;
53 class LineIntersector;
54 class BoundaryNodeRule;
60 class SegmentIntersector;
61 class EdgeSetIntersector;
69 class GEOS_DLL GeometryGraph:
public PlanarGraph
71 using PlanarGraph::add;
76 const geom::Geometry* parentGeom;
87 std::map<const geom::LineString*, Edge*> lineEdgeMap;
93 bool useBoundaryDeterminationRule;
95 const algorithm::BoundaryNodeRule& boundaryNodeRule;
104 std::auto_ptr< geom::CoordinateSequence > boundaryPoints;
106 std::auto_ptr< std::vector<Node*> > boundaryNodes;
108 bool hasTooFewPointsVar;
110 geom::Coordinate invalidPoint;
113 index::EdgeSetIntersector* createEdgeSetIntersector();
115 void add(
const geom::Geometry *g);
118 void addCollection(
const geom::GeometryCollection *gc);
120 void addPoint(
const geom::Point *p);
122 void addPolygonRing(
const geom::LinearRing *lr,
123 int cwLeft,
int cwRight);
125 void addPolygon(
const geom::Polygon *p);
127 void addLineString(
const geom::LineString *line);
129 void insertPoint(
int argIndex,
const geom::Coordinate& coord,
139 void insertBoundaryPoint(
int argIndex,
const geom::Coordinate& coord);
141 void addSelfIntersectionNodes(
int argIndex);
150 void addSelfIntersectionNode(
int argIndex,
151 const geom::Coordinate& coord,
int loc);
154 GeometryGraph(
const GeometryGraph& other);
155 GeometryGraph& operator=(
const GeometryGraph& rhs);
159 static bool isInBoundary(
int boundaryCount);
161 static int determineBoundary(
int boundaryCount);
163 static int determineBoundary(
164 const algorithm::BoundaryNodeRule& boundaryNodeRule,
169 GeometryGraph(
int newArgIndex,
const geom::Geometry *newParentGeom);
171 GeometryGraph(
int newArgIndex,
const geom::Geometry *newParentGeom,
172 const algorithm::BoundaryNodeRule& boundaryNodeRule);
174 virtual ~GeometryGraph();
177 const geom::Geometry* getGeometry();
180 std::vector<Node*>* getBoundaryNodes();
182 void getBoundaryNodes(std::vector<Node*>&bdyNodes);
185 geom::CoordinateSequence* getBoundaryPoints();
187 Edge* findEdge(
const geom::LineString *line);
189 void computeSplitEdges(std::vector<Edge*> *edgelist);
191 void addEdge(Edge *e);
193 void addPoint(geom::Coordinate& pt);
210 index::SegmentIntersector* computeSelfNodes(
211 algorithm::LineIntersector *li,
212 bool computeRingSelfNodes);
216 index::SegmentIntersector* computeSelfNodes(
217 algorithm::LineIntersector& li,
218 bool computeRingSelfNodes);
220 index::SegmentIntersector* computeEdgeIntersections(GeometryGraph *g,
221 algorithm::LineIntersector *li,
bool includeProper);
223 std::vector<Edge*> *getEdges();
225 bool hasTooFewPoints();
227 const geom::Coordinate& getInvalidPoint();
229 const algorithm::BoundaryNodeRule& getBoundaryNodeRule()
const
230 {
return boundaryNodeRule; }
243 # include "geos/geomgraph/GeometryGraph.inl"
246 #endif // ifndef GEOS_GEOMGRAPH_GEOMETRYGRAPH_H