% +------------------------------------------------------------------------+
% | Reference manual page: Barycentric_mapping_parameterizer_3.tex
% +------------------------------------------------------------------------+
% | 23.08.2005   Laurent Saboret, Pierre Alliez
% | Package: Parameterization
% |
\RCSdef{\RCSBarycentricmappingparameterizerRev}{$Revision$}
\RCSdefDate{\RCSBarycentricmappingparameterizerDate}{$Date$}
% |
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+


\begin{ccRefClass}{Barycentric_mapping_parameterizer_3}  %% add template arg's if necessary

%% \ccHtmlCrossLink{}     %% add further rules for cross referencing links
%% \ccHtmlIndexC[class]{} %% add further index entries


\ccDefinition

% The section below is automatically generated. Do not edit!
%START-AUTO(\ccDefinition)

The class Barycentric\_mapping\_parameterizer\_3 implements Tutte Barycentric Mapping algorithm \cite{t-hdg-63}. This algorithm is also called {\em Tutte Uniform Weights} by other authors.

1 to 1 mapping is guaranteed if the surface's border is mapped to a convex polygon.

As all parameterization algorithms of the package, this class is usually called via the global function parameterize().

This class is a Strategy \cite{cgal:ghjv-dpero-95} called by the main parameterization algorithm Fixed\_border\_parameterizer\_3::parameterize(). Barycentric\_mapping\_parameterizer\_3:\begin{itemize}
\item provides default BorderParameterizer\_3 and SparseLinearAlgebraTraits\_d template parameters that make sense.\item implements compute\_w\_ij() to compute w\_ij = (i,j) coefficient of matrix A for j neighbor vertex of i based on Tutte Barycentric Mapping method.\item implements an optimized version of is\_one\_to\_one\_mapping().\end{itemize}

%END-AUTO(\ccDefinition)

\ccInclude{CGAL/Barycentric_mapping_parameterizer_3.h}


\ccIsModel

% The section below is automatically generated. Do not edit!
%START-AUTO(\ccIsModel)

Model of the ParameterizerTraits\_3 concept.

%END-AUTO(\ccIsModel)


\ccParameters

The full template declaration is:

% The section below is automatically generated. Do not edit!
%START-AUTO(\ccParameters)

template$<$  \\
class ParameterizationMesh\_3,   \\
class BorderParameterizer\_3 = Circular\_border\_arc\_length\_parameterizer\_3$<$ParameterizationMesh\_3$>$,   \\
class SparseLinearAlgebraTraits\_d = OpenNL::DefaultLinearSolverTraits$<$typename ParameterizationMesh\_3::NT$>$$>$   \\
class Barycentric\_mapping\_parameterizer\_3;

%END-AUTO(\ccParameters)


\ccTypes

% The section below is automatically generated. Do not edit!
%START-AUTO(\ccTypes)



%END-AUTO(\ccTypes)


\ccCreation
\ccCreationVariable{param}  %% variable name used by \ccMethod below

% The section below is automatically generated. Do not edit!
%START-AUTO(\ccCreation)

\ccConstructor{Barycentric_mapping_parameterizer_3 (Border_param border_param = Border_param(), Sparse_LA sparse_la = Sparse_LA());}
{
Constructor.
}
\ccGlue
\begin{description}
\item[Parameters: ]
\begin{description}
\item[border\_param]Object that maps the surface's border to 2D space. \item[sparse\_la]Traits object to access a sparse linear system. \end{description}
\end{description}
\ccGlue

%END-AUTO(\ccCreation)


\ccOperations

% The section below is automatically generated. Do not edit!
%START-AUTO(\ccOperations)

\ccMethod{virtual NT compute_w_ij (const Adaptor & mesh, Vertex_const_handle main_vertex_v_i, Vertex_around_vertex_const_circulator neighbor_vertex_v_j);}
{
Compute w\_ij = (i,j) coefficient of matrix A for j neighbor vertex of i.
Tutte Barycentric Mapping algorithm is the most simple one: w\_ij = 1 for j neighbor vertex of i.
}
\ccGlue
\ccMethod{virtual bool is_one_to_one_mapping (const Adaptor & mesh, const Matrix & A, const Vector & Bu, const Vector & Bv);}
{
Check if 3D -$>$ 2D mapping is 1 to 1.
Theorem: 1 to 1 mapping is guaranteed if all w\_ij coefficients are $>$ 0 (for j vertex neighbor of i) and if the surface border is mapped onto a 2D convex polygon. All w\_ij coefficients = 1 (for j vertex neighbor of i), thus mapping is guaranteed if the surface border is mapped onto a 2D convex polygon.
}
\ccGlue

%END-AUTO(\ccOperations)


\ccSeeAlso

\ccRefIdfierPage{CGAL::Parameterizer_traits_3}  \\
\ccRefIdfierPage{CGAL::Fixed_border_parameterizer_3}  \\
\ccRefIdfierPage{CGAL::Discrete_authalic_parameterizer_3}  \\
\ccRefIdfierPage{CGAL::Discrete_conformal_map_parameterizer_3}  \\
\ccRefIdfierPage{CGAL::LSCM_parameterizer_3}  \\
\ccRefIdfierPage{CGAL::Mean_value_coordinates_parameterizer_3}  \\


\ccExample

\begin{ccExampleCode}

// CGAL kernel
typedef CGAL::Cartesian<double>                         Kernel;

// Mesh true type and parameterization adaptor
typedef CGAL::Polyhedron_3<Kernel>                      Polyhedron;
typedef CGAL::Parameterization_polyhedron_adaptor_3<Polyhedron>
                                                        Parameterization_polyhedron_adaptor;

// Tutte barycentric mapping
typedef CGAL::Barycentric_mapping_parameterizer_3<Parameterization_polyhedron_adaptor>
                                                        Parameterizer;

int main(int argc,char * argv[])
{
    Polyhedron mesh;
    ...

    // The parameterization package needs an adaptor to handle Polyhedron_3 meshes
    // The mesh must be a topological disk
    Parameterization_polyhedron_adaptor mesh_adaptor(&mesh);

    Parameterizer::Error_code err = CGAL::parameterize(&mesh_adaptor, Parameterizer());
    ...
}

\end{ccExampleCode}


\end{ccRefClass}

% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
% EOF
% +------------------------------------------------------------------------+

