[vtk-developers] VTK style ques. - enum vars

Dean Inglis dean.inglis at sympatico.ca
Mon Sep 18 09:39:05 EDT 2006


with regard to this vtkusers message thread:

http://public.kitware.com/pipermail/vtkusers/2006-September/087016.html


it appears that at least 1 user has experienced
this problem with a conflict between #defines of
LEFT_BUTTON, RIGHT_BUTTON, MIDDLE_BUTTON
in the MFC afxctl.h file and the (protected) enum vars
in vtkImagePlaneWidget.h:
   enum
   {
   LEFT_BUTTON = 1,
   RIGHT_BUTTON = 2,
   MIDDLE_BUTTON = 3
   };

It was news to me that enums within a class are treated as
#defines and can therefore be #undef(ined) (please correct
me if I'm wrong!).  As a question of style, is there any
objection/problem to changing the above enums to say
   enum
   {
   VTK_LEFT_BUTTON = 1,
   VTK_RIGHT_BUTTON = 2,
   VTK_MIDDLE_BUTTON = 3
   };

thanks,
Dean




More information about the vtk-developers mailing list