VTK
9.1.0
|
helper class to generate triangulations More...
#include <vtkOrderedTriangulator.h>
Public Types | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual vtkTypeBool | IsA (const char *type) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
vtkOrderedTriangulator * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
void | UpdatePointType (vtkIdType internalId, int type) |
Update the point type. | |
double * | GetPointPosition (vtkIdType internalId) |
Return the parametric coordinates of point ‘internalId’. | |
double * | GetPointLocation (vtkIdType internalId) |
Return the global coordinates of point ‘internalId’. | |
vtkIdType | GetPointId (vtkIdType internalId) |
Return the Id of point ‘internalId’. | |
vtkIdType | GetTetras (int classification, vtkUnstructuredGrid *ugrid) |
Initialize and add the tetras and points from the triangulation to the unstructured grid provided. | |
vtkIdType | AddTetras (int classification, vtkUnstructuredGrid *ugrid) |
Add the tetras to the unstructured grid provided. | |
vtkIdType | AddTetras (int classification, vtkCellArray *connectivity) |
Add the tetrahedra classified (0=inside,1=outside) to the connectivity list provided. | |
vtkIdType | AddTetras (int classification, vtkIncrementalPointLocator *locator, vtkCellArray *outConnectivity, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD) |
Assuming that all the inserted points come from a cell ‘cellId’ to triangulate, get the tetrahedra in outConnectivity, the points in locator and copy point data and cell data. | |
vtkIdType | AddTetras (int classification, vtkIdList *ptIds, vtkPoints *pts) |
Add the tetrahedra classified (0=inside,1=outside) to the list of ids and coordinates provided. | |
vtkIdType | AddTriangles (vtkCellArray *connectivity) |
Add the triangle faces classified (2=boundary) to the connectivity list provided. | |
vtkIdType | AddTriangles (vtkIdType id, vtkCellArray *connectivity) |
Add the triangle faces classified (2=boundary) and attached to the specified point id to the connectivity list provided. | |
void | InitTetraTraversal () |
Methods to get one tetra at a time. | |
int | GetNextTetra (int classification, vtkTetra *tet, vtkDataArray *cellScalars, vtkDoubleArray *tetScalars) |
Methods to get one tetra at a time. | |
void | InitTriangulation (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int numPts) |
Initialize the triangulation process. | |
void | InitTriangulation (double bounds[6], int numPts) |
Initialize the triangulation process. | |
vtkIdType | InsertPoint (vtkIdType id, double x[3], double p[3], int type) |
For each point to be inserted, provide an id, a position x, parametric coordinate p, and whether the point is inside (type=0), outside (type=1), or on the boundary (type=2). | |
vtkIdType | InsertPoint (vtkIdType id, vtkIdType sortid, double x[3], double p[3], int type) |
For each point to be inserted, provide an id, a position x, parametric coordinate p, and whether the point is inside (type=0), outside (type=1), or on the boundary (type=2). | |
vtkIdType | InsertPoint (vtkIdType id, vtkIdType sortid, vtkIdType sortid2, double x[3], double p[3], int type) |
For each point to be inserted, provide an id, a position x, parametric coordinate p, and whether the point is inside (type=0), outside (type=1), or on the boundary (type=2). | |
void | Triangulate () |
Perform the triangulation. | |
void | TemplateTriangulate (int cellType, int numPts, int numEdges) |
Perform the triangulation. | |
virtual int | GetNumberOfPoints () |
Return the number of inserted points. | |
virtual void | SetUseTemplates (vtkTypeBool) |
If this flag is set, then the ordered triangulator will create and use templates for the triangulation. | |
virtual vtkTypeBool | GetUseTemplates () |
If this flag is set, then the ordered triangulator will create and use templates for the triangulation. | |
virtual void | UseTemplatesOn () |
If this flag is set, then the ordered triangulator will create and use templates for the triangulation. | |
virtual void | UseTemplatesOff () |
If this flag is set, then the ordered triangulator will create and use templates for the triangulation. | |
virtual void | SetPreSorted (vtkTypeBool) |
Boolean indicates whether the points have been pre-sorted. | |
virtual vtkTypeBool | GetPreSorted () |
Boolean indicates whether the points have been pre-sorted. | |
virtual void | PreSortedOn () |
Boolean indicates whether the points have been pre-sorted. | |
virtual void | PreSortedOff () |
Boolean indicates whether the points have been pre-sorted. | |
virtual void | SetUseTwoSortIds (vtkTypeBool) |
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting. | |
virtual vtkTypeBool | GetUseTwoSortIds () |
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting. | |
virtual void | UseTwoSortIdsOn () |
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting. | |
virtual void | UseTwoSortIdsOff () |
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting. | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
Turn debugging output on. | |
virtual void | DebugOff () |
Turn debugging output off. | |
bool | GetDebug () |
Get the value of the debug flag. | |
void | SetDebug (bool debugFlag) |
Set the value of the debug flag. | |
virtual void | Modified () |
Update the modification time for this object. | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
vtkTypeBool | HasObserver (unsigned long event) |
vtkTypeBool | 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. | |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkCommand * | GetCommand (unsigned long tag) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObserver (vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
void | RemoveObservers (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
Allow people to add/remove/invoke observers (callbacks) to any VTK object. | |
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. | |
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. | |
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. | |
int | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
int | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. | |
virtual vtkTypeBool | IsA (const char *name) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
virtual void | Delete () |
Delete a VTK object. | |
virtual void | FastDelete () |
Delete a reference to this object. | |
void | InitializeObjectBase () |
void | Print (ostream &os) |
Print an object to an ostream. | |
virtual void | Register (vtkObjectBase *o) |
Increase the reference count (mark as used by another object). | |
virtual void | UnRegister (vtkObjectBase *o) |
Decrease the reference count (release by another object). | |
int | GetReferenceCount () |
Return the current reference count of this object. | |
void | SetReferenceCount (int) |
Sets the reference count. | |
bool | GetIsInMemkind () const |
A local state flag that remembers whether this object lives in the normal or extended memory space. | |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
Methods invoked by print to print information about the object including superclasses. | |
Static Public Member Functions | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkOrderedTriangulator * | SafeDownCast (vtkObjectBase *o) |
static vtkOrderedTriangulator * | New () |
Construct object. | |
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. | |
static void | BreakOnError () |
This method is called when vtkErrorMacro executes. | |
static void | SetGlobalWarningDisplay (int val) |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOn () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static void | GlobalWarningDisplayOff () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
static int | GetGlobalWarningDisplay () |
This is a global flag that controls whether any debug, warning or error messages are displayed. | |
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. | |
static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). | |
static vtkObjectBase * | New () |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on. | |
static void | SetMemkindDirectory (const char *directoryname) |
The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. | |
static bool | GetUsingMemkind () |
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. | |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkOrderedTriangulator () | |
~vtkOrderedTriangulator () override | |
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=nullptr) |
These methods allow a command to exclusively grab all events. | |
void | InternalReleaseFocus () |
These methods allow a command to exclusively grab all events. | |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Additional Inherited Members | |
Static Protected Member Functions inherited from vtkObjectBase | |
static vtkMallocingFunction | GetCurrentMallocFunction () |
static vtkReallocingFunction | GetCurrentReallocFunction () |
static vtkFreeingFunction | GetCurrentFreeFunction () |
static vtkFreeingFunction | GetAlternateFreeFunction () |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
std::atomic< int32_t > | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
helper class to generate triangulations
This class is used to generate unique triangulations of points. The uniqueness of the triangulation is controlled by the id of the inserted points in combination with a Delaunay criterion. The class is designed to be as fast as possible (since the algorithm can be slow) and uses block memory allocations to support rapid triangulation generation. Also, the assumption behind the class is that a maximum of hundreds of points are to be triangulated. If you desire more robust triangulation methods use vtkPolygon::Triangulate(), vtkDelaunay2D, or vtkDelaunay3D.
Definition at line 114 of file vtkOrderedTriangulator.h.
Definition at line 117 of file vtkOrderedTriangulator.h.
|
protected |
|
overrideprotected |
|
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 vtkObjectBase.
|
static |
|
protectedvirtual |
vtkOrderedTriangulator * vtkOrderedTriangulator::NewInstance | ( | ) | const |
|
overridevirtual |
|
static |
Construct object.
void vtkOrderedTriangulator::InitTriangulation | ( | double | xmin, |
double | xmax, | ||
double | ymin, | ||
double | ymax, | ||
double | zmin, | ||
double | zmax, | ||
int | numPts | ||
) |
Initialize the triangulation process.
Provide a bounding box and the maximum number of points to be inserted. Note that since the triangulation is performed using parametric coordinates (see InsertPoint()) the bounds should be represent the range of the parametric coordinates inserted.
void vtkOrderedTriangulator::InitTriangulation | ( | double | bounds[6], |
int | numPts | ||
) |
Initialize the triangulation process.
Provide a bounding box and the maximum number of points to be inserted. Note that since the triangulation is performed using parametric coordinates (see InsertPoint()) the bounds should be represent the range of the parametric coordinates inserted.
For each point to be inserted, provide an id, a position x, parametric coordinate p, and whether the point is inside (type=0), outside (type=1), or on the boundary (type=2).
You must call InitTriangulation() prior to invoking this method. Make sure that the number of points inserted does not exceed the numPts specified in InitTriangulation(). Also note that the "id" can be any integer and can be greater than numPts. It is used to create tetras (in AddTetras()) with the appropriate connectivity ids. The method returns an internal id that can be used prior to the Triangulate() method to update the type of the point with UpdatePointType(). (Note: the algorithm triangulated with the parametric coordinate p[3] and creates tetras with the global coordinate x[3]. The parametric coordinates and global coordinates may be the same.)
vtkIdType vtkOrderedTriangulator::InsertPoint | ( | vtkIdType | id, |
vtkIdType | sortid, | ||
double | x[3], | ||
double | p[3], | ||
int | type | ||
) |
For each point to be inserted, provide an id, a position x, parametric coordinate p, and whether the point is inside (type=0), outside (type=1), or on the boundary (type=2).
You must call InitTriangulation() prior to invoking this method. Make sure that the number of points inserted does not exceed the numPts specified in InitTriangulation(). Also note that the "id" can be any integer and can be greater than numPts. It is used to create tetras (in AddTetras()) with the appropriate connectivity ids. The method returns an internal id that can be used prior to the Triangulate() method to update the type of the point with UpdatePointType(). (Note: the algorithm triangulated with the parametric coordinate p[3] and creates tetras with the global coordinate x[3]. The parametric coordinates and global coordinates may be the same.)
vtkIdType vtkOrderedTriangulator::InsertPoint | ( | vtkIdType | id, |
vtkIdType | sortid, | ||
vtkIdType | sortid2, | ||
double | x[3], | ||
double | p[3], | ||
int | type | ||
) |
For each point to be inserted, provide an id, a position x, parametric coordinate p, and whether the point is inside (type=0), outside (type=1), or on the boundary (type=2).
You must call InitTriangulation() prior to invoking this method. Make sure that the number of points inserted does not exceed the numPts specified in InitTriangulation(). Also note that the "id" can be any integer and can be greater than numPts. It is used to create tetras (in AddTetras()) with the appropriate connectivity ids. The method returns an internal id that can be used prior to the Triangulate() method to update the type of the point with UpdatePointType(). (Note: the algorithm triangulated with the parametric coordinate p[3] and creates tetras with the global coordinate x[3]. The parametric coordinates and global coordinates may be the same.)
void vtkOrderedTriangulator::Triangulate | ( | ) |
Perform the triangulation.
(Complete all calls to InsertPoint() prior to invoking this method.) A special version is available when templates should be used.
void vtkOrderedTriangulator::TemplateTriangulate | ( | int | cellType, |
int | numPts, | ||
int | numEdges | ||
) |
Perform the triangulation.
(Complete all calls to InsertPoint() prior to invoking this method.) A special version is available when templates should be used.
void vtkOrderedTriangulator::UpdatePointType | ( | vtkIdType | internalId, |
int | type | ||
) |
Update the point type.
This is useful when the merging of nearly coincident points is performed. The id is the internal id returned from InsertPoint(). The method should be invoked prior to the Triangulate method. The type is specified as inside (type=0), outside (type=1), or on the boundary (type=2).
double * vtkOrderedTriangulator::GetPointPosition | ( | vtkIdType | internalId | ) |
Return the parametric coordinates of point ‘internalId’.
It assumes that the point has already been inserted. The method should be invoked prior to the Triangulate method.
double * vtkOrderedTriangulator::GetPointLocation | ( | vtkIdType | internalId | ) |
Return the global coordinates of point ‘internalId’.
It assumes that the point has already been inserted. The method should be invoked prior to the Triangulate method.
Return the Id of point ‘internalId’.
This id is the one passed in argument of InsertPoint. It assumes that the point has already been inserted. The method should be invoked prior to the Triangulate method.
|
virtual |
Return the number of inserted points.
|
virtual |
If this flag is set, then the ordered triangulator will create and use templates for the triangulation.
To use templates, the TemplateTriangulate() method should be called when appropriate. (Note: the TemplateTriangulate() method works for complete (interior) cells without extra points due to intersection, etc.)
|
virtual |
If this flag is set, then the ordered triangulator will create and use templates for the triangulation.
To use templates, the TemplateTriangulate() method should be called when appropriate. (Note: the TemplateTriangulate() method works for complete (interior) cells without extra points due to intersection, etc.)
|
virtual |
If this flag is set, then the ordered triangulator will create and use templates for the triangulation.
To use templates, the TemplateTriangulate() method should be called when appropriate. (Note: the TemplateTriangulate() method works for complete (interior) cells without extra points due to intersection, etc.)
|
virtual |
If this flag is set, then the ordered triangulator will create and use templates for the triangulation.
To use templates, the TemplateTriangulate() method should be called when appropriate. (Note: the TemplateTriangulate() method works for complete (interior) cells without extra points due to intersection, etc.)
|
virtual |
Boolean indicates whether the points have been pre-sorted.
If pre-sorted is enabled, the points are not sorted on point id. By default, presorted is off. (The point id is defined in InsertPoint().)
|
virtual |
Boolean indicates whether the points have been pre-sorted.
If pre-sorted is enabled, the points are not sorted on point id. By default, presorted is off. (The point id is defined in InsertPoint().)
|
virtual |
Boolean indicates whether the points have been pre-sorted.
If pre-sorted is enabled, the points are not sorted on point id. By default, presorted is off. (The point id is defined in InsertPoint().)
|
virtual |
Boolean indicates whether the points have been pre-sorted.
If pre-sorted is enabled, the points are not sorted on point id. By default, presorted is off. (The point id is defined in InsertPoint().)
|
virtual |
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.
|
virtual |
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.
|
virtual |
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.
|
virtual |
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.
vtkIdType vtkOrderedTriangulator::GetTetras | ( | int | classification, |
vtkUnstructuredGrid * | ugrid | ||
) |
Initialize and add the tetras and points from the triangulation to the unstructured grid provided.
New points are created and the mesh is allocated. (This method differs from AddTetras() in that it inserts points and cells; AddTetras only adds the tetra cells.) The tetrahdera added are of the type specified (0=inside,1=outside,2=all). Inside tetrahedron are those whose points are classified "inside" or on the "boundary." Outside tetrahedron have at least one point classified "outside." The method returns the number of tetrahedrahedron of the type requested.
vtkIdType vtkOrderedTriangulator::AddTetras | ( | int | classification, |
vtkUnstructuredGrid * | ugrid | ||
) |
Add the tetras to the unstructured grid provided.
The unstructured grid is assumed to have been initialized (with Allocate()) and points set (with SetPoints()). The tetrahdera added are of the type specified (0=inside,1=outside,2=all). Inside tetrahedron are those whose points are classified "inside" or on the "boundary." Outside tetrahedron have at least one point classified "outside." The method returns the number of tetrahedrahedron of the type requested.
vtkIdType vtkOrderedTriangulator::AddTetras | ( | int | classification, |
vtkCellArray * | connectivity | ||
) |
Add the tetrahedra classified (0=inside,1=outside) to the connectivity list provided.
Inside tetrahedron are those whose points are all classified "inside." Outside tetrahedron have at least one point classified "outside." The method returns the number of tetrahedron of the type requested.
vtkIdType vtkOrderedTriangulator::AddTetras | ( | int | classification, |
vtkIncrementalPointLocator * | locator, | ||
vtkCellArray * | outConnectivity, | ||
vtkPointData * | inPD, | ||
vtkPointData * | outPD, | ||
vtkCellData * | inCD, | ||
vtkIdType | cellId, | ||
vtkCellData * | outCD | ||
) |
Assuming that all the inserted points come from a cell ‘cellId’ to triangulate, get the tetrahedra in outConnectivity, the points in locator and copy point data and cell data.
Return the number of added tetras.
vtkIdType vtkOrderedTriangulator::AddTetras | ( | int | classification, |
vtkIdList * | ptIds, | ||
vtkPoints * | pts | ||
) |
Add the tetrahedra classified (0=inside,1=outside) to the list of ids and coordinates provided.
These assume that the first four points form a tetrahedron, the next four the next, and so on.
vtkIdType vtkOrderedTriangulator::AddTriangles | ( | vtkCellArray * | connectivity | ) |
Add the triangle faces classified (2=boundary) to the connectivity list provided.
The method returns the number of triangles.
vtkIdType vtkOrderedTriangulator::AddTriangles | ( | vtkIdType | id, |
vtkCellArray * | connectivity | ||
) |
Add the triangle faces classified (2=boundary) and attached to the specified point id to the connectivity list provided.
(The id is the same as that specified in InsertPoint().)
void vtkOrderedTriangulator::InitTetraTraversal | ( | ) |
Methods to get one tetra at a time.
Start with InitTetraTraversal() and then invoke GetNextTetra() until the method returns 0.
int vtkOrderedTriangulator::GetNextTetra | ( | int | classification, |
vtkTetra * | tet, | ||
vtkDataArray * | cellScalars, | ||
vtkDoubleArray * | tetScalars | ||
) |
Methods to get one tetra at a time.
Start with InitTetraTraversal() and then invoke GetNextTetra() until the method returns 0. cellScalars are point-centered scalars on the original cell. tetScalars are point-centered scalars on the tetra: the values will be copied from cellScalars.