Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkDecimate Class Reference

#include <vtkDecimate.h>

Inheritance diagram for vtkDecimate:

Inheritance graph
[legend]
Collaboration diagram for vtkDecimate:

Collaboration graph
[legend]
List of all members.

Detailed Description

reduce the number of triangles in a mesh

vtkDecimate is a filter to reduce the number of triangles in a triangle mesh, while preserving the original topology and a forming good approximation to the original geometry. The input to vtkDecimate is a vtkPolyData object, and only triangles are treated. If you desire to decimate polygonal meshes, first triangulate the polygons with the vtkTriangleFilter object.

The algorithm proceeds as follows. Each vertex in the triangle list is evaluated for local planarity (i.e., the triangles using the vertex are gathered and compared to an "average" plane). If the region is locally planar, that is if the target vertex is within a certain distance of the average plane (i.e., the error), and there are no edges radiating from the vertex that have a dihedral angle greater than a user-specified edge angle (i.e., feature angle), and topology is not altered, then that vertex is deleted. The resulting hole is then patched by re-triangulation. The process continues over the entire vertex list (this constitutes an iteration). Iterations proceed until a target reduction is reached or a maximum iteration count is exceeded.

There are a number of additional parameters you can set to control the decimation algorithm. The Error ivar may be increased over each iteration with the ErrorIncrement. (These two variables have the largest effect.) Edge preservation (i.e., PreserveEdges ivar) may be disabled or enabled. You can turn on/off edge vertex deletion (i.e., BoundaryVertexDeletion ivar). (Edge vertices are vertices that lie along boundaries of meshes.) Sub iterations are iterations that are performed without changing the decimation criterion. The AspectRatio ivar controls the shape of the triangles that are created, and is the ratio of maximum edge length to minimum edge length. The Degree is the number of triangles using a single vertex. Vertices of high degree are considered "complex" and are never deleted.

