Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkCellArray Class Reference

#include <vtkCellArray.h>

Inheritance diagram for vtkCellArray:

Inheritance graph
[legend]
Collaboration diagram for vtkCellArray:

Collaboration graph
[legend]
List of all members.

Detailed Description

object to represent cell connectivity

vtkCellArray is a supporting object that explicitly represents cell connectivity. The cell array structure is a raw integer list of the form: (n,id1,id2,...,idn, n,id1,id2,...,idn, ...) where n is the number of points in the cell, and id is a zero-offset index into an associated point list.

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
Examples:
vtkCellArray (Examples)
Tests:
vtkCellArray (Tests)

Definition at line 48 of file vtkCellArray.h.
int Allocate (const vtkIdType sz, const int ext=1000)
static vtkCellArrayNew ()

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void InitTraversal ()
void GetCell (vtkIdType loc, vtkIdType &npts, vtkIdType *&pts)
vtkIdType InsertNextCell (vtkCell *cell)
vtkIdType InsertNextCell (vtkIdType npts, const vtkIdType *pts)
vtkIdType InsertNextCell (vtkIdList *pts)
vtkIdType InsertNextCell (int npts)
void InsertCellPoint (vtkIdType id)
void ReverseCell (vtkIdType loc)
void ReplaceCell (vtkIdType loc, int npts, const vtkIdType *pts)
vtkIdTypeWritePointer (const vtkIdType ncells, const vtkIdType size)
void SetCells (vtkIdType ncells, vtkIdTypeArray *cells)
unsigned long GetActualMemorySize ()
void Initialize ()
virtual vtkIdType GetNumberOfCells ()
virtual void SetNumberOfCells (vtkIdType)
vtkIdType EstimateSize (vtkIdType numCells, int maxPtsPerCell)
int GetNextCell (vtkIdType &npts, vtkIdType *&pts)
vtkIdType GetSize ()
vtkIdType GetNumberOfConnectivityEntries ()
void UpdateCellCount (int npts)
vtkIdType GetInsertLocation (int npts)
vtkIdType GetTraversalLocation ()
void SetTraversalLocation (vtkIdType loc)
vtkIdType GetTraversalLocation (vtkIdType npts)
int GetMaxCellSize ()
vtkIdTypeGetPointer ()
void DeepCopy (vtkCellArray *ca)
vtkIdTypeArrayGetData ()
void Reset ()
void Squeeze ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkCellArraySafeDownCast (vtkObject *o)

Protected Member Functions

 vtkCellArray ()
 ~vtkCellArray ()

Protected Attributes

vtkIdType NumberOfCells
vtkIdType InsertLocation
vtkIdType TraversalLocation
vtkIdTypeArrayIa


Member Typedef Documentation

typedef vtkObject vtkCellArray::Superclass
 

Reimplemented from vtkObject.

Definition at line 51 of file vtkCellArray.h.


Constructor & Destructor Documentation

vtkCellArray::vtkCellArray  )  [protected]
 

vtkCellArray::~vtkCellArray  )  [protected]
 


Member Function Documentation

virtual const char* vtkCellArray::GetClassName  )  [virtual]
 

Reimplemented from vtkObject.

static int vtkCellArray::IsTypeOf const char *  type  )  [static]
 

Return 1 if this class type 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.

Reimplemented from vtkObject.

virtual int vtkCellArray::IsA const char *  type  )  [virtual]
 

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.

Reimplemented from vtkObject.

static vtkCellArray* vtkCellArray::SafeDownCast vtkObject o  )  [static]
 

Reimplemented from vtkObject.

void vtkCellArray::PrintSelf ostream &  os,
vtkIndent  indent
[virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

static vtkCellArray* vtkCellArray::New  )  [static]
 

Instantiate cell array (connectivity list).

Reimplemented from vtkObject.

int vtkCellArray::Allocate const vtkIdType  sz,
const int  ext = 1000
[inline]
 

Allocate memory and set the size to extend by.

Definition at line 59 of file vtkCellArray.h.

void vtkCellArray::Initialize  )  [inline]
 

Free any memory and reset to an empty state.

Definition at line 65 of file vtkCellArray.h.

