VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
vtkSimpleCellTessellator Class Reference

helper class to perform cell tessellation More...

#include <vtkSimpleCellTessellator.h>

Inheritance diagram for vtkSimpleCellTessellator:
Inheritance graph
[legend]
Collaboration diagram for vtkSimpleCellTessellator:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkGenericCellTessellator Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkSimpleCellTessellatorNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
void Reset ()
void Initialize (vtkGenericDataSet *ds)
int GetFixedSubdivisions ()
int GetMaxSubdivisionLevel ()
int GetMaxAdaptiveSubdivisions ()
void SetFixedSubdivisions (int level)
void SetMaxSubdivisionLevel (int level)
virtual vtkGenericAdaptorCellGetGenericCell ()
void TessellateFace (vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkIdType index, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)
void Tessellate (vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)
void Triangulate (vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)
void SetSubdivisionLevels (int fixed, int maxLevel)

Static Public Member Functions

static vtkSimpleCellTessellatorNew ()
static int IsTypeOf (const char *type)
static vtkSimpleCellTessellatorSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkSimpleCellTessellator ()
 ~vtkSimpleCellTessellator ()
void CopyPoint (vtkIdType pointId)
void InsertEdgesIntoEdgeTable (vtkTriangleTile &tri)
void RemoveEdgesFromEdgeTable (vtkTriangleTile &tri)
void InsertPointsIntoEdgeTable (vtkTriangleTile &tri)
void InsertEdgesIntoEdgeTable (vtkTetraTile &tetra)
void RemoveEdgesFromEdgeTable (vtkTetraTile &tetra)
void AllocateScalars (int size)
int FindEdgeReferenceCount (double p1[3], double p2[3], vtkIdType &e1, vtkIdType &e2)
int GetNumberOfCellsUsingFace (int faceId)
int GetNumberOfCellsUsingEdge (int edgeId)
int IsEdgeOnFace (double p1[3], double p2[3])
int FindEdgeParent2D (double p1[3], double p2[3], int &localId)
int FindEdgeParent (double p1[3], double p2[3], int &localId)
void AllocatePointIds (int size)
void InitTetraTile (vtkTetraTile &root, vtkIdType *localIds, vtkIdType *ids, int *edgeIds, int *faceIds)
void TriangulateTriangle (vtkGenericAdaptorCell *cell, vtkIdType *localIds, vtkIdType *ids, int *edgeIds, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd)
int FacesAreEqual (int *originalFace, int face[3])

Protected Attributes

vtkGenericEdgeTableEdgeTable
vtkGenericAdaptorCellGenericCell
doubleScalars
int ScalarsCapacity
int PointOffset
vtkGenericCellIteratorCellIterator
vtkGenericAttributeCollectionAttributeCollection
vtkGenericDataSetDataSet
vtkIdType NumberOfPoints
int FixedSubdivisions
int MaxSubdivisionLevel
int CurrentSubdivisionLevel
intEdgeIds
intFaceIds
vtkOrderedTriangulatorTriangulator
vtkCellArrayConnectivity
vtkPolygonPolygon
vtkIdListTriangleIds
vtkIdTypePointIds
int PointIdsCapacity
vtkDoubleArrayTessellatePoints
vtkCellArrayTessellateCellArray
vtkPointDataTessellatePointData

Friends

class vtkTetraTile
class vtkTriangleTile

Detailed Description

helper class to perform cell tessellation

vtkSimpleCellTessellator is a helper class to perform adaptive tessellation of particular cell topologies. The major purpose for this class is to transform higher-order cell types (e.g., higher-order finite elements) into linear cells that can then be easily visualized by VTK. This class works in conjunction with the vtkGenericDataSet and vtkGenericAdaptorCell classes.

This algorithm is based on edge subdivision. An error metric along each edge is evaluated, and if the error is greater than some tolerance, the edge is subdivided (as well as all connected 2D and 3D cells). The process repeats until the error metric is satisfied. Since the algorithm is based on edge subdivision it inherently avoid T-junctions.

A significant issue addressed by this algorithm is to insure face compatibility across neigboring cells. That is, diagonals due to face triangulation must match to insure that the mesh is compatible. The algorithm employs a precomputed table to accelerate the tessellation process. The table was generated with the help of vtkOrderedTriangulator the basic idea is that the choice of diagonal is made only by considering the relative value of the point ids.

