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. | |
VertBitSet * | region = 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. | |
Parameters structure for MR::decimatePolyline.
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.
int MR::DecimatePolylineSettings< V >::maxDeletedVertices = INT_MAX |
Limit on the number of deleted vertices.
float MR::DecimatePolylineSettings< V >::maxEdgeLen = FLT_MAX |
Maximal possible edge length created during decimation.
float MR::DecimatePolylineSettings< V >::maxError = 0.001f |
Limit from above on the maximum distance from moved vertices to original contour.
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
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
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
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.
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
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.