VTK
|
helper class to perform cell tessellation More...
#include <vtkSimpleCellTessellator.h>
Public Types | |
typedef vtkGenericCellTessellator | Superclass |
Public Types inherited from vtkGenericCellTessellator | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. More... | |
vtkSimpleCellTessellator * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. More... | |
void | TessellateFace (vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkIdType index, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd) override |
Tessellate a face of a 3D `cell'. More... | |
void | Tessellate (vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd) override |
Tessellate a 3D `cell'. More... | |
void | Triangulate (vtkGenericAdaptorCell *cell, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd) override |
Triangulate a 2D `cell'. More... | |
void | Reset () |
Reset the output for repeated use of this class. More... | |
void | Initialize (vtkGenericDataSet *ds) override |
Initialize the tessellator with a data set `ds'. More... | |
int | GetFixedSubdivisions () |
Return the number of fixed subdivisions. More... | |
int | GetMaxSubdivisionLevel () |
Return the maximum level of subdivision. More... | |
int | GetMaxAdaptiveSubdivisions () |
Return the maximum number of adaptive subdivisions. More... | |
void | SetFixedSubdivisions (int level) |
Set the number of fixed subdivisions. More... | |
void | SetMaxSubdivisionLevel (int level) |
Set the maximum level of subdivision. More... | |
void | SetSubdivisionLevels (int fixed, int maxLevel) |
Set both the number of fixed subdivisions and the maximum level of subdivisions. More... | |
virtual vtkGenericAdaptorCell * | GetGenericCell () |
Get the higher order cell in order to access the evaluation function. More... | |
Public Member Functions inherited from vtkGenericCellTessellator | |
vtkGenericCellTessellator * | NewInstance () const |
void | InitErrorMetrics (vtkGenericDataSet *ds) |
Init the error metric with the dataset. More... | |
void | GetMaxErrors (double *errors) |
Get the maximum error measured after the fixed subdivision. More... | |
virtual void | SetErrorMetrics (vtkCollection *someErrorMetrics) |
Specify the list of error metrics used to decide if an edge has to be splitted or not. More... | |
virtual vtkCollection * | GetErrorMetrics () |
Specify the list of error metrics used to decide if an edge has to be splitted or not. More... | |
virtual int | GetMeasurement () |
If true, measure the quality of the fixed subdivision. More... | |
virtual void | SetMeasurement (int) |
If true, measure the quality of the fixed subdivision. More... | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. More... | |
virtual void | DebugOff () |
Turn debugging output off. More... | |
bool | GetDebug () |
Get the value of the debug flag. More... | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. More... | |
virtual void | Modified () |
Update the modification time for this object. More... | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. More... | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
int | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
int | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More... | |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
Allow user to set the AbortFlagOn() with the return value of the callback method. More... | |
int | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. More... | |
int | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. More... | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. More... | |
virtual void | Delete () |
Delete a VTK object. More... | |
virtual void | FastDelete () |
Delete a reference to this object. More... | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. More... | |
virtual void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). More... | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). More... | |
int | GetReferenceCount () |
Return the current reference count of this object. More... | |
void | SetReferenceCount (int) |
Sets the reference count. More... | |
void | PrintRevisions (ostream &) |
Legacy. More... | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. More... | |
Static Public Member Functions | |
static vtkSimpleCellTessellator * | New () |
static int | IsTypeOf (const char *type) |
static vtkSimpleCellTessellator * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkGenericCellTessellator | |
static int | IsTypeOf (const char *type) |
static vtkGenericCellTessellator * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. More... | |
static void | SetGlobalWarningDisplay (int val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
static int | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. More... | |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
Return 1 if this class type is the same type of (or a subclass of) the named class. More... | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More... | |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkSimpleCellTessellator () | |
~vtkSimpleCellTessellator () override | |
void | CopyPoint (vtkIdType pointId) |
Extract point `pointId' from the edge table to the output point and output point data. More... | |
void | InsertEdgesIntoEdgeTable (vtkTriangleTile &tri) |
void | RemoveEdgesFromEdgeTable (vtkTriangleTile &tri) |
void | InsertPointsIntoEdgeTable (vtkTriangleTile &tri) |
void | InsertEdgesIntoEdgeTable (vtkTetraTile &tetra) |
void | RemoveEdgesFromEdgeTable (vtkTetraTile &tetra) |
void | InitTetraTile (vtkTetraTile &root, vtkIdType *localIds, vtkIdType *ids, int *edgeIds, int *faceIds) |
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. More... | |
void | TriangulateTriangle (vtkGenericAdaptorCell *cell, vtkIdType *localIds, vtkIdType *ids, int *edgeIds, vtkGenericAttributeCollection *att, vtkDoubleArray *points, vtkCellArray *cellArray, vtkPointData *internalPd) |
Triangulate a triangle of `cell'. More... | |
void | AllocateScalars (int size) |
Allocate some memory if Scalars does not exists or is smaller than size. More... | |
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]) |
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. More... | |
int | FindEdgeParent2D (double p1[3], double p2[3], int &localId) |
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). More... | |
int | FindEdgeParent (double p1[3], double p2[3], int &localId) |
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). More... | |
void | AllocatePointIds (int size) |
Allocate some memory if PointIds does not exist or is smaller than size. More... | |
int | FacesAreEqual (int *originalFace, int face[3]) |
Are the faces `originalFace' and `face' equal? The result is independent from any order or orientation. More... | |
Protected Member Functions inherited from vtkGenericCellTessellator | |
vtkGenericCellTessellator () | |
~vtkGenericCellTessellator () override | |
int | RequiresEdgeSubdivision (double *left, double *mid, double *right, double alpha) |
Does the edge need to be subdivided according to at least one error metric? The edge is defined by its `leftPoint' and its `rightPoint'. More... | |
virtual void | UpdateMaxError (double *leftPoint, double *midPoint, double *rightPoint, double alpha) |
Update the max error of each error metric according to the error at the mid-point. More... | |
void | ResetMaxErrors () |
Reset the maximal error of each error metric. More... | |
void | SetGenericCell (vtkGenericAdaptorCell *cell) |
Send the current cell to error metrics. More... | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
~vtkObject () override | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
These methods allow a command to exclusively grab all events. More... | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. More... | |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
vtkGenericEdgeTable * | EdgeTable |
HashTable instead of vtkPointLocator. More... | |
vtkGenericAdaptorCell * | GenericCell |
To access the higher order cell from third party library. More... | |
double * | Scalars |
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. More... | |
int | ScalarsCapacity |
int | PointOffset |
Number of double value to skip to go to the next point into Scalars array It is 6+attributeCollection->GetNumberOfComponents() More... | |
vtkGenericCellIterator * | CellIterator |
Used to iterate over edges boundaries in GetNumberOfCellsUsingEdges() More... | |
vtkGenericAttributeCollection * | AttributeCollection |
To access the higher order field from third party library. More... | |
vtkGenericDataSet * | DataSet |
Dataset to be tessellated. More... | |
vtkIdType | NumberOfPoints |
Number of points in the dataset to be tessellated. More... | |
int | FixedSubdivisions |
int | MaxSubdivisionLevel |
int | CurrentSubdivisionLevel |
int * | EdgeIds |
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. More... | |
int * | FaceIds |
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. More... | |
vtkOrderedTriangulator * | Triangulator |
vtkCellArray * | Connectivity |
vtkPolygon * | Polygon |
vtkIdList * | TriangleIds |
vtkIdType * | PointIds |
int | PointIdsCapacity |
vtkDoubleArray * | TessellatePoints |
To avoid New/Delete. More... | |
vtkCellArray * | TessellateCellArray |
To avoid New/Delete. More... | |
vtkPointData * | TessellatePointData |
To avoid New/Delete. More... | |
Protected Attributes inherited from vtkGenericCellTessellator | |
vtkCollection * | ErrorMetrics |
List of error metrics. More... | |
vtkGenericDataSet * | DataSet |
int | Measurement |
double * | MaxErrors |
int | MaxErrorsCapacity |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Friends | |
class | vtkTetraTile |
class | vtkTriangleTile |
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.
Definition at line 71 of file vtkSimpleCellTessellator.h.
Definition at line 75 of file vtkSimpleCellTessellator.h.
|
protected |
|
overrideprotected |
|
static |
|
static |
|
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.
|
static |
|
protectedvirtual |
Reimplemented from vtkGenericCellTessellator.
vtkSimpleCellTessellator* vtkSimpleCellTessellator::NewInstance | ( | ) | const |
|
overridevirtual |
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.
|
virtual |
Get the higher order cell in order to access the evaluation function.
|
overridevirtual |
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'.
Implements vtkGenericCellTessellator.
|
overridevirtual |
Tessellate a 3D `cell'.
The result is a set of smaller linear tetrahedra in `cellArray' with `points' and point data `internalPd'.
Implements vtkGenericCellTessellator.
|
overridevirtual |
Triangulate a 2D `cell'.
The result is a set of smaller linear triangles in `cellArray' with `points' and point data `internalPd'.
Implements vtkGenericCellTessellator.
void vtkSimpleCellTessellator::Reset | ( | ) |
Reset the output for repeated use of this class.
|
overridevirtual |
Initialize the tessellator with a data set `ds'.
Implements vtkGenericCellTessellator.
int vtkSimpleCellTessellator::GetFixedSubdivisions | ( | ) |
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.
int vtkSimpleCellTessellator::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.
int vtkSimpleCellTessellator::GetMaxAdaptiveSubdivisions | ( | ) |
Return the maximum number of adaptive subdivisions.
void vtkSimpleCellTessellator::SetFixedSubdivisions | ( | int | level | ) |
Set the number of fixed subdivisions.
See GetFixedSubdivisions() for more explanations.
void vtkSimpleCellTessellator::SetMaxSubdivisionLevel | ( | int | level | ) |
Set the maximum level of subdivision.
See GetMaxSubdivisionLevel() for more explanations.
Set both the number of fixed subdivisions and the maximum level of subdivisions.
See GetFixedSubdivisions(), GetMaxSubdivisionLevel() and GetMaxAdaptiveSubdivisions() for more explanations.
|
protected |
Extract point `pointId' from the edge table to the output point and output point data.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
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.
|
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.
|
protected |
Allocate some memory if Scalars does not exists or is smaller than size.
|
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.
|
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'.
|
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'.
|
protected |
Allocate some memory if PointIds does not exist or is smaller than size.
Are the faces `originalFace' and `face' equal? The result is independent from any order or orientation.
|
friend |
Definition at line 426 of file vtkSimpleCellTessellator.h.
|
friend |
Definition at line 427 of file vtkSimpleCellTessellator.h.
|
protected |
HashTable instead of vtkPointLocator.
Definition at line 221 of file vtkSimpleCellTessellator.h.
|
protected |
To access the higher order cell from third party library.
Definition at line 279 of file vtkSimpleCellTessellator.h.
|
protected |
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 299 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 300 of file vtkSimpleCellTessellator.h.
|
protected |
Number of double value to skip to go to the next point into Scalars array It is 6+attributeCollection->GetNumberOfComponents()
Definition at line 306 of file vtkSimpleCellTessellator.h.
|
protected |
Used to iterate over edges boundaries in GetNumberOfCellsUsingEdges()
Definition at line 311 of file vtkSimpleCellTessellator.h.
|
protected |
To access the higher order field from third party library.
Definition at line 316 of file vtkSimpleCellTessellator.h.
|
protected |
To avoid New/Delete.
Definition at line 322 of file vtkSimpleCellTessellator.h.
|
protected |
To avoid New/Delete.
Definition at line 323 of file vtkSimpleCellTessellator.h.
|
protected |
To avoid New/Delete.
Definition at line 324 of file vtkSimpleCellTessellator.h.
|
protected |
Dataset to be tessellated.
Definition at line 381 of file vtkSimpleCellTessellator.h.
|
protected |
Number of points in the dataset to be tessellated.
Definition at line 386 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 388 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 389 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 390 of file vtkSimpleCellTessellator.h.
|
protected |
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 396 of file vtkSimpleCellTessellator.h.
|
protected |
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 401 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 407 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 411 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 414 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 417 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 419 of file vtkSimpleCellTessellator.h.
|
protected |
Definition at line 420 of file vtkSimpleCellTessellator.h.