GEOS  3.14.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 <memory>
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 
35 // Forward declarations
36 namespace geos {
37 namespace geomgraph {
38 class DirectedEdge;
39 class EdgeRing;
40 }
41 }
42 
43 namespace geos {
44 namespace geomgraph { // geos.geomgraph
45 
54 class GEOS_DLL DirectedEdgeStar: public EdgeEndStar {
55 
56 public:
57 
59  :
60  EdgeEndStar(),
61  label(),
62  resultAreaEdgesComputed(false)
63  {}
64 
65  ~DirectedEdgeStar() override = default;
66 
68  void insert(EdgeEnd* ee) override;
69 
70  Label&
71  getLabel()
72  {
73  return label;
74  }
75 
76  int getOutgoingDegree();
77 
78  int getOutgoingDegree(EdgeRing* er);
79 
80  DirectedEdge* getRightmostEdge();
81 
85  void computeLabelling(const std::vector<std::unique_ptr<GeometryGraph>>&geom) override; // throw(TopologyException *);
86 
91 
93  void updateLabelling(const Label& nodeLabel);
94 
95 
113  void linkResultDirectedEdges(); // throw(TopologyException *);
114 
115  void linkMinimalDirectedEdges(EdgeRing* er);
116 
117  void linkAllDirectedEdges();
118 
126 
131 
132  std::string print() const override;
133 
134 private:
135 
139  std::vector<DirectedEdge*> resultAreaEdgeList;
140 
141  Label label;
142 
143  bool resultAreaEdgesComputed;
144 
148  const std::vector<DirectedEdge*>& getResultAreaEdges();
149 
150 
152  enum {
153  SCANNING_FOR_INCOMING = 1,
154  LINKING_TO_OUTGOING
155  };
156 
157  int computeDepths(EdgeEndStar::iterator startIt,
158  EdgeEndStar::iterator endIt, int startDepth);
159 };
160 
161 
162 } // namespace geos.geomgraph
163 } // namespace geos
164 
A DirectedEdgeStar is an ordered list of outgoing DirectedEdges around a node.
Definition: geomgraph/DirectedEdgeStar.h:54
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, maintaining 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(const std::vector< std::unique_ptr< 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:63
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