GEOS  3.9.1dev
geomgraph/DirectedEdge.h
Go to the documentation of this file.
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/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 
153 
154 private:
155 
157 
159 
162 
165 
168 
171 
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
#define GEOS_DLL
Definition: export.h:28
DirectedEdge * nextMin
the next edge in the MinimalEdgeRing that contains this edge
DirectedEdge * next
the next edge in the edge ring for the polygon containing this edge
Models the end of an edge incident on a node.
Definition: EdgeEnd.h:56
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:34
Basic namespace for all GEOS functionalities.
EdgeRing * edgeRing
the EdgeRing that this edge is part of
EdgeRing * minEdgeRing
the MinimalEdgeRing that this edge is part of
DirectedEdge * sym
the symmetric edge