VTK  9.6.1
vtkDecimatePro.h File Reference
#include "vtkFiltersCoreModule.h"
#include "vtkPolyDataAlgorithm.h"
#include "vtkWrappingHints.h"
#include "vtkCell.h"
Include dependency graph for vtkDecimatePro.h:

Go to the source code of this file.

Classes

class  LocalVertex
class  LocalTri
class  VertexArray
class  TriArray

Typedefs

typedef LocalVertexLocalVertexPtr
typedef LocalTriLocalTriPtr

Functions

static vtkDecimateProNew ()
vtkIdType GetNumberOfInflectionPoints ()
 Get the number of inflection points.
void GetInflectionPoints (double *inflectionPoints)
 Get a list of inflection points.
double * GetInflectionPoints ()
 Get a list of inflection points.
 vtkDecimatePro ()
 ~vtkDecimatePro () override
int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void SplitMesh ()
int EvaluateVertex (vtkIdType ptId, vtkIdType numTris, vtkIdType *tris, vtkIdType fedges[2])
vtkIdType FindSplit (int type, vtkIdType fedges[2], vtkIdType &pt1, vtkIdType &pt2, vtkIdList *CollapseTris)
int IsValidSplit (int index)
void SplitLoop (vtkIdType fedges[2], vtkIdType &n1, vtkIdType *l1, vtkIdType &n2, vtkIdType *l2)
void SplitVertex (vtkIdType ptId, int type, vtkIdType numTris, vtkIdType *tris, int insert)
int CollapseEdge (int type, vtkIdType ptId, vtkIdType collapseId, vtkIdType pt1, vtkIdType pt2, vtkIdList *CollapseTris)
void DistributeError (double error)
virtual void SetTargetReduction (double)
 Specify the desired reduction in the total number of polygons (e.g., if TargetReduction is set to 0.9, this filter will try to reduce the data set to 10% of its original size).
virtual double GetTargetReduction ()
 Specify the desired reduction in the total number of polygons (e.g., if TargetReduction is set to 0.9, this filter will try to reduce the data set to 10% of its original size).
virtual void SetPreserveTopology (vtkTypeBool)
 Turn on/off whether to preserve the topology of the original mesh.
virtual vtkTypeBool GetPreserveTopology ()
 Turn on/off whether to preserve the topology of the original mesh.
virtual void PreserveTopologyOn ()
 Turn on/off whether to preserve the topology of the original mesh.
virtual void PreserveTopologyOff ()
 Turn on/off whether to preserve the topology of the original mesh.
virtual void SetFeatureAngle (double)
 Specify the mesh feature angle.
virtual double GetFeatureAngle ()
 Specify the mesh feature angle.
virtual void SetSplitting (vtkTypeBool)
 Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required.
virtual vtkTypeBool GetSplitting ()
 Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required.
virtual void SplittingOn ()
 Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required.
virtual void SplittingOff ()
 Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required.
virtual void SetSplitAngle (double)
 Specify the mesh split angle.
virtual double GetSplitAngle ()
 Specify the mesh split angle.
virtual void SetPreSplitMesh (vtkTypeBool)
 In some cases you may wish to split the mesh prior to algorithm execution.
virtual vtkTypeBool GetPreSplitMesh ()
 In some cases you may wish to split the mesh prior to algorithm execution.
virtual void PreSplitMeshOn ()
 In some cases you may wish to split the mesh prior to algorithm execution.
virtual void PreSplitMeshOff ()
 In some cases you may wish to split the mesh prior to algorithm execution.
virtual void SetMaximumError (double)
 Set the largest decimation error that is allowed during the decimation process.
virtual double GetMaximumError ()
 Set the largest decimation error that is allowed during the decimation process.
virtual void SetAccumulateError (vtkTypeBool)
 The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified.
virtual vtkTypeBool GetAccumulateError ()
 The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified.
virtual void AccumulateErrorOn ()
 The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified.
virtual void AccumulateErrorOff ()
 The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified.
virtual void SetErrorIsAbsolute (int)
 The MaximumError is normally defined as a fraction of the dataset bounding diagonal.
virtual int GetErrorIsAbsolute ()
 The MaximumError is normally defined as a fraction of the dataset bounding diagonal.
virtual void SetAbsoluteError (double)
 Same as MaximumError, but to be used when ErrorIsAbsolute is 1.
