Graphite
Version 3
An experimental 3D geometry processing program
|
Tests whether texture coordinates attached to a surface mesh define a valid parameterization. More...
#include <geogram/parameterization/mesh_param_validator.h>
Public Member Functions | |
ParamValidator () | |
ParamValidator constructor. | |
~ParamValidator () | |
ParamValidator destructor. | |
ParamValidator (const ParamValidator &rhs)=delete | |
Forbids copy. | |
ParamValidator & | operator= (const ParamValidator &rhs)=delete |
Forbids copy. | |
bool | chart_is_valid (Mesh &chart) |
Tests whether a Mesh and associated texture coordinates defines a valid parameterization. More... | |
double | chart_scaling (Mesh &chart) |
Computes the scaling induced by the parameterization. More... | |
void | compute_fill_and_overlap_ratio (Mesh &chart) |
Computes the filling and overlapping ratio of a parameterized chart. More... | |
double | fill_ratio () const |
Gets the computed filling ratio. More... | |
double | overlap_ratio () const |
Gets the computed overlap ratio. More... | |
double | get_max_overlap_ratio () const |
Gets the maximum overlapping ratio. More... | |
void | set_max_overlap_ratio (double x) |
Sets the maximum overlapping ratio. More... | |
double | get_max_scaling () const |
Gets the maximum scaling. More... | |
void | set_max_scaling (double x) |
Sets the maximum scaling. More... | |
double | get_min_fill_ratio () const |
Gets the minimum filling ratio. More... | |
void | set_min_fill_ratio (double x) |
Sets the minimum filling ratio. More... | |
void | set_verbose (bool x) |
Enables or disables messages. More... | |
Protected Member Functions | |
void | begin_rasterizer (Mesh &mesh, Attribute< double > &tex_coord) |
Initializes the software rasterizer for a chart. More... | |
void | end_rasterizer () |
Terminates the software rasterizer. More... | |
void | rasterize_triangle (const vec2 &p1, const vec2 &p2, const vec2 &p3) |
Rasterizes a triangle. More... | |
void | transform (const vec2 &p, int &x, int &y) |
Transforms a 2d point from parameter space to raterizer coordinates. More... | |
Tests whether texture coordinates attached to a surface mesh define a valid parameterization.
Definition at line 61 of file mesh_param_validator.h.
|
protected |
Initializes the software rasterizer for a chart.
[in] | mesh | a reference to the chart. |
[in] | tex_coord | a vector attribute of dimension 2 attached to the facet corners of the chart with the texture coordinates. |
bool GEO::ParamValidator::chart_is_valid | ( | Mesh & | chart | ) |
Tests whether a Mesh and associated texture coordinates defines a valid parameterization.
[in] | chart | a reference to the Mesh |
The mesh this chart belongs to is supposed to have a 2d vector attribute "tex_coord" attached to the vertices of the mesh with the texture coordinates.
true | if texture coordinates define a valid parameterization. |
false | otherwise. |
double GEO::ParamValidator::chart_scaling | ( | Mesh & | chart | ) |
Computes the scaling induced by the parameterization.
[in] | chart | a reference to the chart |
void GEO::ParamValidator::compute_fill_and_overlap_ratio | ( | Mesh & | chart | ) |
Computes the filling and overlapping ratio of a parameterized chart.
The filling and overlapping ratio are stored in this ParamValidator and can be subsequently queried with fill_ratio() and overlap_ratio() respectively.
|
protected |
Terminates the software rasterizer.
This counts the pixels to evaluate the filling and overlapping ratio.
|
inline |
Gets the computed filling ratio.
chart_is_valid() or compute_fill_and_overlap_ration() need to be called before.
Definition at line 119 of file mesh_param_validator.h.
|
inline |
Gets the maximum overlapping ratio.
If the overlapping ratio is greater than this threshold then chart_is_valid() returns false.
Definition at line 143 of file mesh_param_validator.h.
|
inline |
Gets the maximum scaling.
If the scaling is greater than this threshold then chart_is_valid() returns false.
Definition at line 168 of file mesh_param_validator.h.
|
inline |
Gets the minimum filling ratio.
If the filling ratio is greater than this threshold then chart_is_valid() returns false.
Definition at line 191 of file mesh_param_validator.h.
|
inline |
Gets the computed overlap ratio.
chart_is_valid() or compute_fill_and_overlap_ration() need to be called before.
Definition at line 131 of file mesh_param_validator.h.
|
protected |
Rasterizes a triangle.
This updates pixel counts for evaluating the filling and overlapping ratio.
[in] | p1,p2,p3 | the 2d coordinates of the vertices of the triangle. |
|
inline |
Sets the maximum overlapping ratio.
[in] | x | the maximum ratio between the area that correspond to overlapping triangles in parameter space and the total area of the bounding rectangle. |
If the overlapping ratio is greater than this threshold then chart_is_valid() returns false.
Definition at line 155 of file mesh_param_validator.h.
|
inline |
Sets the maximum scaling.
If the scaling is greater than this threshold then chart_is_valid() returns false.
[in] | x | the maximum scaling between the area of a facet in parameter space and the area of the facet in 3D, relative to the mimium scaling evaluated on all the facets of the mesh. |
Definition at line 180 of file mesh_param_validator.h.
|
inline |
Sets the minimum filling ratio.
If the filling ratio is greater than this threshold then chart_is_valid() returns false.
[in] | x | the minimum ratio between the area taken by the facets in parameter space and the total area of the bounding rectangle. |
Definition at line 204 of file mesh_param_validator.h.
|
inline |
Enables or disables messages.
[in] | x | if true, messages are displayed on the console with charts statistics. Default is non-verbose. |
Definition at line 213 of file mesh_param_validator.h.
|
protected |
Transforms a 2d point from parameter space to raterizer coordinates.
[in] | p | the parameter-space 2d coordinates of the point. |
[out] | x,y | the integer rasterizer-space coordinates. |