Geogram Version 1.9.6-rc
A programming library of geometric algorithms
Loading...
Searching...
No Matches
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.
 
virtual ~VSDM ()
 VSDM destructor.
 
void set_affinity (double x)
 Sets the affinity.
 
void optimize (index_t nb_iter)
 Optimizes the fitting.
 
void set_progress (ProgressTask *progress)
 Sets an optional progress bar to track progress during calls of optimize()
 
void set_subdivision_surface (Mesh *mesh, index_t nb_subdiv)
 Sets a subdivision surface.
 

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

Protected Member Functions

virtual void funcgrad (index_t n, double *x, double &f, double *g)
 Evaluates the objective function and its gradient.
 
virtual void newiteration ()
 Updates the progress bar (if specified) and graphics.
 
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.
 

Static Protected Member Functions

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

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.

Member Data Documentation

◆ affinity_

double GEO::VSDM::affinity_
protected

Definition at line 196 of file VSDM.h.

◆ affinity_scaling_

double GEO::VSDM::affinity_scaling_
protected

Definition at line 197 of file VSDM.h.

◆ cur_iter_

index_t GEO::VSDM::cur_iter_
protected

Definition at line 202 of file VSDM.h.

◆ delaunay_

Delaunay_var GEO::VSDM::delaunay_
protected

Definition at line 192 of file VSDM.h.

◆ instance_

VSDM* GEO::VSDM::instance_
staticprotected

Definition at line 199 of file VSDM.h.

◆ L_

NLSparseMatrix GEO::VSDM::L_
protected

Definition at line 204 of file VSDM.h.

◆ nb_iter_

index_t GEO::VSDM::nb_iter_
protected

Definition at line 201 of file VSDM.h.

◆ optimizer_

Optimizer_var GEO::VSDM::optimizer_
protected

Definition at line 200 of file VSDM.h.

◆ progress_

ProgressTask* GEO::VSDM::progress_
protected

Definition at line 198 of file VSDM.h.

◆ RVD_

RestrictedVoronoiDiagram_var GEO::VSDM::RVD_
protected

Definition at line 193 of file VSDM.h.

◆ S_

Mesh* GEO::VSDM::S_
protected

Definition at line 194 of file VSDM.h.

◆ subd_

Mesh* GEO::VSDM::subd_
protected

Definition at line 209 of file VSDM.h.

◆ subd_g_

vector<double> GEO::VSDM::subd_g_
protected

Definition at line 210 of file VSDM.h.

◆ subd_matrix_

NLMatrix GEO::VSDM::subd_matrix_
protected

Definition at line 208 of file VSDM.h.

◆ T_

Mesh* GEO::VSDM::T_
protected

Definition at line 195 of file VSDM.h.

◆ temp_V1_

vector<double> GEO::VSDM::temp_V1_
protected

Definition at line 205 of file VSDM.h.

◆ temp_V2_

vector<double> GEO::VSDM::temp_V2_
protected

Definition at line 206 of file VSDM.h.


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