Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Common/vtkCommand.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCommand.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00028 #ifndef __vtkCommand_h
00029 #define __vtkCommand_h
00030 
00031 #include "vtkWin32Header.h"
00032 
00033 class vtkObject;
00034 
00035 // The superclass that all commands should be subclasses of
00036 class VTK_COMMON_EXPORT vtkCommand
00037 {
00038 public:
00039   void Delete() {
00040     this->UnRegister(); }
00041 
00043 
00044   void Register();
00045   void Register(vtkObject *) {
00046     this->Register(); }
00048   
00050 
00053   void UnRegister();
00054   void UnRegister(vtkObject *) {
00055     this->UnRegister(); }
00057   
00058   virtual void Execute(vtkObject *caller, unsigned long, void *callData) = 0;
00059   static const char *GetStringFromEventId(unsigned long event);
00060   static unsigned long GetEventIdFromString(const char *event);
00061 
00062 //BTX
00063   // all the currently defined events
00064   // developers can use -- vtkCommand::UserEvent + int to
00065   // specify their own events. 
00066   // if this list is adjusted, be sure to adjust vtkCommandEventStrings
00067   // in vtkCommand.cxx to match.
00068   enum EventIds {
00069     NoEvent = 0,
00070     AnyEvent,
00071     DeleteEvent,
00072     StartEvent,
00073     EndEvent,
00074     ProgressEvent,
00075     PickEvent,
00076     StartPickEvent,
00077     EndPickEvent,
00078     AbortCheckEvent,
00079     ExitEvent,
00080     LeftButtonPressEvent,
00081     LeftButtonReleaseEvent,
00082     MiddleButtonPressEvent,
00083     MiddleButtonReleaseEvent,
00084     RightButtonPressEvent,
00085     RightButtonReleaseEvent,
00086     EnterEvent,
00087     LeaveEvent,
00088     KeyPressEvent,
00089     KeyReleaseEvent,
00090     CharEvent,
00091     ConfigureEvent,
00092     TimerEvent,
00093     MouseMoveEvent,
00094     ResetCameraEvent,
00095     ResetCameraClippingRangeEvent,
00096     ModifiedEvent,
00097     WindowLevelEvent,
00098     NextDataEvent,
00099     PushDataStartEvent,
00100     SetOutputEvent,
00101     EndOfDataEvent,
00102     ErrorEvent,
00103     WarningEvent,
00104     UserEvent = 1000
00105   };
00106 //ETX
00107 protected:
00108   int ReferenceCount;      // Number of uses of this object by other objects
00109   vtkCommand() { this->ReferenceCount = 1;};
00110   virtual ~vtkCommand() {};
00111 };
00112 
00113 #endif /* __vtkCommand_h */
00114  

Generated on Thu Mar 28 14:19:14 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001