GEOS 3.9.1
EdgeEndStar.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/EdgeEndStar.java r428 (JTS-1.12+)
18 *
19 **********************************************************************/
20
21
22#ifndef GEOS_GEOMGRAPH_EDGEENDSTAR_H
23#define GEOS_GEOMGRAPH_EDGEENDSTAR_H
24
25#include <geos/export.h>
26#include <geos/geomgraph/EdgeEnd.h> // for EdgeEndLT
27#include <geos/geom/Location.h>
28#include <geos/geom/Coordinate.h> // for p0,p1
29
30#include <geos/inline.h>
31
32#include <array>
33#include <set>
34#include <string>
35#include <vector>
36#include <algorithm> // for inlines (find)
37
38#ifdef _MSC_VER
39#pragma warning(push)
40#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
41#endif
42
43// Forward declarations
44namespace geos {
45namespace algorithm {
46class BoundaryNodeRule;
47}
48namespace geomgraph {
49class GeometryGraph;
50}
51}
52
53namespace geos {
54namespace geomgraph { // geos.geomgraph
55
56
65class GEOS_DLL EdgeEndStar {
66public:
67
68 typedef std::set<EdgeEnd*, EdgeEndLT> container;
69
70 typedef container::iterator iterator;
71 typedef container::const_iterator const_iterator;
72 typedef container::reverse_iterator reverse_iterator;
73
75
76 virtual
77 ~EdgeEndStar() {}
78
82 virtual void insert(EdgeEnd* e) = 0;
83
92
93 const geom::Coordinate& getCoordinate() const;
94
95 virtual std::size_t getDegree();
96
97 virtual iterator begin();
98
99 virtual iterator end();
100
101 virtual reverse_iterator rbegin();
102
103 virtual reverse_iterator rend();
104
105 virtual const_iterator
106 begin() const
107 {
108 return edgeMap.begin();
109 }
110
111 virtual const_iterator
112 end() const
113 {
114 return edgeMap.end();
115 }
116
117 virtual container& getEdges();
118
119 virtual EdgeEnd* getNextCW(EdgeEnd* ee);
120
121 virtual void computeLabelling(std::vector<GeometryGraph*>* geomGraph);
122 // throw(TopologyException *);
123
124 virtual bool isAreaLabelsConsistent(const GeometryGraph& geomGraph);
125
126 virtual void propagateSideLabels(uint32_t geomIndex);
127 // throw(TopologyException *);
128
129 //virtual int findIndex(EdgeEnd *eSearch);
130 virtual iterator find(EdgeEnd* eSearch);
131
132 virtual std::string print() const;
133
134protected:
135
140 EdgeEndStar::container edgeMap;
141
145 virtual void
147 {
148 edgeMap.insert(e);
149 }
150
151private:
152
153 virtual geom::Location getLocation(uint32_t geomIndex,
154 const geom::Coordinate& p,
155 std::vector<GeometryGraph*>* geom);
156
161 std::array<geom::Location, 2> ptInAreaLocation;
162
163 virtual void computeEdgeEndLabels(const algorithm::BoundaryNodeRule&);
164
165 virtual bool checkAreaLabelsConsistent(uint32_t geomIndex);
166
167};
168
169inline std::size_t
170EdgeEndStar::getDegree()
171{
172 return edgeMap.size();
173}
174
175inline EdgeEndStar::iterator
176EdgeEndStar::begin()
177{
178 return edgeMap.begin();
179}
180
181inline EdgeEndStar::container&
182EdgeEndStar::getEdges()
183{
184 return edgeMap;
185}
186
187inline EdgeEndStar::reverse_iterator
188EdgeEndStar::rend()
189{
190 return edgeMap.rend();
191}
192
193inline EdgeEndStar::iterator
194EdgeEndStar::end()
195{
196 return edgeMap.end();
197}
198
199inline EdgeEndStar::reverse_iterator
200EdgeEndStar::rbegin()
201{
202 return edgeMap.rbegin();
203}
204
205inline EdgeEndStar::iterator
206EdgeEndStar::find(EdgeEnd* eSearch)
207{
208 return edgeMap.find(eSearch);
209}
210
211std::ostream& operator<< (std::ostream&, const EdgeEndStar&);
212
213} // namespace geos.geomgraph
214} // namespace geos
215
216//#ifdef GEOS_INLINE
217//# include "geos/geomgraph/EdgeEndStar.inl"
218//#endif
219
220#ifdef _MSC_VER
221#pragma warning(pop)
222#endif
223
224#endif // ifndef GEOS_GEOMGRAPH_EDGEENDSTAR_H
225
An interface for rules which determine whether node points which are in boundaries of lineal geometry...
Definition BoundaryNodeRule.h:51
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
A EdgeEndStar is an ordered list of EdgeEnds around a node.
Definition EdgeEndStar.h:65
virtual geom::Coordinate & getCoordinate()
EdgeEndStar::container edgeMap
A map which maintains the edges in sorted order around the node.
Definition EdgeEndStar.h:140
virtual void insert(EdgeEnd *e)=0
Insert a EdgeEnd into this EdgeEndStar.
virtual void insertEdgeEnd(EdgeEnd *e)
Insert an EdgeEnd into the map.
Definition EdgeEndStar.h:146
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.
Definition IndexedNestedRingTester.h:26