Go to the documentation of this file.
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);}
222 int GetMaxCellSize();
228 {
return this->Ia->GetPointer(0);}
268 {this->Ia->Squeeze();}
278 unsigned long GetActualMemorySize();
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);
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
vtkIdType GetNumberOfConnectivityEntries()
Get the total number of entries (i.e., data values) in the connectivity array.
int Allocate(const vtkIdType sz, const int ext=1000)
Allocate memory and set the size to extend by.
void UpdateCellCount(int npts)
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of point...
void ReverseCell(vtkIdType loc)
Special method inverts ordering of current cell.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkIdType * WritePointer(const vtkIdType ncells, const vtkIdType size)
Get pointer to data array for purpose of direct writes of data.
abstract base class for most VTK objects
vtkIdTypeArray * GetData()
Return the underlying data as a data array.
int GetNextCell(vtkIdType &npts, vtkIdType *&pts)
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
vtkIdType GetTraversalLocation(vtkIdType npts)
Computes the current traversal location within the internal array.
vtkIdType GetMaxId()
What is the maximum id currently in the array.
void GetCell(vtkIdType loc, vtkIdType &npts, vtkIdType *&pts)
Internal method used to retrieve a cell given an offset into the internal array.
vtkIdType EstimateSize(vtkIdType numCells, int maxPtsPerCell)
Utility routines help manage memory of cell array.
abstract class to specify cell behavior
void Squeeze()
Reclaim any extra memory.
a simple class to control print indentation
vtkIdType * GetPointer()
Get pointer to array of cell data.
object to represent cell connectivity
void InsertCellPoint(vtkIdType id)
Used in conjunction with InsertNextCell(int npts) to add another point to the list of cells.
list of point or cell ids
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType GetNumberOfPoints()
Return the number of points in the cell.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
dynamic, self-adjusting array of vtkIdType
vtkIdType GetSize()
Get the size of the allocated connectivity array.
void InitTraversal()
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
void ReplaceCell(vtkIdType loc, int npts, const vtkIdType *pts)
Replace the point ids of the cell with a different list of point ids.
vtkIdType InsertNextCell(vtkCell *cell)
Insert a cell object.
vtkIdType * GetPointer(const vtkIdType i)
Get a pointer to a particular data index.
vtkIdType GetNumberOfIds()
Return the number of id's in the list.
void SetTraversalLocation(vtkIdType loc)
vtkIdType GetInsertLocation(int npts)
Computes the current insertion location within the internal array.
vtkIdType GetTraversalLocation()
Get/Set the current traversal location.