GEOS  3.8.0dev
geomgraph/DirectedEdgeStar.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/DirectedEdgeStar.java r428 (JTS-1.12+)
18  *
19  **********************************************************************/
20 
21 
22 #ifndef GEOS_GEOMGRAPH_DIRECTEDEDGEENDSTAR_H
23 #define GEOS_GEOMGRAPH_DIRECTEDEDGEENDSTAR_H
24 
25 #include <geos/export.h>
26 #include <set>
27 #include <string>
28 #include <vector>
29 
30 #include <geos/geomgraph/EdgeEndStar.h> // for inheritance
31 #include <geos/geomgraph/Label.h> // for private member
32 #include <geos/geom/Coordinate.h> // for p0,p1
33 
34 #include <geos/inline.h>
35 
36 // Forward declarations
37 namespace geos {
38 namespace geomgraph {
39 class DirectedEdge;
40 class EdgeRing;
41 }
42 }
43 
44 namespace geos {
45 namespace geomgraph { // geos.geomgraph
46 
55 class GEOS_DLL DirectedEdgeStar: public EdgeEndStar {
56 
57 public:
58 
60  :
61  EdgeEndStar(),
62  resultAreaEdgeList(nullptr),
63  label()
64  {}
65 
66  ~DirectedEdgeStar() override
67  {
68  delete resultAreaEdgeList;
69  }
70 
72  void insert(EdgeEnd* ee) override;
73 
74  Label&
75  getLabel()
76  {
77  return label;
78  }
79 
80  int getOutgoingDegree();
81 
82  int getOutgoingDegree(EdgeRing* er);
83 
84  DirectedEdge* getRightmostEdge();
85 
90  void computeLabelling(std::vector<GeometryGraph*>* geom) override; // throw(TopologyException *);
91 
96  void mergeSymLabels();
97 
99  void updateLabelling(const Label& nodeLabel);
100 
101 
119  void linkResultDirectedEdges(); // throw(TopologyException *);
120 
121  void linkMinimalDirectedEdges(EdgeRing* er);
122 
123  void linkAllDirectedEdges();
124 
131  void findCoveredLineEdges();
132 
138  void computeDepths(DirectedEdge* de);
139 
140  std::string print() const override;
141 
142 private:
143 
147  std::vector<DirectedEdge*>* resultAreaEdgeList;
148 
149  Label label;
150 
154  std::vector<DirectedEdge*>* getResultAreaEdges();
155 
157  enum {
158  SCANNING_FOR_INCOMING = 1,
159  LINKING_TO_OUTGOING
160  };
161 
162  int computeDepths(EdgeEndStar::iterator startIt,
163  EdgeEndStar::iterator endIt, int startDepth);
164 };
165 
166 
167 } // namespace geos.geomgraph
168 } // namespace geos
169 
170 //#ifdef GEOS_INLINE
171 //# include "geos/geomgraph/DirectedEdgeEndStar.inl"
172 //#endif
173 
174 #endif // ifndef GEOS_GEOMGRAPH_DIRECTEDEDGEENDSTAR_H
175 
A EdgeEndStar is an ordered list of EdgeEnds around a node.
Definition: EdgeEndStar.h:63
A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node.
Definition: geomgraph/DirectedEdgeStar.h:55
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
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition: Label.h:57
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25