Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkCommand.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCommand.h,v $
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 =========================================================================*/
00061 #ifndef __vtkCommand_h
00062 #define __vtkCommand_h
00063 
00064 #include "vtkObjectBase.h"
00065 
00066 class vtkObject;
00067 
00068 // The superclass that all commands should be subclasses of
00069 class VTK_COMMON_EXPORT vtkCommand : public vtkObjectBase
00070 {
00071 public:
00073 
00076   void UnRegister();
00077   virtual void UnRegister(vtkObjectBase *) 
00078     { this->UnRegister(); }
00080   
00082 
00091   virtual void Execute(vtkObject *caller, unsigned long eventId, 
00092                        void *callData) = 0;
00094 
00096 
00098   static const char *GetStringFromEventId(unsigned long event);
00099   static unsigned long GetEventIdFromString(const char *event);
00101 
00103 
00105   void SetAbortFlag(int f)  
00106     { this->AbortFlag = f; }
00107   int GetAbortFlag() 
00108     { return this->AbortFlag; }
00109   void AbortFlagOn() 
00110     { this->SetAbortFlag(1); }
00111   void AbortFlagOff() 
00112     { this->SetAbortFlag(0); }
00114   
00115 //BTX
00117 
00121   enum EventIds {
00122     NoEvent = 0,
00123     AnyEvent,
00124     DeleteEvent,
00125     StartEvent,
00126     EndEvent,
00127     ProgressEvent,
00128     PickEvent,
00129     StartPickEvent,
00130     EndPickEvent,
00131     AbortCheckEvent,
00132     ExitEvent,
00133     LeftButtonPressEvent,
00134     LeftButtonReleaseEvent,
00135     MiddleButtonPressEvent,
00136     MiddleButtonReleaseEvent,
00137     RightButtonPressEvent,
00138     RightButtonReleaseEvent,
00139     EnterEvent,
00140     LeaveEvent,
00141     KeyPressEvent,
00142     KeyReleaseEvent,
00143     CharEvent,
00144     ExposeEvent,
00145     ConfigureEvent,
00146     TimerEvent,
00147     MouseMoveEvent,
00148     MouseWheelForwardEvent,
00149     MouseWheelBackwardEvent,
00150     ResetCameraEvent,
00151     ResetCameraClippingRangeEvent,
00152     ModifiedEvent,
00153     WindowLevelEvent,
00154     StartWindowLevelEvent,
00155     EndWindowLevelEvent,
00156     ResetWindowLevelEvent,
00157     SetOutputEvent,
00158     ErrorEvent,
00159     WarningEvent,
00160     StartInteractionEvent, //mainly used by vtkInteractorObservers
00161     InteractionEvent,
00162     EndInteractionEvent,
00163     EnableEvent,
00164     DisableEvent,
00165     CreateTimerEvent,
00166     DestroyTimerEvent,
00167     PlaceWidgetEvent,
00168     CursorChangedEvent,
00169     ExecuteInformationEvent,
00170     RenderWindowMessageEvent,
00171     WrongTagEvent,
00172     UserEvent = 1000
00173   };
00175 //ETX
00176 
00177 protected:
00178   int AbortFlag;
00179   vtkCommand();
00180   virtual ~vtkCommand() {}
00181 
00182   friend class vtkSubjectHelper;
00183 //BTX
00184   vtkCommand(const vtkCommand& c) : vtkObjectBase(c) {}
00185   void operator=(const vtkCommand&) {}
00186 //ETX
00187 };
00188 
00189 #endif /* __vtkCommand_h */
00190