GEOS  3.8.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.
13  * See the COPYING file for more information.
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/geomgraph/EdgeEnd.h> // for inheritance
29 
30 #include <geos/inline.h>
31 
32 // Forward declarations
33 namespace geos {
34 namespace geomgraph {
35 class Edge;
36 class EdgeRing;
37 }
38 }
39 
40 namespace geos {
41 namespace geomgraph { // geos.geomgraph
42 
44 class GEOS_DLL DirectedEdge: public EdgeEnd {
45 
46 public:
47 
54  static int depthFactor(int currLocation, int nextLocation);
55 
56  //DirectedEdge();
57  //virtual ~DirectedEdge();
58 
59  DirectedEdge(Edge* newEdge, bool newIsForward);
60 
61  // this is no different from Base class, no need to override
62  //Edge* getEdge();
63 
64  void setInResult(bool newIsInResult);
65 
66  bool isInResult();
67 
68  bool isVisited();
69 
70  void setVisited(bool newIsVisited);
71 
72  void setEdgeRing(EdgeRing* newEdgeRing);
73 
74  EdgeRing* getEdgeRing();
75 
76  void setMinEdgeRing(EdgeRing* newMinEdgeRing);
77 
78  EdgeRing* getMinEdgeRing();
79 
80  int getDepth(int position);
81 
82  void setDepth(int position, int newDepth);
83 
84  int getDepthDelta() const;
85 
87  //
91  void setVisitedEdge(bool newIsVisited);
92 
93 
101  DirectedEdge* getSym();
102 
103  bool isForward();
104 
105  void setSym(DirectedEdge* de);
106 
107  DirectedEdge* getNext();
108 
109  void setNext(DirectedEdge* newNext);
110 
111  DirectedEdge* getNextMin();
112 
113  void setNextMin(DirectedEdge* newNextMin);
114 
123  bool isLineEdge();
124 
134  bool isInteriorAreaEdge();
135 
143  void setEdgeDepths(int position, int newDepth);
144 
145  std::string print() const override;
146 
147  std::string printEdge();
148 
149 protected:
150 
151  bool isForwardVar;
152 
153 private:
154 
155  bool isInResultVar;
156 
157  bool isVisitedVar;
158 
160  DirectedEdge* sym;
161 
163  DirectedEdge* next;
164 
166  DirectedEdge* nextMin;
167 
169  EdgeRing* edgeRing;
170 
172  EdgeRing* minEdgeRing;
173 
178  int depth[3];
179 
181  void computeDirectedLabel();
182 };
183 
184 } // namespace geos.geomgraph
185 } // namespace geos
186 
187 #ifdef GEOS_INLINE
188 # include "geos/geomgraph/DirectedEdge.inl"
189 #endif
190 
191 #endif // ifndef GEOS_GEOMGRAPH_DIRECTEDEDGE_H
A directed EdgeEnd.
Definition: geomgraph/DirectedEdge.h:44
Models the end of an edge incident on a node.
Definition: EdgeEnd.h:56
Definition: geomgraph/EdgeRing.h:59
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
Definition: geomgraph/Edge.h:66