virtual double GetAbsoluteError ()
 Same as MaximumError, but to be used when ErrorIsAbsolute is 1.
virtual void SetBoundaryVertexDeletion (vtkTypeBool)
 Turn on/off the deletion of vertices on the boundary of a mesh.
virtual vtkTypeBool GetBoundaryVertexDeletion ()
 Turn on/off the deletion of vertices on the boundary of a mesh.
virtual void BoundaryVertexDeletionOn ()
 Turn on/off the deletion of vertices on the boundary of a mesh.
virtual void BoundaryVertexDeletionOff ()
 Turn on/off the deletion of vertices on the boundary of a mesh.
virtual void SetDegree (int)
 If the number of triangles connected to a vertex exceeds "Degree", then the vertex will be split.
virtual int GetDegree ()
 If the number of triangles connected to a vertex exceeds "Degree", then the vertex will be split.
virtual void SetInflectionPointRatio (double)
 Specify the inflection point ratio.
virtual double GetInflectionPointRatio ()
 Specify the inflection point ratio.
virtual void SetOutputPointsPrecision (int)
 Set/get the desired precision for the output types.
virtual int GetOutputPointsPrecision ()
 Set/get the desired precision for the output types.

Variables

double TargetReduction
double FeatureAngle
double MaximumError
double AbsoluteError
int ErrorIsAbsolute
vtkTypeBool AccumulateError
double SplitAngle
vtkTypeBool Splitting
vtkTypeBool PreSplitMesh
vtkTypeBool BoundaryVertexDeletion
vtkTypeBool PreserveTopology
int Degree
double InflectionPointRatio
vtkDoubleArrayInflectionPoints
int OutputPointsPrecision
vtkIdListNeighbors
vtkPriorityQueueEdgeLengths

Typedef Documentation

◆ LocalVertexPtr

typedef LocalVertex* LocalVertexPtr
protected

Definition at line 329 of file vtkDecimatePro.h.

◆ LocalTriPtr

typedef LocalTri* LocalTriPtr
protected

Definition at line 339 of file vtkDecimatePro.h.

Function Documentation

◆ New()

vtkDecimatePro * New ( )
static

◆ SetTargetReduction()

virtual void SetTargetReduction ( double )
virtual

Specify the desired reduction in the total number of polygons (e.g., if TargetReduction is set to 0.9, this filter will try to reduce the data set to 10% of its original size).

Because of various constraints, this level of reduction may not be realized. If you want to guarantee a particular reduction, you must turn off PreserveTopology, turn on SplitEdges and BoundaryVertexDeletion, and set the MaximumError to VTK_DOUBLE_MAX (these ivars are initialized this way when the object is instantiated).

◆ GetTargetReduction()

virtual double GetTargetReduction ( )
virtual

Specify the desired reduction in the total number of polygons (e.g., if TargetReduction is set to 0.9, this filter will try to reduce the data set to 10% of its original size).

Because of various constraints, this level of reduction may not be realized. If you want to guarantee a particular reduction, you must turn off PreserveTopology, turn on SplitEdges and BoundaryVertexDeletion, and set the MaximumError to VTK_DOUBLE_MAX (these ivars are initialized this way when the object is instantiated).

◆ SetPreserveTopology()

virtual void SetPreserveTopology ( vtkTypeBool )
virtual

Turn on/off whether to preserve the topology of the original mesh.

If on, mesh splitting and hole elimination will not occur. This may limit the maximum reduction that may be achieved.

◆ GetPreserveTopology()

virtual vtkTypeBool GetPreserveTopology ( )
virtual

Turn on/off whether to preserve the topology of the original mesh.

If on, mesh splitting and hole elimination will not occur. This may limit the maximum reduction that may be achieved.

◆ PreserveTopologyOn()

virtual void PreserveTopologyOn ( )
virtual

Turn on/off whether to preserve the topology of the original mesh.

If on, mesh splitting and hole elimination will not occur. This may limit the maximum reduction that may be achieved.

◆ PreserveTopologyOff()

virtual void PreserveTopologyOff ( )
virtual

Turn on/off whether to preserve the topology of the original mesh.

If on, mesh splitting and hole elimination will not occur. This may limit the maximum reduction that may be achieved.

◆ SetFeatureAngle()

virtual void SetFeatureAngle ( double )
virtual

Specify the mesh feature angle.

This angle is used to define what an edge is (i.e., if the surface normal between two adjacent triangles is >= FeatureAngle, an edge exists).

