SFCGAL 2.3.0
SFCGAL::graph::GeometryGraphBuilderT< Graph > Class Template Reference

[private]Convert Geometries to a GeometryGraph. More...

#include <GeometryGraphBuilder.h>

Public Types

using graph_t = Graph
 Graph type being used.
typedef graph_t::vertex_properties vertex_properties
 Vertex properties type.
typedef graph_t::edge_properties edge_properties
 Edge properties type.
typedef graph_t::vertex_descriptor vertex_descriptor
 Vertex descriptor type.
typedef graph_t::edge_descriptor edge_descriptor
 Edge descriptor type.
using coordinate_list = std::map<Coordinate, vertex_descriptor>
 allows to match duplicates

Public Member Functions

 GeometryGraphBuilderT (graph_t &graph)
 Default constructor.
 ~GeometryGraphBuilderT ()
 destructor
vertex_descriptor addPoint (const Point &point)
 Add a Point to the Graph.
edge_descriptor addLineSegment (const Point &a, const Point &b, const edge_properties &edgeProperties=edge_properties())
 Add a line segment to the Graph.
std::vector< edge_descriptor > addLineString (const LineString &lineString, const edge_properties &edgeProperties=edge_properties())
 Add a LineString to the graph.
std::vector< edge_descriptor > addTriangle (const Triangle &triangle, const edge_properties &edgeProperties=edge_properties())
 Add a Triangle to the graph.
std::vector< std::vector< edge_descriptor > > addPolygon (const Polygon &polygon, const edge_properties &edgeProperties=edge_properties())
 Add a Polygon to the graph.
std::vector< std::vector< edge_descriptor > > addTriangulatedSurface (const TriangulatedSurface &triangulatedSurface, const edge_properties &edgeProperties=edge_properties())
 Add a TriangulatedSurface to the graph.
std::vector< std::vector< std::vector< edge_descriptor > > > addPolyhedralSurface (const PolyhedralSurface &polyhedralSurface, const edge_properties &edgeProperties=edge_properties())
 Add a PolyhedralSurface to the graph.

Detailed Description

template<typename Graph>
class SFCGAL::graph::GeometryGraphBuilderT< Graph >

[private]Convert Geometries to a GeometryGraph.

Identifier in the Graph are returned in order to allow the user to keep identify the geometry.

Todo
wrap vertex_descriptor, std::vector< edge_descriptor >, etc. in SharedPoint, SharedLineString, SharedPolygon, etc. and add utility method on the Graph?

Member Typedef Documentation

◆ coordinate_list

template<typename Graph>
using SFCGAL::graph::GeometryGraphBuilderT< Graph >::coordinate_list = std::map<Coordinate, vertex_descriptor>

allows to match duplicates

◆ edge_descriptor

template<typename Graph>
typedef graph_t::edge_descriptor SFCGAL::graph::GeometryGraphBuilderT< Graph >::edge_descriptor

Edge descriptor type.

◆ edge_properties

template<typename Graph>
typedef graph_t::edge_properties SFCGAL::graph::GeometryGraphBuilderT< Graph >::edge_properties

Edge properties type.

◆ graph_t

template<typename Graph>
using SFCGAL::graph::GeometryGraphBuilderT< Graph >::graph_t = Graph

Graph type being used.

◆ vertex_descriptor

template<typename Graph>
typedef graph_t::vertex_descriptor SFCGAL::graph::GeometryGraphBuilderT< Graph >::vertex_descriptor

Vertex descriptor type.

◆ vertex_properties

template<typename Graph>
typedef graph_t::vertex_properties SFCGAL::graph::GeometryGraphBuilderT< Graph >::vertex_properties

Vertex properties type.

Constructor & Destructor Documentation

◆ GeometryGraphBuilderT()

template<typename Graph>
SFCGAL::graph::GeometryGraphBuilderT< Graph >::GeometryGraphBuilderT ( graph_t & graph)
inline

Default constructor.

Parameters
graphThe graph to build into

◆ ~GeometryGraphBuilderT()

template<typename Graph>
SFCGAL::graph::GeometryGraphBuilderT< Graph >::~GeometryGraphBuilderT ( )
inline

destructor

Member Function Documentation

◆ addLineSegment()

template<typename Graph>
edge_descriptor SFCGAL::graph::GeometryGraphBuilderT< Graph >::addLineSegment ( const Point & a,
const Point & b,
const edge_properties & edgeProperties = edge_properties() )
inline

Add a line segment to the Graph.

Parameters
aFirst point of the segment
bSecond point of the segment
edgePropertiesProperties for the edge
Returns
The edge inserted into the graph

◆ addLineString()

template<typename Graph>
std::vector< edge_descriptor > SFCGAL::graph::GeometryGraphBuilderT< Graph >::addLineString ( const LineString & lineString,
const edge_properties & edgeProperties = edge_properties() )
inline

Add a LineString to the graph.

Parameters
lineStringThe linestring to add
edgePropertiesProperties for the edges
Returns
The list of edges inserted into the graph

◆ addPoint()

template<typename Graph>
vertex_descriptor SFCGAL::graph::GeometryGraphBuilderT< Graph >::addPoint ( const Point & point)
inline

Add a Point to the Graph.

Parameters
pointThe point to add
Returns
The vertex descriptor for the added point

◆ addPolygon()

template<typename Graph>
std::vector< std::vector< edge_descriptor > > SFCGAL::graph::GeometryGraphBuilderT< Graph >::addPolygon ( const Polygon & polygon,
const edge_properties & edgeProperties = edge_properties() )
inline

Add a Polygon to the graph.

Parameters
polygonThe polygon to add
edgePropertiesProperties for the edges
Returns
The list of rings inserted into the graph

◆ addPolyhedralSurface()

template<typename Graph>
std::vector< std::vector< std::vector< edge_descriptor > > > SFCGAL::graph::GeometryGraphBuilderT< Graph >::addPolyhedralSurface ( const PolyhedralSurface & polyhedralSurface,
const edge_properties & edgeProperties = edge_properties() )
inline

Add a PolyhedralSurface to the graph.

Parameters
polyhedralSurfaceThe polyhedral surface to add
edgePropertiesProperties for the edges
Returns
The list of polygons inserted into the graph

◆ addTriangle()

template<typename Graph>
std::vector< edge_descriptor > SFCGAL::graph::GeometryGraphBuilderT< Graph >::addTriangle ( const Triangle & triangle,
const edge_properties & edgeProperties = edge_properties() )
inline

Add a Triangle to the graph.

Parameters
triangleThe triangle to add
edgePropertiesProperties for the edges
Returns
The list of edges inserted into the graph

◆ addTriangulatedSurface()

template<typename Graph>
std::vector< std::vector< edge_descriptor > > SFCGAL::graph::GeometryGraphBuilderT< Graph >::addTriangulatedSurface ( const TriangulatedSurface & triangulatedSurface,
const edge_properties & edgeProperties = edge_properties() )
inline

Add a TriangulatedSurface to the graph.

Parameters
triangulatedSurfaceThe triangulated surface to add
edgePropertiesProperties for the edges
Returns
The list of triangles inserted into the graph