SFCGAL 2.3.0
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.
using FaceIndex = size_t
 Face index type for identifying faces in the surface graph.
using CoordinateMap = std::map<Coordinate, VertexIndex>
 Map type for associating coordinates with vertex indices.
using EdgeMap
 Map type for storing edges and their adjacent faces.
using FaceGraph
 Graph type representing face adjacency relationships.

Public Member Functions

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

Static Public Attributes

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

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

◆ CoordinateMap

Map type for associating coordinates with vertex indices.

◆ EdgeMap

Initial value:
std::map<std::pair<VertexIndex, VertexIndex>,
std::pair<FaceIndex, FaceIndex>>

Map type for storing edges and their adjacent faces.

◆ FaceGraph

Initial value:
boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS>

Graph type representing face adjacency relationships.

◆ FaceIndex

Face index type for identifying faces in the surface graph.

◆ VertexIndex

Vertex index type for identifying vertices in the surface graph.

Constructor & Destructor Documentation

◆ SurfaceGraph() [1/2]

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

◆ SurfaceGraph() [2/2]

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

◆ edgeMap()

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

Get the edge map.

Returns
Const reference to the edge map

◆ faceGraph()

const FaceGraph & SFCGAL::algorithm::SurfaceGraph::faceGraph ( ) const
inline

Get the face adjacency graph.

Returns
Const reference to the face graph

◆ isValid()

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

◆ INVALID_INDEX

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

Constant representing an invalid index value.