◆ GetFeatureAngle()

virtual double GetFeatureAngle ( )
virtual

Specify the mesh feature angle.

This angle is used to define what an edge is (i.e., if the surface normal between two adjacent triangles is >= FeatureAngle, an edge exists).

◆ SetSplitting()

virtual void SetSplitting ( vtkTypeBool )
virtual

Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required.

Turning splitting off will better preserve the original topology of the mesh, but you may not obtain the requested reduction.

◆ GetSplitting()

virtual vtkTypeBool GetSplitting ( )
virtual

Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required.

Turning splitting off will better preserve the original topology of the mesh, but you may not obtain the requested reduction.

◆ SplittingOn()

virtual void SplittingOn ( )
virtual

Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required.

Turning splitting off will better preserve the original topology of the mesh, but you may not obtain the requested reduction.

◆ SplittingOff()

virtual void SplittingOff ( )
virtual

Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required.

Turning splitting off will better preserve the original topology of the mesh, but you may not obtain the requested reduction.

◆ SetSplitAngle()

virtual void SetSplitAngle ( double )
virtual

Specify the mesh split angle.

This angle is used to control the splitting of the mesh. A split line exists when the surface normals between two edge connected triangles are >= SplitAngle.

◆ GetSplitAngle()

virtual double GetSplitAngle ( )
virtual

Specify the mesh split angle.

This angle is used to control the splitting of the mesh. A split line exists when the surface normals between two edge connected triangles are >= SplitAngle.

◆ SetPreSplitMesh()

virtual void SetPreSplitMesh ( vtkTypeBool )
virtual

In some cases you may wish to split the mesh prior to algorithm execution.

This separates the mesh into semi-planar patches, which are disconnected from each other. This can give superior results in some cases. If the ivar PreSplitMesh ivar is enabled, the mesh is split with the specified SplitAngle. Otherwise mesh splitting is deferred as long as possible.

◆ GetPreSplitMesh()

virtual vtkTypeBool GetPreSplitMesh ( )
virtual

In some cases you may wish to split the mesh prior to algorithm execution.

This separates the mesh into semi-planar patches, which are disconnected from each other. This can give superior results in some cases. If the ivar PreSplitMesh ivar is enabled, the mesh is split with the specified SplitAngle. Otherwise mesh splitting is deferred as long as possible.

◆ PreSplitMeshOn()

virtual void PreSplitMeshOn ( )
virtual

In some cases you may wish to split the mesh prior to algorithm execution.

This separates the mesh into semi-planar patches, which are disconnected from each other. This can give superior results in some cases. If the ivar PreSplitMesh ivar is enabled, the mesh is split with the specified SplitAngle. Otherwise mesh splitting is deferred as long as possible.

◆ PreSplitMeshOff()

virtual void PreSplitMeshOff ( )
virtual

In some cases you may wish to split the mesh prior to algorithm execution.

This separates the mesh into semi-planar patches, which are disconnected from each other. This can give superior results in some cases. If the ivar PreSplitMesh ivar is enabled, the mesh is split with the specified SplitAngle. Otherwise mesh splitting is deferred as long as possible.

◆ SetMaximumError()

virtual void SetMaximumError ( double )
virtual

Set the largest decimation error that is allowed during the decimation process.

This may limit the maximum reduction that may be achieved. The maximum error is specified as a fraction of the maximum length of the input data bounding box.

◆ GetMaximumError()

virtual double GetMaximumError ( )
virtual

Set the largest decimation error that is allowed during the decimation process.

This may limit the maximum reduction that may be achieved. The maximum error is specified as a fraction of the maximum length of the input data bounding box.

◆ SetAccumulateError()

virtual void SetAccumulateError ( vtkTypeBool )
virtual

The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified.

If the error is accumulated, then it represents a global error bounds, and the ivar MaximumError becomes a global bounds on mesh error. Accumulating the error requires extra memory proportional to the number of vertices in the mesh. If AccumulateError is off, then the error is not accumulated.

◆ GetAccumulateError()

virtual vtkTypeBool GetAccumulateError ( )
virtual

The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified.

If the error is accumulated, then it represents a global error bounds, and the ivar MaximumError becomes a global bounds on mesh error. Accumulating the error requires extra memory proportional to the number of vertices in the mesh. If AccumulateError is off, then the error is not accumulated.

