41 #ifndef vtkCellArray_h 42 #define vtkCellArray_h 44 #include "vtkCommonDataModelModule.h" 65 {
return this->Ia->Allocate(sz,ext);}
96 {
return numCells*(1+maxPtsPerCell);}
124 {
return this->Ia->GetSize();}
132 {
return this->Ia->GetMaxId()+1;}
185 void UpdateCellCount(
int npts);
192 {
return (this->InsertLocation - npts - 1);};
198 {
return this->TraversalLocation;}
200 {this->TraversalLocation = loc;}
207 {
return(this->TraversalLocation-npts-1);}
230 int GetMaxCellSize();
236 {
return this->Ia->GetPointer(0);}
276 {this->Ia->Squeeze();}
286 unsigned long GetActualMemorySize();
308 vtkIdType *ptr = this->Ia->WritePointer(i, npts+1);
310 for ( *ptr++ = npts, i = 0; i < npts; i++)
315 this->NumberOfCells++;
316 this->InsertLocation += npts + 1;
318 return this->NumberOfCells - 1;
324 this->InsertLocation = this->Ia->InsertNextValue(npts) + 1;
325 this->NumberOfCells++;
327 return this->NumberOfCells - 1;
333 this->Ia->InsertValue(this->InsertLocation++,
id);
339 this->Ia->SetValue(this->InsertLocation-npts-1, npts);
358 this->NumberOfCells = 0;
359 this->InsertLocation = 0;
360 this->TraversalLocation = 0;
367 if ( this->Ia->GetMaxId() >= 0 &&
368 this->TraversalLocation <= this->Ia->GetMaxId() )
370 npts = this->Ia->GetValue(this->TraversalLocation++);
371 pts = this->Ia->GetPointer(this->TraversalLocation);
372 this->TraversalLocation += npts;
384 npts = this->Ia->GetValue(loc++);
385 pts = this->Ia->GetPointer(loc);
394 vtkIdType *pts=this->Ia->GetPointer(loc+1);
395 for (i=0; i < (npts/2); i++)
398 pts[i] = pts[npts-i-1];
407 vtkIdType *oldPts=this->Ia->GetPointer(loc+1);
408 for (
int i=0; i < npts; i++)
418 this->NumberOfCells = ncells;
419 this->InsertLocation =
size;
420 this->TraversalLocation = 0;
421 return this->Ia->WritePointer(0,size);
vtkIdType * GetPointer()
Get pointer to array of cell data.
vtkIdType GetNumberOfPoints()
Return the number of points in the cell.
vtkIdType GetInsertLocation(int npts)
Computes the current insertion location within the internal array.
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InsertCellPoint(vtkIdType id)
Used in conjunction with InsertNextCell(int npts) to add another point to the list of cells...
vtkIdType GetNumberOfIds()
Return the number of id's in the list.
void InitTraversal()
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext=1000)
Allocate memory and set the size to extend by.
dynamic, self-adjusting array of vtkIdType
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.
abstract class to specify cell behavior
void SetTraversalLocation(vtkIdType loc)
vtkIdType GetTraversalLocation(vtkIdType npts)
Computes the current traversal location within the internal array.
a simple class to control print indentation
vtkIdType GetNumberOfConnectivityEntries()
Get the total number of entries (i.e., data values) in the connectivity array.
list of point or cell ids
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.
#define VTK_SIZEHINT(...)
void UpdateCellCount(int npts)
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of point...
vtkIdType TraversalLocation
vtkIdType InsertNextCell(vtkCell *cell)
Insert a cell object.
vtkIdType * WritePointer(const vtkIdType ncells, const vtkIdType size)
Get pointer to data array for purpose of direct writes of data.
object to represent cell connectivity
vtkIdTypeArray * GetData()
Return the underlying data as a data array.
vtkIdType GetSize()
Get the size of the allocated connectivity array.
int GetNextCell(vtkIdType &npts, vtkIdType *&pts)
A cell traversal methods that is more efficient than vtkDataSet traversal methods.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkIdType GetTraversalLocation()
Get/Set the current traversal location.
vtkIdType * GetPointer(const vtkIdType i)
Get a pointer to a particular data index.
void GetCell(vtkIdType loc, vtkIdType &npts, vtkIdType *&pts)
Internal method used to retrieve a cell given an offset into the internal array.