112#ifndef vtkCellArrayIterator_h
113#define vtkCellArrayIterator_h
115#include "vtkCommonDataModelModule.h"
123#include <type_traits>
125VTK_ABI_NAMESPACE_BEGIN
151 this->CurrentCellId = cellId;
152 this->NumberOfCells = this->CellArray->GetNumberOfCells();
153 assert(cellId <= this->NumberOfCells);
171 this->GoToCell(cellId);
172 this->GetCurrentCell(numCellPts, cellPts);
176 this->GoToCell(cellId);
177 this->GetCurrentCell(cellIds);
181 this->GoToCell(cellId);
182 return this->GetCurrentCell();
196 this->CurrentCellId = 0;
197 this->NumberOfCells = this->CellArray->GetNumberOfCells();
226 assert(this->CurrentCellId < this->NumberOfCells);
228 if (this->CellArray->IsStorageShareable())
230 this->CellArray->GetCellAtId(this->CurrentCellId, cellSize, cellPoints);
234 this->CellArray->GetCellAtId(this->CurrentCellId, this->TempCell);
235 cellSize = this->TempCell->GetNumberOfIds();
236 cellPoints = this->TempCell->GetPointer(0);
241 assert(this->CurrentCellId < this->NumberOfCells);
242 this->CellArray->GetCellAtId(this->CurrentCellId, ids);
246 assert(this->CurrentCellId < this->NumberOfCells);
247 this->CellArray->GetCellAtId(this->CurrentCellId, this->TempCell);
248 return this->TempCell;
264 assert(this->CurrentCellId < this->NumberOfCells);
265 this->CellArray->ReplaceCellAtId(this->CurrentCellId, list);
275 assert(this->CurrentCellId < this->NumberOfCells);
276 this->CellArray->ReplaceCellAtId(this->CurrentCellId, npts, pts);
284 assert(this->CurrentCellId < this->NumberOfCells);
285 this->CellArray->ReverseCellAtId(this->CurrentCellId);
Encapsulate traversal logic for vtkCellArray.
bool IsDoneWithTraversal()
Returns true if the iterator has completed the traversal.
vtkNew< vtkIdList > TempCell
vtkSmartPointer< vtkCellArray > CellArray
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.
void GoToCell(vtkIdType cellId)
Initialize the iterator to a specific cell.
vtkIdList * GetCellAtId(vtkIdType cellId)
The following are methods supporting random access iteration.
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.
vtkIdList * GetCurrentCell()
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.
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.
static vtkCellArrayIterator * New()
Standard methods for instantiation, type information, and printing.
void GoToFirstCell()
The following are methods supporting forward iteration.
object to represent cell connectivity
list of point or cell ids
a simple class to control print indentation
Allocate and hold a VTK object.
abstract base class for most VTK objects
Hold a reference to a vtkObjectBase instance.