Skip to content

Class SFCGAL::graph::GeometryGraphT

template <typename VertexProperties, typename EdgeProperties>

ClassList > SFCGAL > graph > GeometryGraphT

[private]Represents the vertices and edges for a list of geometries. More...

  • #include <GeometryGraph.h>

Public Types

Type Name
typedef std::pair< edge_descriptor, EdgeDirection > directed_edge_descriptor
typedef boost::graph_traits< graph_t >::edge_descriptor edge_descriptor
typedef boost::graph_traits< graph_t >::edge_iterator edge_iterator
typedef EdgeProperties edge_properties
typedef boost::adjacency_list< boost::listS, boost::listS, boost::bidirectionalS, vertex_properties, edge_properties > graph_t
typedef boost::graph_traits< graph_t >::in_edge_iterator in_edge_iterator
typedef boost::graph_traits< graph_t >::out_edge_iterator out_edge_iterator
typedef boost::graph_traits< graph_t >::vertex_descriptor vertex_descriptor
typedef boost::graph_traits< graph_t >::vertex_iterator vertex_iterator
typedef VertexProperties vertex_properties

Public Functions

Type Name
edge_descriptor addEdge (const vertex_descriptor & source, const vertex_descriptor & target, const EdgeProperties & properties=EdgeProperties())
vertex_descriptor addVertex (const vertex_properties & properties=vertex_properties())
std::set< vertex_descriptor > adjacentVertices (const vertex_descriptor & vertex, bool withReverseDirection=true)
bool areOpposite (const edge_descriptor & a, const edge_descriptor & b) const
bool areParallel (const edge_descriptor & a, const edge_descriptor & b) const
size_t degree (const vertex_descriptor & vertex) const
std::pair< edge_iterator, edge_iterator > edges () const
std::vector< directed_edge_descriptor > edges (const vertex_descriptor & a, const vertex_descriptor & b) const
graph_t & graph ()
const graph_t & graph () const
std::vector< edge_descriptor > inEdges (const vertex_descriptor & vertex)
std::vector< directed_edge_descriptor > inOutEdges (const vertex_descriptor & vertex) const
size_t numEdges () const
size_t numVertices () const
operator const graph_t & (void) const
operator graph_t & (void)
const vertex_properties & operator[] (const vertex_descriptor & vertex) const
vertex_properties & operator[] (const vertex_descriptor & vertex)
const edge_properties & operator[] (const edge_descriptor & edge) const
edge_properties & operator[] (const edge_descriptor & edge)
std::vector< edge_descriptor > outEdges (const vertex_descriptor & vertex) const
void removeEdge (const edge_descriptor & edge)
void removeVertex (const vertex_descriptor & vertex)
void reverse (std::vector< edge_descriptor > & edges)
vertex_descriptor source (const edge_descriptor & edge) const
vertex_descriptor source (const edge_descriptor & edge, const EdgeDirection & direction) const
vertex_descriptor source (const directed_edge_descriptor & edge) const
vertex_descriptor target (const edge_descriptor & edge) const
vertex_descriptor target (const edge_descriptor & edge, const EdgeDirection & direction) const
vertex_descriptor target (const directed_edge_descriptor & edge) const
std::pair< vertex_iterator, vertex_iterator > vertices () const

Detailed Description

A boost::adjancency_list is wrapped in order to be able to annex some information and to provide basic functionalities.

Warning:

