 |
VTK
9.1.0
|
Go to the documentation of this file.
124 #ifndef vtkCellArrayIterator_h
125 #define vtkCellArrayIterator_h
127 #include "vtkCommonDataModelModule.h"
135 #include <type_traits>
162 this->CurrentCellId = cellId;
163 this->NumberOfCells = this->CellArray->GetNumberOfCells();
164 assert(cellId <= this->NumberOfCells);
182 this->GoToCell(cellId);
183 this->GetCurrentCell(numCellPts, cellPts);
187 this->GoToCell(cellId);
188 this->GetCurrentCell(cellIds);
192 this->GoToCell(cellId);
193 return this->GetCurrentCell();
207 this->CurrentCellId = 0;
208 this->NumberOfCells = this->CellArray->GetNumberOfCells();
237 assert(this->CurrentCellId < this->NumberOfCells);
239 if (this->CellArray->IsStorageShareable())
241 this->CellArray->GetCellAtId(this->CurrentCellId, cellSize, cellPoints);
245 this->CellArray->GetCellAtId(this->CurrentCellId, this->TempCell);
246 cellSize = this->TempCell->GetNumberOfIds();
247 cellPoints = this->TempCell->GetPointer(0);
252 assert(this->CurrentCellId < this->NumberOfCells);
253 this->CellArray->GetCellAtId(this->CurrentCellId, ids);
257 assert(this->CurrentCellId < this->NumberOfCells);
258 this->CellArray->GetCellAtId(this->CurrentCellId, this->TempCell);
259 return this->TempCell;
275 assert(this->CurrentCellId < this->NumberOfCells);
276 this->CellArray->ReplaceCellAtId(this->CurrentCellId, list);
286 assert(this->CurrentCellId < this->NumberOfCells);
287 this->CellArray->ReplaceCellAtId(this->CurrentCellId, npts, pts);
295 assert(this->CurrentCellId < this->NumberOfCells);
296 this->CellArray->ReverseCellAtId(this->CurrentCellId);
317 #endif // vtkCellArrayIterator_h
void GoToNextCell()
Advance the forward iterator to the next cell.
void ReplaceCurrentCell(vtkIdType npts, const vtkIdType *pts)
Replace the current cell with the ids in pts.
~vtkCellArrayIterator() override=default
void GetCurrentCell(vtkIdList *ids)
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.
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.
abstract base class for most VTK objects
vtkCellArray * GetCellArray()
Return the vtkCellArray object over which iteration is occuring.
void GoToCell(vtkIdType cellId)
Intialize the iterator to a specific cell.
Encapsulate traversal logic for vtkCellArray.
bool IsDoneWithTraversal()
Returns true if the iterator has completed the traversal.
friend class vtkCellArrayIterator
vtkCellArrayIterator()=default
a simple class to control print indentation
object to represent cell connectivity
list of point or cell ids
void ReplaceCurrentCell(vtkIdList *list)
Specialized methods for performing operations on the vtkCellArray.
void GetCurrentCell(vtkIdType &cellSize, vtkIdType const *&cellPoints)
Returns the definition of the current cell during forward traversal.
void GoToFirstCell()
The following are methods supporting forward iteration.
void GetCellAtId(vtkIdType cellId, vtkIdType &numCellPts, vtkIdType const *&cellPts)
The following are methods supporting random access iteration.
static vtkCellArrayIterator * New()
Standard methods for instantiation, type information, and printing.
void GetCellAtId(vtkIdType cellId, vtkIdList *cellIds)
The following are methods supporting random access iteration.
vtkIdList * GetCellAtId(vtkIdType cellId)
The following are methods supporting random access iteration.
vtkSmartPointer< vtkCellArray > CellArray
vtkNew< vtkIdList > TempCell