See also:
vtkGenericCellTessellator vtkGenericSubdivisionErrorMetric vtkAttributesErrorMetric vtkGeometricErrorMetric vtkViewDependentErrorMetric
Tests:
vtkSimpleCellTessellator (Tests)

Definition at line 70 of file vtkSimpleCellTessellator.h.


Member Typedef Documentation

Reimplemented from vtkGenericCellTessellator.

Definition at line 74 of file vtkSimpleCellTessellator.h.


Constructor & Destructor Documentation


Member Function Documentation

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

Reimplemented from vtkObject.

static int vtkSimpleCellTessellator::IsTypeOf ( const char *  name) [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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkGenericCellTessellator.

virtual int vtkSimpleCellTessellator::IsA ( const char *  name) [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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkGenericCellTessellator.

Reimplemented from vtkGenericCellTessellator.

virtual vtkObjectBase* vtkSimpleCellTessellator::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkGenericCellTessellator.

Reimplemented from vtkGenericCellTessellator.

void vtkSimpleCellTessellator::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 vtkGenericCellTessellator.

Get the higher order cell in order to access the evaluation function.

void vtkSimpleCellTessellator::TessellateFace ( vtkGenericAdaptorCell cell,
vtkGenericAttributeCollection att,
vtkIdType  index,
vtkDoubleArray points,
vtkCellArray cellArray,
vtkPointData internalPd 
) [virtual]

Tessellate a face of a 3D `cell'. The face is specified by the index value. The result is a set of smaller linear triangles in `cellArray' with `points' and point data `internalPd'.

Precondition:
cell_exists: cell!=0
valid_dimension: cell->GetDimension()==3
valid_index_range: (index>=0) && (index<cell->GetNumberOfBoundaries(2))
att_exists: att!=0
points_exists: points!=0
cellArray_exists: cellArray!=0
internalPd_exists: internalPd!=0

Implements vtkGenericCellTessellator.

void vtkSimpleCellTessellator::Tessellate ( vtkGenericAdaptorCell cell,
vtkGenericAttributeCollection att,
vtkDoubleArray points,
vtkCellArray cellArray,
vtkPointData internalPd 
) [virtual]

Tessellate a 3D `cell'. The result is a set of smaller linear tetrahedra in `cellArray' with `points' and point data `internalPd'.

Precondition:
cell_exists: cell!=0
valid_dimension: cell->GetDimension()==3
att_exists: att!=0
points_exists: points!=0
cellArray_exists: cellArray!=0
internalPd_exists: internalPd!=0

Implements vtkGenericCellTessellator.

void vtkSimpleCellTessellator::Triangulate ( vtkGenericAdaptorCell cell,
vtkGenericAttributeCollection att,
vtkDoubleArray points,
vtkCellArray cellArray,
vtkPointData internalPd 
) [virtual]

Triangulate a 2D `cell'. The result is a set of smaller linear triangles in `cellArray' with `points' and point data `internalPd'.

Precondition:
cell_exists: cell!=0
valid_dimension: cell->GetDimension()==2
att_exists: att!=0
points_exists: points!=0
cellArray_exists: cellArray!=0
internalPd_exists: internalPd!=0

Implements vtkGenericCellTessellator.

Reset the output for repeated use of this class.

Initialize the tessellator with a data set `ds'.

Implements vtkGenericCellTessellator.

Return the number of fixed subdivisions. It is used to prevent from infinite loop in degenerated cases. For order 3 or higher, if the inflection point is exactly on the mid-point, error metric will not detect that a subdivision is required. 0 means no fixed subdivision: there will be only adaptive subdivisions. The algorithm first performs `GetFixedSubdivisions' non adaptive subdivisions followed by at most `GetMaxAdaptiveSubdivisions' adaptive subdivisions. Hence, there are at most `GetMaxSubdivisionLevel' subdivisions.

Postcondition:
positive_result: result>=0 && result<=GetMaxSubdivisionLevel()

Return the maximum level of subdivision. It is used to prevent from infinite loop in degenerated cases. For order 3 or higher, if the inflection point is exactly on the mid-point, error metric will not detect that a subdivision is required. 0 means no subdivision, neither fixed nor adaptive.

Postcondition:
positive_result: result>=GetFixedSubdivisions()

Return the maximum number of adaptive subdivisions.

Postcondition:
valid_result: result==GetMaxSubdivisionLevel()-GetFixedSubdivisions()

Set the number of fixed subdivisions. See GetFixedSubdivisions() for more explanations.

Precondition:
positive_level: level>=0 && level<=GetMaxSubdivisionLevel()
Postcondition:
is_set: GetFixedSubdivisions()==level

Set the maximum level of subdivision. See GetMaxSubdivisionLevel() for more explanations.

Precondition:
positive_level: level>=GetFixedSubdivisions()
Postcondition:
is_set: level==GetMaxSubdivisionLevel()
void vtkSimpleCellTessellator::SetSubdivisionLevels ( int  fixed,
int  maxLevel 
)

Set both the number of fixed subdivisions and the maximum level of subdivisions. See GetFixedSubdivisions(), GetMaxSubdivisionLevel() and GetMaxAdaptiveSubdivisions() for more explanations.

Precondition:
positive_fixed: fixed>=0
valid_range: fixed<=maxLevel
Postcondition:
fixed_is_set: fixed==GetFixedSubdivisions()
maxLevel_is_set: maxLevel==GetMaxSubdivisionLevel()
void vtkSimpleCellTessellator::CopyPoint ( vtkIdType  pointId) [protected]

Extract point `pointId' from the edge table to the output point and output point data.

void vtkSimpleCellTessellator::InitTetraTile ( vtkTetraTile root,
vtkIdType localIds,
vtkIdType ids,
int edgeIds,
int faceIds 
) [protected]

Initialize `root' with the sub-tetra defined by the `localIds' points on the complex cell, `ids' are the global ids over the mesh of those points. The sub-tetra is also defined by the ids of its edges and of its faces relative to the complex cell. -1 means that the edge or the face of the sub-tetra is not an original edge or face of the complex cell.

Precondition:
cell_exists: this->GenericCell!=0
localIds_exists: localIds!=0
localIds_size: sizeof(localIds)==4
ids_exists: ids!=0
ids_size: sizeof(ids)==4
edgeIds_exists: edgeIds!=0
edgeIds_size: sizeof(edgeIds)==6
faceIds_exists: faceIds!=0
faceIds_size: sizeof(faceIds)==4
void vtkSimpleCellTessellator::TriangulateTriangle ( vtkGenericAdaptorCell cell,
vtkIdType localIds,
vtkIdType ids,
int edgeIds,
vtkGenericAttributeCollection att,
vtkDoubleArray points,
vtkCellArray cellArray,
vtkPointData internalPd 
) [protected]

Triangulate a triangle of `cell'. This triangle can be the top-level triangle if the cell is a triangle or a toplevel sub-triangle is the cell is a polygon, or a triangular face of a 3D cell or a top-level sub-triangle of a face of a 3D cell if the face is not a triangle. Arguments `localIds', `ids' and `edgeIds' have the same meaning than for InitTetraTile.

Precondition:
cell_exists: cell!=0
localIds_exists: localIds!=0
localIds_size: sizeof(localIds)==3
ids_exists: ids!=0
ids_size: sizeof(ids)==3
edgeIds_exists: edgeIds!=0
edgeIds_size: sizeof(edgeIds)==3
void vtkSimpleCellTessellator::AllocateScalars ( int  size) [protected]

Allocate some memory if Scalars does not exists or is smaller than size.

Precondition:
positive_size: size>0
int vtkSimpleCellTessellator::FindEdgeReferenceCount ( double  p1[3],
double  p2[3],
vtkIdType e1,
vtkIdType e2 
) [protected]
int vtkSimpleCellTessellator::IsEdgeOnFace ( double  p1[3],
double  p2[3] 
) [protected]

Is the edge defined by vertices (`p1',`p2') in parametric coordinates on some edge of the original tetrahedron? If yes return on which edge it is, else return -1.

Precondition:
p1!=p2
p1 and p2 are in bounding box (0,0,0) (1,1,1)
Postcondition:
valid_result: (result==-1) || ( result>=0 && result<=5 )
int vtkSimpleCellTessellator::FindEdgeParent2D ( double  p1[3],
double  p2[3],
int localId 
) [protected]

Return 1 if the parent of edge defined by vertices (`p1',`p2') in parametric coordinates, is an edge; 3 if there is no parent (the edge is inside). If the parent is an edge, return its id in `localId'.

Precondition:
p1!=p2
p1 and p2 are in bounding box (0,0,0) (1,1,1)
Postcondition:
valid_result: (result==1)||(result==3)
int vtkSimpleCellTessellator::FindEdgeParent ( double  p1[3],
double  p2[3],
int localId 
) [protected]

Return 1 if the parent of edge defined by vertices (`p1',`p2') in parametric coordinates, is an edge; 2 if the parent is a face, 3 if there is no parent (the edge is inside). If the parent is an edge or a face, return its id in `localId'.

Precondition:
p1!=p2
p1 and p2 are in bounding box (0,0,0) (1,1,1)
Postcondition:
valid_result: result>=1 && result<=3
void vtkSimpleCellTessellator::AllocatePointIds ( int  size) [protected]

Allocate some memory if PointIds does not exist or is smaller than size.

Precondition:
positive_size: size>0
int vtkSimpleCellTessellator::FacesAreEqual ( int originalFace,
int  face[3] 
) [protected]

Are the faces `originalFace' and `face' equal? The result is independent from any order or orientation.

Precondition:
originalFace_exists: originalFace!=0

Friends And Related Function Documentation

friend class vtkTetraTile [friend]

Definition at line 354 of file vtkSimpleCellTessellator.h.

friend class vtkTriangleTile [friend]

Definition at line 355 of file vtkSimpleCellTessellator.h.


Member Data Documentation

HashTable instead of vtkPointLocator

Definition at line 189 of file vtkSimpleCellTessellator.h.

To access the higher order cell from third party library

Definition at line 237 of file vtkSimpleCellTessellator.h.

Scalar buffer used to save the interpolate values of the attributes The capacity is at least the number of components of the attribute collection ot the current cell.

Definition at line 253 of file vtkSimpleCellTessellator.h.

Definition at line 254 of file vtkSimpleCellTessellator.h.

Number of double value to skip to go to the next point into Scalars array It is 6+attributeCollection->GetNumberOfComponents()

Definition at line 258 of file vtkSimpleCellTessellator.h.

Used to iterate over edges boundaries in GetNumberOfCellsUsingEdges()

Definition at line 261 of file vtkSimpleCellTessellator.h.

To access the higher order field from third party library

Definition at line 264 of file vtkSimpleCellTessellator.h.

To avoid New/Delete

Definition at line 268 of file vtkSimpleCellTessellator.h.

To avoid New/Delete

Definition at line 269 of file vtkSimpleCellTessellator.h.

To avoid New/Delete

Definition at line 270 of file vtkSimpleCellTessellator.h.

Dataset to be tessellated.

Reimplemented from vtkGenericCellTessellator.

Definition at line 314 of file vtkSimpleCellTessellator.h.

Number of points in the dataset to be tessellated.

Definition at line 317 of file vtkSimpleCellTessellator.h.

Definition at line 319 of file vtkSimpleCellTessellator.h.

Definition at line 320 of file vtkSimpleCellTessellator.h.

Definition at line 321 of file vtkSimpleCellTessellator.h.

For each edge (6) of the sub-tetra, there is the id of the original edge or -1 if the edge is not an original edge

Definition at line 325 of file vtkSimpleCellTessellator.h.

For each face (4) of the sub-tetra, there is the id of the original face or -1 if the face is not an original face

Definition at line 328 of file vtkSimpleCellTessellator.h.

Definition at line 334 of file vtkSimpleCellTessellator.h.

Definition at line 338 of file vtkSimpleCellTessellator.h.

Definition at line 341 of file vtkSimpleCellTessellator.h.

Definition at line 344 of file vtkSimpleCellTessellator.h.

Definition at line 346 of file vtkSimpleCellTessellator.h.

Definition at line 347 of file vtkSimpleCellTessellator.h.


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