buffer/PolygonBuilder.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: operation/overlay/PolygonBuilder.java rev. 1.20 (JTS-1.10)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
#include <vector>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
#endif
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
class Coordinate;
class GeometryFactory;
}
namespace geomgraph {
class EdgeRing;
class Node;
class PlanarGraph;
class DirectedEdge;
}
namespace operation {
namespace buffer {
class MaximalEdgeRing;
class MinimalEdgeRing;
}
}
}
namespace geos {
namespace operation { // geos::operation
namespace buffer { // geos::operation::buffer
class GEOS_DLL PolygonBuilder {
public:
PolygonBuilder(const geom::GeometryFactory* newGeometryFactory);
~PolygonBuilder();
void add(geomgraph::PlanarGraph* graph);
// throw(const TopologyException &)
void add(const std::vector<geomgraph::DirectedEdge*>* dirEdges,
const std::vector<geomgraph::Node*>* nodes);
// throw(const TopologyException &)
std::vector<std::unique_ptr<geom::Geometry>> getPolygons();
private:
const geom::GeometryFactory* geometryFactory;
std::vector<geomgraph::EdgeRing*> shellList;
void buildMaximalEdgeRings(
const std::vector<geomgraph::DirectedEdge*>* dirEdges,
std::vector<MaximalEdgeRing*>& maxEdgeRings);
// throw(const TopologyException &)
void buildMinimalEdgeRings(
std::vector<MaximalEdgeRing*>& maxEdgeRings,
std::vector<geomgraph::EdgeRing*>& newShellList,
std::vector<geomgraph::EdgeRing*>& freeHoleList,
std::vector<MaximalEdgeRing*>& edgeRings);
geomgraph::EdgeRing* findShell(std::vector<MinimalEdgeRing*>* minEdgeRings);
void placePolygonHoles(geomgraph::EdgeRing* shell,
std::vector<MinimalEdgeRing*>* minEdgeRings);
void sortShellsAndHoles(std::vector<MaximalEdgeRing*>& edgeRings,
std::vector<geomgraph::EdgeRing*>& newShellList,
std::vector<geomgraph::EdgeRing*>& freeHoleList);
struct FastPIPRing {
geomgraph::EdgeRing* edgeRing;
algorithm::locate::IndexedPointInAreaLocator* pipLocator;
};
void placeFreeHoles(std::vector<FastPIPRing>& newShellList,
std::vector<geomgraph::EdgeRing*>& freeHoleList);
geomgraph::EdgeRing* findEdgeRingContaining(geomgraph::EdgeRing* testEr,
std::vector<FastPIPRing>& newShellList);
std::vector<std::unique_ptr<geom::Geometry>> computePolygons(
std::vector<geomgraph::EdgeRing*>& newShellList);
};
} // namespace geos::operation::buffer
} // namespace geos::operation
} // namespace geos
#ifdef _MSC_VER
#pragma warning(pop)
#endif
geos::algorithm::locate::IndexedPointInAreaLocator
Determines the location of Coordinates relative to an areal geometry, using indexing for efficiency.
Definition IndexedPointInAreaLocator.h:54
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geomgraph::DirectedEdge
A directed EdgeEnd.
Definition geomgraph/DirectedEdge.h:42
geos::geomgraph::EdgeRing
Definition geomgraph/EdgeRing.h:57
geos::geomgraph::Node
The node component of a geometry graph.
Definition geomgraph/Node.h:59
geos::geomgraph::PlanarGraph
Represents a directed graph which is embeddable in a planar surface.
Definition geomgraph/PlanarGraph.h:72
geos::operation::buffer::MaximalEdgeRing
A ring of DirectedEdges which may contain nodes of degree > 2.
Definition buffer/MaximalEdgeRing.h:64
geos::operation::buffer::MinimalEdgeRing
A ring of Edges with the property that no node has degree greater than 2.
Definition MinimalEdgeRing.h:54
geos::operation::buffer::PolygonBuilder::add
void add(const std::vector< geomgraph::DirectedEdge * > *dirEdges, const std::vector< geomgraph::Node * > *nodes)
geos::operation::buffer::PolygonBuilder::add
void add(geomgraph::PlanarGraph *graph)
geos::geom
Definition Angle.h:26
geos::geomgraph
Contains classes that implement topology graphs.
Definition Depth.h:31
geos::operation::buffer
Provides classes for computing buffers of geometries.
Definition namespaces.h:182
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38