GEOS: EdgeEndStar.h Source File

GEOS 3.5.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

EdgeEndStar.h
1 /**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
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/Coordinate.h> // for p0,p1
28
29 #include <geos/inline.h>
30
31 #include <set>
32 #include <string>
33 #include <vector>
34 #include <algorithm> // for inlines (find)
35
36 #ifdef _MSC_VER
37 #pragma warning(push)
38 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
39 #endif
40
41 // Forward declarations
42 namespace geos {
43 namespace algorithm {
44 class BoundaryNodeRule;
45 }
46 namespace geomgraph {
47 class GeometryGraph;
48 }
49 }
50
51 namespace geos {
52 namespace geomgraph { // geos.geomgraph
53
54
63 class GEOS_DLL EdgeEndStar {
64 public:
65
66 typedef std::set<EdgeEnd *, EdgeEndLT> container;
67
68 typedef container::iterator iterator;
69 typedef container::reverse_iterator reverse_iterator;
70
71 EdgeEndStar();
72
73 virtual ~EdgeEndStar() {}
74
78 virtual void insert(EdgeEnd *e)=0;
79
87 virtual geom::Coordinate& getCoordinate();
88
89 virtual std::size_t getDegree();
90
91 virtual iterator begin();
92
93 virtual iterator end();
94
95 virtual reverse_iterator rbegin();
96
97 virtual reverse_iterator rend();
98
99 virtual container &getEdges();
100
101
102 virtual EdgeEnd* getNextCW(EdgeEnd *ee);
103
104 virtual void computeLabelling(std::vector<GeometryGraph*> *geomGraph);
105 // throw(TopologyException *);
106
107 virtual bool isAreaLabelsConsistent(const GeometryGraph& geomGraph);
108
109 virtual void propagateSideLabels(int geomIndex);
110 // throw(TopologyException *);
111
112 //virtual int findIndex(EdgeEnd *eSearch);
113 virtual iterator find(EdgeEnd *eSearch);
114
115 virtual std::string print();
116
117 protected:
118
123 EdgeEndStar::container edgeMap;
124
128 virtual void insertEdgeEnd(EdgeEnd *e) { edgeMap.insert(e); }
129
130 private:
131
132 virtual int getLocation(int geomIndex,
133 const geom::Coordinate& p,
134 std::vector<GeometryGraph*> *geom);
135
140 int ptInAreaLocation[2];
141
142 virtual void computeEdgeEndLabels(const algorithm::BoundaryNodeRule&);
143
144 virtual bool checkAreaLabelsConsistent(int geomIndex);
145
146 };
147
148 inline std::size_t
149 EdgeEndStar::getDegree()
150 {
151 return edgeMap.size();
152 }
153
154 inline EdgeEndStar::iterator
155 EdgeEndStar::begin()
156 {
157 return edgeMap.begin();
158 }
159
160 inline EdgeEndStar::container&
161 EdgeEndStar::getEdges()
162 {
163 return edgeMap;
164 }
165
166 inline EdgeEndStar::reverse_iterator
167 EdgeEndStar::rend()
168 {
169 return edgeMap.rend();
170 }
171
172 inline EdgeEndStar::iterator
173 EdgeEndStar::end()
174 {
175 return edgeMap.end();
176 }
177
178 inline EdgeEndStar::reverse_iterator
179 EdgeEndStar::rbegin()
180 {
181 return edgeMap.rbegin();
182 }
183
184 inline EdgeEndStar::iterator
185 EdgeEndStar::find(EdgeEnd *eSearch)
186 {
187 return edgeMap.find(eSearch);
188 }
189
190
191 } // namespace geos.geomgraph
192 } // namespace geos
193
194 //#ifdef GEOS_INLINE
195 //# include "geos/geomgraph/EdgeEndStar.inl"
196 //#endif
197
198 #ifdef _MSC_VER
199 #pragma warning(pop)
200 #endif
201
202 #endif // ifndef GEOS_GEOMGRAPH_EDGEENDSTAR_H
203
geos::geomgraph::EdgeEndStar::insertEdgeEnd
virtual void insertEdgeEnd(EdgeEnd *e)
Insert an EdgeEnd into the map.
Definition: EdgeEndStar.h:128
geos::geomgraph::EdgeEndStar
A EdgeEndStar is an ordered list of EdgeEnds around a node.
Definition: EdgeEndStar.h:63
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
geos::geomgraph::GeometryGraph
Definition: GeometryGraph.h:73
geos::geomgraph::EdgeEnd
Models the end of an edge incident on a node.
Definition: EdgeEnd.h:56
geos::algorithm::BoundaryNodeRule
Definition: BoundaryNodeRule.h:50
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::geomgraph::EdgeEndStar::edgeMap
EdgeEndStar::container edgeMap
A map which maintains the edges in sorted order around the node.
Definition: EdgeEndStar.h:123