MeshLib
 
Loading...
Searching...
No Matches
MR::DecimatePolylineSettings< V > Struct Template Reference

Parameters structure for MR::decimatePolyline. More...

#include <MRPolylineDecimate.h>

Public Attributes

float maxError = 0.001f
 Limit from above on the maximum distance from moved vertices to original contour.
 
float maxEdgeLen = FLT_MAX
 Maximal possible edge length created during decimation.
 
float stabilizer = 0.001f
 
bool optimizeVertexPos = true
 
int maxDeletedVertices = INT_MAX
 Limit on the number of deleted vertices.
 
VertBitSetregion = nullptr
 
bool touchBdVertices = true
 
std::function< bool(EdgeId edgeToCollapse, const V &newEdgeOrgPos)> preCollapse
 The user can provide this optional callback that is invoked immediately before edge collapse;.
 
std::function< void(UndirectedEdgeId ue, float &collapseErrorSq, V &collapsePos)> adjustCollapse
 The user can provide this optional callback for adjusting error introduced by this edge collapse and the collapse position.
 
Vector< QuadraticForm< V >, VertId > * vertForms = nullptr
 If not null, then on input: if the vector is not empty then it is taken for initialization instead of form computation for all vertices; on output: quadratic form for each remaining vertex is returned there.
 

Detailed Description

template<typename V>
struct MR::DecimatePolylineSettings< V >

Parameters structure for MR::decimatePolyline.

See also
decimatePolyline

Member Data Documentation

◆ adjustCollapse

template<typename V >
std::function<void( UndirectedEdgeId ue, float & collapseErrorSq, V & collapsePos )> MR::DecimatePolylineSettings< V >::adjustCollapse

The user can provide this optional callback for adjusting error introduced by this edge collapse and the collapse position.

On input the callback gets the squared error and position computed by standard means, and callback can modify any of them. The larger the error, the later this edge will be collapsed. This callback can be called from many threads in parallel and must be thread-safe. This callback can be called many times for each edge before real collapsing, and it is important to make the same adjustment.

◆ maxDeletedVertices

template<typename V >
int MR::DecimatePolylineSettings< V >::maxDeletedVertices = INT_MAX

Limit on the number of deleted vertices.

◆ maxEdgeLen

template<typename V >
float MR::DecimatePolylineSettings< V >::maxEdgeLen = FLT_MAX

Maximal possible edge length created during decimation.

◆ maxError

template<typename V >
float MR::DecimatePolylineSettings< V >::maxError = 0.001f

Limit from above on the maximum distance from moved vertices to original contour.

◆ optimizeVertexPos

template<typename V >
bool MR::DecimatePolylineSettings< V >::optimizeVertexPos = true

if true then after each edge collapse the position of remaining vertex is optimized to minimize local shape change, if false then the edge is collapsed in one of its vertices, which keeps its position

◆ preCollapse

template<typename V >
std::function<bool( EdgeId edgeToCollapse, const V & newEdgeOrgPos )> MR::DecimatePolylineSettings< V >::preCollapse

The user can provide this optional callback that is invoked immediately before edge collapse;.

It receives the edge being collapsed: its destination vertex will disappear, and its origin vertex will get new position (provided as the second argument) after collapse; If the callback returns false, then the collapse is prohibited

◆ region

template<typename V >
VertBitSet* MR::DecimatePolylineSettings< V >::region = nullptr

Region of the polyline to be decimated, it is updated during the operation Remain nullptr to include the whole polyline

◆ stabilizer

template<typename V >
float MR::DecimatePolylineSettings< V >::stabilizer = 0.001f

Stabilizer is dimensionless coefficient. The larger is stabilizer, the more Decimator will strive to retain the density of input points. If stabilizer is zero, then only the shape of input line will be preserved.

◆ touchBdVertices

template<typename V >
bool MR::DecimatePolylineSettings< V >::touchBdVertices = true

Whether to allow collapsing edges with at least one vertex on the end of not-closed polyline (or on region boundary if region is given); if touchBdVertices is false then boundary vertices are strictly fixed

◆ vertForms

template<typename V >
Vector<QuadraticForm<V>, VertId>* MR::DecimatePolylineSettings< V >::vertForms = nullptr

If not null, then on input: if the vector is not empty then it is taken for initialization instead of form computation for all vertices; on output: quadratic form for each remaining vertex is returned there.


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