vtk
Class vtkTriangle

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

public class vtkTriangle
extends vtkCell
implements java.io.Serializable

vtkTriangle - a cell that represents a triangle. vtkTriangle is a concrete implementation of vtkCell to represent a triangle located in 3-space. JavaBean wrapper for vtkTriangle object.

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

Field Summary
protected  java.beans.PropertyChangeSupport changes
           
 
Fields inherited from class vtk.vtkObjectBase
vtkId
 
Constructor Summary
  vtkTriangle()
           
protected vtkTriangle(int dmy)
           
 
Method Summary
 int barycentricCoords(double[] id0, double[] id1, double[] id2, double[] id3, double[] id4)
          Given a 2D point x[2], determine the barycentric coordinates of the point.
 int cellBoundary(int id0, double[] id1, vtkIdList id2)
          See the vtkCell API for descriptions of these methods.
 double circumcircle(double[] id0, double[] id1, double[] id2, double[] id3)
          Compute the circumcenter (center[3]) and radius squared (method return value) of a triangle defined by the three points x1, x2, and x3.
 void clip(double id0, vtkDataArray id1, vtkPointLocator id2, vtkCellArray id3, vtkPointData id4, vtkPointData id5, vtkCellData id6, int id7, vtkCellData id8, int id9)
          Clip this triangle using scalar value provided.
 void computeNormal(double[] id0, double[] id1, double[] id2, double[] id3)
          Compute the triangle normal from three points.
 void computeNormalDirection(double[] id0, double[] id1, double[] id2, double[] id3)
          Compute the (unnormalized) triangle normal direction from three points.
 void computeQuadric(double[] id0, double[] id1, double[] id2, vtkQuadric id3)
          Calculate the error quadric for this triangle.
 void contour(double id0, vtkDataArray id1, vtkPointLocator id2, vtkCellArray id3, vtkCellArray id4, vtkCellArray id5, vtkPointData id6, vtkPointData id7, vtkCellData id8, int id9, vtkCellData id10)
          See the vtkCell API for descriptions of these methods.
 int getCellDimension()
          See the vtkCell API for descriptions of these methods.
 int getCellType()
          See the vtkCell API for descriptions of these methods.
 java.lang.String getClassName()
          Return the class name as a string.
 vtkCell getEdge(int id0)
          Get the edge specified by edgeId (range 0 to 2) and return that edge's coordinates.
 vtkCell getFace(int id0)
          See the vtkCell API for descriptions of these methods.
 int getNumberOfEdges()
          See the vtkCell API for descriptions of these methods.
 int getNumberOfFaces()
          See the vtkCell API for descriptions of these methods.
 int getParametricCenter(double[] id0)
          Return the center of the triangle in parametric coordinates.
 double getParametricDistance(double[] id0)
          Return the distance of the parametric coordinate provided to the cell.
 vtkTriangle getThisTriangle()
           
 int isA(java.lang.String id0)
          Return 1 if this class is the same type of (or a subclass of) the named class.
 int pointInTriangle(double[] id0, double[] id1, double[] id2, double[] id3, double id4)
          Given a point x, determine whether it is inside (within the tolerance squared, tol2) the triangle defined by the three coordinate values p1, p2, p3.
 int projectTo2D(double[] id0, double[] id1, double[] id2, double[] id3, double[] id4, double[] id5)
          Project triangle defined in 3D to 2D coordinates.
 double triangleArea(double[] id0, double[] id1, double[] id2)
          Compute the area of a triangle in 3D.
 void triangleCenter(double[] id0, double[] id1, double[] id2, double[] id3)
          Compute the center of the triangle.
 int triangulate(int id0, vtkIdList id1, vtkPoints id2)
          See the vtkCell API for descriptions of these methods.
protected  void VTKCastInit()
           
 void VTKInit()
           
 
Methods inherited from class vtk.vtkCell
deepCopy, getBounds, getBounds, getLength2, getNumberOfPoints, getPointId, getPointIds, getPoints, getThisCell, initialize, isExplicitCell, isLinear, isPrimaryCell, requiresInitialization, shallowCopy
 
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

vtkTriangle

public vtkTriangle()

vtkTriangle

protected vtkTriangle(int dmy)
Method Detail

getThisTriangle

public vtkTriangle getThisTriangle()

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 vtkCell

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 vtkCell

getEdge

public vtkCell getEdge(int id0)
Get the edge specified by edgeId (range 0 to 2) and return that edge's coordinates.

Overrides:
getEdge in class vtkCell

getCellType

public int getCellType()
See the vtkCell API for descriptions of these methods.

Overrides:
getCellType in class vtkCell

getCellDimension

public int getCellDimension()
See the vtkCell API for descriptions of these methods.

Overrides:
getCellDimension in class vtkCell

getNumberOfEdges

public int getNumberOfEdges()
See the vtkCell API for descriptions of these methods.

Overrides:
getNumberOfEdges in class vtkCell

getNumberOfFaces

