VTK  9.0.1
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 =========================================================================*/
45 #ifndef vtkRenderWindowInteractor_h
46 #define vtkRenderWindowInteractor_h
47 
48 #include "vtkCommand.h" // for method sig
49 #include "vtkObject.h"
50 #include "vtkRenderingCoreModule.h" // For export macro
51 
52 class vtkTimerIdMap;
53 
54 // Timer flags for win32/X compatibility
55 #define VTKI_TIMER_FIRST 0
56 #define VTKI_TIMER_UPDATE 1
57 
58 // maximum pointers active at once
59 // for example in multitouch
60 #define VTKI_MAX_POINTERS 5
61 
62 class vtkAbstractPicker;
64 class vtkAssemblyPath;
65 class vtkHardwareWindow;
67 class vtkRenderWindow;
68 class vtkRenderer;
71 class vtkPickingManager;
72 
73 class VTKRENDERINGCORE_EXPORT vtkRenderWindowInteractor : public vtkObject
74 {
75 
77 
78 public:
81  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
84 
91  virtual void Initialize();
92  void ReInitialize()
93  {
94  this->Initialized = 0;
95  this->Enabled = 0;
96  this->Initialize();
97  }
99 
104  void UnRegister(vtkObjectBase* o) override;
105 
111  virtual void Start();
112 
118  virtual void ProcessEvents() {}
119 
123  vtkGetMacro(Done, bool);
124  vtkSetMacro(Done, bool);
125 
135  virtual void Enable()
136  {
137  this->Enabled = 1;
138  this->Modified();
139  }
140  virtual void Disable()
141  {
142  this->Enabled = 0;
143  this->Modified();
144  }
145  vtkGetMacro(Enabled, int);
146 
148 
152  vtkBooleanMacro(EnableRender, bool);
153  vtkSetMacro(EnableRender, bool);
154  vtkGetMacro(EnableRender, bool);
156 
158 
162  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
164 
166 
172  vtkGetObjectMacro(HardwareWindow, vtkHardwareWindow);
174 
182  virtual void UpdateSize(int x, int y);
183 
200  virtual int CreateTimer(int timerType); // first group, for backward compatibility
201  virtual int DestroyTimer(); // first group, for backward compatibility
202 
207  int CreateRepeatingTimer(unsigned long duration);
208 
213  int CreateOneShotTimer(unsigned long duration);
214 
219  int IsOneShotTimer(int timerId);
220 
224  unsigned long GetTimerDuration(int timerId);
225 
229  int ResetTimer(int timerId);
230 
235  int DestroyTimer(int timerId);
236 
240  virtual int GetVTKTimerId(int platformTimerId);
241 
242  // Moved into the public section of the class so that classless timer procs
243  // can access these enum members without being "friends"...
244  enum
245  {
246  OneShotTimer = 1,
247  RepeatingTimer
248  };
249 
251 
260  vtkSetClampMacro(TimerDuration, unsigned long, 1, 100000);
261  vtkGetMacro(TimerDuration, unsigned long);
263 
265 
277  vtkSetMacro(TimerEventId, int);
278  vtkGetMacro(TimerEventId, int);
279  vtkSetMacro(TimerEventType, int);
280  vtkGetMacro(TimerEventType, int);
281  vtkSetMacro(TimerEventDuration, int);
282  vtkGetMacro(TimerEventDuration, int);
283  vtkSetMacro(TimerEventPlatformId, int);
284  vtkGetMacro(TimerEventPlatformId, int);
286 
292  virtual void TerminateApp(void) { this->Done = true; }
293 
295 
300  vtkGetObjectMacro(InteractorStyle, vtkInteractorObserver);
302 
304 
308  vtkSetMacro(LightFollowCamera, vtkTypeBool);
309  vtkGetMacro(LightFollowCamera, vtkTypeBool);
310  vtkBooleanMacro(LightFollowCamera, vtkTypeBool);
312 
314 
321  vtkSetClampMacro(DesiredUpdateRate, double, 0.0001, VTK_FLOAT_MAX);
322  vtkGetMacro(DesiredUpdateRate, double);
324 
326 
331  vtkSetClampMacro(StillUpdateRate, double, 0.0001, VTK_FLOAT_MAX);
332  vtkGetMacro(StillUpdateRate, double);
334 
336 
340  vtkGetMacro(Initialized, int);
342 
344 
350  virtual void SetPicker(vtkAbstractPicker*);
351  vtkGetObjectMacro(Picker, vtkAbstractPicker);
353 
359 
361 
367  vtkGetObjectMacro(PickingManager, vtkPickingManager);
369 
371 
375  virtual void ExitCallback();
376  virtual void UserCallback();
377  virtual void StartPickCallback();
378  virtual void EndPickCallback();
380 
384  virtual void GetMousePosition(int* x, int* y)
385  {
386  *x = 0;
387  *y = 0;
388  }
389 
391 
395  void HideCursor();
396  void ShowCursor();
398 
403  virtual void Render();
404 
406 
411  void FlyTo(vtkRenderer* ren, double x, double y, double z);
412  void FlyTo(vtkRenderer* ren, double* x) { this->FlyTo(ren, x[0], x[1], x[2]); }
413  void FlyToImage(vtkRenderer* ren, double x, double y);
414  void FlyToImage(vtkRenderer* ren, double* x) { this->FlyToImage(ren, x[0], x[1]); }
416 
418 
421  vtkSetClampMacro(NumberOfFlyFrames, int, 1, VTK_INT_MAX);
422  vtkGetMacro(NumberOfFlyFrames, int);
424 
426 
430  vtkSetMacro(Dolly, double);
431  vtkGetMacro(Dolly, double);
433 
435 
443  vtkGetVector2Macro(EventPosition, int);
444  vtkGetVector2Macro(LastEventPosition, int);
445  vtkSetVector2Macro(LastEventPosition, int);
446  virtual void SetEventPosition(int x, int y)
447  {
448  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting EventPosition to (" << x
449  << "," << y << ")");
450  if (this->EventPosition[0] != x || this->EventPosition[1] != y ||
451  this->LastEventPosition[0] != x || this->LastEventPosition[1] != y)
452  {
453  this->LastEventPosition[0] = this->EventPosition[0];
454  this->LastEventPosition[1] = this->EventPosition[1];
455  this->EventPosition[0] = x;
456  this->EventPosition[1] = y;
457  this->Modified();
458  }
459  }
460  virtual void SetEventPosition(int pos[2]) { this->SetEventPosition(pos[0], pos[1]); }
461  virtual void SetEventPositionFlipY(int x, int y)
462  {
463  this->SetEventPosition(x, this->Size[1] - y - 1);
464  }
465  virtual void SetEventPositionFlipY(int pos[2]) { this->SetEventPositionFlipY(pos[0], pos[1]); }
467 
468  virtual int* GetEventPositions(int pointerIndex)
469  {
470  if (pointerIndex >= VTKI_MAX_POINTERS)
471  {
472  return nullptr;
473  }
474  return this->EventPositions[pointerIndex];
475  }
476  virtual int* GetLastEventPositions(int pointerIndex)
477  {
478  if (pointerIndex >= VTKI_MAX_POINTERS)
479  {
480  return nullptr;
481  }
482  return this->LastEventPositions[pointerIndex];
483  }
484  virtual void SetEventPosition(int x, int y, int pointerIndex)
485  {
486  if (pointerIndex < 0 || pointerIndex >= VTKI_MAX_POINTERS)
487  {
488  return;
489  }
490  if (pointerIndex == 0)
491  {
492  this->LastEventPosition[0] = this->EventPosition[0];
493  this->LastEventPosition[1] = this->EventPosition[1];
494  this->EventPosition[0] = x;
495  this->EventPosition[1] = y;
496  }
497  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting EventPosition to (" << x
498  << "," << y << ") for pointerIndex number " << pointerIndex);
499  if (this->EventPositions[pointerIndex][0] != x || this->EventPositions[pointerIndex][1] != y ||
500  this->LastEventPositions[pointerIndex][0] != x ||
501  this->LastEventPositions[pointerIndex][1] != y)
502  {
503  this->LastEventPositions[pointerIndex][0] = this->EventPositions[pointerIndex][0];
504  this->LastEventPositions[pointerIndex][1] = this->EventPositions[pointerIndex][1];
505  this->EventPositions[pointerIndex][0] = x;
506  this->EventPositions[pointerIndex][1] = y;
507  this->Modified();
508  }
509  }
510  virtual void SetEventPosition(int pos[2], int pointerIndex)
511  {
512  this->SetEventPosition(pos[0], pos[1], pointerIndex);
513  }
514  virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
515  {
516  this->SetEventPosition(x, this->Size[1] - y - 1, pointerIndex);
517  }
518  virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
519  {
520  this->SetEventPositionFlipY(pos[0], pos[1], pointerIndex);
521  }
522 
524 
527  vtkSetMacro(AltKey, int);
528  vtkGetMacro(AltKey, int);
530 
532 
535  vtkSetMacro(ControlKey, int);
536  vtkGetMacro(ControlKey, int);
538 
540 
543  vtkSetMacro(ShiftKey, int);
544  vtkGetMacro(ShiftKey, int);
546 
548 
551  vtkSetMacro(KeyCode, char);
552  vtkGetMacro(KeyCode, char);
554 
556 
560  vtkSetMacro(RepeatCount, int);
561  vtkGetMacro(RepeatCount, int);
563 
565 
571  vtkSetStringMacro(KeySym);
572  vtkGetStringMacro(KeySym);
574 
576 
579  vtkSetMacro(PointerIndex, int);
580  vtkGetMacro(PointerIndex, int);
582 
584 
587  void SetRotation(double val);
588  vtkGetMacro(Rotation, double);
589  vtkGetMacro(LastRotation, double);
591 
593 
596  void SetScale(double val);
597  vtkGetMacro(Scale, double);
598  vtkGetMacro(LastScale, double);
600 
602 
605  void SetTranslation(double val[2]);
606  vtkGetVector2Macro(Translation, double);
607  vtkGetVector2Macro(LastTranslation, double);
609 
611 
614  void SetEventInformation(int x, int y, int ctrl, int shift, char keycode, int repeatcount,
615  const char* keysym, int pointerIndex)
616  {
617  this->SetEventPosition(x, y, pointerIndex);
618  this->ControlKey = ctrl;
619  this->ShiftKey = shift;
620  this->KeyCode = keycode;
621  this->RepeatCount = repeatcount;
622  this->PointerIndex = pointerIndex;
623  if (keysym)
624  {
625  this->SetKeySym(keysym);
626  }
627  this->Modified();
628  }
629  void SetEventInformation(int x, int y, int ctrl = 0, int shift = 0, char keycode = 0,
630  int repeatcount = 0, const char* keysym = nullptr)
631  {
632  this->SetEventInformation(x, y, ctrl, shift, keycode, repeatcount, keysym, 0);
633  }
635 
637 
641  void SetEventInformationFlipY(int x, int y, int ctrl, int shift, char keycode, int repeatcount,
642  const char* keysym, int pointerIndex)
643  {
644  this->SetEventInformation(
645  x, this->Size[1] - y - 1, ctrl, shift, keycode, repeatcount, keysym, pointerIndex);
646  }
647  void SetEventInformationFlipY(int x, int y, int ctrl = 0, int shift = 0, char keycode = 0,
648  int repeatcount = 0, const char* keysym = nullptr)
649  {
650  this->SetEventInformationFlipY(x, y, ctrl, shift, keycode, repeatcount, keysym, 0);
651  }
653 
655 
658  void SetKeyEventInformation(int ctrl = 0, int shift = 0, char keycode = 0, int repeatcount = 0,
659  const char* keysym = nullptr)
660  {
661  this->ControlKey = ctrl;
662  this->ShiftKey = shift;
663  this->KeyCode = keycode;
664  this->RepeatCount = repeatcount;
665  if (keysym)
666  {
667  this->SetKeySym(keysym);
668  }
669  this->Modified();
670  }
672 
674 
685  vtkSetVector2Macro(Size, int);
686  vtkGetVector2Macro(Size, int);
687  vtkSetVector2Macro(EventSize, int);
688  vtkGetVector2Macro(EventSize, int);
690 
696  virtual vtkRenderer* FindPokedRenderer(int, int);
697 
706 
708 
716  vtkSetMacro(UseTDx, bool);
717  vtkGetMacro(UseTDx, bool);
719 
721 
726  virtual void MouseMoveEvent();
727  virtual void RightButtonPressEvent();
728  virtual void RightButtonReleaseEvent();
729  virtual void LeftButtonPressEvent();
730  virtual void LeftButtonReleaseEvent();
731  virtual void MiddleButtonPressEvent();
732  virtual void MiddleButtonReleaseEvent();
733  virtual void MouseWheelForwardEvent();
734  virtual void MouseWheelBackwardEvent();
735  virtual void ExposeEvent();
736  virtual void ConfigureEvent();
737  virtual void EnterEvent();
738  virtual void LeaveEvent();
739  virtual void KeyPressEvent();
740  virtual void KeyReleaseEvent();
741  virtual void CharEvent();
742  virtual void ExitEvent();
743  virtual void FourthButtonPressEvent();
744  virtual void FourthButtonReleaseEvent();
745  virtual void FifthButtonPressEvent();
746  virtual void FifthButtonReleaseEvent();
748 
750 
754  virtual void StartPinchEvent();
755  virtual void PinchEvent();
756  virtual void EndPinchEvent();
757  virtual void StartRotateEvent();
758  virtual void RotateEvent();
759  virtual void EndRotateEvent();
760  virtual void StartPanEvent();
761  virtual void PanEvent();
762  virtual void EndPanEvent();
763  virtual void TapEvent();
764  virtual void LongTapEvent();
765  virtual void SwipeEvent();
767 
769 
775  vtkSetMacro(RecognizeGestures, bool);
776  vtkGetMacro(RecognizeGestures, bool);
778 
780 
785  vtkGetMacro(PointersDownCount, int);
787 
789 
796  void ClearContact(size_t contactID);
797  int GetPointerIndexForContact(size_t contactID);
798  int GetPointerIndexForExistingContact(size_t contactID);
799  bool IsPointerIndexSet(int i);
800  void ClearPointerIndex(int i);
802 
803 protected:
806 
810 
811  // Used as a helper object to pick instances of vtkProp
814 
815  bool Done; // is the event loop done running
816 
822 
824  int Enabled;
826  int Style;
831 
832  // Event information
833  int AltKey;
835  int ShiftKey;
836  char KeyCode;
837  double Rotation;
838  double LastRotation;
839  double Scale;
840  double LastScale;
841  double Translation[2];
842  double LastTranslation[2];
844  char* KeySym;
845  int EventPosition[2];
846  int LastEventPosition[2];
847  int EventSize[2];
848  int Size[2];
853 
854  int EventPositions[VTKI_MAX_POINTERS][2];
855  int LastEventPositions[VTKI_MAX_POINTERS][2];
857 
858  size_t PointerIndexLookup[VTKI_MAX_POINTERS];
859 
860  // control the fly to
862  double Dolly;
863 
872  friend class vtkInteractorObserver;
873  void GrabFocus(vtkCommand* mouseEvents, vtkCommand* keypressEvents = nullptr)
874  {
875  this->Superclass::InternalGrabFocus(mouseEvents, keypressEvents);
876  }
878 
883 
884  // Timer related members
885  friend struct vtkTimerStruct;
886  vtkTimerIdMap* TimerMap; // An internal, PIMPLd map of timers and associated attributes
887  unsigned long TimerDuration; // in milliseconds
889 
895  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
896  virtual int InternalDestroyTimer(int platformTimerId);
899 
900  // Force the interactor to handle the Start() event loop, ignoring any
901  // overrides. (Overrides are registered by observing StartEvent on the
902  // interactor.)
904 
908  virtual void StartEventLoop() {}
909 
910  bool UseTDx; // 3DConnexion device.
911 
912  // when recognizing gestures VTK will take multitouch events
913  // if it receives them and convert them to gestures
916  int PointersDown[VTKI_MAX_POINTERS];
918  int StartingEventPositions[VTKI_MAX_POINTERS][2];
920 
921 private:
923  void operator=(const vtkRenderWindowInteractor&) = delete;
924 };
925 
926 #endif
vtkRenderWindowInteractor::RepeatCount
int RepeatCount
Definition: vtkRenderWindowInteractor.h:843
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:378
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:42
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkRenderWindowInteractor::ExitEvent
virtual void ExitEvent()
vtkRenderWindowInteractor::RecognizeGestures
bool RecognizeGestures
Definition: vtkRenderWindowInteractor.h:914
vtkRenderWindowInteractor::CreateTimer
virtual int CreateTimer(int timerType)
This class provides two groups of methods for manipulating timers.
vtkRenderWindowInteractor::HandleEventLoop
int HandleEventLoop
Definition: vtkRenderWindowInteractor.h:903
vtkRenderWindowInteractor::TimerEventType
int TimerEventType
Definition: vtkRenderWindowInteractor.h:850
vtkRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
Definition: vtkRenderWindowInteractor.h:908
vtkInteractorEventRecorder::AltKey
@ AltKey
Definition: vtkInteractorEventRecorder.h:145
vtkRenderWindowInteractor::MiddleButtonPressEvent
virtual void MiddleButtonPressEvent()
vtkRenderWindowInteractor::AltKey
int AltKey
Definition: vtkRenderWindowInteractor.h:833
vtkRenderWindowInteractor::NumberOfFlyFrames
int NumberOfFlyFrames
Definition: vtkRenderWindowInteractor.h:861
vtkRenderWindowInteractor::MouseWheelBackwardEvent
virtual void MouseWheelBackwardEvent()
vtkRenderWindowInteractor::~vtkRenderWindowInteractor
~vtkRenderWindowInteractor() override
vtkRenderWindowInteractor::ControlKey
int ControlKey
Definition: vtkRenderWindowInteractor.h:834
vtkRenderWindowInteractor::ShiftKey
int ShiftKey
Definition: vtkRenderWindowInteractor.h:835
vtkRenderWindowInteractor::UseTDx
bool UseTDx
Definition: vtkRenderWindowInteractor.h:910
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:825
vtkRenderWindowInteractor::SetRotation
void SetRotation(double val)
Set/get the rotation for the gesture in degrees, update LastRotation.
vtkRenderWindowInteractor::ReleaseFocus
void ReleaseFocus()
Definition: vtkRenderWindowInteractor.h:877
vtkRenderWindowInteractor::FlyTo
void FlyTo(vtkRenderer *ren, double *x)
Definition: vtkRenderWindowInteractor.h:412
vtkRenderWindowInteractor::EndPickCallback
virtual void EndPickCallback()
vtkRenderWindowInteractor::TimerEventPlatformId
int TimerEventPlatformId
Definition: vtkRenderWindowInteractor.h:852
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:915
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkRenderWindowInteractor::UpdateSize
virtual void UpdateSize(int x, int y)
Event loop notification member for window size change.
vtkRenderWindowInteractor::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkRenderWindowInteractor.h:807
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int x, int y)
Definition: vtkRenderWindowInteractor.h:446
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:629
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:813
vtkAbstractPicker
define API for picking subclasses
Definition: vtkAbstractPicker.h:69
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:42
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:856
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:476
vtkRenderWindowInteractor::IsPointerIndexSet
bool IsPointerIndexSet(int i)
vtkRenderWindowInteractor::Disable
virtual void Disable()
Definition: vtkRenderWindowInteractor.h:140
vtkObject::InternalReleaseFocus
void InternalReleaseFocus()
vtkRenderWindowInteractor::Dolly
double Dolly
Definition: vtkRenderWindowInteractor.h:862
vtkRenderWindowInteractor::GetPointerIndexForContact
int GetPointerIndexForContact(size_t contactID)
vtkRenderWindowInteractor::Initialized
int Initialized
Definition: vtkRenderWindowInteractor.h:823
vtkInteractorEventRecorder::ControlKey
@ ControlKey
Definition: vtkInteractorEventRecorder.h:144
vtkRenderWindowInteractor::GetEventPositions
virtual int * GetEventPositions(int pointerIndex)
Definition: vtkRenderWindowInteractor.h:468
vtkRenderWindowInteractor::CreateOneShotTimer
int CreateOneShotTimer(unsigned long duration)
Create a one shot timer, with the specified duration (in milliseconds).
vtkRenderWindowInteractor::RightButtonReleaseEvent
virtual void RightButtonReleaseEvent()
vtkRenderWindowInteractor::HardwareWindow
vtkHardwareWindow * HardwareWindow
Definition: vtkRenderWindowInteractor.h:808
vtkRenderWindowInteractor::Picker
vtkAbstractPicker * Picker
Definition: vtkRenderWindowInteractor.h:812
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:658
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:384
vtkRenderWindowInteractor::CharEvent
virtual void CharEvent()
vtkRenderWindowInteractor::GetCurrentTimerId
int GetCurrentTimerId()
vtkRenderWindowInteractor::KeySym
char * KeySym
Definition: vtkRenderWindowInteractor.h:844
vtkRenderWindowInteractor::FlyToImage
void FlyToImage(vtkRenderer *ren, double *x)
Definition: vtkRenderWindowInteractor.h:414
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:886
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:64
vtkRenderWindowInteractor::EndPanEvent
virtual void EndPanEvent()
vtkInteractorEventRecorder::ShiftKey
@ ShiftKey
Definition: vtkInteractorEventRecorder.h:143
vtkRenderWindowInteractor::ObserverMediator
vtkObserverMediator * ObserverMediator
Widget mediators are used to resolve contention for cursors and other resources.
Definition: vtkRenderWindowInteractor.h:882
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:34
vtkRenderWindowInteractor::FourthButtonReleaseEvent
virtual void FourthButtonReleaseEvent()
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int pos[2])
Definition: vtkRenderWindowInteractor.h:460
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:830
vtkRenderWindowInteractor::InteractorStyle
vtkInteractorObserver * InteractorStyle
Definition: vtkRenderWindowInteractor.h:809
vtkRenderWindowInteractor::ReInitialize
void ReInitialize()
Definition: vtkRenderWindowInteractor.h:92
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
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:484
vtkRenderWindowInteractor::Render
virtual void Render()
Render the scene.
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int pos[2])
Definition: vtkRenderWindowInteractor.h:465
vtkRenderWindowInteractor::DestroyTimer
virtual int DestroyTimer()
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:74
vtkRenderWindowInteractor::EndRotateEvent
virtual void EndRotateEvent()
vtkRenderWindowInteractor::FifthButtonPressEvent
virtual void FifthButtonPressEvent()
vtkRenderWindowInteractor::MiddleButtonReleaseEvent
virtual void MiddleButtonReleaseEvent()
vtkRenderWindowInteractor::SetHardwareWindow
void SetHardwareWindow(vtkHardwareWindow *aren)
Set/Get the hardware window being controlled by this object.
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:838
vtkRenderWindowInteractor::ActorMode
int ActorMode
Definition: vtkRenderWindowInteractor.h:828
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:873
vtkRenderWindowInteractor::LightFollowCamera
vtkTypeBool LightFollowCamera
Definition: vtkRenderWindowInteractor.h:827
vtkRenderWindowInteractor::KeyCode
char KeyCode
Definition: vtkRenderWindowInteractor.h:836
vtkRenderWindowInteractor::Enabled
int Enabled
Definition: vtkRenderWindowInteractor.h:824
vtkRenderWindowInteractor::TimerEventDuration
int TimerEventDuration
Definition: vtkRenderWindowInteractor.h:851
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:292
vtkRenderWindowInteractor::LastScale
double LastScale
Definition: vtkRenderWindowInteractor.h:840
vtkRenderWindowInteractor::DesiredUpdateRate
double DesiredUpdateRate
Definition: vtkRenderWindowInteractor.h:829
vtkRenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
Definition: vtkRenderWindowInteractor.h:135
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:641
vtkCommand::EventIds
EventIds
Definition: vtkCommand.h:445
vtkRenderWindowInteractor::vtkRenderWindowInteractor
vtkRenderWindowInteractor()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
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:510
vtkRenderWindowInteractor::Style
int Style
Definition: vtkRenderWindowInteractor.h:826
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int x, int y)
Definition: vtkRenderWindowInteractor.h:461
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:60
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:514
vtkRenderWindowInteractor::ProcessEvents
virtual void ProcessEvents()
Run the event loop and return.
Definition: vtkRenderWindowInteractor.h:118
vtkRenderWindowInteractor::CreateRepeatingTimer
int CreateRepeatingTimer(unsigned long duration)
Create a repeating timer, with the specified duration (in milliseconds).
vtkRenderWindowInteractor::Scale
double Scale
Definition: vtkRenderWindowInteractor.h:839
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:85
vtkObserverMediator
manage contention for cursors and other resources
Definition: vtkObserverMediator.h:42
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
Definition: vtkRenderWindowInteractor.h:518
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:231
vtkHardwareWindow
create a window for renderers to draw into
Definition: vtkHardwareWindow.h:36
vtkRenderWindowInteractor::CurrentGesture
vtkCommand::EventIds CurrentGesture
Definition: vtkRenderWindowInteractor.h:919
vtkRenderWindowInteractor::FifthButtonReleaseEvent
virtual void FifthButtonReleaseEvent()
vtkRenderWindowInteractor::TimerEventId
int TimerEventId
Definition: vtkRenderWindowInteractor.h:849
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:837
vtkRenderWindowInteractor::TimerDuration
unsigned long TimerDuration
Definition: vtkRenderWindowInteractor.h:887
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:647
vtkRenderWindowInteractor::Done
bool Done
Definition: vtkRenderWindowInteractor.h:815
vtkPickingManager
Class defines API to manage the picking process.
Definition: vtkPickingManager.h:83
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:614