◆ AccumulateErrorOn()

virtual void AccumulateErrorOn ( )
virtual

The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified.

If the error is accumulated, then it represents a global error bounds, and the ivar MaximumError becomes a global bounds on mesh error. Accumulating the error requires extra memory proportional to the number of vertices in the mesh. If AccumulateError is off, then the error is not accumulated.

◆ AccumulateErrorOff()

virtual void AccumulateErrorOff ( )
virtual

The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified.

If the error is accumulated, then it represents a global error bounds, and the ivar MaximumError becomes a global bounds on mesh error. Accumulating the error requires extra memory proportional to the number of vertices in the mesh. If AccumulateError is off, then the error is not accumulated.

◆ SetErrorIsAbsolute()

virtual void SetErrorIsAbsolute ( int )
virtual

The MaximumError is normally defined as a fraction of the dataset bounding diagonal.

By setting ErrorIsAbsolute to 1, the error is instead defined as that specified by AbsoluteError. By default ErrorIsAbsolute=0.

◆ GetErrorIsAbsolute()

virtual int GetErrorIsAbsolute ( )
virtual

The MaximumError is normally defined as a fraction of the dataset bounding diagonal.

By setting ErrorIsAbsolute to 1, the error is instead defined as that specified by AbsoluteError. By default ErrorIsAbsolute=0.

◆ SetAbsoluteError()

virtual void SetAbsoluteError ( double )
virtual

Same as MaximumError, but to be used when ErrorIsAbsolute is 1.

◆ GetAbsoluteError()

virtual double GetAbsoluteError ( )
virtual

Same as MaximumError, but to be used when ErrorIsAbsolute is 1.

◆ SetBoundaryVertexDeletion()

virtual void SetBoundaryVertexDeletion ( vtkTypeBool )
virtual

Turn on/off the deletion of vertices on the boundary of a mesh.

This may limit the maximum reduction that may be achieved.

◆ GetBoundaryVertexDeletion()

virtual vtkTypeBool GetBoundaryVertexDeletion ( )
virtual

Turn on/off the deletion of vertices on the boundary of a mesh.

This may limit the maximum reduction that may be achieved.

◆ BoundaryVertexDeletionOn()

virtual void BoundaryVertexDeletionOn ( )
virtual

Turn on/off the deletion of vertices on the boundary of a mesh.

This may limit the maximum reduction that may be achieved.

◆ BoundaryVertexDeletionOff()

virtual void BoundaryVertexDeletionOff ( )
virtual

Turn on/off the deletion of vertices on the boundary of a mesh.

This may limit the maximum reduction that may be achieved.

◆ SetDegree()

virtual void SetDegree ( int )
virtual

If the number of triangles connected to a vertex exceeds "Degree", then the vertex will be split.

(NOTE: the complexity of the triangulation algorithm is proportional to Degree^2. Setting degree small can improve the performance of the algorithm.)

◆ GetDegree()

virtual int GetDegree ( )
virtual

If the number of triangles connected to a vertex exceeds "Degree", then the vertex will be split.

(NOTE: the complexity of the triangulation algorithm is proportional to Degree^2. Setting degree small can improve the performance of the algorithm.)

◆ SetInflectionPointRatio()

virtual void SetInflectionPointRatio ( double )
virtual

Specify the inflection point ratio.

An inflection point occurs when the ratio of reduction error between two iterations is greater than or equal to the InflectionPointRatio.

◆ GetInflectionPointRatio()

virtual double GetInflectionPointRatio ( )
virtual

Specify the inflection point ratio.

An inflection point occurs when the ratio of reduction error between two iterations is greater than or equal to the InflectionPointRatio.

◆ GetNumberOfInflectionPoints()

vtkIdType GetNumberOfInflectionPoints ( )

Get the number of inflection points.

Only returns a valid value after the filter has executed. The values in the list are mesh reduction values at each inflection point. Note: the first inflection point always occurs right before non-planar triangles are decimated (i.e., as the error becomes non-zero).

◆ GetInflectionPoints() [1/2]

void GetInflectionPoints ( double * inflectionPoints)

Get a list of inflection points.

These are double values 0 < r <= 1.0 corresponding to reduction level, and there are a total of NumberOfInflectionPoints() values. You must provide an array (of the correct size) into which the inflection points are written.

◆ GetInflectionPoints() [2/2]

double * GetInflectionPoints ( )

Get a list of inflection points.