duplicate matching is performed in GeometryGraphBuilder (allows to modify position once it's done)

Public Types Documentation

typedef directed_edge_descriptor

typedef std::pair<edge_descriptor, EdgeDirection> SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::directed_edge_descriptor;

An edge descriptor, with a direction.

From the vertex point of view, out edges are DIRECT, in edges are REVERSE.


typedef edge_descriptor

typedef boost::graph_traits<graph_t>::edge_descriptor SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::edge_descriptor;

typedef edge_iterator

typedef boost::graph_traits<graph_t>::edge_iterator SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::edge_iterator;

typedef edge_properties

typedef EdgeProperties SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::edge_properties;

typedef graph_t

typedef boost::adjacency_list< boost::listS, boost::listS, boost::bidirectionalS, vertex_properties, edge_properties> SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::graph_t;

the wrapped graphEdgeProperties


typedef in_edge_iterator

typedef boost::graph_traits<graph_t>::in_edge_iterator SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::in_edge_iterator;

typedef out_edge_iterator

typedef boost::graph_traits<graph_t>::out_edge_iterator SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::out_edge_iterator;

typedef vertex_descriptor

typedef boost::graph_traits<graph_t>::vertex_descriptor SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::vertex_descriptor;

typedef vertex_iterator

typedef boost::graph_traits<graph_t>::vertex_iterator SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::vertex_iterator;

typedef vertex_properties

typedef VertexProperties SFCGAL::graph::GeometryGraphT< VertexProperties, EdgeProperties >::vertex_properties;

Public Functions Documentation

function addEdge

inline edge_descriptor SFCGAL::graph::GeometryGraphT::addEdge (
    const vertex_descriptor & source,
    const vertex_descriptor & target,
    const EdgeProperties & properties=EdgeProperties()
) 

[edge]Add an Edge to the Graph

Returns:

the identifier of the vertex


function addVertex

inline vertex_descriptor SFCGAL::graph::GeometryGraphT::addVertex (
    const vertex_properties & properties=vertex_properties()
) 

[vertex]add a vertex to the graph

Returns:

the identifier of the vertex


function adjacentVertices

inline std::set< vertex_descriptor > SFCGAL::graph::GeometryGraphT::adjacentVertices (
    const vertex_descriptor & vertex,
    bool withReverseDirection=true
) 

[adjacency]Returns the list of the adjacent vertices using both DIRECT and REVERSE direction

Parameters:

  • vertex input vertex
  • withReverseDirection indicates if in_edges are used

function areOpposite

inline bool SFCGAL::graph::GeometryGraphT::areOpposite (
    const edge_descriptor & a,
    const edge_descriptor & b
) const

[helper]indicates if edges are opposite


function areParallel

inline bool SFCGAL::graph::GeometryGraphT::areParallel (
    const edge_descriptor & a,
    const edge_descriptor & b
) const

[helper]indicates if edges are opposite


function degree

inline size_t SFCGAL::graph::GeometryGraphT::degree (
    const vertex_descriptor & vertex
) const

returns the degree of a vertex


function edges [1/2]

inline std::pair< edge_iterator, edge_iterator > SFCGAL::graph::GeometryGraphT::edges () const

[iterator]return edge iterator

typename GeometryGraph<V,E>::edge_iterator it, end ;
for ( boost::tie( it, end ) = g.edges(); it != end; ++it ){
        typename GeometryGraph<V,E>::edge_descriptor edge = *it ;
        std::cout << g.source(edge) << "," << g.target(edge) << std::endl;
}

function edges [2/2]

inline std::vector< directed_edge_descriptor > SFCGAL::graph::GeometryGraphT::edges (
    const vertex_descriptor & a,
    const vertex_descriptor & b
) const

[edge]Get edges from a to b and from b to a


function graph [1/2]

inline graph_t & SFCGAL::graph::GeometryGraphT::graph () 

returns the wrapped boost::graph


function graph [2/2]

inline const graph_t & SFCGAL::graph::GeometryGraphT::graph () const

returns the wrapped boost::graph


function inEdges

inline std::vector< edge_descriptor > SFCGAL::graph::GeometryGraphT::inEdges (
    const vertex_descriptor & vertex
) 

[adjacency]get in edges


function inOutEdges

inline std::vector< directed_edge_descriptor > SFCGAL::graph::GeometryGraphT::inOutEdges (
    const vertex_descriptor & vertex
) const

[adjacency]get in/out edges


function numEdges

inline size_t SFCGAL::graph::GeometryGraphT::numEdges () const

[edge]returns the number of vertices


function numVertices

inline size_t SFCGAL::graph::GeometryGraphT::numVertices () const

[vertex]returns the number of vertices


function operator const graph_t &

inline SFCGAL::graph::GeometryGraphT::operator const graph_t & (
    void
) const

implicit cast to the wrapped boost graph in order to keep boost graph interface


function operator graph_t &

inline SFCGAL::graph::GeometryGraphT::operator graph_t & (
    void
) 

implicit cast to the wrapped boost graph in order to keep boost graph interface


function operator[]

inline const vertex_properties & SFCGAL::graph::GeometryGraphT::operator[] (
    const vertex_descriptor & vertex
) const

returns the VertexProperties attached to a Vertex


function operator[]

inline vertex_properties & SFCGAL::graph::GeometryGraphT::operator[] (
    const vertex_descriptor & vertex
) 

returns the VertexProperties attached to a Vertex


function operator[]

inline const edge_properties & SFCGAL::graph::GeometryGraphT::operator[] (
    const edge_descriptor & edge
) const

returns the VertexProperties attached to a Vertex


function operator[]

inline edge_properties & SFCGAL::graph::GeometryGraphT::operator[] (
    const edge_descriptor & edge
) 

returns the VertexProperties attached to a Vertex


function outEdges

inline std::vector< edge_descriptor > SFCGAL::graph::GeometryGraphT::outEdges (
    const vertex_descriptor & vertex
) const

[adjacency]get out edges


function removeEdge

inline void SFCGAL::graph::GeometryGraphT::removeEdge (
    const edge_descriptor & edge
) 

[edge]Remove an edge


function removeVertex

inline void SFCGAL::graph::GeometryGraphT::removeVertex (
    const vertex_descriptor & vertex
) 

[vertex]Remove a vertex (and all its adjacent edges)


function reverse

inline void SFCGAL::graph::GeometryGraphT::reverse (
    std::vector< edge_descriptor > & edges
) 

[EdgeString]revert the order of a list of edges. Old edges are removed from the graph, new ones are created.

Warning:

properties are kept but oriented one (left face, right face, etc.) are lost.


function source [1/3]

inline vertex_descriptor SFCGAL::graph::GeometryGraphT::source (
    const edge_descriptor & edge
) const

[edge]get the source vertex for an edge


function source [2/3]

inline vertex_descriptor SFCGAL::graph::GeometryGraphT::source (
    const edge_descriptor & edge,
    const EdgeDirection & direction
) const

[edge]get the source vertex for an edge


function source [3/3]

inline vertex_descriptor SFCGAL::graph::GeometryGraphT::source (
    const directed_edge_descriptor & edge
) const

[edge]get the source vertex for an edge with a direction


function target [1/3]

inline vertex_descriptor SFCGAL::graph::GeometryGraphT::target (
    const edge_descriptor & edge
) const

[edge]get the target vertex for an edge


function target [2/3]

inline vertex_descriptor SFCGAL::graph::GeometryGraphT::target (
    const edge_descriptor & edge,
    const EdgeDirection & direction
) const

[edge]get the target vertex for an edge with a direction


function target [3/3]

inline vertex_descriptor SFCGAL::graph::GeometryGraphT::target (
    const directed_edge_descriptor & edge
) const

[edge]get the target vertex for an edge with a direction


function vertices

inline std::pair< vertex_iterator, vertex_iterator > SFCGAL::graph::GeometryGraphT::vertices () const

[iterator]return vertex iterator

typename GeometryGraph<V,E>::vertex_iterator it, end ;
for ( boost::tie( it, end ) = g.vertices(); it != end; ++it ){
        typename GeometryGraph<V,E>::vertex_descriptor vertex = *it ;
        std::cout << g[ vertex ].coordinate << std::endl;
}


The documentation for this class was generated from the following file /builds/sfcgal/SFCGAL/src/detail/graph/GeometryGraph.h