CGAL 5.4 - Planar Parameterization of Triangulated Surface Meshes
CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ > Class Template Referenceabstract

#include <CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h>

Definition

template<typename TriangleMesh_, class BorderParameterizer_ = Default, class SolverTraits_ = Default>
class CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >

The class Fixed_border_parameterizer_3 is the base class of fixed border parameterization methods (Tutte, Floater, ...).

A one-to-one mapping is guaranteed if the border of the surface is mapped onto a convex polygon.

This class is a pure virtual class and thus cannot be instantiated. Nevertheless, it implements most of the parameterization algorithm parameterize(). Subclasses are Strategies [5] that modify the behavior of this algorithm:

  • They provide the template parameters BorderParameterizer_ and SolverTraits_.
  • They implement compute_w_ij() to compute w_ij, the (i,j)-coefficient of matrix A for j neighbor vertex of i.
    Is Model Of:
    Parameterizer_3
Template Parameters
TriangleMesh_must be a model of FaceGraph.
BorderParameterizer_is a Strategy to parameterize the surface border and must be a model of Parameterizer_3.
Default:
Circular_border_arc_length_parameterizer_3<TriangleMesh_>
SolverTraits_must be a model of SparseLinearAlgebraTraits_d.
Note that the system is not symmetric because Fixed_border_parameterizer_3 does not remove border vertices from the system.
Default: If Eigen 3.1 (or greater) is available and CGAL_EIGEN3_ENABLED is defined, then an overload of Eigen_solver_traits is provided as default parameter:
Eigen::BiCGSTAB<Eigen_sparse_matrix<double>::EigenType,
Eigen::IncompleteLUT< double > > >
See also
CGAL::Surface_mesh_parameterization::Barycentric_mapping_parameterizer_3<TriangleMesh, BorderParameterizer, SolverTraits>
CGAL::Surface_mesh_parameterization::Discrete_authalic_parameterizer_3<TriangleMesh, BorderParameterizer, SolverTraits>
CGAL::Surface_mesh_parameterization::Discrete_conformal_map_parameterizer_3<TriangleMesh, BorderParameterizer, SolverTraits>
CGAL::Surface_mesh_parameterization::Mean_value_coordinates_parameterizer_3<TriangleMesh, BorderParameterizer, SolverTraits>

Public Types

typedef Border_parameterizer_ Border_parameterizer
 Border parameterizer type.
 
typedef SolverTraits_ Solver_traits
 Solver traits type.
 
typedef TriangleMesh_ Triangle_mesh
 Triangle mesh type.
 
typedef boost::graph_traits< Triangle_mesh >::vertex_descriptor vertex_descriptor
 Mesh vertex type.
 
typedef boost::graph_traits< Triangle_mesh >::halfedge_descriptor halfedge_descriptor
 Mesh halfedge type.
 
typedef Solver_traits::Vector Vector
 Solver vector type.
 
typedef Solver_traits::Matrix Matrix
 Solver matrix type.
 

Public Member Functions

 Fixed_border_parameterizer_3 (Border_parameterizer border_param=Border_parameterizer(), Solver_traits sparse_la=Solver_traits())
 Constructor. More...
 
virtual ~Fixed_border_parameterizer_3 ()
 Destructor of base class should be virtual.
 
template<typename VertexUVmap , typename VertexIndexMap , typename VertexParameterizedMap >
Error_code parameterize (Triangle_mesh &mesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap, VertexParameterizedMap vpmap)
 computes a one-to-one mapping from a triangular 3D surface mesh to a piece of the 2D space. More...
 

Protected Member Functions

template<typename VertexUVmap , typename VertexIndexMap >
void initialize_system_from_mesh_border (Matrix &A, Vector &Bu, Vector &Bv, const Triangle_mesh &mesh, halfedge_descriptor bhd, VertexUVmap uvmap, VertexIndexMap vimap) const
 initializes A, Bu and Bv after border parameterization. More...
 
virtual NT compute_w_ij (const Triangle_mesh &mesh, vertex_descriptor main_vertex_v_i, Vertex_around_target_circulator< Triangle_mesh > neighbor_vertex_v_j) const =0
 computes w_ij, coefficient of matrix A for j neighbor vertex of i. More...
 
template<typename VertexIndexMap >
Error_code setup_inner_vertex_relations (Matrix &A, Vector &, Vector &, const Triangle_mesh &mesh, vertex_descriptor vertex, VertexIndexMap vimap) const
 Compute the line i of matrix A for i inner vertex: More...
 
Border_parameterizerget_border_parameterizer ()
 Get the object that maps the surface's border onto a 2D space.
 
Solver_traitsget_linear_algebra_traits ()
 Get the sparse linear algebra (traits object to access the linear system).
 

Constructor & Destructor Documentation

◆ Fixed_border_parameterizer_3()

