124 #ifndef vtkCellArrayIterator_h
125 #define vtkCellArrayIterator_h
127 #include "vtkCommonDataModelModule.h"
135 #include <type_traits>
137 VTK_ABI_NAMESPACE_BEGIN
163 this->CurrentCellId = cellId;
164 this->NumberOfCells = this->CellArray->GetNumberOfCells();
165 assert(cellId <= this->NumberOfCells);
183 this->GoToCell(cellId);
184 this->GetCurrentCell(numCellPts, cellPts);
188 this->GoToCell(cellId);
189 this->GetCurrentCell(cellIds);
193 this->GoToCell(cellId);
194 return this->GetCurrentCell();
208 this->CurrentCellId = 0;
209 this->NumberOfCells = this->CellArray->GetNumberOfCells();
238 assert(this->CurrentCellId < this->NumberOfCells);
240 if (this->CellArray->IsStorageShareable())
242 this->CellArray->GetCellAtId(this->CurrentCellId, cellSize, cellPoints);
246 this->CellArray->GetCellAtId(this->CurrentCellId, this->TempCell);
247 cellSize = this->TempCell->GetNumberOfIds();
248 cellPoints = this->TempCell->GetPointer(0);
253 assert(this->CurrentCellId < this->NumberOfCells);
254 this->CellArray->GetCellAtId(this->CurrentCellId, ids);
258 assert(this->CurrentCellId < this->NumberOfCells);
259 this->CellArray->GetCellAtId(this->CurrentCellId, this->TempCell);
260 return this->TempCell;
276 assert(this->CurrentCellId < this->NumberOfCells);
277 this->CellArray->ReplaceCellAtId(this->CurrentCellId, list);
287 assert(this->CurrentCellId < this->NumberOfCells);
288 this->CellArray->ReplaceCellAtId(this->CurrentCellId, npts, pts);
296 assert(this->CurrentCellId < this->NumberOfCells);
297 this->CellArray->ReverseCellAtId(this->CurrentCellId);
318 VTK_ABI_NAMESPACE_END
Encapsulate traversal logic for vtkCellArray.
vtkIdList * GetCurrentCell()
Returns the definition of the current cell during forward traversal.
bool IsDoneWithTraversal()
Returns true if the iterator has completed the traversal.
vtkNew< vtkIdList > TempCell
vtkSmartPointer< vtkCellArray > CellArray
static vtkCellArrayIterator * New()
Standard methods for instantiation, type information, and printing.
void GetCurrentCell(vtkIdList *ids)
Returns the definition of the current cell during forward traversal.
void ReplaceCurrentCell(vtkIdType npts, const vtkIdType *pts)
Replace the current cell with the ids in pts.
~vtkCellArrayIterator() override=default
void GetCellAtId(vtkIdType cellId, vtkIdList *cellIds)
The following are methods supporting random access iteration.
vtkCellArray * GetCellArray()
Return the vtkCellArray object over which iteration is occurring.
void GoToCell(vtkIdType cellId)
Initialize the iterator to a specific cell.
void GoToNextCell()
Advance the forward iterator to the next cell.
void GetCellAtId(vtkIdType cellId, vtkIdType &numCellPts, vtkIdType const *&cellPts)
The following are methods supporting random access iteration.
void ReverseCurrentCell()
Reverses the order of the point ids in the current cell.
vtkIdType GetCurrentCellId() const
Returns the id of the current cell during forward iteration.
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
vtkCellArrayIterator()=default
void ReplaceCurrentCell(vtkIdList *list)
Specialized methods for performing operations on the vtkCellArray.
void GoToFirstCell()
The following are methods supporting forward iteration.
object to represent cell connectivity
friend class vtkCellArrayIterator
list of point or cell ids
a simple class to control print indentation
abstract base class for most VTK objects