Documentation for vtkPolyData

vtkPolyData - concrete dataset represents vertices, lines, polygons, and triangle strips

Super Class: vtkPointSet

Description:

vtkPolyData is a data object that is a concrete implementation of vtkDataSet. vtkPolyData represents a geometric structure consisting of vertices, lines, polygons, and triangle strips. Point attribute values (e.g., scalars, vectors, etc.) also are represented. The actual cell types (CellType.h) supported by vtkPolyData are: vtkVertex, vtkPolyVertex, vtkLine, vtkPolyLine, vtkTriangle, vtkTriangleStrip, vtkPolygon, vtkPixel, and vtkQuad. One important feature of vtkPolyData objects is that special traversal and data manipulation methods are available to process data. These methods are generally more efficient than vtkDataSet methods and should be used whenever possible. For example, traversing the cells in a dataset we would use GetCell(). To traverse cells with vtkPolyData we would retrieve the cell array object representing polygons (for example) and then use vtkCellArray's InitTraversal() and GetNextCell() methods.

 

Methods:

void vtkPolyData ()
void vtkPolyData (const vtkPolyData &)
void vtkPolyData ()
static vtkPolyData *New ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
vtkDataObject *MakeObject ()
int GetDataSetType ()
void CopyStructure (vtkDataSet *)
int GetNumberOfCells ()
vtkCell *GetCell (int )
int GetCellType (int )
void GetCellPoints (int ,vtkIdList *)
void GetPointCells (int ,vtkIdList *)
void Squeeze ()
int GetMaxCellSize ()
void SetVerts (vtkCellArray *)
vtkCellArray *GetVerts ()
void SetLines (vtkCellArray *)
vtkCellArray *GetLines ()
void SetPolys (vtkCellArray *)
vtkCellArray *GetPolys ()
void SetStrips (vtkCellArray *)
vtkCellArray *GetStrips ()
int GetNumberOfVerts ()
int GetNumberOfLines ()
int GetNumberOfPolys ()
int GetNumberOfStrips ()
void Allocate (int ,int )
int InsertNextCell (int ,int ,int *)
int InsertNextCell (int ,vtkIdList *)
void Reset ()
void BuildCells ()
void BuildLinks ()
void GetPointCells (int ,unsigned short & ,int )
void GetCellEdgeNeighbors (int ,int ,int ,vtkIdList *)
void GetCellPoints (int ,int & ,int )
int IsTriangle (int ,int ,int )
int IsEdge (int ,int )
int IsPointUsedByCell (int ,int )
void ReplaceCell (int ,int ,int *)
void ReplaceCellPoint (int ,int ,int )
void ReverseCell (int )
void DeletePoint (int )
void DeleteCell (int )
int InsertNextLinkedPoint (float ,int )
int InsertNextLinkedCell (int ,int ,int *)
void ReplaceLinkedCell (int ,int ,int *)
void RemoveCellReference (int )
void AddCellReference (int )
void RemoveReferenceToCell (int ,int )
void AddReferenceToCell (int ,int )
void ResizeCellList (int ,int )
void Initialize ()
void GetCellPoints (int ,vtkIdList &)
void GetPointCells (int ,vtkIdList &)
int InsertNextCell (int ,vtkIdList &)
void GetCellEdgeNeighbors (int ,int ,int ,vtkIdList &)

 

Detailed Method Descriptions:

Create a similar type object

vtkDataObject *MakeObject ()

Return what type of dataset this is.

int GetDataSetType ()

Copy the geometric and topological structure of an input poly data object.

void CopyStructure (vtkDataSet *)

Standard vtkDataSet interface.

int GetNumberOfCells ()
vtkCell *GetCell (int )
int GetCellType (int )

Copy a cells point ids into list provided. (Less efficient.)

void GetCellPoints (int ,vtkIdList *)

Efficient method to obtain cells using a particular point. Make sure that routine BuildLinks() has been called.

void GetPointCells (int ,vtkIdList *)

Recover extra allocated memory when creating data whose initial size is unknown. Examples include using the InsertNextCell() method, or when using the CellArray::EstimateSize() method to create vertices, lines, polygons, or triangle strips.

void Squeeze ()

Return the maximum cell size in this poly data.

int GetMaxCellSize ()

Set the cell array defining vertices.

void SetVerts (vtkCellArray *)

Get the cell array defining vertices. If there are no vertices, an empty array will be returned (convenience to simplify traversal).

vtkCellArray *GetVerts ()

Set the cell array defining lines.

void SetLines (vtkCellArray *)

Get the cell array defining lines. If there are no lines, an empty array will be returned (convenience to simplify traversal).

vtkCellArray *GetLines ()

Set the cell array defining polygons.

void SetPolys (vtkCellArray *)

Get the cell array defining polygons. If there are no polygons, an empty array will be returned (convenience to simplify traversal).

vtkCellArray *GetPolys ()

Set the cell array defining triangle strips.

void SetStrips (vtkCellArray *)

Get the cell array defining triangle strips. If there are no triangle strips, an empty array will be returned (convenience to simplify traversal).

vtkCellArray *GetStrips ()

Return the number of primitives of a particular type held..

