vtk
Class vtkOrderedTriangulator

java.lang.Object
  extended byvtk.vtkObjectBase
      extended byvtk.vtkObject
          extended byvtk.vtkOrderedTriangulator
All Implemented Interfaces:
java.io.Serializable

public class vtkOrderedTriangulator
extends vtkObject
implements java.io.Serializable

vtkOrderedTriangulator - 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 very fast 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. Background: Delaunay triangulations are unique assuming a random distribution of input points. The 3D Delaunay criterion is as follows: the circumsphere of each tetrahedron contains no other points of the triangulation except for the four points defining the tetrahedron. In application this property is hard to satisfy because objects like cubes are defined by eight points all sharing the same circumsphere (center and radius); hence the Delaunay triangulation is not unique. These so-called degenerate situations are typically resolved by arbitrary selecting a triangulation. This code does something different: it resolves degenerate triangulations by modifying the "InCircumsphere" method to use a slightly smaller radius. Hence, degenerate points are always considered "out" of the circumsphere. This, in combination with an ordering (based on id) of the input points, guarantees a unique triangulation. There is another related characteristic of Delaunay triangulations. Given a N-dimensional Delaunay triangulation, points lying on a (N-1) dimensional plane also form a (N-1) Delaunay triangulation. This means for example, that if a 3D cell is defined by a set of (2D) planar faces, then the face triangulations are Delaunay. Combinaing this with the method to generate unique triangulations described previously, the triangulations on the face are guaranteed unique. This fact can be used to triangulate 3D objects in such a way to guarantee compatible face triangulations. This is a very useful fact for parallel processing, or performing operations like clipping that require compatible triangulations across 3D cell faces. (See vtkClipVolume for an example.) A special feature of this class is that it can generate triangulation templates on the fly. If template triangulation is enabled, then the ordered triangulator will first triangulate the cell using the slower ordered Delaunay approach, and then store the result as a template. Later, if the same cell type and cell configuration is encountered, then the template is reused which greatly speeds the triangulation. JavaBean wrapper for vtkOrderedTriangulator object.

Author:
vtk2jbean Automatic JavaBean wrapper for VTK.
See Also:
vtkDelaunay2D, vtkDelaunay3D, Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkOrderedTriangulator()
           
protected vtkOrderedTriangulator(int dmy)
           
 
Method Summary
 int addTetras(int id0, vtkCellArray id1)
          Add the tetrahedra classified (0=inside,1=outside) to the connectivity list provided.
 int addTetras(int id0, vtkIdList id1, vtkPoints id2)
          Add the tetrahedra classified (0=inside,1=outside) to the list of ids and coordinates provided.
 int addTetras(int id0, vtkUnstructuredGrid id1)
          Add the tetras to the unstructured grid provided.
 int addTriangles(int id0, vtkCellArray id1)
          Add the triangle faces classified (2=boundary) and attached to the specified point id to the connectivity list provided.
 int addTriangles(vtkCellArray id0)
          Add the triangle faces classified (2=boundary) to the connectivity list provided.
 java.lang.String getClassName()
          Return the class name as a string.
 int getNextTetra(int id0, vtkTetra id1, vtkDataArray id2, vtkDoubleArray id3)
          Methods to get one tetra at a time.
 int getPreSorted()
          Boolean indicates whether the points have been pre-sorted.
 int getTetras(int id0, vtkUnstructuredGrid id1)
          Initialize and add the tetras and points from the triangulation to the unstructured grid provided.
 vtkOrderedTriangulator getThisOrderedTriangulator()
           
 int getUseTemplates()
          If this flag is set, then the ordered triangulator will create and use templates for the triangulation.
 int getUseTwoSortIds()
          Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.
 void initTetraTraversal()
          Methods to get one tetra at a time.
 void initTriangulation(double[] id0, int id1)
          Initialize the triangulation process.
 void initTriangulation(double id0, double id1, double id2, double id3, double id4, double id5, int id6)
          Initialize the triangulation process.
 int insertPoint(int id0, double[] id1, double[] id2, int id3)
          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).
 int insertPoint(int id0, int id1, double[] id2, double[] id3, int id4)
          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).
 int insertPoint(int id0, int id1, int id2, double[] id3, double[] id4, int id5)
          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).
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 void preSortedOff()
          Boolean indicates whether the points have been pre-sorted.
 void preSortedOn()
          Boolean indicates whether the points have been pre-sorted.
 void setPreSorted(int id0)
          Boolean indicates whether the points have been pre-sorted.
 void setUseTemplates(int id0)
          If this flag is set, then the ordered triangulator will create and use templates for the triangulation.
 void setUseTwoSortIds(int id0)
          Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.
 void templateTriangulate(int id0, int id1, int id2)
          Perform the triangulation.
 void triangulate()
          Perform the triangulation.
 void updatePointType(int id0, int id1)
          Update the point type.
 void useTemplatesOff()
          If this flag is set, then the ordered triangulator will create and use templates for the triangulation.
 void useTemplatesOn()
          If this flag is set, then the ordered triangulator will create and use templates for the triangulation.
 void useTwoSortIdsOff()
          Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.
 void useTwoSortIdsOn()
          Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.
