00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00190 #ifndef __vtkCommand_h
00191 #define __vtkCommand_h
00192
00193 #include "vtkObjectBase.h"
00194
00195 class vtkObject;
00196
00197
00198 class VTK_COMMON_EXPORT vtkCommand : public vtkObjectBase
00199 {
00200 public:
00202
00205 void UnRegister();
00206 virtual void UnRegister(vtkObjectBase *)
00207 { this->UnRegister(); }
00209
00211
00220 virtual void Execute(vtkObject *caller, unsigned long eventId,
00221 void *callData) = 0;
00223
00225
00227 static const char *GetStringFromEventId(unsigned long event);
00228 static unsigned long GetEventIdFromString(const char *event);
00230
00232
00234 void SetAbortFlag(int f)
00235 { this->AbortFlag = f; }
00236 int GetAbortFlag()
00237 { return this->AbortFlag; }
00238 void AbortFlagOn()
00239 { this->SetAbortFlag(1); }
00240 void AbortFlagOff()
00241 { this->SetAbortFlag(0); }
00243
00245
00249 void SetPassiveObserver(int f)
00250 { this->PassiveObserver = f; }
00251 int GetPassiveObserver()
00252 { return this->PassiveObserver; }
00253 void PassiveObserverOn()
00254 { this->SetPassiveObserver(1); }
00255 void PassiveObserverOff()
00256 { this->SetPassiveObserver(0); }
00258
00259
00261
00265 enum EventIds {
00266 NoEvent = 0,
00267 AnyEvent,
00268 DeleteEvent,
00269 StartEvent,
00270 EndEvent,
00271 RenderEvent,
00272 ProgressEvent,
00273 PickEvent,
00274 StartPickEvent,
00275 EndPickEvent,
00276 AbortCheckEvent,
00277 ExitEvent,
00278 LeftButtonPressEvent,
00279 LeftButtonReleaseEvent,
00280 MiddleButtonPressEvent,
00281 MiddleButtonReleaseEvent,
00282 RightButtonPressEvent,
00283 RightButtonReleaseEvent,
00284 EnterEvent,
00285 LeaveEvent,
00286 KeyPressEvent,
00287 KeyReleaseEvent,
00288 CharEvent,
00289 ExposeEvent,
00290 ConfigureEvent,
00291 TimerEvent,
00292 MouseMoveEvent,
00293 MouseWheelForwardEvent,
00294 MouseWheelBackwardEvent,
00295 ResetCameraEvent,
00296 ResetCameraClippingRangeEvent,
00297 ModifiedEvent,
00298 WindowLevelEvent,
00299 StartWindowLevelEvent,
00300 EndWindowLevelEvent,
00301 ResetWindowLevelEvent,
00302 SetOutputEvent,
00303 ErrorEvent,
00304 WarningEvent,
00305 StartInteractionEvent,
00306 InteractionEvent,
00307 EndInteractionEvent,
00308 EnableEvent,
00309 DisableEvent,
00310 CreateTimerEvent,
00311 DestroyTimerEvent,
00312 PlacePointEvent,
00313 PlaceWidgetEvent,
00314 CursorChangedEvent,
00315 ExecuteInformationEvent,
00316 RenderWindowMessageEvent,
00317 WrongTagEvent,
00318 StartAnimationCueEvent,
00319 AnimationCueTickEvent,
00320 EndAnimationCueEvent,
00321 VolumeMapperRenderEndEvent,
00322 VolumeMapperRenderProgressEvent,
00323 VolumeMapperRenderStartEvent,
00324 VolumeMapperComputeGradientsEndEvent,
00325 VolumeMapperComputeGradientsProgressEvent,
00326 VolumeMapperComputeGradientsStartEvent,
00327 WidgetModifiedEvent,
00328 WidgetValueChangedEvent,
00329 WidgetActivateEvent,
00330 ConnectionCreatedEvent,
00331 ConnectionClosedEvent,
00332 DomainModifiedEvent,
00333 PropertyModifiedEvent,
00334 UpdateEvent,
00335 RegisterEvent,
00336 UnRegisterEvent,
00337 UpdateInformationEvent,
00338 SelectionChangedEvent,
00339 UpdatePropertyEvent,
00340 UserEvent = 1000
00341 };
00343
00344
00345 protected:
00346 int AbortFlag;
00347 int PassiveObserver;
00348
00349 vtkCommand();
00350 virtual ~vtkCommand() {}
00351
00352 friend class vtkSubjectHelper;
00353
00354 vtkCommand(const vtkCommand& c) : vtkObjectBase(c) {}
00355 void operator=(const vtkCommand&) {}
00356
00357 };
00358
00359 #endif
00360