CGAL 6.0.1 - CGAL and the Boost Graph Library
Loading...
Searching...
No Matches
CGAL::Seam_mesh< TM, SEM, SVM > Class Template Reference

#include <CGAL/boost/graph/Seam_mesh.h>

Definition

template<class TM, class SEM, class SVM>
class CGAL::Seam_mesh< TM, SEM, SVM >

This class is a data structure that takes a triangle mesh, further referred to as underlying mesh and turns some marked edges of that mesh into virtual boundary edges.

Note that a seam edge must be an edge of the underlying mesh that is not a border edge (that is, such that either halfedge or the edge have null_face() as incident face). Marking a border edge as seam will not do anything.

Is model of
FaceGraph or FaceListGraph depending on the underlying mesh TM.
Template Parameters
TMa model of FaceGraph or FaceListGraph
SEMa model of ReadablePropertyMap with boost::graph_traits<TM>::edge_descriptor as key type and bool as value type.
SVMa model of ReadablePropertyMap with boost::graph_traits<TM>::vertex_descriptor as key type and bool as value type.
See also
boost::graph_traits<Seam_mesh<TM> >
Examples
BGL_surface_mesh/seam_mesh.cpp.

Classes

class  edge_descriptor
 This class represents an edge of the seam mesh. More...
 
class  halfedge_descriptor
 This class represents a halfedge of the seam mesh. More...
 
class  vertex_descriptor
 This class represents a vertex of the seam mesh. More...
 

Public Types

typedef TM Triangle_mesh
 The underlying mesh type.
 
typedef boost::graph_traits< TM >::face_descriptor face_descriptor
 This class represents a face of the seam mesh.
 

Public Member Functions

const TM & mesh () const
 returns the underlying mesh.
 
 Seam_mesh (const TM &tm, const SEM &sem, const SVM svm)
 constructs a seam mesh for a triangle mesh and an edge and vertex property map
 

Underlying mesh's descriptor and iterator typedefs

typedef boost::graph_traits< TM >::vertex_descriptor TM_vertex_descriptor
 The type for the objects used to identify vertices in the underlying mesh.
 
typedef boost::graph_traits< TM >::halfedge_descriptor TM_halfedge_descriptor
 The type for the objects used to identify halfedges in the underlying mesh.
 
typedef boost::graph_traits< TM >::halfedge_iterator TM_halfedge_iterator
 The type for the iterators that traverse through the complete halfedge set of the underlying mesh.
 
typedef boost::graph_traits< TM >::edge_descriptor TM_edge_descriptor
 The type for the objects used to identify edges in the underlying mesh.
 

Size types

typedef boost::graph_traits< TM >::degree_size_type degree_size_type
 The unsigned integer type used for representing the degree of vertices in the seam mesh.
 
typedef boost::graph_traits< TM >::vertices_size_type vertices_size_type
 The unsigned integer type used to represent the number of vertices in the seam mesh.
 
typedef boost::graph_traits< TM >::edges_size_type edges_size_type
 The unsigned integer type used for representing the number of edges in the seam mesh.
 
typedef boost::graph_traits< TM >::halfedges_size_type halfedges_size_type
 The unsigned integer type used for representing the number of halfedges in the seam mesh.
 
typedef boost::graph_traits< TM >::faces_size_type faces_size_type
 The unsigned integer type used for representing the number of faces in the seam mesh.
 

Seam query functions

bool has_on_seam (TM_vertex_descriptor vd) const
 returns true if the vertex is on the seam.
 
bool has_on_seam (TM_edge_descriptor ed) const
 returns true if the edge is on the seam.
 
bool has_on_seam (TM_halfedge_descriptor tmhd) const
 returns true if the halfedge is on the seam.
 
bool has_on_seam (const halfedge_descriptor &hd) const
 returns true if the halfedge is on the seam.
 
edges_size_type number_of_seam_edges () const
 returns the number of seam edges in the seam mesh.
 

Range Types

Iterator_range< vertex_iterator > vertices () const
 returns the iterator range of the vertices of the mesh.
 
Iterator_range< halfedge_iterator > halfedges () const
 returns the iterator range of the halfedges of the mesh.
 
Iterator_range< edge_iterator > edges () const
 returns the iterator range of the edges of the mesh.
 
Iterator_range< face_iterator > faces () const
 returns the iterator range of the faces of the mesh.
 

Memory Management

vertices_size_type num_vertices () const
 returns the number of vertices in the seam mesh.
 
halfedges_size_type num_halfedges () const
 returns the number of halfedges in the seam mesh.
 
halfedges_size_type num_edges () const
 returns the number of edges in the seam mesh.
 
faces_size_type num_faces () const
 returns the number of faces in the seam mesh.
 

Degree Functions

degree_size_type degree (vertex_descriptor v) const
 returns the number of incident halfedges of vertex v.
 

Seam selection

bool add_seam (TM_vertex_descriptor tm_vd_s, TM_vertex_descriptor tm_vd_t)
 marks the edge of the underlying mesh that has extremities the vertices tm_vd_s and tm_vd_s as a seam edge.
 
template<class InputIterator >
TM_halfedge_descriptor add_seams (InputIterator first, InputIterator last)
 creates new seams.
 
