\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.11 - CGAL and the Boost Graph Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::Seam_mesh< TM, SEM, SVM > Class Template Reference

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

Definition

This class is a data structure that takes a triangle mesh, further refered 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> >

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 boost::graph_traits
< TM >::face_descriptor 
face_descriptor
 This class represents a face of the seam mesh. More...
 

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

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
 Return 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)
 Mark the edge of the underlying mesh that has extremities the vertices tm_vd_s and tm_vd_s as a seam edge. More...
 
template<class InputIterator >
TM_halfedge_descriptor add_seams (InputIterator first, InputIterator last)
 Create new seams. More...
 
template<typename VdContainer >
TM_halfedge_descriptor add_seams (std::ifstream &in, const VdContainer &tm_vds)
 Create new seams. More...
 
TM_halfedge_descriptor add_seams (std::ifstream &in)
 Create new seams. More...
 
template<typename VdContainer >
TM_halfedge_descriptor add_seams (const char *filename, const VdContainer &tm_vds)
 Create new seams. More...
 
TM_halfedge_descriptor add_seams (const char *filename)
 Create new seams. More...
 

Member Typedef Documentation

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

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

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 
)

Mark 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.
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 
)

Create 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.
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 
)

Create 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.
template<class TM , class SEM , class SVM >
TM_halfedge_descriptor CGAL::Seam_mesh< TM, SEM, SVM >::add_seams ( std::ifstream &  in)

Create 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.
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 
)

Create 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: edges are described by pairs of integers, on the third line of the file.
template<class TM , class SEM , class SVM >
TM_halfedge_descriptor CGAL::Seam_mesh< TM, SEM, SVM >::add_seams ( const char *  filename)

Create 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: edges are described by pairs of integers, on the third line of the file.