GEOS  3.9.0dev
geomgraph/DirectedEdge.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7  * Copyright (C) 2005-2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
14  *
15  **********************************************************************
16  *
17  * Last port: geomgraph/DirectedEdge.java r428 (JTS-1.12)
18  *
19  **********************************************************************/
20
21
22 #ifndef GEOS_GEOMGRAPH_DIRECTEDEDGE_H
23 #define GEOS_GEOMGRAPH_DIRECTEDEDGE_H
24
25 #include <geos/export.h>
26 #include <string>
27
28 #include <geos/geom/Location.h>
29 #include <geos/geomgraph/EdgeEnd.h> // for inheritance
30
31 #include <geos/inline.h>
32
33 // Forward declarations
34 namespace geos {
35 namespace geomgraph {
36 class Edge;
37 class EdgeRing;
38 }
39 }
40
41 namespace geos {
42 namespace geomgraph { // geos.geomgraph
43
45 class GEOS_DLL DirectedEdge: public EdgeEnd {
46
47 public:
48
55  static int depthFactor(geom::Location currLocation, geom::Location nextLocation);
56
57  //DirectedEdge();
58  //virtual ~DirectedEdge();
59
60  DirectedEdge(Edge* newEdge, bool newIsForward);
61
62  // this is no different from Base class, no need to override
63  //Edge* getEdge();
64
65  void setInResult(bool newIsInResult);
66
67  bool isInResult();
68
69  bool isVisited();
70
71  void setVisited(bool newIsVisited);
72
73  void setEdgeRing(EdgeRing* newEdgeRing);
74
75  EdgeRing* getEdgeRing();
76
77  void setMinEdgeRing(EdgeRing* newMinEdgeRing);
78
79  EdgeRing* getMinEdgeRing();
80
81  int getDepth(int position);
82
83  void setDepth(int position, int newDepth);
84
85  int getDepthDelta() const;
86
92  void setVisitedEdge(bool newIsVisited);
93
94
102  DirectedEdge* getSym();
103
104  bool isForward();
105
106  void setSym(DirectedEdge* de);
107
108  DirectedEdge* getNext();
109
110  void setNext(DirectedEdge* newNext);
111
112  DirectedEdge* getNextMin();
113
114  void setNextMin(DirectedEdge* newNextMin);
115
124  bool isLineEdge();
125
135  bool isInteriorAreaEdge();
136
144  void setEdgeDepths(int position, int newDepth);
145
146  std::string print() const override;
147
148  std::string printEdge();
149
150 protected:
151
152  bool isForwardVar;
153
154 private:
155
156  bool isInResultVar;
157
158  bool isVisitedVar;
159
161  DirectedEdge* sym;
162
164  DirectedEdge* next;
165
167  DirectedEdge* nextMin;
168
170  EdgeRing* edgeRing;
171
173  EdgeRing* minEdgeRing;
174
179  int depth[3];
180
182  void computeDirectedLabel();
183 };
184
185 } // namespace geos.geomgraph
186 } // namespace geos
187
188 #ifdef GEOS_INLINE
189 # include "geos/geomgraph/DirectedEdge.inl"
190 #endif
191
192 #endif // ifndef GEOS_GEOMGRAPH_DIRECTEDEDGE_H
A directed EdgeEnd.
Definition: geomgraph/DirectedEdge.h:45
Models the end of an edge incident on a node.
Definition: EdgeEnd.h:56
Definition: geomgraph/EdgeRing.h:60
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:34
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26
Definition: geomgraph/Edge.h:66