These are double values 0 < r <= 1.0 corresponding to reduction level, and there are a total of NumberOfInflectionPoints() values. You must provide an array (of the correct size) into which the inflection points are written. This method returns a pointer to a list of inflection points.

◆ SetOutputPointsPrecision()

virtual void SetOutputPointsPrecision ( int )
virtual

Set/get the desired precision for the output types.

See the documentation for the vtkAlgorithm::DesiredOutputPrecision enum for an explanation of the available precision settings.

◆ GetOutputPointsPrecision()

virtual int GetOutputPointsPrecision ( )
virtual

Set/get the desired precision for the output types.

See the documentation for the vtkAlgorithm::DesiredOutputPrecision enum for an explanation of the available precision settings.

◆ vtkDecimatePro()

vtkDecimatePro ( )
protected

◆ ~vtkDecimatePro()

~vtkDecimatePro ( )
overrideprotected

◆ RequestData()

int RequestData ( vtkInformation * ,
vtkInformationVector ** ,
vtkInformationVector *  )
overrideprotected

◆ SplitMesh()

void SplitMesh ( )
protected

◆ EvaluateVertex()

int EvaluateVertex ( vtkIdType ptId,
vtkIdType numTris,
vtkIdType * tris,
vtkIdType fedges[2] )
protected

◆ FindSplit()

vtkIdType FindSplit ( int type,
vtkIdType fedges[2],
vtkIdType & pt1,
vtkIdType & pt2,
vtkIdList * CollapseTris )
protected

◆ IsValidSplit()

int IsValidSplit ( int index)
protected

◆ SplitLoop()

void SplitLoop ( vtkIdType fedges[2],
vtkIdType & n1,
vtkIdType * l1,
vtkIdType & n2,
vtkIdType * l2 )
protected

◆ SplitVertex()

void SplitVertex ( vtkIdType ptId,
int type,
vtkIdType numTris,
vtkIdType * tris,
int insert )
protected

◆ CollapseEdge()

int CollapseEdge ( int type,
vtkIdType ptId,
vtkIdType collapseId,
vtkIdType pt1,
vtkIdType pt2,
vtkIdList * CollapseTris )
protected

◆ DistributeError()

void DistributeError ( double error)
protected

Variable Documentation

◆ TargetReduction

double TargetReduction
protected

Definition at line 287 of file vtkDecimatePro.h.

◆ FeatureAngle

double FeatureAngle
protected

Definition at line 288 of file vtkDecimatePro.h.

◆ MaximumError

double MaximumError
protected

Definition at line 289 of file vtkDecimatePro.h.

◆ AbsoluteError

double AbsoluteError
protected

Definition at line 290 of file vtkDecimatePro.h.

◆ ErrorIsAbsolute

int ErrorIsAbsolute
protected

Definition at line 291 of file vtkDecimatePro.h.

◆ AccumulateError

vtkTypeBool AccumulateError
protected

Definition at line 292 of file vtkDecimatePro.h.

◆ SplitAngle

double SplitAngle
protected

Definition at line 293 of file vtkDecimatePro.h.

◆ Splitting

vtkTypeBool Splitting
protected

Definition at line 294 of file vtkDecimatePro.h.

◆ PreSplitMesh

vtkTypeBool PreSplitMesh
protected

Definition at line 295 of file vtkDecimatePro.h.

◆ BoundaryVertexDeletion

vtkTypeBool BoundaryVertexDeletion
protected

Definition at line 296 of file vtkDecimatePro.h.

◆ PreserveTopology

vtkTypeBool PreserveTopology
protected

Definition at line 297 of file vtkDecimatePro.h.

◆ Degree

int Degree
protected

Definition at line 298 of file vtkDecimatePro.h.

◆ InflectionPointRatio

double InflectionPointRatio
protected

Definition at line 299 of file vtkDecimatePro.h.

◆ InflectionPoints

vtkDoubleArray* InflectionPoints
protected

Definition at line 300 of file vtkDecimatePro.h.

◆ OutputPointsPrecision

int OutputPointsPrecision
protected

Definition at line 301 of file vtkDecimatePro.h.

◆ Neighbors

vtkIdList* Neighbors
protected

Definition at line 304 of file vtkDecimatePro.h.

◆ EdgeLengths

vtkPriorityQueue* EdgeLengths
protected

Definition at line 305 of file vtkDecimatePro.h.