NAME
vtkCellArray - object represents cell connectivity
SYNOPSIS
#include "/opt/vtk-c++/common/vtkCellArray.h"
class VTK_EXPORT vtkCellArray : public vtkReferenceCount
vtkCellArray();
vtkCellArray (const int sz, const int ext=1000);
vtkCellArray(const vtkCellArray& ca);
~vtkCellArray();
int Allocate(const int sz, const int ext=1000)
{return this->Ia->Allocate(sz,ext);};
void Initialize() {this->Ia->Initialize();};
static vtkCellArray *New() {return new vtkCellArray;};
const char *GetClassName() {return "vtkCellArray";};
int GetNumberOfCells();
int EstimateSize(int numCells, int maxPtsPerCell);
void InitTraversal();
int GetNextCell(int& npts, int* &pts);
int GetSize();
int GetNumberOfConnectivityEntries();
void GetCell(int loc, int &npts, int* &pts);
int InsertNextCell(vtkCell *cell);
int InsertNextCell(int npts, int* pts);
int InsertNextCell(vtkIdList &pts);
Advantages of this data structure are its compactness, simplicity, and easy interface to external data. However, it
is totally inadequate for random access. This functionality (when necessary) is accomplished by using the vtkCellTypes and vtkCellLinks objects to extend the definition of the data structure.
SEE ALSO
vtkCellTypes vtkCellLinks
SUMMARY
int GetNumberOfCells()
Get the number of cells in the array.
int InsertNextCell(int npts, int* pts)
Create a cell by specifying the number of points and an array of point id's.
int InsertNextCell(vtkIdList &pts)
Create a cell by specifying a list of point ids.
int InsertNextCell(int npts)
Create cells by specifying count, and then adding points one at a time using method InsertCellPoint(). If you don't know the count initially, use the method UpdateCellCount() to complete the cell.
void InsertCellPoint(int id)
Used in conjunction with InsertNextCell(int npts) to add another point to the list of cells.
void UpdateCellCount(int npts)
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of points defining the cell.
int InsertNextCell(vtkCell *cell)
Insert a cell object.
int EstimateSize(int numCells, int maxPtsPerCell)
Utility routines help manage memory of cell array. EstimateSize() returns a value used to initialize and allocate memory for array based on number of cells and maximum number of points making up cell. If every cell is the same size (in terms of number of points), then the memory estimate is guaranteed exact. (If not exact, use Squeeze() to reclaim any extra memory.)
void Reset()
Reuse list. Reset to initial condition.
void Squeeze()
Reclaim any extra memory.
void InitTraversal()
A cell traversal methods that is more efficient than vtkDataSet traversal methods. InitTraversal() initializes the traversal of the list of cells.
int GetNextCell(int& npts, int* &pts)
A cell traversal methods that is more efficient than vtkDataSet traversal methods. GetNextCell() gets the next cell in the list. If end of list is encountered, 0 is returned.
int GetSize()
Get the size of the allocated connectivity array.
int GetNumberOfConnectivityEntries()
Get the total number of entries (i.e., data values) in the connectivity array. This may be much less than the allocated size (i.e., return value from GetSize().)
void GetCell(int loc, int &npts, int* &pts)
Internal method used to retrieve a cell given an offset into the internal array.
int GetLocation(int npts)
Computes the current location within the internal array. Used in conjunction with GetCell(int loc,...).
void ReverseCell(int loc)
Special method inverts ordering of current cell. Must be called carefully or the cell topology may be corrupted.
void ReplaceCell(int loc, int npts, int *pts)
Replace the point ids of the cell with a different list of point ids.
int *GetPointer()
Get pointer to array of cell data.
int *WritePointer(const int ncells, const int size)
Get pointer to data array for purpose of direct writes of data. Size is the total storage consumed by the cell array. ncells is the number of cells represented in the array.
int GetMaxCellSize()
Returns the size of the largest cell. The size is the number of points defining the cell.