GEOS 3.6.2
geomgraph/DirectedEdge.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
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
33namespace geos {
34 namespace geomgraph {
35 class Edge;
36 class EdgeRing;
37 }
38}
39
40namespace geos {
41namespace geomgraph { // geos.geomgraph
42
44class GEOS_DLL DirectedEdge: public EdgeEnd {
45
46public:
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
124
135
143 void setEdgeDepths(int position, int newDepth);
144
145 virtual std::string print() const;
146
147 std::string printEdge();
148
149protected:
150
151 bool isForwardVar;
152
153private:
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
static int depthFactor(int currLocation, int nextLocation)
Computes the factor for the change in depth when moving from one location to another....
DirectedEdge * getSym()
Each Edge gives rise to a pair of symmetric DirectedEdges, in opposite directions.
void setEdgeDepths(int position, int newDepth)
Set both edge depths.
void setVisitedEdge(bool newIsVisited)
Marks both DirectedEdges attached to a given Edge.
bool isLineEdge()
Tells wheter this edge is a Line.
bool isInteriorAreaEdge()
Tells wheter this edge is an Area.
Definition geomgraph/EdgeRing.h:59
Definition geomgraph/Edge.h:66
Contains classes that implement topology graphs.
Definition IndexedNestedRingTester.h:34
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25