GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
geos::operation::buffer::BufferBuilder Class Reference

Builds the buffer geometry for a given input geometry and precision model. More...

#include <BufferBuilder.h>

Collaboration diagram for geos::operation::buffer::BufferBuilder:
[legend]

Public Member Functions

 BufferBuilder (const BufferParameters &nBufParams)
 
 ~BufferBuilder ()
 
void setWorkingPrecisionModel (const geom::PrecisionModel *pm)
 
void setNoder (noding::Noder *newNoder)
 
geom::Geometrybuffer (const geom::Geometry *g, double distance)
 
geom::GeometrybufferLineSingleSided (const geom::Geometry *g, double distance, bool leftSide)
 

Private Member Functions

void computeNodedEdges (std::vector< noding::SegmentString * > &bufSegStr, const geom::PrecisionModel *precisionModel)
 
void insertUniqueEdge (geomgraph::Edge *e)
 
void createSubgraphs (geomgraph::PlanarGraph *graph, std::vector< BufferSubgraph * > &list)
 
void buildSubgraphs (const std::vector< BufferSubgraph * > &subgraphList, overlay::PolygonBuilder &polyBuilder)
 
noding::NodergetNoder (const geom::PrecisionModel *precisionModel)
 Return the externally-set noding::Noder OR a newly created one using the given precisionModel. More...
 
geom::GeometrycreateEmptyResultGeometry () const
 
 BufferBuilder (const BufferBuilder &other)=delete
 
BufferBuilderoperator= (const BufferBuilder &rhs)=delete
 

Static Private Member Functions

static int depthDelta (const geomgraph::Label &label)
 

Private Attributes

const BufferParametersbufParams
 
const geom::PrecisionModelworkingPrecisionModel
 
algorithm::LineIntersectorli
 
noding::IntersectionAdderintersectionAdder
 
noding::NoderworkingNoder
 
const geom::GeometryFactorygeomFact
 
geomgraph::EdgeList edgeList
 
std::vector< geomgraph::Label * > newLabels
 

Detailed Description

Builds the buffer geometry for a given input geometry and precision model.

Allows setting the level of approximation for circular arcs, and the precision model in which to carry out the computation.

When computing buffers in floating point double-precision it can happen that the process of iterated noding can fail to converge (terminate).

In this case a TopologyException will be thrown. Retrying the computation in a fixed precision can produce more robust results.

Definition at line 88 of file BufferBuilder.h.

Constructor & Destructor Documentation

geos::operation::buffer::BufferBuilder::BufferBuilder ( const BufferParameters nBufParams)
inline

Creates a new BufferBuilder

Parameters
nBufParamsbuffer parameters, this object will keep a reference to the passed parameters so caller must make sure the object is kept alive for the whole lifetime of the buffer builder.

Definition at line 100 of file BufferBuilder.h.

geos::operation::buffer::BufferBuilder::~BufferBuilder ( )
geos::operation::buffer::BufferBuilder::BufferBuilder ( const BufferBuilder other)
privatedelete

Member Function Documentation

geom::Geometry* geos::operation::buffer::BufferBuilder::buffer ( const geom::Geometry g,
double  distance 
)
geom::Geometry* geos::operation::buffer::BufferBuilder::bufferLineSingleSided ( const geom::Geometry g,
double  distance,
bool  leftSide 
)

Generates offset curve for linear geometry.

Parameters
gnon-areal geometry object
distancewidth of offset
leftSidecontrols on which side of the input geometry offset curve is generated.
Note
For left-side offset curve, the offset will be at the left side of the input line and retain the same direction. For right-side offset curve, it'll be at the right side and in the opposite direction.
BufferParameters::setSingleSided parameter, which is specific to areal geometries only, is ignored by this routine.
Not in JTS: this is a GEOS extension
void geos::operation::buffer::BufferBuilder::buildSubgraphs ( const std::vector< BufferSubgraph * > &  subgraphList,
overlay::PolygonBuilder polyBuilder 
)
private

Completes the building of the input subgraphs by depth-labelling them, and adds them to the PolygonBuilder. The subgraph list must be sorted in rightmost-coordinate order.

Parameters
subgraphListthe subgraphs to build
polyBuilderthe PolygonBuilder which will build the final polygons
void geos::operation::buffer::BufferBuilder::computeNodedEdges ( std::vector< noding::SegmentString * > &  bufSegStr,
const geom::PrecisionModel precisionModel 
)
private
geom::Geometry* geos::operation::buffer::BufferBuilder::createEmptyResultGeometry ( ) const
private

Gets the standard result for an empty buffer. Since buffer always returns a polygonal result, this is chosen to be an empty polygon.

Returns
the empty result geometry, transferring ownership to caller.
void geos::operation::buffer::BufferBuilder::createSubgraphs ( geomgraph::PlanarGraph graph,
std::vector< BufferSubgraph * > &  list 
)
private
static int geos::operation::buffer::BufferBuilder::depthDelta ( const geomgraph::Label label)
staticprivate

Compute the change in depth as an edge is crossed from R to L

noding::Noder* geos::operation::buffer::BufferBuilder::getNoder ( const geom::PrecisionModel precisionModel)
private

Return the externally-set noding::Noder OR a newly created one using the given precisionModel.

NOTE: if an externally-set noding::Noder is available no check is performed to ensure it will use the given PrecisionModel

void geos::operation::buffer::BufferBuilder::insertUniqueEdge ( geomgraph::Edge e)
private

Inserted edges are checked to see if an identical edge already exists. If so, the edge is not inserted, but its label is merged with the existing edge.

The function takes responsability of releasing the Edge parameter memory when appropriate.

BufferBuilder& geos::operation::buffer::BufferBuilder::operator= ( const BufferBuilder rhs)
privatedelete
void geos::operation::buffer::BufferBuilder::setNoder ( noding::Noder newNoder)
inline

Sets the noding::Noder to use during noding. This allows choosing fast but non-robust noding, or slower but robust noding.

Parameters
newNoderthe noder to use

Definition at line 138 of file BufferBuilder.h.

void geos::operation::buffer::BufferBuilder::setWorkingPrecisionModel ( const geom::PrecisionModel pm)
inline

Sets the precision model to use during the curve computation and noding, if it is different to the precision model of the Geometry. If the precision model is less than the precision of the Geometry precision model, the Geometry must have previously been rounded to that precision.

Parameters
pmthe precision model to use

Definition at line 125 of file BufferBuilder.h.

Member Data Documentation

const BufferParameters& geos::operation::buffer::BufferBuilder::bufParams
private

Definition at line 175 of file BufferBuilder.h.

geomgraph::EdgeList geos::operation::buffer::BufferBuilder::edgeList
private

Definition at line 187 of file BufferBuilder.h.

const geom::GeometryFactory* geos::operation::buffer::BufferBuilder::geomFact
private

Definition at line 185 of file BufferBuilder.h.

noding::IntersectionAdder* geos::operation::buffer::BufferBuilder::intersectionAdder
private

Definition at line 181 of file BufferBuilder.h.

algorithm::LineIntersector* geos::operation::buffer::BufferBuilder::li
private

Definition at line 179 of file BufferBuilder.h.

std::vector<geomgraph::Label*> geos::operation::buffer::BufferBuilder::newLabels
private

Definition at line 189 of file BufferBuilder.h.

noding::Noder* geos::operation::buffer::BufferBuilder::workingNoder
private

Definition at line 183 of file BufferBuilder.h.

const geom::PrecisionModel* geos::operation::buffer::BufferBuilder::workingPrecisionModel
private

Definition at line 177 of file BufferBuilder.h.


The documentation for this class was generated from the following file: