53 #ifndef vtkCellArrayIterator_h
54 #define vtkCellArrayIterator_h
56 #include "vtkCommonDataModelModule.h"
64 #include <type_traits>
66 VTK_ABI_NAMESPACE_BEGIN
92 this->CurrentCellId = cellId;
93 this->NumberOfCells = this->CellArray->GetNumberOfCells();
94 assert(cellId <= this->NumberOfCells);
112 this->GoToCell(cellId);
113 this->GetCurrentCell(numCellPts, cellPts);
117 this->GoToCell(cellId);
118 this->GetCurrentCell(cellIds);
122 this->GoToCell(cellId);
123 return this->GetCurrentCell();
137 this->CurrentCellId = 0;
138 this->NumberOfCells = this->CellArray->GetNumberOfCells();
167 assert(this->CurrentCellId < this->NumberOfCells);
169 if (this->CellArray->IsStorageShareable())
171 this->CellArray->GetCellAtId(this->CurrentCellId, cellSize, cellPoints);
175 this->CellArray->GetCellAtId(this->CurrentCellId, this->TempCell);
176 cellSize = this->TempCell->GetNumberOfIds();
177 cellPoints = this->TempCell->GetPointer(0);
182 assert(this->CurrentCellId < this->NumberOfCells);
183 this->CellArray->GetCellAtId(this->CurrentCellId, ids);
187 assert(this->CurrentCellId < this->NumberOfCells);
188 this->CellArray->GetCellAtId(this->CurrentCellId, this->TempCell);
189 return this->TempCell;
205 assert(this->CurrentCellId < this->NumberOfCells);
206 this->CellArray->ReplaceCellAtId(this->CurrentCellId, list);
216 assert(this->CurrentCellId < this->NumberOfCells);
217 this->CellArray->ReplaceCellAtId(this->CurrentCellId, npts, pts);
225 assert(this->CurrentCellId < this->NumberOfCells);
226 this->CellArray->ReverseCellAtId(this->CurrentCellId);
247 VTK_ABI_NAMESPACE_END
248 #endif // vtkCellArrayIterator_h
void ReplaceCurrentCell(vtkIdList *list)
Specialized methods for performing operations on the vtkCellArray.
void GetCellAtId(vtkIdType cellId, vtkIdList *cellIds)
The following are methods supporting random access iteration.
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 ReverseCurrentCell()
Reverses the order of the point ids in the current cell.
void GetCurrentCell(vtkIdList *ids)
Returns the definition of the current cell during forward traversal.
vtkIdType GetCurrentCellId() const
Returns the id of the current cell during forward iteration.
vtkCellArray * GetCellArray()
Return the vtkCellArray object over which iteration is occurring.
vtkIdList * GetCellAtId(vtkIdType cellId)
The following are methods supporting random access iteration.
void GetCurrentCell(vtkIdType &cellSize, vtkIdType const *&cellPoints)
Returns the definition of the current cell during forward traversal.
bool IsDoneWithTraversal()
Returns true if the iterator has completed the traversal.
void ReplaceCurrentCell(vtkIdType npts, const vtkIdType *pts)
Replace the current cell with the ids in pts.
a simple class to control print indentation
void GetCellAtId(vtkIdType cellId, vtkIdType &numCellPts, vtkIdType const *&cellPts)
The following are methods supporting random access iteration.
list of point or cell ids
friend class vtkCellArrayIterator
void GoToNextCell()
Advance the forward iterator to the next cell.
vtkSmartPointer< vtkCellArray > CellArray
vtkNew< vtkIdList > TempCell
object to represent cell connectivity
vtkIdList * GetCurrentCell()
Returns the definition of the current cell during forward traversal.
void GoToFirstCell()
The following are methods supporting forward iteration.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Encapsulate traversal logic for vtkCellArray.
void GoToCell(vtkIdType cellId)
Initialize the iterator to a specific cell.