VTK
|
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 =========================================================================*/ 00192 #ifndef __vtkCommand_h 00193 #define __vtkCommand_h 00194 00195 #include "vtkObjectBase.h" 00196 00197 class vtkObject; 00198 00199 // The superclass that all commands should be subclasses of 00200 class VTK_COMMON_EXPORT vtkCommand : public vtkObjectBase 00201 { 00202 public: 00204 00207 void UnRegister(); 00208 virtual void UnRegister(vtkObjectBase *) 00209 { this->UnRegister(); } 00211 00213 00222 virtual void Execute(vtkObject *caller, unsigned long eventId, 00223 void *callData) = 0; 00225 00227 00229 static const char *GetStringFromEventId(unsigned long event); 00230 static unsigned long GetEventIdFromString(const char *event); 00232 00234 00236 void SetAbortFlag(int f) 00237 { this->AbortFlag = f; } 00238 int GetAbortFlag() 00239 { return this->AbortFlag; } 00240 void AbortFlagOn() 00241 { this->SetAbortFlag(1); } 00242 void AbortFlagOff() 00243 { this->SetAbortFlag(0); } 00245 00247 00251 void SetPassiveObserver(int f) 00252 { this->PassiveObserver = f; } 00253 int GetPassiveObserver() 00254 { return this->PassiveObserver; } 00255 void PassiveObserverOn() 00256 { this->SetPassiveObserver(1); } 00257 void PassiveObserverOff() 00258 { this->SetPassiveObserver(0); } 00260 00261 //BTX 00263 00267 enum EventIds { 00268 NoEvent = 0, 00269 AnyEvent, 00270 DeleteEvent, 00271 StartEvent, 00272 EndEvent, 00273 RenderEvent, 00274 ProgressEvent, 00275 PickEvent, 00276 StartPickEvent, 00277 EndPickEvent, 00278 AbortCheckEvent, 00279 ExitEvent, 00280 LeftButtonPressEvent, 00281 LeftButtonReleaseEvent, 00282 MiddleButtonPressEvent, 00283 MiddleButtonReleaseEvent, 00284 RightButtonPressEvent, 00285 RightButtonReleaseEvent, 00286 EnterEvent, 00287 LeaveEvent, 00288 KeyPressEvent, 00289 KeyReleaseEvent, 00290 CharEvent, 00291 ExposeEvent, 00292 ConfigureEvent, 00293 TimerEvent, 00294 MouseMoveEvent, 00295 MouseWheelForwardEvent, 00296 MouseWheelBackwardEvent, 00297 ActiveCameraEvent, 00298 CreateCameraEvent, 00299 ResetCameraEvent, 00300 ResetCameraClippingRangeEvent, 00301 ModifiedEvent, 00302 WindowLevelEvent, 00303 StartWindowLevelEvent, 00304 EndWindowLevelEvent, 00305 ResetWindowLevelEvent, 00306 SetOutputEvent, 00307 ErrorEvent, 00308 WarningEvent, 00309 StartInteractionEvent, //mainly used by vtkInteractorObservers 00310 InteractionEvent, 00311 EndInteractionEvent, 00312 EnableEvent, 00313 DisableEvent, 00314 CreateTimerEvent, 00315 DestroyTimerEvent, 00316 PlacePointEvent, 00317 PlaceWidgetEvent, 00318 CursorChangedEvent, 00319 ExecuteInformationEvent, 00320 RenderWindowMessageEvent, 00321 WrongTagEvent, 00322 StartAnimationCueEvent, // used by vtkAnimationCue 00323 AnimationCueTickEvent, 00324 EndAnimationCueEvent, 00325 VolumeMapperRenderEndEvent, 00326 VolumeMapperRenderProgressEvent, 00327 VolumeMapperRenderStartEvent, 00328 VolumeMapperComputeGradientsEndEvent, 00329 VolumeMapperComputeGradientsProgressEvent, 00330 VolumeMapperComputeGradientsStartEvent, 00331 WidgetModifiedEvent, 00332 WidgetValueChangedEvent, 00333 WidgetActivateEvent, 00334 ConnectionCreatedEvent, 00335 ConnectionClosedEvent, 00336 DomainModifiedEvent, 00337 PropertyModifiedEvent, 00338 UpdateEvent, 00339 RegisterEvent, 00340 UnRegisterEvent, 00341 UpdateInformationEvent, 00342 SelectionChangedEvent, 00343 UpdatePropertyEvent, 00344 ViewProgressEvent, 00345 UpdateDataEvent, 00346 CurrentChangedEvent, 00347 UserEvent = 1000 00348 }; 00350 //ETX 00351 00352 protected: 00353 int AbortFlag; 00354 int PassiveObserver; 00355 00356 vtkCommand(); 00357 virtual ~vtkCommand() {} 00358 00359 friend class vtkSubjectHelper; 00360 //BTX 00361 vtkCommand(const vtkCommand& c) : vtkObjectBase(c) {} 00362 void operator=(const vtkCommand&) {} 00363 //ETX 00364 }; 00365 00366 #endif /* __vtkCommand_h */ 00367