SFCGAL  2.3.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
SFCGAL::algorithm::SurfaceGraph Class Reference

Represents a polyhedral surface as a graph where faces are nodes and egde are graph edges. More...

#include <connection.h>

Inheritance diagram for SFCGAL::algorithm::SurfaceGraph:

Public Types

using VertexIndex = size_t
 Vertex index type for identifying vertices in the surface graph. More...
 
using FaceIndex = size_t
 Face index type for identifying faces in the surface graph. More...
 
using CoordinateMap = std::map< Coordinate, VertexIndex >
 Map type for associating coordinates with vertex indices. More...
 
using EdgeMap = std::map< std::pair< VertexIndex, VertexIndex >, std::pair< FaceIndex, FaceIndex >>
 Map type for storing edges and their adjacent faces. More...
 
using FaceGraph = boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS >
 Graph type representing face adjacency relationships. More...
 

Public Member Functions

 SurfaceGraph (const PolyhedralSurface &surface)
 Construct from PolyhedralSurface. More...
 
 SurfaceGraph (const TriangulatedSurface &triangulatedSurface)
 Construct from TriangulatedSurface. More...
 
const EdgeMap & edgeMap () const
 Get the edge map. More...
 
const FaceGraph & faceGraph () const
 Get the face adjacency graph. More...
 
const Validity isValid () const
 Check if the surface graph is valid. More...
 

Static Public Attributes

static const size_t INVALID_INDEX = std::numeric_limits<size_t>::max()
 Constant representing an invalid index value. More...
 

Detailed Description

Represents a polyhedral surface as a graph where faces are nodes and egde are graph edges.

Precondition
the polygons are valid
Todo:
unittest

Member Typedef Documentation

Map type for associating coordinates with vertex indices.

Map type for storing edges and their adjacent faces.

using SFCGAL::algorithm::SurfaceGraph::FaceGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS>

Graph type representing face adjacency relationships.

Face index type for identifying faces in the surface graph.

Vertex index type for identifying vertices in the surface graph.

Constructor & Destructor Documentation

SFCGAL::algorithm::SurfaceGraph::SurfaceGraph ( const PolyhedralSurface &  surface)

Construct from PolyhedralSurface.

Parameters
surfaceThe polyhedral surface to construct the graph from
Exceptions
Exceptionif surface is not connected
SFCGAL::algorithm::SurfaceGraph::SurfaceGraph ( const TriangulatedSurface &  triangulatedSurface)

Construct from TriangulatedSurface.

Parameters
triangulatedSurfaceThe triangulated surface to construct the graph from
Exceptions
Exceptionif surface is not connected

Member Function Documentation

const EdgeMap& SFCGAL::algorithm::SurfaceGraph::edgeMap ( ) const
inline

Get the edge map.

Returns
Const reference to the edge map
const FaceGraph& SFCGAL::algorithm::SurfaceGraph::faceGraph ( ) const
inline

Get the face adjacency graph.

Returns
Const reference to the face graph
const Validity SFCGAL::algorithm::SurfaceGraph::isValid ( ) const
inline

Check if the surface graph is valid.

Returns
Validity status of the surface graph

Member Data Documentation

const size_t SFCGAL::algorithm::SurfaceGraph::INVALID_INDEX = std::numeric_limits<size_t>::max()
static

Constant representing an invalid index value.