Public Methods |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | SetInitialError (float) |
virtual float | GetInitialError () |
virtual void | SetErrorIncrement (float) |
virtual float | GetErrorIncrement () |
virtual void | SetMaximumError (float) |
virtual float | GetMaximumError () |
virtual void | SetTargetReduction (float) |
virtual float | GetTargetReduction () |
virtual void | SetMaximumIterations (int) |
virtual int | GetMaximumIterations () |
virtual void | SetMaximumSubIterations (int) |
virtual int | GetMaximumSubIterations () |
virtual void | SetInitialFeatureAngle (float) |
virtual float | GetInitialFeatureAngle () |
virtual void | SetFeatureAngleIncrement (float) |
virtual float | GetFeatureAngleIncrement () |
virtual void | SetMaximumFeatureAngle (float) |
virtual float | 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 (float) |
virtual float | 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 Methods |
vtkDecimate * | New () |
int | IsTypeOf (const char *type) |
vtkDecimate * | SafeDownCast (vtkObject *o) |
Protected Methods |
| vtkDecimate () |
| ~vtkDecimate () |
| vtkDecimate (const vtkDecimate &) |
void | operator= (const vtkDecimate &) |
void | Execute () |
void | CreateOutput (int numPts, int numTris, int numEliminated, vtkPointData *pd, vtkPoints *inPts) |
int | BuildLoop (int ptId, unsigned short int nTris, int *tris) |
void | EvaluateLoop (int &vtype, int &numFEdges, vtkLocalVertexPtr fedges[]) |
int | CanSplitLoop (vtkLocalVertexPtr fedges[2], int numVerts, vtkLocalVertexPtr verts[], int &n1, vtkLocalVertexPtr l1[], int &n2, vtkLocalVertexPtr l2[], float &ar) |
void | SplitLoop (vtkLocalVertexPtr fedges[2], int numVerts, vtkLocalVertexPtr *verts, int &n1, vtkLocalVertexPtr *l1, int &n2, vtkLocalVertexPtr *l2) |
void | Triangulate (int numVerts, vtkLocalVertexPtr verts[]) |
int | CheckError () |
Protected Attributes |
float | InitialFeatureAngle |
float | FeatureAngleIncrement |
float | MaximumFeatureAngle |
int | PreserveEdges |
int | BoundaryVertexDeletion |
float | InitialError |
float | ErrorIncrement |
float | MaximumError |
float | TargetReduction |
int | MaximumIterations |
int | MaximumSubIterations |
float | AspectRatio |
int | Degree |
int | Stats [VTK_NUMBER_STATISTICS] |
int | GenerateErrorScalars |
int | MaximumNumberOfSquawks |
int | PreserveTopology |
vtkIdList * | Neighbors |
vtkVertexArray * | V |
vtkTriArray * | T |
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.