GEOS 3.9.1
overlay/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#include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
24
25#include <vector>
26
27#ifdef _MSC_VER
28#pragma warning(push)
29#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
30#endif
31
32// Forward declarations
33namespace geos {
34namespace geom {
35class Geometry;
36class Coordinate;
37class GeometryFactory;
38}
39namespace geomgraph {
40class EdgeRing;
41class Node;
42class PlanarGraph;
43class DirectedEdge;
44}
45namespace operation {
46namespace overlay {
47class MaximalEdgeRing;
48class MinimalEdgeRing;
49}
50}
51}
52
53namespace geos {
54namespace operation { // geos::operation
55namespace overlay { // geos::operation::overlay
56
62class GEOS_DLL PolygonBuilder {
63public:
64
65 PolygonBuilder(const geom::GeometryFactory* newGeometryFactory);
66
68
75 // throw(const TopologyException &)
76
82 void add(const std::vector<geomgraph::DirectedEdge*>* dirEdges,
83 const std::vector<geomgraph::Node*>* nodes);
84 // throw(const TopologyException &)
85
86 std::vector<geom::Geometry*>* getPolygons();
87
88private:
89
90 const geom::GeometryFactory* geometryFactory;
91
92 std::vector<geomgraph::EdgeRing*> shellList;
93
101 void buildMaximalEdgeRings(
102 const std::vector<geomgraph::DirectedEdge*>* dirEdges,
103 std::vector<MaximalEdgeRing*>& maxEdgeRings);
104 // throw(const TopologyException &)
105
106 void buildMinimalEdgeRings(
107 std::vector<MaximalEdgeRing*>& maxEdgeRings,
108 std::vector<geomgraph::EdgeRing*>& newShellList,
109 std::vector<geomgraph::EdgeRing*>& freeHoleList,
110 std::vector<MaximalEdgeRing*>& edgeRings);
111
123 geomgraph::EdgeRing* findShell(std::vector<MinimalEdgeRing*>* minEdgeRings);
124
136 void placePolygonHoles(geomgraph::EdgeRing* shell,
137 std::vector<MinimalEdgeRing*>* minEdgeRings);
138
146 void sortShellsAndHoles(std::vector<MaximalEdgeRing*>& edgeRings,
147 std::vector<geomgraph::EdgeRing*>& newShellList,
148 std::vector<geomgraph::EdgeRing*>& freeHoleList);
149
150 struct FastPIPRing {
151 geomgraph::EdgeRing* edgeRing;
153 };
154
169 void placeFreeHoles(std::vector<FastPIPRing>& newShellList,
170 std::vector<geomgraph::EdgeRing*>& freeHoleList);
171 // throw(const TopologyException&)
172
191 geomgraph::EdgeRing* findEdgeRingContaining(geomgraph::EdgeRing* testEr,
192 std::vector<FastPIPRing>& newShellList);
193
194 std::vector<geom::Geometry*>* computePolygons(
195 std::vector<geomgraph::EdgeRing*>& newShellList);
196
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
Determines the location of Coordinates relative to an areal geometry, using indexing for efficiency.
Definition: IndexedPointInAreaLocator.h:55
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Definition: geomgraph/EdgeRing.h:60
Represents a directed graph which is embeddable in a planar surface.
Definition: geomgraph/PlanarGraph.h:75
Forms Polygon out of a graph of geomgraph::DirectedEdge.
Definition: overlay/PolygonBuilder.h:62
void add(const std::vector< geomgraph::DirectedEdge * > *dirEdges, const std::vector< geomgraph::Node * > *nodes)
void add(geomgraph::PlanarGraph *graph)
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26