virtual vtkIdType vtkCellArray::GetNumberOfCells  )  [virtual]
 

Get the number of cells in the array.

virtual void vtkCellArray::SetNumberOfCells vtkIdType   )  [virtual]
 

Set the number of cells in the array. DO NOT do any kind of allocation, advanced use only.

vtkIdType vtkCellArray::EstimateSize vtkIdType  numCells,
int  maxPtsPerCell
[inline]
 

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

Definition at line 87 of file vtkCellArray.h.

void vtkCellArray::InitTraversal  )  [inline]
 

A cell traversal methods that is more efficient than vtkDataSet traversal methods. InitTraversal() initializes the traversal of the list of cells.

Definition at line 94 of file vtkCellArray.h.

int vtkCellArray::GetNextCell vtkIdType npts,
vtkIdType *&  pts
[inline]
 

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.

Definition at line 323 of file vtkCellArray.h.

References vtkDataArray::GetMaxId(), vtkIdTypeArray::GetPointer(), vtkIdTypeArray::GetValue(), Ia, and TraversalLocation.

vtkIdType vtkCellArray::GetSize  )  [inline]
 

Get the size of the allocated connectivity array.

Definition at line 103 of file vtkCellArray.h.

vtkIdType vtkCellArray::GetNumberOfConnectivityEntries  )  [inline]
 

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().)

Definition at line 111 of file vtkCellArray.h.

void vtkCellArray::GetCell vtkIdType  loc,
vtkIdType npts,
vtkIdType *&  pts
[inline]
 

Internal method used to retrieve a cell given an offset into the internal array.

Definition at line 340 of file vtkCellArray.h.

References vtkIdTypeArray::GetPointer(), vtkIdTypeArray::GetValue(), and Ia.

vtkIdType vtkCellArray::InsertNextCell vtkCell cell  )  [inline]
 

Insert a cell object. Return the cell id of the cell.

Definition at line 296 of file vtkCellArray.h.

References vtkIdList::GetId(), vtkDataArray::GetMaxId(), vtkCell::GetNumberOfPoints(), Ia, InsertLocation, NumberOfCells, vtkCell::PointIds, and vtkIdTypeArray::WritePointer().

vtkIdType vtkCellArray::InsertNextCell vtkIdType  npts,
const vtkIdType pts
[inline]
 

Create a cell by specifying the number of points and an array of point id's. Return the cell id of the cell.

Definition at line 239 of file vtkCellArray.h.

References vtkDataArray::GetMaxId(), Ia, InsertLocation, NumberOfCells, and vtkIdTypeArray::WritePointer().

vtkIdType vtkCellArray::InsertNextCell vtkIdList pts  )  [inline]
 

Create a cell by specifying a list of point ids. Return the cell id of the cell.

Definition at line 257 of file vtkCellArray.h.

References vtkIdList::GetId(), vtkDataArray::GetMaxId(), vtkIdList::GetNumberOfIds(), Ia, InsertLocation, NumberOfCells, and vtkIdTypeArray::WritePointer().

vtkIdType vtkCellArray::InsertNextCell int  npts  )  [inline]
 

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. Return the cell id of the cell.

Definition at line 275 of file vtkCellArray.h.

References Ia, InsertLocation, vtkIdTypeArray::InsertNextValue(), and NumberOfCells.

void vtkCellArray::InsertCellPoint vtkIdType  id  )  [inline]
 

Used in conjunction with InsertNextCell(int npts) to add another point to the list of cells.

Definition at line 284 of file vtkCellArray.h.

References Ia, and vtkIdTypeArray::InsertValue().

void vtkCellArray::UpdateCellCount int  npts  )  [inline]
 

Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of points defining the cell.

Definition at line 290 of file vtkCellArray.h.

References Ia, and vtkIdTypeArray::SetValue().

vtkIdType vtkCellArray::GetInsertLocation int  npts  )  [inline]
 

Computes the current insertion location within the internal array. Used in conjunction with GetCell(int loc,...).

Definition at line 147 of file vtkCellArray.h.

vtkIdType vtkCellArray::GetTraversalLocation  )  [inline]
 

Get/Set the current traversal location.

