GEOS 3.6.2
PolygonBuilder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: operation/overlay/PolygonBuilder.java rev. 1.20 (JTS-1.10)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_OP_OVERLAY_POLYGONBUILDER_H
20#define GEOS_OP_OVERLAY_POLYGONBUILDER_H
21
22#include <geos/export.h>
23
24#include <vector>
25
26#ifdef _MSC_VER
27#pragma warning(push)
28#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
29#endif
30
31// Forward declarations
32namespace geos {
33 namespace geom {
34 class Geometry;
35 class Coordinate;
36 class GeometryFactory;
37 }
38 namespace geomgraph {
39 class EdgeRing;
40 class Node;
41 class PlanarGraph;
42 class DirectedEdge;
43 }
44 namespace operation {
45 namespace overlay {
46 class MaximalEdgeRing;
47 class MinimalEdgeRing;
48 }
49 }
50}
51
52namespace geos {
53namespace operation { // geos::operation
54namespace overlay { // geos::operation::overlay
55
61class GEOS_DLL PolygonBuilder {
62public:
63
64 PolygonBuilder(const geom::GeometryFactory *newGeometryFactory);
65
66 ~PolygonBuilder();
67
74 // throw(const TopologyException &)
75
81 void add(const std::vector<geomgraph::DirectedEdge*> *dirEdges,
82 const std::vector<geomgraph::Node*> *nodes);
83 // throw(const TopologyException &)
84
85 std::vector<geom::Geometry*>* getPolygons();
86
92
93private:
94
95 const geom::GeometryFactory *geometryFactory;
96
97 std::vector<geomgraph::EdgeRing*> shellList;
98
106 void buildMaximalEdgeRings(
107 const std::vector<geomgraph::DirectedEdge*> *dirEdges,
108 std::vector<MaximalEdgeRing*> &maxEdgeRings);
109 // throw(const TopologyException &)
110
111 void buildMinimalEdgeRings(
112 std::vector<MaximalEdgeRing*> &maxEdgeRings,
113 std::vector<geomgraph::EdgeRing*> &newShellList,
114 std::vector<geomgraph::EdgeRing*> &freeHoleList,
115 std::vector<MaximalEdgeRing*> &edgeRings);
116
128 geomgraph::EdgeRing* findShell(std::vector<MinimalEdgeRing*>* minEdgeRings);
129
141 void placePolygonHoles(geomgraph::EdgeRing *shell,
142 std::vector<MinimalEdgeRing*> *minEdgeRings);
143
151 void sortShellsAndHoles(std::vector<MaximalEdgeRing*> &edgeRings,
152 std::vector<geomgraph::EdgeRing*> &newShellList,
153 std::vector<geomgraph::EdgeRing*> &freeHoleList);
154
169 void placeFreeHoles(std::vector<geomgraph::EdgeRing*>& newShellList,
170 std::vector<geomgraph::EdgeRing*>& freeHoleList);
171 // throw(const TopologyException&)
172
191 geomgraph::EdgeRing* findEdgeRingContaining(geomgraph::EdgeRing *testEr,
192 std::vector<geomgraph::EdgeRing*>& newShellList);
193
194 std::vector<geom::Geometry*>* computePolygons(
195 std::vector<geomgraph::EdgeRing*>& newShellList);
196
201
202};
203
204} // namespace geos::operation::overlay
205} // namespace geos::operation
206} // namespace geos
207
208#ifdef _MSC_VER
209#pragma warning(pop)
210#endif
211
212#endif // ndef GEOS_OP_OVERLAY_POLYGONBUILDER_H
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:67
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
A directed EdgeEnd.
Definition geomgraph/DirectedEdge.h:44
Definition geomgraph/EdgeRing.h:59
Definition geomgraph/Node.h:62
Represents a directed graph which is embeddable in a planar surface.
Definition geomgraph/PlanarGraph.h:75
A ring of edges which may contain nodes of degree > 2.
Definition MaximalEdgeRing.h:66
A ring of Edges with the property that no node has degree greater than 2.
Definition MinimalEdgeRing.h:56
bool containsPoint(const geom::Coordinate &p)
Checks the current set of shells (with their associated holes) to see if any of them contain the poin...
void add(const std::vector< geomgraph::DirectedEdge * > *dirEdges, const std::vector< geomgraph::Node * > *nodes)
void add(geomgraph::PlanarGraph *graph)
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement topology graphs.
Definition IndexedNestedRingTester.h:34
Contains classes that perform a topological overlay to compute boolean spatial functions.
Definition BufferBuilder.h:62
Provides classes for implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25