00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00204 #ifndef __vtkCommand_h
00205 #define __vtkCommand_h
00206
00207 #include "vtkObjectBase.h"
00208 #include "vtkObject.h"
00209
00210
00211 class VTK_COMMON_EXPORT vtkCommand : public vtkObjectBase
00212 {
00213 public:
00214 vtkTypeMacro(vtkCommand,vtkObjectBase);
00215
00217
00220 void UnRegister();
00221 virtual void UnRegister(vtkObjectBase *)
00222 { this->UnRegister(); }
00224
00226
00235 virtual void Execute(vtkObject *caller, unsigned long eventId,
00236 void *callData) = 0;
00238
00240
00242 static const char *GetStringFromEventId(unsigned long event);
00243 static unsigned long GetEventIdFromString(const char *event);
00245
00247
00249 void SetAbortFlag(int f)
00250 { this->AbortFlag = f; }
00251 int GetAbortFlag()
00252 { return this->AbortFlag; }
00253 void AbortFlagOn()
00254 { this->SetAbortFlag(1); }
00255 void AbortFlagOff()
00256 { this->SetAbortFlag(0); }
00258
00260
00264 void SetPassiveObserver(int f)
00265 { this->PassiveObserver = f; }
00266 int GetPassiveObserver()
00267 { return this->PassiveObserver; }
00268 void PassiveObserverOn()
00269 { this->SetPassiveObserver(1); }
00270 void PassiveObserverOff()
00271 { this->SetPassiveObserver(0); }
00273
00274
00276
00280 enum EventIds {
00281 NoEvent = 0,
00282 AnyEvent,
00283 DeleteEvent,
00284 StartEvent,
00285 EndEvent,
00286 RenderEvent,
00287 ProgressEvent,
00288 PickEvent,
00289 StartPickEvent,
00290 EndPickEvent,
00291 AbortCheckEvent,
00292 ExitEvent,
00293 LeftButtonPressEvent,
00294 LeftButtonReleaseEvent,
00295 MiddleButtonPressEvent,
00296 MiddleButtonReleaseEvent,
00297 RightButtonPressEvent,
00298 RightButtonReleaseEvent,
00299 EnterEvent,
00300 LeaveEvent,
00301 KeyPressEvent,
00302 KeyReleaseEvent,
00303 CharEvent,
00304 ExposeEvent,
00305 ConfigureEvent,
00306 TimerEvent,
00307 MouseMoveEvent,
00308 MouseWheelForwardEvent,
00309 MouseWheelBackwardEvent,
00310 ActiveCameraEvent,
00311 CreateCameraEvent,
00312 ResetCameraEvent,
00313 ResetCameraClippingRangeEvent,
00314 ModifiedEvent,
00315 WindowLevelEvent,
00316 StartWindowLevelEvent,
00317 EndWindowLevelEvent,
00318 ResetWindowLevelEvent,
00319 SetOutputEvent,
00320 ErrorEvent,
00321 WarningEvent,
00322 StartInteractionEvent,
00323 InteractionEvent,
00324 EndInteractionEvent,
00325 EnableEvent,
00326 DisableEvent,
00327 CreateTimerEvent,
00328 DestroyTimerEvent,
00329 PlacePointEvent,
00330 PlaceWidgetEvent,
00331 CursorChangedEvent,
00332 ExecuteInformationEvent,
00333 RenderWindowMessageEvent,
00334 WrongTagEvent,
00335 StartAnimationCueEvent,
00336 AnimationCueTickEvent,
00337 EndAnimationCueEvent,
00338 VolumeMapperRenderEndEvent,
00339 VolumeMapperRenderProgressEvent,
00340 VolumeMapperRenderStartEvent,
00341 VolumeMapperComputeGradientsEndEvent,
00342 VolumeMapperComputeGradientsProgressEvent,
00343 VolumeMapperComputeGradientsStartEvent,
00344 WidgetModifiedEvent,
00345 WidgetValueChangedEvent,
00346 WidgetActivateEvent,
00347 ConnectionCreatedEvent,
00348 ConnectionClosedEvent,
00349 DomainModifiedEvent,
00350 PropertyModifiedEvent,
00351 UpdateEvent,
00352 RegisterEvent,
00353 UnRegisterEvent,
00354 UpdateInformationEvent,
00355 AnnotationChangedEvent,
00356 SelectionChangedEvent,
00357 UpdatePropertyEvent,
00358 ViewProgressEvent,
00359 UpdateDataEvent,
00360 CurrentChangedEvent,
00361 ComputeVisiblePropBoundsEvent,
00362 TDxMotionEvent,
00363 TDxButtonPressEvent,
00364 TDxButtonReleaseEvent,
00365 HoverEvent,
00366 LoadStateEvent,
00367 SaveStateEvent,
00368 StateChangedEvent,
00369 WindowMakeCurrentEvent,
00370 WindowIsCurrentEvent,
00371 WindowFrameEvent,
00372 HighlightEvent,
00373 WindowSupportsOpenGLEvent,
00374 WindowIsDirectEvent,
00375 UserEvent = 1000
00376 };
00377
00379
00380 protected:
00381 int AbortFlag;
00382 int PassiveObserver;
00383
00384 vtkCommand();
00385 virtual ~vtkCommand() {}
00386
00387 friend class vtkSubjectHelper;
00388
00389 vtkCommand(const vtkCommand& c) : vtkObjectBase(c) {}
00390 void operator=(const vtkCommand&) {}
00391
00392 };
00393
00394 #endif
00395