template<typename TriangleMesh_, class BorderParameterizer_ = Default, class SolverTraits_ = Default>
CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >::Fixed_border_parameterizer_3 ( Border_parameterizer  border_param = Border_parameterizer(),
Solver_traits  sparse_la = Solver_traits() 
)

Constructor.

Parameters
border_paramObject that maps the surface's border to 2D space
sparse_laTraits object to access a sparse linear system

Member Function Documentation

◆ compute_w_ij()

template<typename TriangleMesh_, class BorderParameterizer_ = Default, class SolverTraits_ = Default>
virtual NT CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >::compute_w_ij ( const Triangle_mesh mesh,
vertex_descriptor  main_vertex_v_i,
Vertex_around_target_circulator< Triangle_mesh neighbor_vertex_v_j 
) const
protectedpure virtual

◆ initialize_system_from_mesh_border()

template<typename TriangleMesh_, class BorderParameterizer_ = Default, class SolverTraits_ = Default>
template<typename VertexUVmap , typename VertexIndexMap >
void CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >::initialize_system_from_mesh_border ( Matrix A,
Vector Bu,
Vector Bv,
const Triangle_mesh mesh,
halfedge_descriptor  bhd,
VertexUVmap  uvmap,
VertexIndexMap  vimap 
) const
protected

initializes A, Bu and Bv after border parameterization.

Fill the border vertices' lines in both linear systems: "u = constant" and "v = constant".

Template Parameters
VertexUVmapmust be a model of ReadWritePropertyMap with boost::graph_traits<Triangle_mesh>::vertex_descriptor as key type and Point_2 (type deduced from Triangle_mesh using Kernel_traits) as value type.
VertexIndexMapmust be a model of ReadablePropertyMap with boost::graph_traits<Triangle_mesh>::vertex_descriptor as key type and a unique integer as value type.
Parameters
Athe matrix in both linear system
Buthe right hand side vector in the linear system of x coordinates
Bvthe right hand side vector in the linear system of y coordinates
mesha triangulated surface.
bhda halfedge descriptor on the boundary of mesh.
uvmapan instanciation of the class VertexUVmap.
vimapan instanciation of the class VertexIndexMap.
Precondition
Vertices must be indexed (vimap must be initialized).
A, Bu, and Bv must be allocated.
Border vertices must be parameterized.

◆ parameterize()

template<typename TriangleMesh_, class BorderParameterizer_ = Default, class SolverTraits_ = Default>
template<typename VertexUVmap , typename VertexIndexMap , typename VertexParameterizedMap >
Error_code CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >::parameterize ( Triangle_mesh mesh,
halfedge_descriptor  bhd,
VertexUVmap  uvmap,
VertexIndexMap  vimap,
VertexParameterizedMap  vpmap 
)

computes a one-to-one mapping from a triangular 3D surface mesh to a piece of the 2D space.

The mapping is piecewise linear (linear in each triangle). The result is the (u,v) pair image of each vertex of the 3D surface.

Template Parameters
VertexUVmapmust be a model of ReadWritePropertyMap with boost::graph_traits<Triangle_mesh>::vertex_descriptor as key type and Point_2 (type deduced from Triangle_mesh using Kernel_traits) as value type.
VertexIndexMapmust be a model of ReadablePropertyMap with boost::graph_traits<Triangle_mesh>::vertex_descriptor as key type and a unique integer as value type.
VertexParameterizedMapmust be a model of ReadWritePropertyMap with boost::graph_traits<Triangle_mesh>::vertex_descriptor as key type and a Boolean as value type.
Parameters
mesha triangulated surface.
bhda halfedge descriptor on the boundary of mesh.
uvmapan instanciation of the class VertexUVmap.
vimapan instanciation of the class VertexIndexMap.
vpmapan instanciation of the class VertexParameterizedMap.
Precondition
mesh must be a triangular mesh.
The mesh border must be mapped onto a convex polygon.
The vertices must be indexed (vimap must be initialized)

◆ setup_inner_vertex_relations()

template<typename TriangleMesh_, class BorderParameterizer_ = Default, class SolverTraits_ = Default>
template<typename VertexIndexMap >
Error_code CGAL::Surface_mesh_parameterization::Fixed_border_parameterizer_3< TriangleMesh_, BorderParameterizer_, SolverTraits_ >::setup_inner_vertex_relations ( Matrix A,
Vector ,
Vector ,
const Triangle_mesh mesh,
vertex_descriptor  vertex,
VertexIndexMap  vimap 
) const
protected

Compute the line i of matrix A for i inner vertex:

  • call compute_w_ij() to compute the A coefficient w_ij for each neighbor v_j.
  • compute w_ii = - sum of w_ijs.
Precondition
Vertices must be indexed.
Vertex i musn't be already parameterized.
Line i of A must contain only zeros.