Definition at line 153 of file vtkCellArray.h.

void vtkCellArray::SetTraversalLocation vtkIdType  loc  )  [inline]
 

Get/Set the current traversal location.

Definition at line 155 of file vtkCellArray.h.

vtkIdType vtkCellArray::GetTraversalLocation vtkIdType  npts  )  [inline]
 

Computes the current traversal location within the internal array. Used in conjunction with GetCell(int loc,...).

Definition at line 162 of file vtkCellArray.h.

void vtkCellArray::ReverseCell vtkIdType  loc  )  [inline]
 

Special method inverts ordering of current cell. Must be called carefully or the cell topology may be corrupted.

Definition at line 348 of file vtkCellArray.h.

References vtkIdTypeArray::GetPointer(), vtkIdTypeArray::GetValue(), and Ia.

void vtkCellArray::ReplaceCell vtkIdType  loc,
int  npts,
const vtkIdType pts
[inline]
 

Replace the point ids of the cell with a different list of point ids.

Definition at line 363 of file vtkCellArray.h.

References vtkIdTypeArray::GetPointer(), and Ia.

int vtkCellArray::GetMaxCellSize  ) 
 

Returns the size of the largest cell. The size is the number of points defining the cell.

vtkIdType* vtkCellArray::GetPointer  )  [inline]
 

Get pointer to array of cell data.

Definition at line 179 of file vtkCellArray.h.

vtkIdType * vtkCellArray::WritePointer const vtkIdType  ncells,
const vtkIdType  size
[inline]
 

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.

Definition at line 374 of file vtkCellArray.h.

References Ia, InsertLocation, NumberOfCells, TraversalLocation, and vtkIdTypeArray::WritePointer().

void vtkCellArray::SetCells vtkIdType  ncells,
vtkIdTypeArray cells
 

Define multiple cells by providing a connectivity list. The list is in the form (npts,p0,p1,...p(npts-1), repeated for each cell). Be careful using this method because it discards the old cells, and anything referring these cells becomes invalid (for example, if BuildCells() has been called see vtkPolyData). The traversal location is reset to the beginning of the list; the insertion location is set to the end of the list.

void vtkCellArray::DeepCopy vtkCellArray ca  ) 
 

Perform a deep copy (no reference counting) of the given cell array.

vtkIdTypeArray* vtkCellArray::GetData  )  [inline]
 

Return the underlying data as a data array.

Definition at line 202 of file vtkCellArray.h.

void vtkCellArray::Reset  )  [inline]
 

Reuse list. Reset to initial condition.

Definition at line 314 of file vtkCellArray.h.

References Ia, InsertLocation, NumberOfCells, vtkDataArray::Reset(), and TraversalLocation.

void vtkCellArray::Squeeze  )  [inline]
 

Reclaim any extra memory.

Definition at line 211 of file vtkCellArray.h.

unsigned long vtkCellArray::GetActualMemorySize  ) 
 

Return the memory in kilobytes consumed by this cell array. Used to support streaming and reading/writing data. The value returned is guaranteed to be greater than or equal to the memory required to actually represent the data represented by this object. The information returned is valid only after the pipeline has been updated.


Member Data Documentation

vtkIdType vtkCellArray::NumberOfCells [protected]
 

Definition at line 227 of file vtkCellArray.h.

Referenced by InsertNextCell(), Reset(), and WritePointer().

vtkIdType vtkCellArray::InsertLocation [protected]
 

Definition at line 228 of file vtkCellArray.h.

Referenced by InsertNextCell(), Reset(), and WritePointer().

vtkIdType vtkCellArray::TraversalLocation [protected]
 

Definition at line 229 of file vtkCellArray.h.

Referenced by GetNextCell(), Reset(), and WritePointer().

vtkIdTypeArray* vtkCellArray::Ia [protected]
 

Definition at line 230 of file vtkCellArray.h.

Referenced by GetCell(), GetNextCell(), InsertCellPoint(), InsertNextCell(), ReplaceCell(), Reset(), ReverseCell(), UpdateCellCount(), and WritePointer().


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 23:36:56 2008 for VTK by  doxygen 1.4.3-20050530