template<typename VdContainer >
TM_halfedge_descriptor add_seams (std::ifstream &in, const VdContainer &tm_vds)
 creates new seams.
 
TM_halfedge_descriptor add_seams (std::ifstream &in)
 creates new seams.
 
template<typename VdContainer >
TM_halfedge_descriptor add_seams (const char *filename, const VdContainer &tm_vds)
 creates new seams.
 
TM_halfedge_descriptor add_seams (const char *filename)
 creates new seams.
 

Member Typedef Documentation

◆ face_descriptor

template<class TM , class SEM , class SVM >
typedef boost::graph_traits<TM>::face_descriptor CGAL::Seam_mesh< TM, SEM, SVM >::face_descriptor

This class represents a face of the seam mesh.

Is model of
Descriptor

Constructor & Destructor Documentation

◆ Seam_mesh()

template<class TM , class SEM , class SVM >
CGAL::Seam_mesh< TM, SEM, SVM >::Seam_mesh ( const TM &  tm,
const SEM &  sem,
const SVM  svm 
)

constructs a seam mesh for a triangle mesh and an edge and vertex property map

Parameters
tmthe underlying mesh
semthe edge property map with value true for seam edges
svmthe vertex property map with value true for seam vertices
Note
the vertices must be exactly the vertices on the seam edges.

Member Function Documentation

◆ add_seam()

template<class TM , class SEM , class SVM >
bool CGAL::Seam_mesh< TM, SEM, SVM >::add_seam ( TM_vertex_descriptor  tm_vd_s,
TM_vertex_descriptor  tm_vd_t 
)

marks the edge of the underlying mesh that has extremities the vertices tm_vd_s and tm_vd_s as a seam edge.

Returns
whether the edge was successfully marked or not. Marking will fail if:
  • No edge of the underlying mesh exist with extremities tm_vd_s and tm_vd_s,
  • the edge of the underlying mesh with extremities tm_vd_s and tm_vd_s is a border edge, or
  • the edge of the underlying mesh with extremities tm_vd_s and tm_vd_s is already a seam edge.

◆ add_seams() [1/5]

template<class TM , class SEM , class SVM >
TM_halfedge_descriptor CGAL::Seam_mesh< TM, SEM, SVM >::add_seams ( const char *  filename)

creates new seams.

A seam edge is described by a pair of integers. The integer index of a vertex of the underlying mesh is defined as its position when iterating over the vertices of the underlying mesh with boost::graph_traits<TM>::vertices().

Returns
one of the halfedges of the seam mesh that is on a seam.
Precondition
filename should be the name of a CGAL selection file with file extension "*.selection.txt": edges are described by pairs of integers, on the third line of the file.

◆ add_seams() [2/5]

template<class TM , class SEM , class SVM >
template<typename VdContainer >
TM_halfedge_descriptor CGAL::Seam_mesh< TM, SEM, SVM >::add_seams ( const char *  filename,
const VdContainer &  tm_vds 
)

creates new seams.

A seam edge is described by a pair of integers. The integer index of a vertex of the underlying mesh is given by its position in the container tm_vds.

Returns
one of the halfedges of the seam mesh that is on a seam.
Template Parameters
VdContainermust be a model of SequenceContainer (that is, provide the functions: operator[] and at()).
Precondition
filename should be the name of a CGAL selection file with file extension "*.selection.txt": edges are described by pairs of integers, on the third line of the file.

◆ add_seams() [3/5]

template<class TM , class SEM , class SVM >
template<class InputIterator >
TM_halfedge_descriptor CGAL::Seam_mesh< TM, SEM, SVM >::add_seams ( InputIterator  first,
InputIterator  last 
)

creates new seams.

The edges to be marked as seams are described by the range [first, last) of vertices of the underlying mesh. Each edge to be marked is described by two consecutive iterators.

Returns
one of the halfedges of the seam mesh that is on a seam.
Precondition
InputIterator must be a model of InputIterator.
The value type of InputIterator must be boost::graph_traits<TM>::vertex_descriptor.
There is an even number of vertices.

◆ add_seams() [4/5]

template<class TM , class SEM , class SVM >
TM_halfedge_descriptor CGAL::Seam_mesh< TM, SEM, SVM >::add_seams ( std::ifstream &  in)

creates new seams.

A seam edge is described by a pair of integers. The integer index of a vertex of the underlying mesh is defined as its position when iterating over the vertices of the underlying mesh with boost::graph_traits<TM>::vertices().

Returns
one of the halfedges of the seam mesh that is on a seam.
Precondition
The stream must contain an even number of values.

◆ add_seams() [5/5]

template<class TM , class SEM , class SVM >
template<typename VdContainer >
TM_halfedge_descriptor CGAL::Seam_mesh< TM, SEM, SVM >::add_seams ( std::ifstream &  in,
const VdContainer &  tm_vds 
)

creates new seams.

A seam edge is described by a pair of integers. The integer index of a vertex of the underlying mesh is given by its position in the container tm_vds.

Template Parameters
VdContainermust be a model of SequenceContainer (that is, provide the functions: operator[] and at()).
Returns
one of the halfedges of the seam mesh that is on a seam.
Precondition
The stream must contain an even number of values.