SFCGAL  2.3.0
Public Member Functions | Protected Member Functions | List of all members
SFCGAL::algorithm::BoundaryVisitor Class Reference

Compute the boundary for a Geometry. More...

#include <BoundaryVisitor.h>

Inheritance diagram for SFCGAL::algorithm::BoundaryVisitor:
SFCGAL::ConstGeometryVisitor

Public Member Functions

void visit (const Point &g) override
 Visit a Point geometry to compute its boundary. More...
 
void visit (const LineString &g) override
 Visit a LineString geometry to compute its boundary. More...
 
void visit (const Polygon &g) override
 Visit a Polygon geometry to compute its boundary. More...
 
void visit (const Triangle &g) override
 Visit a Triangle geometry to compute its boundary. More...
 
void visit (const Solid &g) override
 Visit a Solid geometry to compute its boundary. More...
 
void visit (const MultiPoint &g) override
 Visit a MultiPoint geometry to compute its boundary. More...
 
void visit (const MultiLineString &g) override
 Visit a MultiLineString geometry to compute its boundary. More...
 
void visit (const MultiPolygon &g) override
 Visit a MultiPolygon geometry to compute its boundary. More...
 
void visit (const MultiSolid &g) override
 Visit a MultiSolid geometry to compute its boundary. More...
 
void visit (const GeometryCollection &g) override
 Visit a GeometryCollection to compute its boundary. More...
 
void visit (const PolyhedralSurface &g) override
 Visit a PolyhedralSurface geometry to compute its boundary. More...
 
void visit (const TriangulatedSurface &g) override
 Visit a TriangulatedSurface geometry to compute its boundary. More...
 
void visit (const NURBSCurve &g) override
 Process NURBSCurve for boundary calculation. More...
 
Geometry * releaseBoundary ()
 get the boundary More...
 
- Public Member Functions inherited from SFCGAL::ConstGeometryVisitor
virtual ~ConstGeometryVisitor ()
 Default destructor for ConstGeometryVisitor. More...
 
virtual void visit (const Geometry &geometry)
 Apply this visitor to a generic const Geometry reference. More...
 

Protected Member Functions

void getBoundaryFromLineStrings (const graph::GeometryGraph &g)
 get the boundary vertices for a set of LineString in a GeometryGraph More...
 
void getBoundaryFromPolygons (const graph::GeometryGraph &g)
 get the boundary edges for a set of Polygons in a GeometryGraph More...
 

Detailed Description

Compute the boundary for a Geometry.

boundary( Point ) : GEOMETRYCOLLECTION EMPTY boundary( LineString ) : either GEOMETRYCOLLECTION EMPTY is the LineString is closed, or MULTIPOINT(2) boundary( Polygon ) : LINESTRING | MULTILINESTRING (polygon rings) boundary( Triangle ) : either GEOMETRYCOLLECTION EMPTY is the LineString is closed, or MULTIPOINT(2)

boundary( MultiPoint ) : GEOMETRYCOLLECTION EMPTY boundary( MultiLineString ) : either GEOMETRYCOLLECTION EMPTY or single occurance points

Warning
GeometryCollection are not supported in the general case

@ŧodo Solid

Todo:

MultiPolygon, PolyhedralSurface, TriangulatedSurface (same graph algorithm, edges without parallel or opposite)

MultiSolid : faced elimination

Todo:
GeometryCollection : complex for heterogeneous collection (not supported in GEOS)

Member Function Documentation

void SFCGAL::algorithm::BoundaryVisitor::getBoundaryFromLineStrings ( const graph::GeometryGraph &  g)
protected

get the boundary vertices for a set of LineString in a GeometryGraph

Parameters
gThe GeometryGraph containing LineStrings
void SFCGAL::algorithm::BoundaryVisitor::getBoundaryFromPolygons ( const graph::GeometryGraph &  g)
protected

get the boundary edges for a set of Polygons in a GeometryGraph

Parameters
gThe GeometryGraph containing Polygons
Warning
not optimal (edges could be counted using complex< vertex_descriptor >)
Todo:
merge resulting edges
auto SFCGAL::algorithm::BoundaryVisitor::releaseBoundary ( )

get the boundary

Releases and returns the visitor's current boundary geometry.

If the visitor holds an internal boundary, ownership of that Geometry is transferred to the caller and the visitor no longer retains it. If no internal boundary exists, a newly allocated empty GeometryCollection is returned.

Returns
Geometry* Pointer to a non-null Geometry instance owned by the caller. The caller is responsible for deleting the returned object.
void SFCGAL::algorithm::BoundaryVisitor::visit ( const Point &  g)
overridevirtual

Visit a Point geometry to compute its boundary.

Parameters
gThe Point geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const LineString &  g)
overridevirtual

Visit a LineString geometry to compute its boundary.

Parameters
gThe LineString geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const Polygon &  g)
overridevirtual

Visit a Polygon geometry to compute its boundary.

Parameters
gThe Polygon geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const Triangle &  g)
overridevirtual

Visit a Triangle geometry to compute its boundary.

Parameters
gThe Triangle geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const Solid &  g)
overridevirtual

Visit a Solid geometry to compute its boundary.

Parameters
gThe Solid geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const MultiPoint &  g)
overridevirtual

Visit a MultiPoint geometry to compute its boundary.

Parameters
gThe MultiPoint geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const MultiLineString &  g)
overridevirtual

Visit a MultiLineString geometry to compute its boundary.

Parameters
gThe MultiLineString geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const MultiPolygon &  g)
overridevirtual

Visit a MultiPolygon geometry to compute its boundary.

Parameters
gThe MultiPolygon geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const MultiSolid &  g)
overridevirtual

Visit a MultiSolid geometry to compute its boundary.

Parameters
gThe MultiSolid geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const GeometryCollection &  g)
overridevirtual

Visit a GeometryCollection to compute its boundary.

Parameters
gThe GeometryCollection to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const PolyhedralSurface &  g)
overridevirtual

Visit a PolyhedralSurface geometry to compute its boundary.

Parameters
gThe PolyhedralSurface geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const TriangulatedSurface &  g)
overridevirtual

Visit a TriangulatedSurface geometry to compute its boundary.

Parameters
gThe TriangulatedSurface geometry to visit

Implements SFCGAL::ConstGeometryVisitor.

void SFCGAL::algorithm::BoundaryVisitor::visit ( const NURBSCurve &  g)
overridevirtual

Process NURBSCurve for boundary calculation.

Compute and set the boundary for a NURBSCurve.

Parameters
gThe NURBSCurve geometry to process

If the curve is empty or its start and end coordinates are identical, the visitor clears the internal boundary. Otherwise the boundary is set to a MultiPoint containing copies of the curve's start and end points.

Reimplemented from SFCGAL::ConstGeometryVisitor.