65 #ifndef vtkCellIterator_h 66 #define vtkCellIterator_h 68 #include "vtkCommonDataModelModule.h" 96 virtual bool IsDoneWithTraversal() = 0;
108 int GetCellDimension();
160 virtual void ResetToFirstCell() = 0;
165 virtual void IncrementToNextCell() = 0;
170 virtual void FetchCellType() = 0;
175 virtual void FetchPointIds() = 0;
180 virtual void FetchPoints() = 0;
201 UninitializedFlag = 0x0,
210 this->CacheFlags = UninitializedFlag;
214 void SetCache(
unsigned char flags)
216 this->CacheFlags |= flags;
219 bool CheckCache(
unsigned char flags)
221 return (this->CacheFlags & flags) == flags;
227 unsigned char CacheFlags;
231 inline void vtkCellIterator::InitTraversal()
233 this->ResetToFirstCell();
240 this->IncrementToNextCell();
247 if (!this->CheckCache(CellTypeFlag))
249 this->FetchCellType();
250 this->SetCache(CellTypeFlag);
252 return this->CellType;
258 if (!this->CheckCache(PointIdsFlag))
260 this->FetchPointIds();
261 this->SetCache(PointIdsFlag);
263 return this->PointIds;
269 if (!this->CheckCache(PointsFlag))
272 this->SetCache(PointsFlag);
280 if (!this->CheckCache(FacesFlag))
283 this->SetCache(FacesFlag);
291 if (!this->CheckCache(PointIdsFlag))
293 this->FetchPointIds();
294 this->SetCache(PointIdsFlag);
296 return this->PointIds->GetNumberOfIds();
302 switch (this->GetCellType())
365 if (!this->CheckCache(FacesFlag))
368 this->SetCache(FacesFlag);
370 return this->Faces->GetNumberOfIds() != 0 ? this->Faces->GetId(0) : 0;
373 vtkGenericWarningMacro(
"Unknown cell type: " << this->CellType);
380 #endif //vtkCellIterator_h
vtkIdType GetNumberOfFaces()
Return the number of faces in the current cell.
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.
provides thread-safe access to cells
void GoToNextCell()
Increment to next cell.
a simple class to control print indentation
list of point or cell ids
vtkIdList * GetPointIds()
Get the ids of the points in the current cell.
vtkIdList * GetFaces()
Get the faces for a polyhedral cell.
virtual void FetchFaces()
Lookup the cell faces in the data set and store them in this->Points.
int GetCellType()
Get the current cell type (e.g.
vtkPoints * GetPoints()
Get the points in the current cell.
Efficient cell iterator for vtkDataSet topologies.
represent and manipulate 3D points
vtkIdType GetNumberOfPoints()
Return the number of points in the current cell.