Documentation for vtkPolygon

vtkPolygon - a cell that represents an n-sided polygon

Super Class: vtkCell

Description:

vtkPolygon is a concrete implementation of vtkCell to represent a 2D n-sided polygon. The polygons cannot have any internal holes, and cannot self-intersect.

 

Methods:

void vtkPolygon ()
void vtkPolygon ()
static vtkPolygon *New ()
const char *GetClassName ()
vtkCell *MakeObject ()
int GetCellType ()
int GetCellDimension ()
int GetNumberOfEdges ()
int GetNumberOfFaces ()
vtkCell *GetEdge (int )
vtkCell *GetFace (int )
int CellBoundary (int ,float ,vtkIdList *)
void Contour (float ,vtkScalars * ,vtkPointLocator * ,vtkCellArray * ,vtkCellArray * ,vtkCellArray * ,vtkPointData * ,vtkPointData * ,vtkCellData * ,int ,vtkCellData *)
void Clip (float ,vtkScalars * ,vtkPointLocator * ,vtkCellArray * ,vtkPointData * ,vtkPointData * ,vtkCellData * ,int ,vtkCellData * ,int )
int EvaluatePosition (float ,float ,int & ,float ,float & ,float *)
void EvaluateLocation (int & ,float ,float ,float *)
int IntersectWithLine (float ,float ,float ,float & ,float ,float ,int &)
int Triangulate (int ,vtkIdList * ,vtkPoints *)
void Derivatives (int ,float ,float * ,int ,float *)
static void ComputeNormal (vtkPoints * ,int ,int * ,float )
static void ComputeNormal (vtkPoints * ,float )
static void ComputeNormal (int ,float * ,float )
void ComputeWeights (float ,float *)
int ParameterizePolygon (float ,float ,float & ,float ,float & ,float )
static int PointInPolygon (float ,int ,float * ,float ,float )
int Triangulate (vtkIdList *)
int RecursiveTriangulate (int ,int *)
int CanSplitLoop (int ,int ,int * ,int & ,int * ,int & ,int *)
void SplitLoop (int ,int ,int * ,int & ,int * ,int & ,int *)
static int IntersectPolygonWithPolygon (int ,float * ,float ,int ,float * ,float ,float ,float )
int CellBoundary (int ,float ,vtkIdList &)
int Triangulate (int ,vtkIdList & ,vtkPoints &)
int Triangulate (vtkIdList &)

 

Detailed Method Descriptions:

See the vtkCell API for descriptions of these methods.

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

Polygon specific

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

Compute the polygon normal from an array of points. This version assumes that the polygon is convex, and looks for the first valid normal.

static void ComputeNormal (int ,float * ,float )

Compute interpolation weights using 1/r**2 normalized sum.

void ComputeWeights (float ,float *)

Create a local s-t coordinate system for a polygon. The point p0 is the origin of the local system, p10 is s-axis vector, and p20 is the t-axis vector. (These are expressed in the modelling coordinate system and are vectors of dimension [3].) The values l20 and l20 are the lengths of the vectors p10 and p20, and n is the polygon normal.

int ParameterizePolygon (float ,float ,float & ,float ,float & ,float )

Determine whether point is inside polygon. Function uses ray-casting to determine if point is inside polygon. Works for arbitrary polygon shape (e.g., non-convex). Returns 0 if point is not in polygon; 1 if it is. Can also return -1 to indicate degenerate polygon.

static int PointInPolygon (float ,int ,float * ,float ,float )

Triangulate polygon. Tries to use the fast triangulation technique first, and if that doesn't work, uses more complex routine that is guaranteed to work.

int Triangulate (vtkIdList *)

A fast triangulation method. Uses recursive divide and conquer based on plane splitting to reduce loop into triangles. The cell (e.g., triangle) is presumed properly initialized (i.e., Points and PointIds).

int RecursiveTriangulate (int ,int *)

Determine whether the loop can be split. Determines this by first checking to see whether points in each loop are on opposite sides of the split plane. If so, then the loop can be split; otherwise see whether one of the loops has all its points on one side of the split plane and the split line is inside the polygon.

int CanSplitLoop (int ,int ,int * ,int & ,int * ,int & ,int *)

Creates two loops from splitting plane provided

void SplitLoop (int ,int ,int * ,int & ,int * ,int & ,int *)

Method intersects two polygons. You must supply the number of points and point coordinates (npts, *pts) and the bounding box (bounds) of the two polygons. Also supply a tolerance squared for controlling error. The method returns 1 if there is an intersection, and 0 if not. A single point of intersection x[3] is also returned if there is an intersection.

static int IntersectPolygonWithPolygon (int ,float * ,float ,int ,float * ,float ,float ,float )

For legacy compatibility. Do not use.

int CellBoundary (int ,float ,vtkIdList &)
int Triangulate (int ,vtkIdList & ,vtkPoints &)