VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkCellArray Class Reference

object to represent cell connectivity More...

#include <vtkCellArray.h>

Inheritance diagram for vtkCellArray:
[legend]
Collaboration diagram for vtkCellArray:
[legend]

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkCellArrayNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
vtkTypeBool Allocate (vtkIdType sz, vtkIdType ext=1000)
 Allocate memory and set the size to extend by. More...
 
void Initialize ()
 Free any memory and reset to an empty state. More...
 
vtkIdType EstimateSize (vtkIdType numCells, int maxPtsPerCell)
 Utility routines help manage memory of cell array. More...
 
void InitTraversal ()
 A cell traversal methods that is more efficient than vtkDataSet traversal methods. More...
 
int GetNextCell (vtkIdType &npts, vtkIdType *&pts)
 A cell traversal methods that is more efficient than vtkDataSet traversal methods. More...
 
int GetNextCell (vtkIdList *pts)
 A cell traversal methods that is more efficient than vtkDataSet traversal methods. More...
 
vtkIdType GetSize ()
 Get the size of the allocated connectivity array. More...
 
vtkIdType GetNumberOfConnectivityEntries ()
 Get the total number of entries (i.e., data values) in the connectivity array. More...
 
void GetCell (vtkIdType loc, vtkIdType &npts, vtkIdType *&pts)
 Internal method used to retrieve a cell given an offset into the internal array. More...
 
void GetCell (vtkIdType loc, vtkIdList *pts)
 Internal method used to retrieve a cell given an offset into the internal array. More...
 
vtkIdType InsertNextCell (vtkCell *cell)
 Insert a cell object. More...
 
vtkIdType InsertNextCell (vtkIdType npts, const vtkIdType pts[])
 Create a cell by specifying the number of points and an array of point id's. More...
 
vtkIdType InsertNextCell (vtkIdList *pts)
 Create a cell by specifying a list of point ids. More...
 
vtkIdType InsertNextCell (int npts)
 Create cells by specifying count, and then adding points one at a time using method InsertCellPoint(). More...
 
void InsertCellPoint (vtkIdType id)
 Used in conjunction with InsertNextCell(int npts) to add another point to the list of cells. More...
 
void UpdateCellCount (int npts)
 Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of points defining the cell. More...
 
vtkIdType GetInsertLocation (int npts)
 Computes the current insertion location within the internal array. More...
 
vtkIdType GetTraversalLocation ()
 Get/Set the current traversal location. More...
 
void SetTraversalLocation (vtkIdType loc)
 
vtkIdType GetTraversalLocation (vtkIdType npts)
 Computes the current traversal location within the internal array. More...
 
void ReverseCell (vtkIdType loc)
 Special method inverts ordering of current cell. More...
 
void ReplaceCell (vtkIdType loc, int npts, const vtkIdType pts[])
 Replace the point ids of the cell with a different list of point ids. More...
 
int GetMaxCellSize ()
 Returns the size of the largest cell. More...
 
vtkIdTypeGetPointer ()
 Get pointer to array of cell data. More...
 
vtkIdTypeWritePointer (const vtkIdType ncells, const vtkIdType size)
 Get pointer to data array for purpose of direct writes of data. More...
 
void SetCells (vtkIdType ncells, vtkIdTypeArray *cells)
 Define multiple cells by providing a connectivity list. More...
 
void DeepCopy (vtkCellArray *ca)
 Perform a deep copy (no reference counting) of the given cell array. More...
 
vtkIdTypeArrayGetData ()
 Return the underlying data as a data array. More...
 
void Reset ()
 Reuse list. More...
 
void Squeeze ()
 Reclaim any extra memory. More...
 
unsigned long GetActualMemorySize ()
 Return the memory in kibibytes (1024 bytes) consumed by this cell array. More...
 
virtual vtkIdType GetNumberOfCells ()
 Get the number of cells in the array. More...
 
virtual void SetNumberOfCells (vtkIdType)
 Set the number of cells in the array. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkCellArraySafeDownCast (vtkObjectBase *o)
 
static vtkCellArrayNew ()
 Instantiate cell array (connectivity list). More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkCellArray ()
 
 ~vtkCellArray () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkIdType NumberOfCells
 
vtkIdType InsertLocation
 
vtkIdType TraversalLocation
 
vtkIdTypeArrayIa
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

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 50 of file vtkCellArray.h.

Member Typedef Documentation

Definition at line 53 of file vtkCellArray.h.

Constructor & Destructor Documentation

vtkCellArray::vtkCellArray ( )
protected
vtkCellArray::~vtkCellArray ( )
overrideprotected

Member Function Documentation

static vtkTypeBool vtkCellArray::IsTypeOf ( const char *  type)
static
virtual vtkTypeBool vtkCellArray::IsA ( const char *  name)
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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

static vtkCellArray* vtkCellArray::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkCellArray::NewInstanceInternal ( ) const
protectedvirtual
vtkCellArray* vtkCellArray::NewInstance ( ) const
void vtkCellArray::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

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

vtkTypeBool vtkCellArray::Allocate ( vtkIdType  sz,
vtkIdType  ext = 1000 
)
inline

Allocate memory and set the size to extend by.

Definition at line 64 of file vtkCellArray.h.

void vtkCellArray::Initialize ( )

Free any memory and reset to an empty state.

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 95 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 102 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. A value of 1 is returned whenever npts and pts have been updated without error.

Definition at line 365 of file vtkCellArray.h.

int vtkCellArray::GetNextCell ( vtkIdList 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.

vtkIdType vtkCellArray::GetSize ( )
inline

Get the size of the allocated connectivity array.

Definition at line 123 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 131 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 381 of file vtkCellArray.h.

void vtkCellArray::GetCell ( vtkIdType  loc,
vtkIdList pts 
)

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

vtkIdType vtkCellArray::InsertNextCell ( vtkCell cell)
inline

Insert a cell object.

Return the cell id of the cell.

Definition at line 349 of file vtkCellArray.h.

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 304 of file vtkCellArray.h.

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 343 of file vtkCellArray.h.

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 322 of file vtkCellArray.h.

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 331 of file vtkCellArray.h.

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 337 of file vtkCellArray.h.

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 191 of file vtkCellArray.h.

vtkIdType vtkCellArray::GetTraversalLocation ( )
inline

Get/Set the current traversal location.

Definition at line 197 of file vtkCellArray.h.

void vtkCellArray::SetTraversalLocation ( vtkIdType  loc)
inline

Definition at line 199 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 206 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 389 of file vtkCellArray.h.

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.

Calling this method does not mark the vtkCellArray as modified. This is the responsibility of the caller and may be done after multiple calls to ReplaceCell.

Definition at line 404 of file vtkCellArray.h.

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 235 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 415 of file vtkCellArray.h.

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 264 of file vtkCellArray.h.

void vtkCellArray::Reset ( )
inline

Reuse list.

Reset to initial condition.

Definition at line 356 of file vtkCellArray.h.

void vtkCellArray::Squeeze ( )
inline

Reclaim any extra memory.

Definition at line 275 of file vtkCellArray.h.

unsigned long vtkCellArray::GetActualMemorySize ( )

Return the memory in kibibytes (1024 bytes) 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 292 of file vtkCellArray.h.

vtkIdType vtkCellArray::InsertLocation
protected

Definition at line 293 of file vtkCellArray.h.

vtkIdType vtkCellArray::TraversalLocation
protected

Definition at line 294 of file vtkCellArray.h.

vtkIdTypeArray* vtkCellArray::Ia
protected

Definition at line 295 of file vtkCellArray.h.


The documentation for this class was generated from the following file: