VTK
vtkRenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRenderWindowInteractor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
51 #ifndef vtkRenderWindowInteractor_h
52 #define vtkRenderWindowInteractor_h
53 
54 #include "vtkRenderingCoreModule.h" // For export macro
55 #include "vtkObject.h"
56 #include "vtkCommand.h" // for method sig
57 
58 class vtkTimerIdMap;
59 
60 // Timer flags for win32/X compatibility
61 #define VTKI_TIMER_FIRST 0
62 #define VTKI_TIMER_UPDATE 1
63 
64 // maximum pointers active at once
65 // for example in multitouch
66 #define VTKI_MAX_POINTERS 5
67 
68 class vtkAbstractPicker;
70 class vtkAssemblyPath;
72 class vtkRenderWindow;
73 class vtkRenderer;
76 class vtkPickingManager;
77 
78 class VTKRENDERINGCORE_EXPORT vtkRenderWindowInteractor : public vtkObject
79 {
80 
82 
83 public:
86  void PrintSelf(ostream& os, vtkIndent indent) override;
87 
89 
96  virtual void Initialize();
97  void ReInitialize() { this->Initialized = 0; this->Enabled = 0;
98  this->Initialize(); }
100 
105  void UnRegister(vtkObjectBase *o) override;
106 
112  virtual void Start();
113 
123  virtual void Enable() { this->Enabled = 1; this->Modified();}
124  virtual void Disable() { this->Enabled = 0; this->Modified();}
125  vtkGetMacro(Enabled, int);
126 
128 
132  vtkBooleanMacro(EnableRender, bool);
133  vtkSetMacro(EnableRender, bool);
134  vtkGetMacro(EnableRender, bool);
136 
138 
142  vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
144 
149  virtual void UpdateSize(int x,int y);
150 
167  virtual int CreateTimer(int timerType); //first group, for backward compatibility
168  virtual int DestroyTimer(); //first group, for backward compatibility
169 
174  int CreateRepeatingTimer(unsigned long duration);
175 
180  int CreateOneShotTimer(unsigned long duration);
181 
186  int IsOneShotTimer(int timerId);
187 
191  unsigned long GetTimerDuration(int timerId);
192 
196  int ResetTimer(int timerId);
197 
202  int DestroyTimer(int timerId);
203 
207  virtual int GetVTKTimerId(int platformTimerId);
208 
209  // Moved into the public section of the class so that classless timer procs
210  // can access these enum members without being "friends"...
211  enum {OneShotTimer=1,RepeatingTimer};
212 
214 
223  vtkSetClampMacro(TimerDuration,unsigned long,1,100000);
224  vtkGetMacro(TimerDuration,unsigned long);
226 
228 
240  vtkSetMacro(TimerEventId, int);
241  vtkGetMacro(TimerEventId, int);
242  vtkSetMacro(TimerEventType, int);
243  vtkGetMacro(TimerEventType, int);
244  vtkSetMacro(TimerEventDuration, int);
245  vtkGetMacro(TimerEventDuration, int);
246  vtkSetMacro(TimerEventPlatformId, int);
247  vtkGetMacro(TimerEventPlatformId, int);
249 
255  virtual void TerminateApp(void) {}
256 
258 
263  vtkGetObjectMacro(InteractorStyle,vtkInteractorObserver);
265 
267 
271  vtkSetMacro(LightFollowCamera,vtkTypeBool);
272  vtkGetMacro(LightFollowCamera,vtkTypeBool);
273  vtkBooleanMacro(LightFollowCamera,vtkTypeBool);
275 
277 
284  vtkSetClampMacro(DesiredUpdateRate,double,0.0001,VTK_FLOAT_MAX);
285  vtkGetMacro(DesiredUpdateRate,double);
287 
289 
294  vtkSetClampMacro(StillUpdateRate,double,0.0001,VTK_FLOAT_MAX);
295  vtkGetMacro(StillUpdateRate,double);
297 
299 
303  vtkGetMacro(Initialized,int);
305 
307 
313  virtual void SetPicker(vtkAbstractPicker*);
314  vtkGetObjectMacro(Picker,vtkAbstractPicker);
316 
322 
324 
330  vtkGetObjectMacro(PickingManager,vtkPickingManager);
332 
334 
338  virtual void ExitCallback();
339  virtual void UserCallback();
340  virtual void StartPickCallback();
341  virtual void EndPickCallback();
343 
347  virtual void GetMousePosition(int *x, int *y) { *x = 0 ; *y = 0; }
348 
350 
354  void HideCursor();
355  void ShowCursor();
357 
362  virtual void Render();
363 
365 
370  void FlyTo(vtkRenderer *ren, double x, double y, double z);
371  void FlyTo(vtkRenderer *ren, double *x)
372  {this->FlyTo(ren, x[0], x[1], x[2]);}
373  void FlyToImage(vtkRenderer *ren, double x, double y);
374  void FlyToImage(vtkRenderer *ren, double *x)
375  {this->FlyToImage(ren, x[0], x[1]);}
377 
379 
382  vtkSetClampMacro(NumberOfFlyFrames,int,1,VTK_INT_MAX);
383  vtkGetMacro(NumberOfFlyFrames,int);
385 
387 
391  vtkSetMacro(Dolly,double);
392  vtkGetMacro(Dolly,double);
394 
396 
404  vtkGetVector2Macro(EventPosition,int);
405  vtkGetVector2Macro(LastEventPosition,int);
406  vtkSetVector2Macro(LastEventPosition,int);
407  virtual void SetEventPosition(int x, int y)
408  {
409  vtkDebugMacro(<< this->GetClassName() << " (" << this
410  << "): setting EventPosition to (" << x << "," << y << ")");
411  if (this->EventPosition[0] != x || this->EventPosition[1] != y ||
412  this->LastEventPosition[0] != x || this->LastEventPosition[1] != y)
413  {
414  this->LastEventPosition[0] = this->EventPosition[0];
415  this->LastEventPosition[1] = this->EventPosition[1];
416  this->EventPosition[0] = x;
417  this->EventPosition[1] = y;
418  this->Modified();
419  }
420  }
421  virtual void SetEventPosition(int pos[2])
422  {
423  this->SetEventPosition(pos[0], pos[1]);
424  }
425  virtual void SetEventPositionFlipY(int x, int y)
426  {
427  this->SetEventPosition(x, this->Size[1] - y - 1);
428  }
429  virtual void SetEventPositionFlipY(int pos[2])
430  {
431  this->SetEventPositionFlipY(pos[0], pos[1]);
432  }
434 
435  virtual int *GetEventPositions(int pointerIndex)
436  {
437  if (pointerIndex >= VTKI_MAX_POINTERS)
438  {
439  return nullptr;
440  }
441  return this->EventPositions[pointerIndex];
442  }
443  virtual int *GetLastEventPositions(int pointerIndex)
444  {
445  if (pointerIndex >= VTKI_MAX_POINTERS)
446  {
447  return nullptr;
448  }
449  return this->LastEventPositions[pointerIndex];
450  }
451  virtual void SetEventPosition(int x, int y, int pointerIndex)
452  {
453  if (pointerIndex < 0 || pointerIndex >= VTKI_MAX_POINTERS)
454  {
455  return;
456  }
457  if (pointerIndex == 0)
458  {
459  this->LastEventPosition[0] = this->EventPosition[0];
460  this->LastEventPosition[1] = this->EventPosition[1];
461  this->EventPosition[0] = x;
462  this->EventPosition[1] = y;
463  }
464  vtkDebugMacro(<< this->GetClassName() << " (" << this
465  << "): setting EventPosition to (" << x << "," << y << ") for pointerIndex number " << pointerIndex);
466  if (this->EventPositions[pointerIndex][0] != x || this->EventPositions[pointerIndex][1] != y ||
467  this->LastEventPositions[pointerIndex][0] != x || this->LastEventPositions[pointerIndex][1] != y)
468  {
469  this->LastEventPositions[pointerIndex][0] = this->EventPositions[pointerIndex][0];
470  this->LastEventPositions[pointerIndex][1] = this->EventPositions[pointerIndex][1];
471  this->EventPositions[pointerIndex][0] = x;
472  this->EventPositions[pointerIndex][1] = y;
473  this->Modified();
474  }
475  }
476  virtual void SetEventPosition(int pos[2], int pointerIndex)
477  {
478  this->SetEventPosition(pos[0], pos[1], pointerIndex);
479  }
480  virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
481  {
482  this->SetEventPosition(x, this->Size[1] - y - 1, pointerIndex);
483  }
484  virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
485  {
486  this->SetEventPositionFlipY(pos[0], pos[1], pointerIndex);
487  }
488 
490 
493  vtkSetMacro(AltKey, int);
494  vtkGetMacro(AltKey, int);
496 
498 
501  vtkSetMacro(ControlKey, int);
502  vtkGetMacro(ControlKey, int);
504 
506 
509  vtkSetMacro(ShiftKey, int);
510  vtkGetMacro(ShiftKey, int);
512 
514 
517  vtkSetMacro(KeyCode, char);
518  vtkGetMacro(KeyCode, char);
520 
522 
526  vtkSetMacro(RepeatCount, int);
527  vtkGetMacro(RepeatCount, int);
529 
531 
537  vtkSetStringMacro(KeySym);
538  vtkGetStringMacro(KeySym);
540 
542 
545  vtkSetMacro(PointerIndex, int);
546  vtkGetMacro(PointerIndex, int);
548 
550 
553  void SetRotation(double val);
554  vtkGetMacro(Rotation, double);
555  vtkGetMacro(LastRotation, double);
557 
559 
562  void SetScale(double val);
563  vtkGetMacro(Scale, double);
564  vtkGetMacro(LastScale, double);
566 
568 
571  void SetTranslation(double val[2]);
572  vtkGetVector2Macro(Translation, double);
573  vtkGetVector2Macro(LastTranslation, double);
575 
577 
581  int y,
582  int ctrl,
583  int shift,
584  char keycode,
585  int repeatcount,
586  const char* keysym,
587  int pointerIndex)
588  {
589  this->SetEventPosition(x,y,pointerIndex);
590  this->ControlKey = ctrl;
591  this->ShiftKey = shift;
592  this->KeyCode = keycode;
593  this->RepeatCount = repeatcount;
594  this->PointerIndex = pointerIndex;
595  if(keysym)
596  {
597  this->SetKeySym(keysym);
598  }
599  this->Modified();
600  }
601  void SetEventInformation(int x, int y,
602  int ctrl=0, int shift=0,
603  char keycode=0,
604  int repeatcount=0,
605  const char* keysym=nullptr)
606  {
607  this->SetEventInformation(x,y,ctrl,shift,keycode,repeatcount,keysym,0);
608  }
610 
612 
616  void SetEventInformationFlipY(int x, int y,
617  int ctrl, int shift,
618  char keycode,
619  int repeatcount,
620  const char* keysym,
621  int pointerIndex)
622  {
623  this->SetEventInformation(x,
624  this->Size[1] - y - 1,
625  ctrl,
626  shift,
627  keycode,
628  repeatcount,
629  keysym,
630  pointerIndex);
631  }
632  void SetEventInformationFlipY(int x, int y,
633  int ctrl=0, int shift=0,
634  char keycode=0,
635  int repeatcount=0,
636  const char* keysym=nullptr)
637  {
638  this->SetEventInformationFlipY(x,y,ctrl,shift,keycode,repeatcount,keysym,0);
639  }
641 
643 
646  void SetKeyEventInformation(int ctrl=0,
647  int shift=0,
648  char keycode=0,
649  int repeatcount=0,
650  const char* keysym=nullptr)
651  {
652  this->ControlKey = ctrl;
653  this->ShiftKey = shift;
654  this->KeyCode = keycode;
655  this->RepeatCount = repeatcount;
656  if(keysym)
657  {
658  this->SetKeySym(keysym);
659  }
660  this->Modified();
661  }
663 
665 
676  vtkSetVector2Macro(Size,int);
677  vtkGetVector2Macro(Size,int);
678  vtkSetVector2Macro(EventSize,int);
679  vtkGetVector2Macro(EventSize,int);
681 
687  virtual vtkRenderer *FindPokedRenderer(int,int);
688 
697 
699 
707  vtkSetMacro(UseTDx,bool);
708  vtkGetMacro(UseTDx,bool);
710 
712 
717  virtual void MouseMoveEvent();
718  virtual void RightButtonPressEvent();
719  virtual void RightButtonReleaseEvent();
720  virtual void LeftButtonPressEvent();
721  virtual void LeftButtonReleaseEvent();
722  virtual void MiddleButtonPressEvent();
723  virtual void MiddleButtonReleaseEvent();
724  virtual void MouseWheelForwardEvent();
725  virtual void MouseWheelBackwardEvent();
726  virtual void ExposeEvent();
727  virtual void ConfigureEvent();
728  virtual void EnterEvent();
729  virtual void LeaveEvent();
730  virtual void KeyPressEvent();
731  virtual void KeyReleaseEvent();
732  virtual void CharEvent();
733  virtual void ExitEvent();
734  virtual void FourthButtonPressEvent();
735  virtual void FourthButtonReleaseEvent();
736  virtual void FifthButtonPressEvent();
737  virtual void FifthButtonReleaseEvent();
739 
741 
745  virtual void StartPinchEvent();
746  virtual void PinchEvent();
747  virtual void EndPinchEvent();
748  virtual void StartRotateEvent();
749  virtual void RotateEvent();
750  virtual void EndRotateEvent();
751  virtual void StartPanEvent();
752  virtual void PanEvent();
753  virtual void EndPanEvent();
754  virtual void TapEvent();
755  virtual void LongTapEvent();
756  virtual void SwipeEvent();
758 
760 
766  vtkSetMacro(RecognizeGestures,bool);
767  vtkGetMacro(RecognizeGestures,bool);
769 
771 
776  vtkGetMacro(PointersDownCount,int);
778 
780 
787  void ClearContact(size_t contactID);
788  int GetPointerIndexForContact(size_t contactID);
789  int GetPointerIndexForExistingContact(size_t contactID);
790  bool IsPointerIndexSet(int i);
791  void ClearPointerIndex(int i);
793 
794 protected:
797 
800 
801  // Used as a helper object to pick instances of vtkProp
804 
810 
812  int Enabled;
814  int Style;
819 
820  // Event information
821  int AltKey;
823  int ShiftKey;
824  char KeyCode;
825  double Rotation;
826  double LastRotation;
827  double Scale;
828  double LastScale;
829  double Translation[2];
830  double LastTranslation[2];
832  char* KeySym;
833  int EventPosition[2];
834  int LastEventPosition[2];
835  int EventSize[2];
836  int Size[2];
841 
842  int EventPositions[VTKI_MAX_POINTERS][2];
843  int LastEventPositions[VTKI_MAX_POINTERS][2];
845 
846  size_t PointerIndexLookup[VTKI_MAX_POINTERS];
847 
848  // control the fly to
850  double Dolly;
851 
860  friend class vtkInteractorObserver;
861  void GrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
862  {this->Superclass::InternalGrabFocus(mouseEvents,keypressEvents);}
865 
870 
871  // Timer related members
872  friend struct vtkTimerStruct;
873  vtkTimerIdMap *TimerMap; // An internal, PIMPLd map of timers and associated attributes
874  unsigned long TimerDuration; //in milliseconds
876 
882  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
883  virtual int InternalDestroyTimer(int platformTimerId);
886 
887  // Force the interactor to handle the Start() event loop, ignoring any
888  // overrides. (Overrides are registered by observing StartEvent on the
889  // interactor.)
891 
895  virtual void StartEventLoop() {}
896 
897  bool UseTDx; // 3DConnexion device.
898 
899  // when recognizing gestures VTK will take multitouch events
900  // if it receives them and convert them to gestures
903  int PointersDown[VTKI_MAX_POINTERS];
905  int StartingEventPositions[VTKI_MAX_POINTERS][2];
907 
908 private:
910  void operator=(const vtkRenderWindowInteractor&) = delete;
911 };
912 
913 #endif
vtkRenderWindowInteractor::RepeatCount
int RepeatCount
Definition: vtkRenderWindowInteractor.h:831
vtkRenderWindowInteractor::SetRenderWindow
void SetRenderWindow(vtkRenderWindow *aren)
Set/Get the rendering window being controlled by this object.
vtkRenderWindowInteractor::New
static vtkRenderWindowInteractor * New()
vtkCommand
superclass for callback/observer methods
Definition: vtkCommand.h:371
vtkRenderWindowInteractor::StartPanEvent
virtual void StartPanEvent()
vtkRenderWindowInteractor::MouseWheelForwardEvent
virtual void MouseWheelForwardEvent()
vtkRenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Internal methods for creating and destroying timers that must be implemented by subclasses.
vtkInteractorEventRecorder
record and play VTK events passing through a vtkRenderWindowInteractor
Definition: vtkInteractorEventRecorder.h:45
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:159
vtkRenderWindowInteractor::ExitEvent
virtual void ExitEvent()
vtkRenderWindowInteractor::RecognizeGestures
bool RecognizeGestures
Definition: vtkRenderWindowInteractor.h:901
vtkRenderWindowInteractor::CreateTimer
virtual int CreateTimer(int timerType)
This class provides two groups of methods for manipulating timers.
vtkRenderWindowInteractor::HandleEventLoop
int HandleEventLoop
Definition: vtkRenderWindowInteractor.h:890
vtkRenderWindowInteractor::TimerEventType
int TimerEventType
Definition: vtkRenderWindowInteractor.h:838
vtkRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
Definition: vtkRenderWindowInteractor.h:895
vtkInteractorEventRecorder::AltKey
@ AltKey
Definition: vtkInteractorEventRecorder.h:148
vtkRenderWindowInteractor::MiddleButtonPressEvent
virtual void MiddleButtonPressEvent()
vtkRenderWindowInteractor::AltKey
int AltKey
Definition: vtkRenderWindowInteractor.h:821
vtkRenderWindowInteractor::NumberOfFlyFrames
int NumberOfFlyFrames
Definition: vtkRenderWindowInteractor.h:849
vtkRenderWindowInteractor::MouseWheelBackwardEvent
virtual void MouseWheelBackwardEvent()
vtkRenderWindowInteractor::~vtkRenderWindowInteractor
~vtkRenderWindowInteractor() override
vtkRenderWindowInteractor::ControlKey
int ControlKey
Definition: vtkRenderWindowInteractor.h:822
vtkRenderWindowInteractor::ShiftKey
int ShiftKey
Definition: vtkRenderWindowInteractor.h:823
vtkRenderWindowInteractor::UseTDx
bool UseTDx
Definition: vtkRenderWindowInteractor.h:897
vtkRenderWindowInteractor::RotateEvent
virtual void RotateEvent()
vtkRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkRenderWindowInteractor::GetObserverMediator
vtkObserverMediator * GetObserverMediator()
Return the object used to mediate between vtkInteractorObservers contending for resources.
vtkRenderWindowInteractor::EnableRender
bool EnableRender
Definition: vtkRenderWindowInteractor.h:813
vtkRenderWindowInteractor::SetRotation
void SetRotation(double val)
Set/get the rotation for the gesture in degrees, update LastRotation.
vtkRenderWindowInteractor::ReleaseFocus
void ReleaseFocus()
Definition: vtkRenderWindowInteractor.h:863
vtkRenderWindowInteractor::FlyTo
void FlyTo(vtkRenderer *ren, double *x)
Definition: vtkRenderWindowInteractor.h:371
vtkRenderWindowInteractor::EndPickCallback
virtual void EndPickCallback()
vtkRenderWindowInteractor::TimerEventPlatformId
int TimerEventPlatformId
Definition: vtkRenderWindowInteractor.h:840
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkRenderWindowInteractor::SetScale
void SetScale(double val)
Set/get the scale for the gesture, updates LastScale.
vtkRenderWindowInteractor::PointersDownCount
int PointersDownCount
Definition: vtkRenderWindowInteractor.h:902
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkRenderWindowInteractor::UpdateSize
virtual void UpdateSize(int x, int y)
Event loop notification member for window size change.
vtkRenderWindowInteractor::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkRenderWindowInteractor.h:798
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int x, int y)
Definition: vtkRenderWindowInteractor.h:407
vtkRenderWindowInteractor::PanEvent
virtual void PanEvent()
vtkObject::InternalGrabFocus
void InternalGrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
These methods allow a command to exclusively grab all events.
vtkRenderWindowInteractor::LeaveEvent
virtual void LeaveEvent()
vtkRenderWindowInteractor::SetEventInformation
void SetEventInformation(int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=nullptr)
Definition: vtkRenderWindowInteractor.h:601
vtkRenderWindowInteractor::UnRegister
void UnRegister(vtkObjectBase *o) override
This Method detects loops of RenderWindow-Interactor, so objects are freed properly.
vtkCommand.h
vtkRenderWindowInteractor::PickingManager
vtkPickingManager * PickingManager
Definition: vtkRenderWindowInteractor.h:803
vtkAbstractPicker
define API for picking subclasses
Definition: vtkAbstractPicker.h:69
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:45
vtkRenderWindowInteractor::SetPickingManager
virtual void SetPickingManager(vtkPickingManager *)
Set the picking manager.
vtkRenderWindowInteractor::KeyPressEvent
virtual void KeyPressEvent()
vtkInteractorObserver
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Definition: vtkInteractorObserver.h:60
vtkRenderWindowInteractor::TapEvent
virtual void TapEvent()
vtkRenderWindowInteractor::PointerIndex
int PointerIndex
Definition: vtkRenderWindowInteractor.h:844
vtkRenderWindowInteractor::FindPokedRenderer
virtual vtkRenderer * FindPokedRenderer(int, int)
When an event occurs, we must determine which Renderer the event occurred within, since one RenderWin...
vtkRenderWindowInteractor::GetLastEventPositions
virtual int * GetLastEventPositions(int pointerIndex)
Definition: vtkRenderWindowInteractor.h:443
vtkRenderWindowInteractor::IsPointerIndexSet
bool IsPointerIndexSet(int i)
vtkRenderWindowInteractor::Disable
virtual void Disable()
Definition: vtkRenderWindowInteractor.h:124
vtkObject::InternalReleaseFocus
void InternalReleaseFocus()
vtkRenderWindowInteractor::Dolly
double Dolly
Definition: vtkRenderWindowInteractor.h:850
vtkRenderWindowInteractor::GetPointerIndexForContact
int GetPointerIndexForContact(size_t contactID)
vtkRenderWindowInteractor::Initialized
int Initialized
Definition: vtkRenderWindowInteractor.h:811
vtkInteractorEventRecorder::ControlKey
@ ControlKey
Definition: vtkInteractorEventRecorder.h:147
vtkRenderWindowInteractor::GetEventPositions
virtual int * GetEventPositions(int pointerIndex)
Definition: vtkRenderWindowInteractor.h:435
vtkRenderWindowInteractor::CreateOneShotTimer
int CreateOneShotTimer(unsigned long duration)
Create a one shot timer, with the specified duretion (in milliseconds).
vtkRenderWindowInteractor::RightButtonReleaseEvent
virtual void RightButtonReleaseEvent()
vtkRenderWindowInteractor::Picker
vtkAbstractPicker * Picker
Definition: vtkRenderWindowInteractor.h:802
vtkRenderWindowInteractor::SetKeyEventInformation
void SetKeyEventInformation(int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=nullptr)
Set all the keyboard-related event information in one call.
Definition: vtkRenderWindowInteractor.h:646
vtkRenderWindowInteractor::RightButtonPressEvent
virtual void RightButtonPressEvent()
vtkObjectBase::GetClassName
const char * GetClassName() const
Return the class name as a string.
vtkRenderWindowInteractor::GetMousePosition
virtual void GetMousePosition(int *x, int *y)
Get the current position of the mouse.
Definition: vtkRenderWindowInteractor.h:347
vtkRenderWindowInteractor::CharEvent
virtual void CharEvent()
vtkRenderWindowInteractor::GetCurrentTimerId
int GetCurrentTimerId()
vtkRenderWindowInteractor::KeySym
char * KeySym
Definition: vtkRenderWindowInteractor.h:832
vtkRenderWindowInteractor::FlyToImage
void FlyToImage(vtkRenderer *ren, double *x)
Definition: vtkRenderWindowInteractor.h:374
vtkRenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRenderWindowInteractor::TimerMap
vtkTimerIdMap * TimerMap
Definition: vtkRenderWindowInteractor.h:873
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:66
vtkRenderWindowInteractor::EndPanEvent
virtual void EndPanEvent()
vtkInteractorEventRecorder::ShiftKey
@ ShiftKey
Definition: vtkInteractorEventRecorder.h:146
vtkRenderWindowInteractor::ObserverMediator
vtkObserverMediator * ObserverMediator
Widget mediators are used to resolve contention for cursors and other resources.
Definition: vtkRenderWindowInteractor.h:869
vtkRenderWindowInteractor::SwipeEvent
virtual void SwipeEvent()
vtkRenderWindowInteractor::ConfigureEvent
virtual void ConfigureEvent()
vtkRenderWindowInteractor::SetInteractorStyle
virtual void SetInteractorStyle(vtkInteractorObserver *)
External switching between joystick/trackball/new? modes.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkRenderWindowInteractor::FourthButtonReleaseEvent
virtual void FourthButtonReleaseEvent()
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int pos[2])
Definition: vtkRenderWindowInteractor.h:421
vtkRenderWindowInteractor::DestroyTimer
int DestroyTimer(int timerId)
Destroy the timer specified by timerId.
vtkRenderWindowInteractor::ResetTimer
int ResetTimer(int timerId)
Reset the specified timer.
vtkRenderWindowInteractor::IsOneShotTimer
int IsOneShotTimer(int timerId)
Query whether the specified timerId is a one shot timer.
vtkRenderWindowInteractor::GetTimerDuration
unsigned long GetTimerDuration(int timerId)
Get the duration (in milliseconds) for the specified timerId.
vtkRenderWindowInteractor::EndPinchEvent
virtual void EndPinchEvent()
vtkRenderWindowInteractor::LongTapEvent
virtual void LongTapEvent()
vtkRenderWindowInteractor::GetPointerIndexForExistingContact
int GetPointerIndexForExistingContact(size_t contactID)
vtkRenderWindowInteractor::CreateDefaultPickingManager
virtual vtkPickingManager * CreateDefaultPickingManager()
Create default pickingManager.
vtkRenderWindowInteractor::StillUpdateRate
double StillUpdateRate
Definition: vtkRenderWindowInteractor.h:818
vtkRenderWindowInteractor::InteractorStyle
vtkInteractorObserver * InteractorStyle
Definition: vtkRenderWindowInteractor.h:799
vtkRenderWindowInteractor::ReInitialize
void ReInitialize()
Definition: vtkRenderWindowInteractor.h:97
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:167
vtkRenderWindowInteractor::LeftButtonReleaseEvent
virtual void LeftButtonReleaseEvent()
vtkRenderWindowInteractor::CreateDefaultPicker
virtual vtkAbstractPropPicker * CreateDefaultPicker()
Create default picker.
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int x, int y, int pointerIndex)
Definition: vtkRenderWindowInteractor.h:451
vtkRenderWindowInteractor::Render
virtual void Render()
Render the scene.
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int pos[2])
Definition: vtkRenderWindowInteractor.h:429
vtkRenderWindowInteractor::DestroyTimer
virtual int DestroyTimer()
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:79
vtkRenderWindowInteractor::EndRotateEvent
virtual void EndRotateEvent()
vtkRenderWindowInteractor::FifthButtonPressEvent
virtual void FifthButtonPressEvent()
vtkRenderWindowInteractor::MiddleButtonReleaseEvent
virtual void MiddleButtonReleaseEvent()
vtkRenderWindowInteractor::ExitCallback
virtual void ExitCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkAbstractPropPicker
abstract API for pickers that can pick an instance of vtkProp
Definition: vtkAbstractPropPicker.h:80
vtkRenderWindowInteractor::LastRotation
double LastRotation
Definition: vtkRenderWindowInteractor.h:826
vtkRenderWindowInteractor::ActorMode
int ActorMode
Definition: vtkRenderWindowInteractor.h:816
vtkObject.h
vtkRenderWindowInteractor::UserCallback
virtual void UserCallback()
vtkRenderWindowInteractor::RecognizeGesture
virtual void RecognizeGesture(vtkCommand::EventIds)
vtkRenderWindowInteractor::GrabFocus
void GrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
Definition: vtkRenderWindowInteractor.h:861
vtkRenderWindowInteractor::LightFollowCamera
vtkTypeBool LightFollowCamera
Definition: vtkRenderWindowInteractor.h:815
vtkRenderWindowInteractor::KeyCode
char KeyCode
Definition: vtkRenderWindowInteractor.h:824
vtkRenderWindowInteractor::Enabled
int Enabled
Definition: vtkRenderWindowInteractor.h:812
vtkRenderWindowInteractor::TimerEventDuration
int TimerEventDuration
Definition: vtkRenderWindowInteractor.h:839
vtkRenderWindowInteractor::TerminateApp
virtual void TerminateApp(void)
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...
Definition: vtkRenderWindowInteractor.h:255
vtkRenderWindowInteractor::LastScale
double LastScale
Definition: vtkRenderWindowInteractor.h:828
vtkRenderWindowInteractor::DesiredUpdateRate
double DesiredUpdateRate
Definition: vtkRenderWindowInteractor.h:817
vtkRenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
Definition: vtkRenderWindowInteractor.h:123
vtkRenderWindowInteractor::EnterEvent
virtual void EnterEvent()
vtkRenderWindowInteractor::KeyReleaseEvent
virtual void KeyReleaseEvent()
vtkRenderWindowInteractor::SetEventInformationFlipY
void SetEventInformationFlipY(int x, int y, int ctrl, int shift, char keycode, int repeatcount, const char *keysym, int pointerIndex)
Calls SetEventInformation, but flips the Y based on the current Size[1] value (i.e.
Definition: vtkRenderWindowInteractor.h:616
vtkCommand::EventIds
EventIds
Definition: vtkCommand.h:448
vtkRenderWindowInteractor::vtkRenderWindowInteractor
vtkRenderWindowInteractor()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkRenderWindowInteractor::StartRotateEvent
virtual void StartRotateEvent()
vtkRenderWindowInteractor::Start
virtual void Start()
Start the event loop.
vtkRenderWindowInteractor::FlyToImage
void FlyToImage(vtkRenderer *ren, double x, double y)
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int pos[2], int pointerIndex)
Definition: vtkRenderWindowInteractor.h:476
vtkRenderWindowInteractor::Style
int Style
Definition: vtkRenderWindowInteractor.h:814
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int x, int y)
Definition: vtkRenderWindowInteractor.h:425
vtkRenderWindowInteractor::SetPicker
virtual void SetPicker(vtkAbstractPicker *)
Set/Get the object used to perform pick operations.
VTKI_MAX_POINTERS
#define VTKI_MAX_POINTERS
Definition: vtkRenderWindowInteractor.h:66
vtkRenderWindowInteractor::Initialize
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
vtkRenderWindowInteractor::FlyTo
void FlyTo(vtkRenderer *ren, double x, double y, double z)
Given a position x, move the current camera's focal point to x.
vtkRenderWindowInteractor::SetTranslation
void SetTranslation(double val[2])
Set/get the translation for pan/swipe gestures, update LastTranslation.
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
Definition: vtkRenderWindowInteractor.h:480
vtkRenderWindowInteractor::CreateRepeatingTimer
int CreateRepeatingTimer(unsigned long duration)
Create a repeating timer, with the specified duration (in milliseconds).
vtkRenderWindowInteractor::Scale
double Scale
Definition: vtkRenderWindowInteractor.h:827
vtkRenderWindowInteractor::LeftButtonPressEvent
virtual void LeftButtonPressEvent()
vtkRenderWindowInteractor::ExposeEvent
virtual void ExposeEvent()
vtkRenderWindowInteractor::ShowCursor
void ShowCursor()
vtkRenderWindowInteractor::MouseMoveEvent
virtual void MouseMoveEvent()
Fire various events.
vtkRenderWindowInteractor::ClearPointerIndex
void ClearPointerIndex(int i)
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:88
vtkObserverMediator
manage contention for cursors and other resources
Definition: vtkObserverMediator.h:43
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
Definition: vtkRenderWindowInteractor.h:484
vtkRenderWindowInteractor::ClearContact
void ClearContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindowInteractor::PinchEvent
virtual void PinchEvent()
vtkRenderWindowInteractor::FourthButtonPressEvent
virtual void FourthButtonPressEvent()
vtkRenderWindowInteractor::HideCursor
void HideCursor()
Hide or show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
vtkRenderWindowInteractor::StartPinchEvent
virtual void StartPinchEvent()
Fire various gesture based events.
vtkInteractorObserver::Enabled
int Enabled
Definition: vtkInteractorObserver.h:235
vtkRenderWindowInteractor::CurrentGesture
vtkCommand::EventIds CurrentGesture
Definition: vtkRenderWindowInteractor.h:906
vtkRenderWindowInteractor::FifthButtonReleaseEvent
virtual void FifthButtonReleaseEvent()
vtkRenderWindowInteractor::TimerEventId
int TimerEventId
Definition: vtkRenderWindowInteractor.h:837
vtkRenderWindowInteractor::StartPickCallback
virtual void StartPickCallback()
vtkRenderWindowInteractor::GetVTKTimerId
virtual int GetVTKTimerId(int platformTimerId)
Get the VTK timer ID that corresponds to the supplied platform ID.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkRenderWindowInteractor::Rotation
double Rotation
Definition: vtkRenderWindowInteractor.h:825
vtkRenderWindowInteractor::TimerDuration
unsigned long TimerDuration
Definition: vtkRenderWindowInteractor.h:874
vtkRenderWindowInteractor::SetEventInformationFlipY
void SetEventInformationFlipY(int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=nullptr)
Definition: vtkRenderWindowInteractor.h:632
vtkPickingManager
Definition: vtkPickingManager.h:86
vtkRenderWindowInteractor::SetEventInformation
void SetEventInformation(int x, int y, int ctrl, int shift, char keycode, int repeatcount, const char *keysym, int pointerIndex)
Set all the event information in one call.
Definition: vtkRenderWindowInteractor.h:580