00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00046 #ifndef __vtkCommand_h
00047 #define __vtkCommand_h
00048
00049 #include "vtkObjectBase.h"
00050
00051 class vtkObject;
00052
00053
00054 class VTK_COMMON_EXPORT vtkCommand : public vtkObjectBase
00055 {
00056 public:
00058
00061 void UnRegister();
00062 virtual void UnRegister(vtkObjectBase *)
00063 { this->UnRegister(); }
00065
00067
00076 virtual void Execute(vtkObject *caller, unsigned long eventId,
00077 void *callData) = 0;
00079
00081
00083 static const char *GetStringFromEventId(unsigned long event);
00084 static unsigned long GetEventIdFromString(const char *event);
00086
00088
00090 void SetAbortFlag(int f)
00091 { this->AbortFlag = f; }
00092 int GetAbortFlag()
00093 { return this->AbortFlag; }
00094 void AbortFlagOn()
00095 { this->SetAbortFlag(1); }
00096 void AbortFlagOff()
00097 { this->SetAbortFlag(0); }
00099
00101
00105 void SetPassiveObserver(int f)
00106 { this->PassiveObserver = f; }
00107 int GetPassiveObserver()
00108 { return this->PassiveObserver; }
00109 void PassiveObserverOn()
00110 { this->SetPassiveObserver(1); }
00111 void PassiveObserverOff()
00112 { this->SetPassiveObserver(0); }
00114
00115
00117
00121 enum EventIds {
00122 NoEvent = 0,
00123 AnyEvent,
00124 DeleteEvent,
00125 StartEvent,
00126 EndEvent,
00127 RenderEvent,
00128 ProgressEvent,
00129 PickEvent,
00130 StartPickEvent,
00131 EndPickEvent,
00132 AbortCheckEvent,
00133 ExitEvent,
00134 LeftButtonPressEvent,
00135 LeftButtonReleaseEvent,
00136 MiddleButtonPressEvent,
00137 MiddleButtonReleaseEvent,
00138 RightButtonPressEvent,
00139 RightButtonReleaseEvent,
00140 EnterEvent,
00141 LeaveEvent,
00142 KeyPressEvent,
00143 KeyReleaseEvent,
00144 CharEvent,
00145 ExposeEvent,
00146 ConfigureEvent,
00147 TimerEvent,
00148 MouseMoveEvent,
00149 MouseWheelForwardEvent,
00150 MouseWheelBackwardEvent,
00151 ResetCameraEvent,
00152 ResetCameraClippingRangeEvent,
00153 ModifiedEvent,
00154 WindowLevelEvent,
00155 StartWindowLevelEvent,
00156 EndWindowLevelEvent,
00157 ResetWindowLevelEvent,
00158 SetOutputEvent,
00159 ErrorEvent,
00160 WarningEvent,
00161 StartInteractionEvent,
00162 InteractionEvent,
00163 EndInteractionEvent,
00164 EnableEvent,
00165 DisableEvent,
00166 CreateTimerEvent,
00167 DestroyTimerEvent,
00168 PlacePointEvent,
00169 PlaceWidgetEvent,
00170 CursorChangedEvent,
00171 ExecuteInformationEvent,
00172 RenderWindowMessageEvent,
00173 WrongTagEvent,
00174 StartAnimationCueEvent,
00175 AnimationCueTickEvent,
00176 EndAnimationCueEvent,
00177 VolumeMapperRenderProgressEvent,
00178 VolumeMapperComputeGradientsEndEvent,
00179 VolumeMapperComputeGradientsProgressEvent,
00180 VolumeMapperComputeGradientsStartEvent,
00181 WidgetModifiedEvent,
00182 WidgetValueChangedEvent,
00183 WidgetActivateEvent,
00184 UserEvent = 1000
00185 };
00187
00188
00189 protected:
00190 int AbortFlag;
00191 int PassiveObserver;
00192
00193 vtkCommand();
00194 virtual ~vtkCommand() {}
00195
00196 friend class vtkSubjectHelper;
00197
00198 vtkCommand(const vtkCommand& c) : vtkObjectBase(c) {}
00199 void operator=(const vtkCommand&) {}
00200
00201 };
00202
00203 #endif
00204