GEOS 3.13.1
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#pragma once
23
24#include <geos/export.h>
25#include <string>
26
27#include <geos/geom/Location.h>
28#include <geos/geomgraph/EdgeEnd.h> // for inheritance
29
30// Forward declarations
31namespace geos {
32namespace geomgraph {
33class Edge;
34class EdgeRing;
35}
36}
37
38namespace geos {
39namespace geomgraph { // geos.geomgraph
40
42class GEOS_DLL DirectedEdge final: public EdgeEnd {
43
44public:
45
52 static int depthFactor(geom::Location currLocation, geom::Location nextLocation);
53
54 //DirectedEdge();
55 //virtual ~DirectedEdge();
56
57 DirectedEdge(Edge* newEdge, bool newIsForward);
58
59 // this is no different from Base class, no need to override
60 //Edge* getEdge();
61
62 void setInResult(bool v)
63 {
64 isInResultVar = v;
65 };
66
67 bool isInResult() const
68 {
69 return isInResultVar;
70 };
71
72 bool isVisited() const
73 {
74 return isVisitedVar;
75 };
76
77
78 void setVisited(bool v)
79 {
80 isVisitedVar = v;
81 };
82
83 void setEdgeRing(EdgeRing* er)
84 {
85 edgeRing = er;
86 };
87
88 EdgeRing* getEdgeRing() const
89 {
90 return edgeRing;
91 };
92
93 void setMinEdgeRing(EdgeRing* mer)
94 {
95 minEdgeRing = mer;
96 };
97
98 EdgeRing* getMinEdgeRing() const
99 {
100 return minEdgeRing;
101 };
102
103 int getDepth(int position) const
104 {
105 return depth[position];
106 };
107
108 void setDepth(int position, int newDepth);
109
110 int getDepthDelta() const;
111
117 void setVisitedEdge(bool newIsVisited);
118
126 DirectedEdge* getSym() const
127 {
128 return sym;
129 };
130
131 bool isForward() const
132 {
133 return isForwardVar;
134 };
135
136 void setSym(DirectedEdge* de)
137 {
138 sym = de;
139 };
140
141 DirectedEdge* getNext() const
142 {
143 return next;
144 };
145
146 void setNext(DirectedEdge* newNext)
147 {
148 next = newNext;
149 };
150
151 DirectedEdge* getNextMin() const
152 {
153 return nextMin;
154 };
155
156 void setNextMin(DirectedEdge* nm)
157 {
158 nextMin = nm;
159 };
160
170
181
189 void setEdgeDepths(int position, int newDepth);
190
191 std::string print() const override;
192
193 std::string printEdge();
194
195
196protected:
197
198 bool isForwardVar;
199
200
201private:
202
203 bool isInResultVar;
204
205 bool isVisitedVar;
206
208 DirectedEdge* sym;
209
211 DirectedEdge* next;
212
214 DirectedEdge* nextMin;
215
217 EdgeRing* edgeRing;
218
220 EdgeRing* minEdgeRing;
221
226 int depth[3];
227
229 void computeDirectedLabel();
230
231
232};
233
234} // namespace geos.geomgraph
235} // namespace geos
236
void setEdgeDepths(int position, int newDepth)
Set both edge depths.
void setVisitedEdge(bool newIsVisited)
bool isLineEdge()
Tells whether this edge is a Line.
DirectedEdge * getSym() const
Each Edge gives rise to a pair of symmetric DirectedEdges, in opposite directions.
Definition geomgraph/DirectedEdge.h:126
static int depthFactor(geom::Location currLocation, geom::Location nextLocation)
Computes the factor for the change in depth when moving from one location to another....
bool isInteriorAreaEdge()
Tells whether this edge is an Area.
Definition geomgraph/EdgeRing.h:57
Definition geomgraph/Edge.h:63
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
Contains classes that implement topology graphs.
Definition Depth.h:31
Basic namespace for all GEOS functionalities.
Definition geos.h:39