VTK
dox/Common/DataModel/vtkUnstructuredGridCellIterator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkUnstructuredGridCellIterator.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00023 #ifndef __vtkUnstructuredGridCellIterator_h
00024 #define __vtkUnstructuredGridCellIterator_h
00025 
00026 #include "vtkCommonDataModelModule.h" // For export macro
00027 #include "vtkCellIterator.h"
00028 #include "vtkSmartPointer.h" // For vtkSmartPointer
00029 
00030 class vtkCellArray;
00031 class vtkUnsignedCharArray;
00032 class vtkUnstructuredGrid;
00033 class vtkPoints;
00034 
00035 class VTKCOMMONDATAMODEL_EXPORT vtkUnstructuredGridCellIterator :
00036     public vtkCellIterator
00037 {
00038 public:
00039   static vtkUnstructuredGridCellIterator *New();
00040   vtkTypeMacro(vtkUnstructuredGridCellIterator, vtkCellIterator)
00041   virtual void PrintSelf(ostream &os, vtkIndent indent);
00042 
00043   bool IsDoneWithTraversal();
00044   vtkIdType GetCellId();
00045 
00046 protected:
00047   vtkUnstructuredGridCellIterator();
00048   ~vtkUnstructuredGridCellIterator();
00049 
00050   void ResetToFirstCell();
00051   void IncrementToNextCell();
00052   void FetchCellType();
00053   void FetchPointIds();
00054   void FetchPoints();
00055   void FetchFaces();
00056 
00057   friend class vtkUnstructuredGrid;
00058   void SetUnstructuredGrid(vtkUnstructuredGrid *ug);
00059 
00060   unsigned char *CellTypeBegin;
00061   unsigned char *CellTypePtr;
00062   unsigned char *CellTypeEnd;
00063 
00064   vtkIdType *ConnectivityBegin;
00065   vtkIdType *ConnectivityPtr;
00066   vtkIdType *FacesBegin;
00067   vtkIdType *FacesLocsBegin;
00068   vtkIdType *FacesLocsPtr;
00069 
00070   // Cache misses make updating ConnectivityPtr in IncrementToNextCell too
00071   // expensive, so we wait to walk through the array until the point ids are
00072   // needed. This variable keeps track of how far we need to increment.
00073   vtkIdType SkippedCells;
00074   void CatchUpSkippedCells();
00075 
00076   vtkSmartPointer<vtkPoints> UnstructuredGridPoints;
00077 
00078 private:
00079   vtkUnstructuredGridCellIterator(const vtkUnstructuredGridCellIterator &); // Not implemented.
00080   void operator=(const vtkUnstructuredGridCellIterator &);   // Not implemented.
00081 };
00082 
00083 #endif //__vtkUnstructuredGridCellIterator_h