[vtk-developers] Recent change in vtkCellType.h

Mathieu Malaterre mathieu.malaterre at kitware.com
Tue May 2 14:43:37 EDT 2006


Hi,

	I changed the #define in the file vtkCellType.h into an enum. As far as 
I know this should not be an issue for anyone, if not let me know ASAP. 
The reasoning behind was that:

* First this allow to automatically count the max number of cells in VTK 
(used to be defined in vtkCutter under VTK_NUMBER_OF_CELL_TYPES)

* A developer can now verify he wrote a correct switch instead of doing:

       switch (input->GetCellType(cellId))
         {
         case VTK_EMPTY_CELL:
         ...

one can now do:

       VTKCellType t = input->GetCellType(cellId);
       switch (t)
         {
         case VTK_EMPTY_CELL:

then one only need to make sure to use -Wswitch (gcc) when compiling 
VTK, this will generate warning for the enumerated case not treated.


Mathieu



More information about the vtk-developers mailing list