Geogram  Version 1.9.1
A programming library of geometric algorithms
GEO::VSDM Class Reference

Voronoi Square Distance Minimization. More...

#include <exploragram/optimal_transport/VSDM.h>

Public Member Functions

 VSDM (Mesh *S, Mesh *T)
 VSDM constructor. More...
 
virtual ~VSDM ()
 VSDM destructor.
 
void set_affinity (double x)
 Sets the affinity. More...
 
void optimize (index_t nb_iter)
 Optimizes the fitting. More...
 
void set_progress (ProgressTask *progress)
 Sets an optional progress bar to track progress during calls of optimize() More...
 
void set_subdivision_surface (Mesh *mesh, index_t nb_subdiv)
 Sets a subdivision surface. More...
 

Static Public Member Functions

static void funcgrad_CB (index_t n, double *x, double &f, double *g)
 The callback to evaluate the objective function, used by the optimizer. More...
 
static void newiteration_CB (index_t n, const double *x, double f, const double *g, double gnorm)
 The callback for each iteration of the optimizer. More...
 

Protected Member Functions

virtual void funcgrad (index_t n, double *x, double &f, double *g)
 Evaluates the objective function and its gradient. More...
 
virtual void newiteration ()
 Updates the progress bar (if specified) and graphics. More...
 
void add_funcgrad_affinity (index_t n, double *x, double &f, double *g)
 Adds the value and gradient of the affinity to the currently evaluated objective function. More...
 

Static Protected Member Functions

static VSDMinstance ()
 Gets the instance. More...
 
static void compute_graph_Laplacian (Mesh *S, NLSparseMatrix *L)
 Computes the graph Laplacian of a surface mesh. More...
 

Protected Attributes

Delaunay_var delaunay_
 
RestrictedVoronoiDiagram_var RVD_
 
MeshS_
 
MeshT_
 
double affinity_
 
double affinity_scaling_
 
ProgressTaskprogress_
 
Optimizer_var optimizer_
 
index_t nb_iter_
 
index_t cur_iter_
 
NLSparseMatrix L_
 
vector< double > temp_V1_
 
vector< double > temp_V2_
 
NLMatrix subd_matrix_
 
Meshsubd_
 
vector< double > subd_g_
 

Static Protected Attributes

static VSDMinstance_
 

Detailed Description

Voronoi Square Distance Minimization.

Fits a surface mesh to a target surface mesh. The algorithm is described in the following references:

  • Fitting Polynomial Surfaces to Triangular Meshes with Voronoi Squared Distance Minimization, Vindent Nivolers, Dong-Ming Yan and Bruno Levy, Intl. Meshing Roundtable Conf. Proc., 2011
  • Centroidal Voronoi Tessellation of Line Segments and Graphs, Lin Lu, Bruno Levy and Wenping Wang, Eurographics conf. Proc., 2012

Definition at line 66 of file VSDM.h.

Constructor & Destructor Documentation

◆ VSDM()

GEO::VSDM::VSDM ( Mesh S,
Mesh T 
)

VSDM constructor.

Parameters
[in]Sthe surface mesh to be fitted.
[in]Tthe target surface mesh.

Member Function Documentation

◆ add_funcgrad_affinity()

void GEO::VSDM::add_funcgrad_affinity ( index_t  n,
double *  x,
double &  f,
double *  g 
)
protected

Adds the value and gradient of the affinity to the currently evaluated objective function.

Parameters
[in]ndimension of the problem (here, three times the number of vertices of the surface S).
[in]xa pointer to the current vector of variables, of dimension n.
[in,out]fthe value of the objective function.
[in,out]ga pointer to a vector of dimension n with the gradient of the objective function.

◆ compute_graph_Laplacian()

static void GEO::VSDM::compute_graph_Laplacian ( Mesh S,
NLSparseMatrix L 
)
staticprotected

Computes the graph Laplacian of a surface mesh.

Parameters
[in]Sa pointer to a surface mesh.
[out]Lthe graph Laplacian of S.

◆ funcgrad()

virtual void GEO::VSDM::funcgrad ( index_t  n,
double *  x,
double &  f,
double *  g 
)
protectedvirtual

Evaluates the objective function and its gradient.

Parameters
[in]ndimension of the problem (here, three times the number of vertices of the surface S).
[in]xa pointer to the current vector of variables, of dimension n.
[out]fthe value of the objective function.
[out]ga pointer to a vector of dimension n with the gradient of the objective function.

◆ funcgrad_CB()

static void GEO::VSDM::funcgrad_CB ( index_t  n,
double *  x,
double &  f,
double *  g 
)
static

The callback to evaluate the objective function, used by the optimizer.

Parameters
[in]ndimension of the problem (here, three times the number of vertices of the surface S).
[in]xa pointer to the current vector of variables, of dimension n.
[out]fthe value of the objective function.
[out]ga pointer to a vector of dimension n with the gradient of the objective function.

◆ instance()

static VSDM* GEO::VSDM::instance ( )
inlinestaticprotected

Gets the instance.

Returns
a pointer to the current VSDM instance.

Definition at line 148 of file VSDM.h.

◆ newiteration()

virtual void GEO::VSDM::newiteration ( )
protectedvirtual

Updates the progress bar (if specified) and graphics.

This function is called after each iteration of the optimizer.

◆ newiteration_CB()

static void GEO::VSDM::newiteration_CB ( index_t  n,
const double *  x,
double  f,
const double *  g,
double  gnorm 
)
static

The callback for each iteration of the optimizer.

Parameters
[in]ndimension of the problem (here, three times the number of vertices of the surface S).
[in]xa pointer to the current vector of variables, of dimension n.
[in]fthe current value of the objective function.
[in]ga pointer to a vector of dimension n with the gradient of the objective function.
[in]gnormthe norm of the gradient.

◆ optimize()

void GEO::VSDM::optimize ( index_t  nb_iter)

Optimizes the fitting.

Parameters
[in]nb_itermaximum number of iterations.

◆ set_affinity()

void GEO::VSDM::set_affinity ( double  x)
inline

Sets the affinity.

Parameters
[in]xthe affinity, the higher the smoother. Default value is 1.0.

Definition at line 85 of file VSDM.h.

◆ set_progress()

void GEO::VSDM::set_progress ( ProgressTask progress)
inline

Sets an optional progress bar to track progress during calls of optimize()

Parameters
[in]progressa pointer to a ProgressTask.

Definition at line 100 of file VSDM.h.

◆ set_subdivision_surface()

void GEO::VSDM::set_subdivision_surface ( Mesh mesh,
index_t  nb_subdiv 
)

Sets a subdivision surface.

If this function is called, then the S mesh passed to the constructor is considered as the control mesh of a subdivision surface.

Parameters
[in]mesha pointer to the mesh that will store the subdivision surface.
[in]nb_subdivthe number of Catmull-Clark subdivisions.

The documentation for this class was generated from the following file: