SFCGAL  2.3.0
Public Types | Public Member Functions | List of all members
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. More...
 
typedef graph_t::vertex_properties vertex_properties
 Vertex properties type. More...
 
typedef graph_t::edge_properties edge_properties
 Edge properties type. More...
 
typedef graph_t::vertex_descriptor vertex_descriptor
 Vertex descriptor type. More...
 
typedef graph_t::edge_descriptor edge_descriptor
 Edge descriptor type. More...
 
using coordinate_list = std::map< Coordinate, vertex_descriptor >
 allows to match duplicates More...
 

Public Member Functions

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

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

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

allows to match duplicates

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

Edge descriptor type.

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

Edge properties type.

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

Graph type being used.

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

Vertex descriptor type.

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

Vertex properties type.

Constructor & Destructor Documentation

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

Default constructor.

Parameters
graphThe graph to build into
template<typename Graph >
SFCGAL::graph::GeometryGraphBuilderT< Graph >::~GeometryGraphBuilderT ( )
inline

destructor

Member Function Documentation

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
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
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
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
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
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
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