GEOS  3.13.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 #pragma once
23 
24 #include <geos/export.h>
25 #include <set>
26 #include <string>
27 #include <vector>
28 
29 #include <geos/geomgraph/EdgeEndStar.h> // for inheritance
30 #include <geos/geomgraph/Label.h> // for private member
31 #include <geos/geom/Coordinate.h> // for p0,p1
32 
33 
34 // Forward declarations
35 namespace geos {
36 namespace geomgraph {
37 class DirectedEdge;
38 class EdgeRing;
39 }
40 }
41 
42 namespace geos {
43 namespace geomgraph { // geos.geomgraph
44 
53 class GEOS_DLL DirectedEdgeStar: public EdgeEndStar {
54 
55 public:
56 
58  :
59  EdgeEndStar(),
60  label(),
61  resultAreaEdgesComputed(false)
62  {}
63 
64  ~DirectedEdgeStar() override = default;
65 
67  void insert(EdgeEnd* ee) override;
68 
69  Label&
70  getLabel()
71  {
72  return label;
73  }
74 
75  int getOutgoingDegree();
76 
77  int getOutgoingDegree(EdgeRing* er);
78 
79  DirectedEdge* getRightmostEdge();
80 
84  void computeLabelling(std::vector<GeometryGraph*>* geom) override; // throw(TopologyException *);
85 
90 
92  void updateLabelling(const Label& nodeLabel);
93 
94 
112  void linkResultDirectedEdges(); // throw(TopologyException *);
113 
114  void linkMinimalDirectedEdges(EdgeRing* er);
115 
116  void linkAllDirectedEdges();
117 
125 
130 
131  std::string print() const override;
132 
133 private:
134 
138  std::vector<DirectedEdge*> resultAreaEdgeList;
139 
140  Label label;
141 
142  bool resultAreaEdgesComputed;
143 
147  const std::vector<DirectedEdge*>& getResultAreaEdges();
148 
149 
151  enum {
152  SCANNING_FOR_INCOMING = 1,
153  LINKING_TO_OUTGOING
154  };
155 
156  int computeDepths(EdgeEndStar::iterator startIt,
157  EdgeEndStar::iterator endIt, int startDepth);
158 };
159 
160 
161 } // namespace geos.geomgraph
162 } // namespace geos
163 
A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node.
Definition: geomgraph/DirectedEdgeStar.h:53
void computeDepths(DirectedEdge *de)
Compute the DirectedEdge depths for a subsequence of the edge array.
void updateLabelling(const Label &nodeLabel)
Update incomplete dirEdge labels from the labelling for the node.
void linkResultDirectedEdges()
Traverse the star of DirectedEdges, linking the included edges together.
void findCoveredLineEdges()
Traverse the star of edges, maintaing the current location in the result area at this node (if any).
void insert(EdgeEnd *ee) override
Insert a directed edge in the list.
void mergeSymLabels()
For each dirEdge in the star, merge the label from the sym dirEdge into the label.
void computeLabelling(std::vector< GeometryGraph * > *geom) override
Compute the labelling for all dirEdges in this star, as well as the overall labelling.
A directed EdgeEnd.
Definition: geomgraph/DirectedEdge.h:42
A EdgeEndStar is an ordered list of EdgeEnds around a node.
Definition: EdgeEndStar.h:62
Models the end of an edge incident on a node.
Definition: EdgeEnd.h:54
Definition: geomgraph/EdgeRing.h:57
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: Angle.h:25