protected  void VTKCastInit()
           
 void VTKInit()
           
 
Methods inherited from class vtk.vtkObject
AddObserver, breakOnError, debugOff, debugOn, getDebug, getGlobalWarningDisplay, getMTime, getThisObject, globalWarningDisplayOff, globalWarningDisplayOn, hasObserver, hasObserver, invokeEvent, invokeEvent, modified, Print, PrintRevisions, register, removeObserver, removeObservers, removeObservers, setDebug, setGlobalWarningDisplay, unRegister
 
Methods inherited from class vtk.vtkObjectBase
addPropertyChangeListener, finalize, getReferenceCount, getThisObjectBase, isTypeOf, removePropertyChangeListener, setReferenceCount, VTKDelete
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changes

protected java.beans.PropertyChangeSupport changes
Constructor Detail

vtkOrderedTriangulator

public vtkOrderedTriangulator()

vtkOrderedTriangulator

protected vtkOrderedTriangulator(int dmy)
Method Detail

getThisOrderedTriangulator

public vtkOrderedTriangulator getThisOrderedTriangulator()

getClassName

public java.lang.String getClassName()
Description copied from class: vtkObjectBase
Return the class name as a string. This method is defined in all subclasses of vtkObjectBase with the vtkTypeRevisionMacro found in vtkSetGet.h.

Overrides:
getClassName in class vtkObject

isA

public int isA(java.lang.String id0)
Description copied from class: vtkObjectBase
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.

Overrides:
isA in class vtkObject

initTriangulation

public void initTriangulation(double id0,
                              double id1,
                              double id2,
                              double id3,
                              double id4,
                              double id5,
                              int id6)
Initialize the triangulation process. Provide a bounding box and the maximum number of points to be inserted.


initTriangulation

public void initTriangulation(double[] id0,
                              int id1)
Initialize the triangulation process. Provide a bounding box and the maximum number of points to be inserted.


insertPoint

public int insertPoint(int id0,
                       double[] id1,
                       double[] id2,
                       int id3)
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]. These may be the same.)


insertPoint

public int insertPoint(int id0,
                       int id1,
                       double[] id2,
                       double[] id3,
                       int id4)
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]. These may be the same.)


insertPoint

public int insertPoint(int id0,
                       int id1,
                       int id2,
                       double[] id3,
                       double[] id4,
                       int id5)
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]. These may be the same.)


triangulate

public void triangulate()
Perform the triangulation. (Complete all calls to InsertPoint() prior to invoking this method.) A special version is available when templates should be used.


templateTriangulate

public void templateTriangulate(int id0,
                                int id1,
                                int id2)
Perform the triangulation. (Complete all calls to InsertPoint() prior to invoking this method.) A special version is available when templates should be used.


updatePointType

public void updatePointType(int id0,
                            int id1)
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).


setUseTemplates

public void setUseTemplates(int id0)
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.)


getUseTemplates

public int getUseTemplates()
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.)


useTemplatesOn

public void useTemplatesOn()
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.)


useTemplatesOff

public void useTemplatesOff()
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.)


setPreSorted

public void setPreSorted(int id0)
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().)


getPreSorted

public int getPreSorted()
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().)


preSortedOn

public void preSortedOn()
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().)


preSortedOff

public void preSortedOff()
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().)


setUseTwoSortIds

public void setUseTwoSortIds(int id0)
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.


getUseTwoSortIds

public int getUseTwoSortIds()
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.


useTwoSortIdsOn

public void useTwoSortIdsOn()
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.


useTwoSortIdsOff

public void useTwoSortIdsOff()
Tells the triangulator that a second sort id is provided for each point and should also be considered when sorting.


getTetras

public int getTetras(int id0,
                     vtkUnstructuredGrid id1)
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.


addTetras

public int addTetras(int id0,
                     vtkUnstructuredGrid id1)
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.


addTetras

public int addTetras(int id0,
                     vtkCellArray id1)
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.


addTetras

public int addTetras(int id0,
                     vtkIdList id1,
                     vtkPoints id2)
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.


addTriangles

public int addTriangles(vtkCellArray id0)
Add the triangle faces classified (2=boundary) to the connectivity list provided. The method returns the number of triangles.


addTriangles

public int addTriangles(int id0,
                        vtkCellArray id1)
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().)


initTetraTraversal

public void initTetraTraversal()
Methods to get one tetra at a time. Start with InitTetraTraversal() and then invoke GetNextTetra() until the method returns 0.


getNextTetra

public int getNextTetra(int id0,
                        vtkTetra id1,
                        vtkDataArray id2,
                        vtkDoubleArray id3)
Methods to get one tetra at a time. Start with InitTetraTraversal() and then invoke GetNextTetra() until the method returns 0.


VTKInit

public void VTKInit()
Overrides:
VTKInit in class vtkObject

VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtkObject


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.