Warning:
This implementation has been adapted for a global error bound decimation criterion. That is, the error is a global bound on distance to original surface. This is an improvement over the original Siggraph paper ("Decimation of Triangle Meshes", Proc Siggraph `92.)

The algorithm has been extended with a special flag to allow topology modification. When the PreserveTopology flag is on, then the algorithm will preserve the topology of the original mesh. If off, the algorithm may close holes and/or collapse tunnels (i.e., form non-manifold attachments).

See also:
vtkDecimatePro vtkQuadricClustering vtkQuadricDecimation
Created by:
  • Schroeder, Will
CVS contributions (if > 5%):
  • Schroeder, Will (63%)
  • Law, Charles (7%)
  • Lorensen, Bill (6%)
CVS logs (CVSweb):
  • .h (/Patented/vtkDecimate.h)
  • .cxx (/Patented/vtkDecimate.cxx)
Tests:
vtkDecimate (Tests)

Definition at line 110 of file vtkDecimate.h.

Public Types

typedef vtkPolyDataToPolyDataFilter Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void SetInitialError (double)
virtual double GetInitialError ()
virtual void SetErrorIncrement (double)
virtual double GetErrorIncrement ()
virtual void SetMaximumError (double)
virtual double GetMaximumError ()
virtual void SetTargetReduction (double)
virtual double GetTargetReduction ()
virtual void SetMaximumIterations (int)
virtual int GetMaximumIterations ()
virtual void SetMaximumSubIterations (int)
virtual int GetMaximumSubIterations ()
virtual void SetInitialFeatureAngle (double)
virtual double GetInitialFeatureAngle ()
virtual void SetFeatureAngleIncrement (double)
virtual double GetFeatureAngleIncrement ()
virtual void SetMaximumFeatureAngle (double)
virtual double GetMaximumFeatureAngle ()
virtual void SetGenerateErrorScalars (int)
virtual int GetGenerateErrorScalars ()
virtual void GenerateErrorScalarsOn ()
virtual void GenerateErrorScalarsOff ()
virtual void SetPreserveEdges (int)
virtual int GetPreserveEdges ()
virtual void PreserveEdgesOn ()
virtual void PreserveEdgesOff ()
virtual void SetBoundaryVertexDeletion (int)
virtual int GetBoundaryVertexDeletion ()
virtual void BoundaryVertexDeletionOn ()
virtual void BoundaryVertexDeletionOff ()
virtual void SetAspectRatio (double)
virtual double GetAspectRatio ()
virtual void SetPreserveTopology (int)
virtual int GetPreserveTopology ()
virtual void PreserveTopologyOn ()
virtual void PreserveTopologyOff ()
virtual void SetDegree (int)
virtual int GetDegree ()
virtual void SetMaximumNumberOfSquawks (int)
virtual int GetMaximumNumberOfSquawks ()

Static Public Member Functions

vtkDecimateNew ()
int IsTypeOf (const char *type)
vtkDecimateSafeDownCast (vtkObject *o)

Protected Types

typedef LocalVertexLocalVertexPtr
typedef LocalTriLocalTriPtr

Protected Member Functions

 vtkDecimate ()
 ~vtkDecimate ()
void Execute ()
void CreateOutput (vtkIdType numPts, vtkIdType numTris, vtkIdType numEliminated, vtkPointData *pd, vtkPoints *inPts)
int BuildLoop (vtkIdType ptId, unsigned short int nTris, vtkIdType *tris)
void EvaluateLoop (int &vtype, vtkIdType &numFEdges, LocalVertexPtr fedges[])
int CanSplitLoop (LocalVertexPtr fedges[2], vtkIdType numVerts, LocalVertexPtr verts[], vtkIdType &n1, LocalVertexPtr l1[], vtkIdType &n2, LocalVertexPtr l2[], double &ar)
void SplitLoop (LocalVertexPtr fedges[2], vtkIdType numVerts, LocalVertexPtr *verts, vtkIdType &n1, LocalVertexPtr *l1, vtkIdType &n2, LocalVertexPtr *l2)
void Triangulate (vtkIdType numVerts, LocalVertexPtr verts[])
int CheckError ()

Protected Attributes

double InitialFeatureAngle
double FeatureAngleIncrement
double MaximumFeatureAngle
int PreserveEdges
int BoundaryVertexDeletion
double InitialError
double ErrorIncrement
double MaximumError
double TargetReduction
int MaximumIterations
int MaximumSubIterations
double AspectRatio
int Degree
int Stats [VTK_NUMBER_STATISTICS]
int GenerateErrorScalars
int MaximumNumberOfSquawks
int PreserveTopology
vtkIdListNeighbors
VertexArrayV
TriArrayT


Member Typedef Documentation

typedef vtkPolyDataToPolyDataFilter vtkDecimate::Superclass
 

Reimplemented from vtkPolyDataToPolyDataFilter.

Definition at line 114 of file vtkDecimate.h.

typedef LocalVertex* vtkDecimate::LocalVertexPtr [protected]
 

Definition at line 248 of file vtkDecimate.h.

typedef LocalTri* vtkDecimate::LocalTriPtr [protected]
 

Definition at line 258 of file vtkDecimate.h.


Constructor & Destructor Documentation

vtkDecimate::vtkDecimate  )  [protected]
 

vtkDecimate::~vtkDecimate  )  [protected]
 


Member Function Documentation

vtkDecimate* vtkDecimate::New  )  [static]
 

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkAlgorithm.

virtual const char* vtkDecimate::GetClassName  )  [virtual]
 

Reimplemented from vtkPolyDataToPolyDataFilter.

int vtkDecimate::IsTypeOf const char *  type  )  [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkPolyDataToPolyDataFilter.

virtual int vtkDecimate::IsA const char *  type  )  [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkPolyDataToPolyDataFilter.

vtkDecimate* vtkDecimate::SafeDownCast vtkObject o  )  [static]
 

Reimplemented from vtkPolyDataToPolyDataFilter.

void vtkDecimate::PrintSelf ostream &  os,
vtkIndent  indent
[virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkPolyDataToPolyDataFilter.

virtual void vtkDecimate::SetInitialError double   )  [virtual]
 

Set the decimation error bounds. Expressed as a fraction of the longest side of the input data's bounding box.

virtual double vtkDecimate::GetInitialError  )  [virtual]
 

Set the decimation error bounds. Expressed as a fraction of the longest side of the input data's bounding box.

virtual void vtkDecimate::SetErrorIncrement double   )  [virtual]
 

Set the value of the increment by which to increase the decimation error after each iteration.

virtual double vtkDecimate::GetErrorIncrement  )  [virtual]
 

Set the value of the increment by which to increase the decimation error after each iteration.

virtual void vtkDecimate::SetMaximumError double   )  [virtual]
 

Set the largest decimation error that can be achieved by incrementing the error.

virtual double vtkDecimate::GetMaximumError  )  [virtual]
 

Set the largest decimation error that can be achieved by incrementing the error.

virtual void vtkDecimate::SetTargetReduction double   )  [virtual]
 

Specify the desired reduction in the total number of polygons. Because of various constraints, this level of reduction may not be realizable.

virtual double vtkDecimate::GetTargetReduction  )  [virtual]
 

Specify the desired reduction in the total number of polygons. Because of various constraints, this level of reduction may not be realizable.

virtual void vtkDecimate::SetMaximumIterations int   )  [virtual]
 

Specify the maximum number of iterations to attempt. If decimation target is reached first, this value will not be reached.

virtual int vtkDecimate::GetMaximumIterations  )  [virtual]
 

Specify the maximum number of iterations to attempt. If decimation target is reached first, this value will not be reached.

virtual void vtkDecimate::SetMaximumSubIterations int   )  [virtual]
 

Specify the maximum sub-iterations to perform. If no triangles are deleted in a sub-iteration, the sub-iteration process is stopped.

virtual int vtkDecimate::GetMaximumSubIterations  )  [virtual]
 

Specify the maximum sub-iterations to perform. If no triangles are deleted in a sub-iteration, the sub-iteration process is stopped.

virtual void vtkDecimate::SetInitialFeatureAngle double   )  [virtual]
 

Specify the mesh feature angles.

virtual double vtkDecimate::GetInitialFeatureAngle  )  [virtual]
 

Specify the mesh feature angles.

virtual void vtkDecimate::SetFeatureAngleIncrement double   )  [virtual]
 

Set/Get the angle by which to increase feature angle over each iteration.

virtual double vtkDecimate::GetFeatureAngleIncrement  )  [virtual]
 

Set/Get the angle by which to increase feature angle over each iteration.

virtual void vtkDecimate::SetMaximumFeatureAngle double   )  [virtual]
 

Set the largest permissible feature angle.

virtual double vtkDecimate::GetMaximumFeatureAngle  )  [virtual]
 

Set the largest permissible feature angle.

virtual void vtkDecimate::SetGenerateErrorScalars int   )  [virtual]
 

Turn on/off the generation of error scalars.

virtual int vtkDecimate::GetGenerateErrorScalars  )  [virtual]
 

Turn on/off the generation of error scalars.

virtual void vtkDecimate::GenerateErrorScalarsOn  )  [virtual]
 

Turn on/off the generation of error scalars.

virtual void vtkDecimate::GenerateErrorScalarsOff  )  [virtual]
 

Turn on/off the generation of error scalars.

virtual void vtkDecimate::SetPreserveEdges int   )  [virtual]
 

Turn on/off the preservation of feature edges.

virtual int vtkDecimate::GetPreserveEdges  )  [virtual]
 

Turn on/off the preservation of feature edges.

virtual void vtkDecimate::PreserveEdgesOn  )  [virtual]
 

Turn on/off the preservation of feature edges.

virtual void vtkDecimate::PreserveEdgesOff  )  [virtual]
 

Turn on/off the preservation of feature edges.

virtual void vtkDecimate::SetBoundaryVertexDeletion int   )  [virtual]
 

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

virtual int vtkDecimate::GetBoundaryVertexDeletion  )  [virtual]
 

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

virtual void vtkDecimate::BoundaryVertexDeletionOn  )  [virtual]
 

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

virtual void vtkDecimate::BoundaryVertexDeletionOff  )  [virtual]
 

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

virtual void vtkDecimate::SetAspectRatio double   )  [virtual]
 

Specify the maximum allowable aspect ratio during triangulation.

virtual double vtkDecimate::GetAspectRatio  )  [virtual]
 

Specify the maximum allowable aspect ratio during triangulation.

virtual void vtkDecimate::SetPreserveTopology int   )  [virtual]
 

Turn on/off whether to preserve the topology of the original mesh. If off, hole elimination and non-manifold attachment can occur.

virtual int vtkDecimate::GetPreserveTopology  )  [virtual]
 

Turn on/off whether to preserve the topology of the original mesh. If off, hole elimination and non-manifold attachment can occur.

virtual void vtkDecimate::PreserveTopologyOn  )  [virtual]
 

Turn on/off whether to preserve the topology of the original mesh. If off, hole elimination and non-manifold attachment can occur.

virtual void vtkDecimate::PreserveTopologyOff  )  [virtual]
 

Turn on/off whether to preserve the topology of the original mesh. If off, hole elimination and non-manifold attachment can occur.

virtual void vtkDecimate::SetDegree int   )  [virtual]
 

If the number of triangles connected to a vertex exceeds "Degree", then the vertex is considered complex and is never deleted. (NOTE: the complexity of the triangulation algorithm is proportional to Degree^2.)

virtual int vtkDecimate::GetDegree  )  [virtual]
 

If the number of triangles connected to a vertex exceeds "Degree", then the vertex is considered complex and is never deleted. (NOTE: the complexity of the triangulation algorithm is proportional to Degree^2.)

virtual void vtkDecimate::SetMaximumNumberOfSquawks int   )  [virtual]
 

Control the printout of warnings. This flag limits the number of warnings regarding non-manifold geometry and complex vertices. If set to zero, no warnings will appear.

virtual int vtkDecimate::GetMaximumNumberOfSquawks  )  [virtual]
 

Control the printout of warnings. This flag limits the number of warnings regarding non-manifold geometry and complex vertices. If set to zero, no warnings will appear.

void vtkDecimate::Execute  )  [protected, virtual]
 

This method is the old style execute method

Reimplemented from vtkSource.

void vtkDecimate::CreateOutput vtkIdType  numPts,
vtkIdType  numTris,
vtkIdType  numEliminated,
vtkPointData pd,
vtkPoints inPts
[protected]
 

int vtkDecimate::BuildLoop vtkIdType  ptId,
unsigned short int  nTris,
vtkIdType tris
[protected]
 

void vtkDecimate::EvaluateLoop int &  vtype,
vtkIdType numFEdges,
LocalVertexPtr  fedges[]
[protected]
 

int vtkDecimate::CanSplitLoop LocalVertexPtr  fedges[2],
vtkIdType  numVerts,
LocalVertexPtr  verts[],
vtkIdType n1,
LocalVertexPtr  l1[],
vtkIdType n2,
LocalVertexPtr  l2[],
double &  ar
[protected]
 

void vtkDecimate::SplitLoop LocalVertexPtr  fedges[2],
vtkIdType  numVerts,
LocalVertexPtr verts,
vtkIdType n1,
LocalVertexPtr l1,
vtkIdType n2,
LocalVertexPtr l2
[protected]
 

void vtkDecimate::Triangulate vtkIdType  numVerts,
LocalVertexPtr  verts[]
[protected]
 

int vtkDecimate::CheckError  )  [protected]
 


Member Data Documentation

double vtkDecimate::InitialFeatureAngle [protected]
 

Definition at line 301 of file vtkDecimate.h.

double vtkDecimate::FeatureAngleIncrement [protected]
 

Definition at line 302 of file vtkDecimate.h.

double vtkDecimate::MaximumFeatureAngle [protected]
 

Definition at line 303 of file vtkDecimate.h.

int vtkDecimate::PreserveEdges [protected]
 

Definition at line 304 of file vtkDecimate.h.

int vtkDecimate::BoundaryVertexDeletion [protected]
 

Definition at line 305 of file vtkDecimate.h.

double vtkDecimate::InitialError [protected]
 

Definition at line 306 of file vtkDecimate.h.

double vtkDecimate::ErrorIncrement [protected]
 

Definition at line 307 of file vtkDecimate.h.

double vtkDecimate::MaximumError [protected]
 

Definition at line 308 of file vtkDecimate.h.

double vtkDecimate::TargetReduction [protected]
 

Definition at line 309 of file vtkDecimate.h.

int vtkDecimate::MaximumIterations [protected]
 

Definition at line 310 of file vtkDecimate.h.

int vtkDecimate::MaximumSubIterations [protected]
 

Definition at line 311 of file vtkDecimate.h.

double vtkDecimate::AspectRatio [protected]
 

Definition at line 312 of file vtkDecimate.h.

int vtkDecimate::Degree [protected]
 

Definition at line 313 of file vtkDecimate.h.

int vtkDecimate::Stats[VTK_NUMBER_STATISTICS] [protected]
 

Definition at line 314 of file vtkDecimate.h.

int vtkDecimate::GenerateErrorScalars [protected]
 

Definition at line 315 of file vtkDecimate.h.

int vtkDecimate::MaximumNumberOfSquawks [protected]
 

Definition at line 316 of file vtkDecimate.h.

int vtkDecimate::PreserveTopology [protected]
 

Definition at line 317 of file vtkDecimate.h.

vtkIdList* vtkDecimate::Neighbors [protected]
 

Definition at line 318 of file vtkDecimate.h.

VertexArray* vtkDecimate::V [protected]
 

Definition at line 319 of file vtkDecimate.h.

TriArray* vtkDecimate::T [protected]
 

Definition at line 320 of file vtkDecimate.h.


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