68#ifndef vtkCellIterator_h
69#define vtkCellIterator_h
71#include "vtkCommonDataModelModule.h"
163 virtual
void ResetToFirstCell() = 0;
168 virtual
void IncrementToNextCell() = 0;
173 virtual
void FetchCellType() = 0;
178 virtual
void FetchPointIds() = 0;
183 virtual
void FetchPoints() = 0;
191 virtual
void FetchFaces() { }
204 UninitializedFlag = 0x0,
213 this->CacheFlags = UninitializedFlag;
217 void SetCache(
unsigned char flags)
219 this->CacheFlags |= flags;
222 bool CheckCache(
unsigned char flags)
224 return (this->CacheFlags & flags) == flags;
230 unsigned char CacheFlags;
234inline void vtkCellIterator::InitTraversal()
250 if (!this->CheckCache(CellTypeFlag))
253 this->SetCache(CellTypeFlag);
261 if (!this->CheckCache(PointIdsFlag))
264 this->SetCache(PointIdsFlag);
272 if (!this->CheckCache(PointsFlag))
275 this->SetCache(PointsFlag);
283 if (!this->CheckCache(FacesFlag))
286 this->SetCache(FacesFlag);
294 if (!this->CheckCache(PointIdsFlag))
297 this->SetCache(PointIdsFlag);
368 if (!this->CheckCache(FacesFlag))
371 this->SetCache(FacesFlag);
376 vtkGenericWarningMacro(
"Unknown cell type: " << this->CellType);
Efficient cell iterator for vtkDataSet topologies.
int GetCellDimension()
Get the current cell dimension (0, 1, 2, or 3).
virtual void FetchPoints()=0
Lookup the cell points in the data set and store them in this->Points.
void GetCell(vtkGenericCell *cell)
Write the current full cell information into the argument.
virtual void FetchPointIds()=0
Lookup the cell point ids in the data set and store them in this->PointIds.
vtkIdType GetNumberOfFaces()
Return the number of faces in the current cell.
vtkIdList * GetFaces()
Get the faces for a polyhedral cell.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPoints * GetPoints()
Get the points in the current cell.
vtkAbstractTypeMacro(vtkCellIterator, vtkObject) void InitTraversal()
Reset to the first cell.
virtual void FetchCellType()=0
Lookup the cell type in the data set and store it in this->CellType.
vtkIdType GetNumberOfPoints()
Return the number of points in the current cell.
virtual void IncrementToNextCell()=0
Update internal state to point to the next cell.
virtual vtkIdType GetCellId()=0
Get the id of the current cell.
virtual void ResetToFirstCell()=0
Update internal state to point to the first cell.
vtkIdList * GetPointIds()
Get the ids of the points in the current cell.
int GetCellType()
Get the current cell type (e.g.
virtual void FetchFaces()
Lookup the cell faces in the data set and store them in this->Points.
void GoToNextCell()
Increment to next cell.
virtual bool IsDoneWithTraversal()=0
Returns false while the iterator is valid.
~vtkCellIterator() override
provides thread-safe access to cells
list of point or cell ids
vtkIdType GetNumberOfIds()
Return the number of id's in the list.
vtkIdType GetId(const vtkIdType i)
Return the id at location i.
a simple class to control print indentation
abstract base class for most VTK objects
represent and manipulate 3D points
@ VTK_QUADRATIC_HEXAHEDRON
@ VTK_HIGHER_ORDER_TETRAHEDRON
@ VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON
@ VTK_TRIQUADRATIC_HEXAHEDRON
@ VTK_PARAMETRIC_TRI_SURFACE
@ VTK_HIGHER_ORDER_TRIANGLE
@ VTK_PARAMETRIC_QUAD_SURFACE
@ VTK_HIGHER_ORDER_PYRAMID
@ VTK_PARAMETRIC_HEX_REGION
@ VTK_QUADRATIC_LINEAR_WEDGE
@ VTK_HIGHER_ORDER_HEXAHEDRON
@ VTK_PARAMETRIC_TETRA_REGION
@ VTK_QUADRATIC_LINEAR_QUAD
@ VTK_BIQUADRATIC_QUADRATIC_WEDGE
@ VTK_HIGHER_ORDER_POLYGON
@ VTK_BIQUADRATIC_TRIANGLE