Documentation for vtkTriangle

vtkTriangle - a cell that represents a triangle

Super Class: vtkCell

Description:

vtkTriangle is a concrete implementation of vtkCell to represent a triangle located in 3-space.

 

Methods:

void vtkTriangle ()
void vtkTriangle ()
static vtkTriangle *New ()
const char *GetClassName ()
vtkCell *MakeObject ()
vtkCell *GetEdge (int )
int GetCellType ()
int GetCellDimension ()
int GetNumberOfEdges ()
int GetNumberOfFaces ()
vtkCell *GetFace (int )
int CellBoundary (int ,float ,vtkIdList *)
void Contour (float ,vtkScalars * ,vtkPointLocator * ,vtkCellArray * ,vtkCellArray * ,vtkCellArray * ,vtkPointData * ,vtkPointData * ,vtkCellData * ,int ,vtkCellData *)
int EvaluatePosition (float ,float ,int & ,float ,float & ,float *)
void EvaluateLocation (int & ,float ,float ,float *)
int Triangulate (int ,vtkIdList * ,vtkPoints *)
void Derivatives (int ,float ,float * ,int ,float *)
void Clip (float ,vtkScalars * ,vtkPointLocator * ,vtkCellArray * ,vtkPointData * ,vtkPointData * ,vtkCellData * ,int ,vtkCellData * ,int )
int IntersectWithLine (float ,float ,float ,float & ,float ,float ,int &)
int GetParametricCenter (float )
static void TriangleCenter (float ,float ,float ,float )
static float TriangleArea (float ,float ,float )
static float Circumcircle (float ,float ,float ,float )
static int BarycentricCoords (float ,float ,float ,float ,float )
static int ProjectTo2D (float ,float ,float ,float ,float ,float )
static void ComputeNormal (vtkPoints * ,int ,int * ,float )
static void ComputeNormal (float ,float ,float ,float )
static int PointInTriangle (float ,float ,float ,float ,float )
int CellBoundary (int ,float ,vtkIdList &)
int Triangulate (int ,vtkIdList & ,vtkPoints &)

 

Detailed Method Descriptions:

Create a new cell and copy this triangle's information into the cell. Returns a poiner to the new cell created.

vtkCell *MakeObject ()

Get the edge specified by edgeId (range 0 to 2) and return that edge's coordinates.

vtkCell *GetEdge (int )

See the vtkCell API for descriptions of these methods.

int GetCellType ()
int GetCellDimension ()
int GetNumberOfEdges ()
int GetNumberOfFaces ()
vtkCell *GetFace (int )
int CellBoundary (int ,float ,vtkIdList *)
void Contour (float ,vtkScalars * ,vtkPointLocator * ,vtkCellArray * ,vtkCellArray * ,vtkCellArray * ,vtkPointData * ,vtkPointData * ,vtkCellData * ,int ,vtkCellData *)
int EvaluatePosition (float ,float ,int & ,float ,float & ,float *)
void EvaluateLocation (int & ,float ,float ,float *)
int Triangulate (int ,vtkIdList * ,vtkPoints *)
void Derivatives (int ,float ,float * ,int ,float *)

Clip this triangle using scalar value provided. Like contouring, except that it cuts the triangle to produce other triangles.

void Clip (float ,vtkScalars * ,vtkPointLocator * ,vtkCellArray * ,vtkPointData * ,vtkPointData * ,vtkCellData * ,int ,vtkCellData * ,int )

Plane intersection plus in/out test on triangle. The in/out test is performed using tol as the tolerance.

int IntersectWithLine (float ,float ,float ,float & ,float ,float ,int &)

Return the center of the triangle in parametric coordinates.

int GetParametricCenter (float )

Compute the center of the triangle.

static void TriangleCenter (float ,float ,float ,float )

Compute the area of a triangle in 3D.

static float TriangleArea (float ,float ,float )

Compute the circumcenter (center[3]) and radius (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.)

static float Circumcircle (float ,float ,float ,float )

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 fourthree 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.

static int BarycentricCoords (float ,float ,float ,float ,float )

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.

static int ProjectTo2D (float ,float ,float ,float ,float ,float )

Compute the triangle normal from a points list, and a list of point ids that index into the points list.

static void ComputeNormal (vtkPoints * ,int ,int * ,float )

Compute the triangle normal from three points.

static void ComputeNormal (float ,float ,float ,float )

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.

static int PointInTriangle (float ,float ,float ,float ,float )

For legacy compatibility. Do not use.

int CellBoundary (int ,float ,vtkIdList &)