35 #ifndef vtkCellArray_h 36 #define vtkCellArray_h 38 #include "vtkCommonDataModelModule.h" 59 {
return this->Ia->Allocate(sz,ext);}
90 {
return numCells*(1+maxPtsPerCell);}
117 {
return this->Ia->GetSize();}
125 {
return this->Ia->GetMaxId()+1;}
174 void UpdateCellCount(
int npts);
181 {
return (this->InsertLocation - npts - 1);};
187 {
return this->TraversalLocation;}
189 {this->TraversalLocation = loc;}
196 {
return(this->TraversalLocation-npts-1);}
216 int GetMaxCellSize();
222 {
return this->Ia->GetPointer(0);}
262 {this->Ia->Squeeze();}
272 unsigned long GetActualMemorySize();
285 void operator=(const
vtkCellArray&) VTK_DELETE_FUNCTION;
294 vtkIdType *ptr = this->Ia->WritePointer(i, npts+1);
296 for ( *ptr++ = npts, i = 0; i < npts; i++)
301 this->NumberOfCells++;
302 this->InsertLocation += npts + 1;
304 return this->NumberOfCells - 1;
310 this->InsertLocation = this->Ia->InsertNextValue(npts) + 1;
311 this->NumberOfCells++;
313 return this->NumberOfCells - 1;
319 this->Ia->InsertValue(this->InsertLocation++,
id);
325 this->Ia->SetValue(this->InsertLocation-npts-1, npts);
344 this->NumberOfCells = 0;
345 this->InsertLocation = 0;
346 this->TraversalLocation = 0;
353 if ( this->Ia->GetMaxId() >= 0 &&
354 this->TraversalLocation <= this->Ia->GetMaxId() )
356 npts = this->Ia->GetValue(this->TraversalLocation++);
357 pts = this->Ia->GetPointer(this->TraversalLocation);
358 this->TraversalLocation += npts;
370 npts = this->Ia->GetValue(loc++);
371 pts = this->Ia->GetPointer(loc);
380 vtkIdType *pts=this->Ia->GetPointer(loc+1);
381 for (i=0; i < (npts/2); i++)
384 pts[i] = pts[npts-i-1];
393 vtkIdType *oldPts=this->Ia->GetPointer(loc+1);
394 for (
int i=0; i < npts; i++)
404 this->NumberOfCells = ncells;
405 this->InsertLocation = 0;
406 this->TraversalLocation = 0;
407 return this->Ia->WritePointer(0,
size);
vtkIdType GetMaxId()
What is the maximum id currently in the array.
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.
void ReplaceCell(vtkIdType loc, int npts, const vtkIdType *pts)
Replace the point ids of the cell with a different list of point ids.
dynamic, self-adjusting array of vtkIdType
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.
void UpdateCellCount(int npts)
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of point...
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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.
int Allocate(const vtkIdType sz, const int ext=1000)
Allocate memory and set the size to extend by.
void GetCell(vtkIdType loc, vtkIdType &npts, vtkIdType *&pts)
Internal method used to retrieve a cell given an offset into the internal array.