41 #ifndef vtkCellArray_h
42 #define vtkCellArray_h
44 #include "vtkCommonDataModelModule.h"
65 {
return this->Ia->Allocate(sz,ext);}
96 {
return numCells*(1+maxPtsPerCell);}
123 {
return this->Ia->GetSize();}
131 {
return this->Ia->GetMaxId()+1;}
180 void UpdateCellCount(
int npts);
187 {
return (this->InsertLocation - npts - 1);};
193 {
return this->TraversalLocation;}
195 {this->TraversalLocation = loc;}
202 {
return(this->TraversalLocation-npts-1);}
228 {
return this->Ia->GetPointer(0);}
268 {this->Ia->Squeeze();}
291 void operator=(const
vtkCellArray&) VTK_DELETE_FUNCTION;
300 vtkIdType *ptr = this->Ia->WritePointer(i, npts+1);
302 for ( *ptr++ = npts, i = 0; i < npts; i++)
307 this->NumberOfCells++;
308 this->InsertLocation += npts + 1;
310 return this->NumberOfCells - 1;
316 this->InsertLocation = this->Ia->InsertNextValue(npts) + 1;
317 this->NumberOfCells++;
319 return this->NumberOfCells - 1;
325 this->Ia->InsertValue(this->InsertLocation++,
id);
331 this->Ia->SetValue(this->InsertLocation-npts-1, npts);
350 this->NumberOfCells = 0;
351 this->InsertLocation = 0;
352 this->TraversalLocation = 0;
359 if ( this->Ia->GetMaxId() >= 0 &&
360 this->TraversalLocation <= this->Ia->GetMaxId() )
362 npts = this->Ia->GetValue(this->TraversalLocation++);
363 pts = this->Ia->GetPointer(this->TraversalLocation);
364 this->TraversalLocation += npts;
376 npts = this->Ia->GetValue(loc++);
377 pts = this->Ia->GetPointer(loc);
386 vtkIdType *pts=this->Ia->GetPointer(loc+1);
387 for (i=0; i < (npts/2); i++)
390 pts[i] = pts[npts-i-1];
399 vtkIdType *oldPts=this->Ia->GetPointer(loc+1);
400 for (
int i=0; i < npts; i++)
410 this->NumberOfCells = ncells;
411 this->InsertLocation = 0;
412 this->TraversalLocation = 0;
413 return this->Ia->WritePointer(0,
size);
vtkIdType GetMaxId()
What is the maximum id currently in the array.
object to represent cell connectivity
void GetCell(vtkIdType loc, vtkIdType &npts, vtkIdType *&pts)
Internal method used to retrieve a cell given an offset into the internal array.
vtkIdType GetNumberOfConnectivityEntries()
Get the total number of entries (i.e., data values) in the connectivity array.
int GetNextCell(vtkIdList *pts)
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
vtkIdTypeArray * GetData()
Return the underlying data as a data array.
vtkIdType GetTraversalLocation()
Get/Set the current traversal location.
vtkIdType EstimateSize(vtkIdType numCells, int maxPtsPerCell)
Utility routines help manage memory of cell array.
void ReverseCell(vtkIdType loc)
Special method inverts ordering of current cell.
int GetNextCell(vtkIdType &npts, vtkIdType *&pts)
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
void InitTraversal()
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
void InsertCellPoint(vtkIdType id)
Used in conjunction with InsertNextCell(int npts) to add another point to the list of cells.
void SetTraversalLocation(vtkIdType loc)
void ReplaceCell(vtkIdType loc, int npts, const vtkIdType *pts)
Replace the point ids of the cell with a different list of point ids.
void Squeeze()
Reclaim any extra memory.
static vtkCellArray * New()
Instantiate cell array (connectivity list).
int GetMaxCellSize()
Returns the size of the largest cell.
void Initialize()
Free any memory and reset to an empty state.
void DeepCopy(vtkCellArray *ca)
Perform a deep copy (no reference counting) of the given cell array.
vtkIdType InsertNextCell(vtkCell *cell)
Insert a cell object.
int Allocate(const vtkIdType sz, const int ext=1000)
Allocate memory and set the size to extend by.
vtkIdType * GetPointer()
Get pointer to array of cell data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType GetInsertLocation(int npts)
Computes the current insertion location within the internal array.
void UpdateCellCount(int npts)
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of point...
void SetCells(vtkIdType ncells, vtkIdTypeArray *cells)
Define multiple cells by providing a connectivity list.
unsigned long GetActualMemorySize()
Return the memory in kibibytes (1024 bytes) consumed by this cell array.
vtkIdType GetTraversalLocation(vtkIdType npts)
Computes the current traversal location within the internal array.
vtkIdType * WritePointer(const vtkIdType ncells, const vtkIdType size)
Get pointer to data array for purpose of direct writes of data.
vtkIdType GetSize()
Get the size of the allocated connectivity array.
void GetCell(vtkIdType loc, vtkIdList *pts)
Internal method used to retrieve a cell given an offset into the internal array.
abstract class to specify cell behavior
vtkIdType GetNumberOfPoints()
Return the number of points in the cell.
list of point or cell ids
vtkIdType * GetPointer(const vtkIdType i)
Get a pointer to a particular data index.
vtkIdType GetNumberOfIds()
Return the number of id's in the list.
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
abstract base class for most VTK objects
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.