int GetNumberOfVerts ()
int GetNumberOfLines ()
int GetNumberOfPolys ()
int GetNumberOfStrips ()

Method allocates initial storage for vertex, line, polygon, and triangle strip arrays. Use this method before the method PolyData::InsertNextCell(). (Or, provide vertex, line, polygon, and triangle strip cell arrays.)

void Allocate (int ,int )

Insert a cell of type vtkVERTEX, vtkPOLY_VERTEX, vtkLINE, vtkPOLY_LINE, vtkTRIANGLE, vtkQUAD, vtkPOLYGON, or vtkTRIANGLE_STRIP. Make sure that the PolyData::Allocate() function has been called first or that vertex, line, polygon, and triangle strip arrays have been supplied. Note: will also insert vtkPIXEL, but converts it to vtkQUAD.

int InsertNextCell (int ,int ,int *)

Insert a cell of type VTK_VERTEX, VTK_POLY_VERTEX, VTK_LINE, VTK_POLY_LINE, VTK_TRIANGLE, VTK_QUAD, VTK_POLYGON, or VTK_TRIANGLE_STRIP. Make sure that the PolyData::Allocate() function has been called first or that vertex, line, polygon, and triangle strip arrays have been supplied. Note: will also insert VTK_PIXEL, but converts it to VTK_QUAD.

int InsertNextCell (int ,vtkIdList *)

Begin inserting data all over again. Memory is not freed but otherwise objects are returned to their initial state.

void Reset ()

Create data structure that allows random access of cells.

void BuildCells ()

Create upward links from points to cells that use each point. Enables topologically complex queries.

void BuildLinks ()

Special (efficient) operations on poly data. Use carefully.

void GetPointCells (int ,unsigned short & ,int )

Get the neighbors at an edge. More efficient than the general GetCellNeighbors(). Assumes links have been built (with BuildLinks()), and looks specifically for edge neighbors.

void GetCellEdgeNeighbors (int ,int ,int ,vtkIdList *)

Return a pointer to a list of point ids defining cell. (More efficient.) Assumes that cells have been built (with BuildCells()).

void GetCellPoints (int ,int & ,int )

Given three vertices, determine whether it's a triangle. Make sure BuildLinks() has been called first.

int IsTriangle (int ,int ,int )

Determine whether two points form an edge. If they do, return non-zero. Make sure BuildLinks() has been called first.

int IsEdge (int ,int )

Determine whether a point is used by a particular cell. If it is, return non-zero. Make sure BuildCells() has been called first.

int IsPointUsedByCell (int ,int )

Replace the points defining cell "cellId" with a new set of points. This operator is (typically) used when links from points to cells have not been built (i.e., BuildLinks() has not been executed). Use the operator ReplaceLinkedCell() to replace a cell when cell structure has been built.

void ReplaceCell (int ,int ,int *)

Replace a point in the cell connectivity list with a different point.

void ReplaceCellPoint (int ,int ,int )

Reverse the order of point ids defining the cell.

void ReverseCell (int )

Mark a point/cell as deleted from this vtkPolyData.

void DeletePoint (int )
void DeleteCell (int )

Add a point to the cell data structure (after cell pointers have been built). This method adds the point and then allocates memory for the links to the cells. (To use this method, make sure points are available and BuildLinks() has been invoked.)

int InsertNextLinkedPoint (float ,int )

Add a new cell to the cell data structure (after cell pointers have been built). This method adds the cell and then updates the links from the points to the cells. (Memory is allocated as necessary.)

int InsertNextLinkedCell (int ,int ,int *)

Replace one cell with another in cell structure. This operator updates the connectivity list and the point's link list. It does not delete references to the old cell in the point's link list. Use the operator RemoveCellReference() to delete all references from points to (old) cell. You may also want to consider using the operator ResizeCellList() if the link list is changing size.

void ReplaceLinkedCell (int ,int ,int *)

Remove all references to cell in cell structure. This means the links from the cell's points to the cell are deleted. Memory is not reclaimed. Use the method ResizeCellList() to resize the link list from a point to its using cells. (This operator assumes BuildLinks() has been called.)

void RemoveCellReference (int )

Add references to cell in cell structure. This means the links from the cell's points to the cell are modified. Memory is not extended. Use the method ResizeCellList() to resize the link list from a point to its using cells. (This operator assumes BuildLinks() has been called.)

void AddCellReference (int )

Remove a reference to a cell in a particular point's link list. You may also consider using RemoveCellReference() to remove the references from all the cell's points to the cell. This operator does not reallocate memory; use the operator ResizeCellList() to do this if necessary.

void RemoveReferenceToCell (int ,int )

Add a reference to a cell in a particular point's link list. (You may also consider using AddCellReference() to add the references from all the cell's points to the cell.) This operator does not realloc memory; use the operator ResizeCellList() to do this if necessary.

void AddReferenceToCell (int ,int )

Resize the list of cells using a particular point. (This operator assumes that BuildLinks() has been called.)

void ResizeCellList (int ,int )

Restore object to initial state. Release memory back to system.

void Initialize ()

For legacy compatibility. Do not use.

void GetCellPoints (int ,vtkIdList &)
void GetPointCells (int ,vtkIdList &)
int InsertNextCell (int ,vtkIdList &)