public int getNumberOfFaces()
See the vtkCell API for descriptions of these methods.

Overrides:
getNumberOfFaces in class vtkCell

getFace

public vtkCell getFace(int id0)
See the vtkCell API for descriptions of these methods.

Overrides:
getFace in class vtkCell

cellBoundary

public int cellBoundary(int id0,
                        double[] id1,
                        vtkIdList id2)
See the vtkCell API for descriptions of these methods.

Overrides:
cellBoundary in class vtkCell

contour

public void contour(double id0,
                    vtkDataArray id1,
                    vtkPointLocator id2,
                    vtkCellArray id3,
                    vtkCellArray id4,
                    vtkCellArray id5,
                    vtkPointData id6,
                    vtkPointData id7,
                    vtkCellData id8,
                    int id9,
                    vtkCellData id10)
See the vtkCell API for descriptions of these methods.

Overrides:
contour in class vtkCell

triangulate

public int triangulate(int id0,
                       vtkIdList id1,
                       vtkPoints id2)
See the vtkCell API for descriptions of these methods.

Overrides:
triangulate in class vtkCell

clip

public void clip(double id0,
                 vtkDataArray id1,
                 vtkPointLocator id2,
                 vtkCellArray id3,
                 vtkPointData id4,
                 vtkPointData id5,
                 vtkCellData id6,
                 int id7,
                 vtkCellData id8,
                 int id9)
Clip this triangle using scalar value provided. Like contouring, except that it cuts the triangle to produce other triangles.

Overrides:
clip in class vtkCell

getParametricCenter

public int getParametricCenter(double[] id0)
Return the center of the triangle in parametric coordinates.

Overrides:
getParametricCenter in class vtkCell

getParametricDistance

public double getParametricDistance(double[] id0)
Return the distance of the parametric coordinate provided to the cell. If inside the cell, a distance of zero is returned.

Overrides:
getParametricDistance in class vtkCell

triangleCenter

public void triangleCenter(double[] id0,
                           double[] id1,
                           double[] id2,
                           double[] id3)
Compute the center of the triangle.


triangleArea

public double triangleArea(double[] id0,
                           double[] id1,
                           double[] id2)
Compute the area of a triangle in 3D.


circumcircle

public double circumcircle(double[] id0,
                           double[] id1,
                           double[] id2,
                           double[] id3)
Compute the circumcenter (center[3]) and radius squared (method return value) of a triangle defined by the three points x1, x2, and x3. (Note that the coordinates are 2D. 3D points can be used but the z-component will be ignored.)


barycentricCoords

public int barycentricCoords(double[] id0,
                             double[] id1,
                             double[] id2,
                             double[] id3,
                             double[] id4)
Given a 2D point x[2], determine the barycentric coordinates of the point. Barycentric coordinates are a natural coordinate system for simplices that express a position as a linear combination of the vertices. For a triangle, there are three barycentric coordinates (because there are three vertices), and the sum of the coordinates must equal 1. If a point x is inside a simplex, then all three coordinates will be strictly positive. If two coordinates are zero (so the third =1), then the point x is on a vertex. If one coordinates are zero, the point x is on an edge. In this method, you must specify the vertex coordinates x1->x3. Returns 0 if triangle is degenerate.


projectTo2D

public int projectTo2D(double[] id0,
                       double[] id1,
                       double[] id2,
                       double[] id3,
                       double[] id4,
                       double[] id5)
Project triangle defined in 3D to 2D coordinates. Returns 0 if degenerate triangle; non-zero value otherwise. Input points are x1->x3; output 2D points are v1->v3.


computeNormal

public void computeNormal(double[] id0,
                          double[] id1,
                          double[] id2,
                          double[] id3)
Compute the triangle normal from three points.


computeNormalDirection

public void computeNormalDirection(double[] id0,
                                   double[] id1,
                                   double[] id2,
                                   double[] id3)
Compute the (unnormalized) triangle normal direction from three points.


pointInTriangle

public int pointInTriangle(double[] id0,
                           double[] id1,
                           double[] id2,
                           double[] id3,
                           double id4)
Given a point x, determine whether it is inside (within the tolerance squared, tol2) the triangle defined by the three coordinate values p1, p2, p3. Method is via comparing dot products. (Note: in current implementation the tolerance only works in the neighborhood of the three vertices of the triangle.


computeQuadric

public void computeQuadric(double[] id0,
                           double[] id1,
                           double[] id2,
                           vtkQuadric id3)
Calculate the error quadric for this triangle. Return the quadric as a 4x4 matrix or a vtkQuadric. (from Peter Lindstrom's Siggraph 2000 paper, "Out-of-Core Simplification of Large Polygonal Models")


VTKInit

public void VTKInit()
Overrides:
VTKInit in class vtkObject

VTKCastInit

protected void VTKCastInit()
Overrides:
VTKCastInit in class vtkCell


Copyright © 2004 Sydney ViSLAB. All Rights Reserved.