68 #ifndef vtkCellIterator_h 69 #define vtkCellIterator_h 71 #include "vtkCommonDataModelModule.h" 99 virtual bool IsDoneWithTraversal() = 0;
111 int GetCellDimension();
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;
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;
234 inline void vtkCellIterator::InitTraversal()
236 this->ResetToFirstCell();
243 this->IncrementToNextCell();
250 if (!this->CheckCache(CellTypeFlag))
252 this->FetchCellType();
253 this->SetCache(CellTypeFlag);
255 return this->CellType;
261 if (!this->CheckCache(PointIdsFlag))
263 this->FetchPointIds();
264 this->SetCache(PointIdsFlag);
266 return this->PointIds;
272 if (!this->CheckCache(PointsFlag))
275 this->SetCache(PointsFlag);
283 if (!this->CheckCache(FacesFlag))
286 this->SetCache(FacesFlag);
294 if (!this->CheckCache(PointIdsFlag))
296 this->FetchPointIds();
297 this->SetCache(PointIdsFlag);
299 return this->PointIds->GetNumberOfIds();
305 switch (this->GetCellType())
368 if (!this->CheckCache(FacesFlag))
371 this->SetCache(FacesFlag);
373 return this->Faces->GetNumberOfIds() != 0 ? this->Faces->GetId(0) : 0;
376 vtkGenericWarningMacro(
"Unknown cell type: " << this->CellType);
383 #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.