VTK  9.2.20230323
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 =========================================================================*/
163 #ifndef vtkRenderWindowInteractor_h
164 #define vtkRenderWindowInteractor_h
165 
166 #include "vtkCommand.h" // for method sig
167 #include "vtkObject.h"
168 #include "vtkRenderingCoreModule.h" // For export macro
169 #include "vtkSmartPointer.h" // For InteractorStyle
170 
171 VTK_ABI_NAMESPACE_BEGIN
172 class vtkTimerIdMap;
173 
174 // Timer flags for win32/X compatibility
175 #define VTKI_TIMER_FIRST 0
176 #define VTKI_TIMER_UPDATE 1
177 
178 // maximum pointers active at once
179 // for example in multitouch
180 #define VTKI_MAX_POINTERS 5
181 
182 class vtkAbstractPicker;
184 class vtkAssemblyPath;
185 class vtkHardwareWindow;
187 class vtkRenderWindow;
188 class vtkRenderer;
189 class vtkObserverMediator;
191 class vtkPickingManager;
192 
193 class VTKRENDERINGCORE_EXPORT vtkRenderWindowInteractor : public vtkObject
194 {
195 
197 
198 public:
201  void PrintSelf(ostream& os, vtkIndent indent) override;
202 
204 
211  virtual void Initialize();
213  {
214  this->Initialized = 0;
215  this->Enabled = 0;
216  this->Initialize();
217  }
219 
224  void UnRegister(vtkObjectBase* o) override;
225 
231  virtual void Start();
232 
238  virtual void ProcessEvents() {}
239 
243  vtkGetMacro(Done, bool);
244  vtkSetMacro(Done, bool);
245 
255  virtual void Enable()
256  {
257  this->Enabled = 1;
258  this->Modified();
259  }
260  virtual void Disable()
261  {
262  this->Enabled = 0;
263  this->Modified();
264  }
265  vtkGetMacro(Enabled, int);
266 
268 
272  vtkBooleanMacro(EnableRender, bool);
273  vtkSetMacro(EnableRender, bool);
274  vtkGetMacro(EnableRender, bool);
276 
278 
282  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
284 
286 
292  vtkGetObjectMacro(HardwareWindow, vtkHardwareWindow);
294 
302  virtual void UpdateSize(int x, int y);
303 
320  virtual int CreateTimer(int timerType); // first group, for backward compatibility
321  virtual int DestroyTimer(); // first group, for backward compatibility
322 
327  int CreateRepeatingTimer(unsigned long duration);
328 
333  int CreateOneShotTimer(unsigned long duration);
334 
339  int IsOneShotTimer(int timerId);
340 
344  unsigned long GetTimerDuration(int timerId);
345 
349  int ResetTimer(int timerId);
350 
355  int DestroyTimer(int timerId);
356 
360  virtual int GetVTKTimerId(int platformTimerId);
361 
362  // Moved into the public section of the class so that classless timer procs
363  // can access these enum members without being "friends"...
364  enum
365  {
366  OneShotTimer = 1,
367  RepeatingTimer
368  };
369 
371 
380  vtkSetClampMacro(TimerDuration, unsigned long, 1, 100000);
381  vtkGetMacro(TimerDuration, unsigned long);
383 
385 
397  vtkSetMacro(TimerEventId, int);
398  vtkGetMacro(TimerEventId, int);
399  vtkSetMacro(TimerEventType, int);
400  vtkGetMacro(TimerEventType, int);
401  vtkSetMacro(TimerEventDuration, int);
402  vtkGetMacro(TimerEventDuration, int);
403  vtkSetMacro(TimerEventPlatformId, int);
404  vtkGetMacro(TimerEventPlatformId, int);
406 
412  virtual void TerminateApp(void) { this->Done = true; }
413 
415 
422 
424 
428  vtkSetMacro(LightFollowCamera, vtkTypeBool);
429  vtkGetMacro(LightFollowCamera, vtkTypeBool);
430  vtkBooleanMacro(LightFollowCamera, vtkTypeBool);
432 
434 
441  vtkSetClampMacro(DesiredUpdateRate, double, 0.0001, VTK_FLOAT_MAX);
442  vtkGetMacro(DesiredUpdateRate, double);
444 
446 
451  vtkSetClampMacro(StillUpdateRate, double, 0.0001, VTK_FLOAT_MAX);
452  vtkGetMacro(StillUpdateRate, double);
454 
456 
460  vtkGetMacro(Initialized, int);
462 
464 
470  virtual void SetPicker(vtkAbstractPicker*);
471  vtkGetObjectMacro(Picker, vtkAbstractPicker);
473 
479 
481 
487  vtkGetObjectMacro(PickingManager, vtkPickingManager);
489 
491 
495  virtual void ExitCallback();
496  virtual void UserCallback();
497  virtual void StartPickCallback();
498  virtual void EndPickCallback();
500 
504  virtual void GetMousePosition(int* x, int* y)
505  {
506  *x = 0;
507  *y = 0;
508  }
509 
511 
515  void HideCursor();
516  void ShowCursor();
518 
523  virtual void Render();
524 
526 
531  void FlyTo(vtkRenderer* ren, double x, double y, double z);
532  void FlyTo(vtkRenderer* ren, double* x) { this->FlyTo(ren, x[0], x[1], x[2]); }
533  void FlyToImage(vtkRenderer* ren, double x, double y);
534  void FlyToImage(vtkRenderer* ren, double* x) { this->FlyToImage(ren, x[0], x[1]); }
536 
538 
541  vtkSetClampMacro(NumberOfFlyFrames, int, 1, VTK_INT_MAX);
542  vtkGetMacro(NumberOfFlyFrames, int);
544 
546 
550  vtkSetMacro(Dolly, double);
551  vtkGetMacro(Dolly, double);
553 
555 
563  vtkGetVector2Macro(EventPosition, int);
564  vtkGetVector2Macro(LastEventPosition, int);
565  vtkSetVector2Macro(LastEventPosition, int);
566  virtual void SetEventPosition(int x, int y)
567  {
568  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting EventPosition to (" << x
569  << "," << y << ")");
570  if (this->EventPosition[0] != x || this->EventPosition[1] != y ||
571  this->LastEventPosition[0] != x || this->LastEventPosition[1] != y)
572  {
573  this->LastEventPosition[0] = this->EventPosition[0];
574  this->LastEventPosition[1] = this->EventPosition[1];
575  this->EventPosition[0] = x;
576  this->EventPosition[1] = y;
577  this->Modified();
578  }
579  }
580  virtual void SetEventPosition(int pos[2]) { this->SetEventPosition(pos[0], pos[1]); }
581  virtual void SetEventPositionFlipY(int x, int y)
582  {
583  this->SetEventPosition(x, this->Size[1] - y - 1);
584  }
585  virtual void SetEventPositionFlipY(int pos[2]) { this->SetEventPositionFlipY(pos[0], pos[1]); }
587 
588  virtual int* GetEventPositions(int pointerIndex)
589  {
590  if (pointerIndex >= VTKI_MAX_POINTERS)
591  {
592  return nullptr;
593  }
594  return this->EventPositions[pointerIndex];
595  }
596  virtual int* GetLastEventPositions(int pointerIndex)
597  {
598  if (pointerIndex >= VTKI_MAX_POINTERS)
599  {
600  return nullptr;
601  }
602  return this->LastEventPositions[pointerIndex];
603  }
604  virtual void SetEventPosition(int x, int y, int pointerIndex)
605  {
606  if (pointerIndex < 0 || pointerIndex >= VTKI_MAX_POINTERS)
607  {
608  return;
609  }
610  if (pointerIndex == 0)
611  {
612  this->LastEventPosition[0] = this->EventPosition[0];
613  this->LastEventPosition[1] = this->EventPosition[1];
614  this->EventPosition[0] = x;
615  this->EventPosition[1] = y;
616  }
617  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting EventPosition to (" << x
618  << "," << y << ") for pointerIndex number " << pointerIndex);
619  if (this->EventPositions[pointerIndex][0] != x || this->EventPositions[pointerIndex][1] != y ||
620  this->LastEventPositions[pointerIndex][0] != x ||
621  this->LastEventPositions[pointerIndex][1] != y)
622  {
623  this->LastEventPositions[pointerIndex][0] = this->EventPositions[pointerIndex][0];
624  this->LastEventPositions[pointerIndex][1] = this->EventPositions[pointerIndex][1];
625  this->EventPositions[pointerIndex][0] = x;
626  this->EventPositions[pointerIndex][1] = y;
627  this->Modified();
628  }
629  }
630  virtual void SetEventPosition(int pos[2], int pointerIndex)
631  {
632  this->SetEventPosition(pos[0], pos[1], pointerIndex);
633  }
634  virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
635  {
636  this->SetEventPosition(x, this->Size[1] - y - 1, pointerIndex);
637  }
638  virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
639  {
640  this->SetEventPositionFlipY(pos[0], pos[1], pointerIndex);
641  }
642 
644 
647  vtkSetMacro(AltKey, int);
648  vtkGetMacro(AltKey, int);
650 
652 
655  vtkSetMacro(ControlKey, int);
656  vtkGetMacro(ControlKey, int);
658 
660 
663  vtkSetMacro(ShiftKey, int);
664  vtkGetMacro(ShiftKey, int);
666 
668 
671  vtkSetMacro(KeyCode, char);
672  vtkGetMacro(KeyCode, char);
674 
676 
680  vtkSetMacro(RepeatCount, int);
681  vtkGetMacro(RepeatCount, int);
683 
685 
691  vtkSetStringMacro(KeySym);
692  vtkGetStringMacro(KeySym);
694 
696 
699  vtkSetMacro(PointerIndex, int);
700  vtkGetMacro(PointerIndex, int);
702 
704 
707  void SetRotation(double rotation);
708  vtkGetMacro(Rotation, double);
709  vtkGetMacro(LastRotation, double);
711 
713 
716  void SetScale(double scale);
717  vtkGetMacro(Scale, double);
718  vtkGetMacro(LastScale, double);
720 
722 
725  void SetTranslation(double val[2]);
726  vtkGetVector2Macro(Translation, double);
727  vtkGetVector2Macro(LastTranslation, double);
729 
731 
734  void SetEventInformation(int x, int y, int ctrl, int shift, char keycode, int repeatcount,
735  const char* keysym, int pointerIndex)
736  {
737  this->SetEventPosition(x, y, pointerIndex);
738  this->ControlKey = ctrl;
739  this->ShiftKey = shift;
740  this->KeyCode = keycode;
741  this->RepeatCount = repeatcount;
742  this->PointerIndex = pointerIndex;
743  if (keysym)
744  {
745  this->SetKeySym(keysym);
746  }
747  this->Modified();
748  }
749  void SetEventInformation(int x, int y, int ctrl = 0, int shift = 0, char keycode = 0,
750  int repeatcount = 0, const char* keysym = nullptr)
751  {
752  this->SetEventInformation(x, y, ctrl, shift, keycode, repeatcount, keysym, 0);
753  }
755 
757 
761  void SetEventInformationFlipY(int x, int y, int ctrl, int shift, char keycode, int repeatcount,
762  const char* keysym, int pointerIndex)
763  {
764  this->SetEventInformation(
765  x, this->Size[1] - y - 1, ctrl, shift, keycode, repeatcount, keysym, pointerIndex);
766  }
767  void SetEventInformationFlipY(int x, int y, int ctrl = 0, int shift = 0, char keycode = 0,
768  int repeatcount = 0, const char* keysym = nullptr)
769  {
770  this->SetEventInformationFlipY(x, y, ctrl, shift, keycode, repeatcount, keysym, 0);
771  }
773 
775 
778  void SetKeyEventInformation(int ctrl = 0, int shift = 0, char keycode = 0, int repeatcount = 0,
779  const char* keysym = nullptr)
780  {
781  this->ControlKey = ctrl;
782  this->ShiftKey = shift;
783  this->KeyCode = keycode;
784  this->RepeatCount = repeatcount;
785  if (keysym)
786  {
787  this->SetKeySym(keysym);
788  }
789  this->Modified();
790  }
792 
794 
805  vtkSetVector2Macro(Size, int);
806  vtkGetVector2Macro(Size, int);
807  vtkSetVector2Macro(EventSize, int);
808  vtkGetVector2Macro(EventSize, int);
810 
816  virtual vtkRenderer* FindPokedRenderer(int, int);
817 
826 
828 
836  vtkSetMacro(UseTDx, bool);
837  vtkGetMacro(UseTDx, bool);
839 
841 
846  virtual void MouseMoveEvent();
847  virtual void RightButtonPressEvent();
848  virtual void RightButtonReleaseEvent();
849  virtual void LeftButtonPressEvent();
850  virtual void LeftButtonReleaseEvent();
851  virtual void MiddleButtonPressEvent();
852  virtual void MiddleButtonReleaseEvent();
853  virtual void MouseWheelForwardEvent();
854  virtual void MouseWheelBackwardEvent();
855  virtual void MouseWheelLeftEvent();
856  virtual void MouseWheelRightEvent();
857  virtual void ExposeEvent();
858  virtual void ConfigureEvent();
859  virtual void EnterEvent();
860  virtual void LeaveEvent();
861  virtual void KeyPressEvent();
862  virtual void KeyReleaseEvent();
863  virtual void CharEvent();
864  virtual void ExitEvent();
865  virtual void FourthButtonPressEvent();
866  virtual void FourthButtonReleaseEvent();
867  virtual void FifthButtonPressEvent();
868  virtual void FifthButtonReleaseEvent();
870 
872 
876  virtual void StartPinchEvent();
877  virtual void PinchEvent();
878  virtual void EndPinchEvent();
879  virtual void StartRotateEvent();
880  virtual void RotateEvent();
881  virtual void EndRotateEvent();
882  virtual void StartPanEvent();
883  virtual void PanEvent();
884  virtual void EndPanEvent();
885  virtual void TapEvent();
886  virtual void LongTapEvent();
887  virtual void SwipeEvent();
889 
891 
897  vtkSetMacro(RecognizeGestures, bool);
898  vtkGetMacro(RecognizeGestures, bool);
900 
902 
907  vtkGetMacro(PointersDownCount, int);
909 
911 
918  void ClearContact(size_t contactID);
919  int GetPointerIndexForContact(size_t contactID);
920  int GetPointerIndexForExistingContact(size_t contactID);
921  bool IsPointerIndexSet(int i);
922  void ClearPointerIndex(int i);
924 
925 protected:
928 
932 
933  // Used as a helper object to pick instances of vtkProp
936 
937  bool Done; // is the event loop done running
938 
944 
946  int Enabled;
948  int Style;
953 
954  // Event information
955  int AltKey;
957  int ShiftKey;
958  char KeyCode;
959  double Rotation;
960  double LastRotation;
961  double Scale;
962  double LastScale;
963  double Translation[2];
964  double LastTranslation[2];
966  char* KeySym;
967  int EventPosition[2];
968  int LastEventPosition[2];
969  int EventSize[2];
970  int Size[2];
975 
976  int EventPositions[VTKI_MAX_POINTERS][2];
977  int LastEventPositions[VTKI_MAX_POINTERS][2];
979 
980  size_t PointerIndexLookup[VTKI_MAX_POINTERS];
981 
982  // control the fly to
984  double Dolly;
985 
994  friend class vtkInteractorObserver;
995  void GrabFocus(vtkCommand* mouseEvents, vtkCommand* keypressEvents = nullptr)
996  {
997  this->Superclass::InternalGrabFocus(mouseEvents, keypressEvents);
998  }
1000 
1005 
1006  // Timer related members
1007  friend struct vtkTimerStruct;
1008  vtkTimerIdMap* TimerMap; // An internal, PIMPLd map of timers and associated attributes
1009  unsigned long TimerDuration; // in milliseconds
1011 
1017  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
1018  virtual int InternalDestroyTimer(int platformTimerId);
1021 
1022  // Force the interactor to handle the Start() event loop, ignoring any
1023  // overrides. (Overrides are registered by observing StartEvent on the
1024  // interactor.)
1026 
1030  virtual void StartEventLoop() {}
1031 
1032  bool UseTDx; // 3DConnexion device.
1033 
1034  // when recognizing gestures VTK will take multitouch events
1035  // if it receives them and convert them to gestures
1038  int PointersDown[VTKI_MAX_POINTERS];
1040  int StartingEventPositions[VTKI_MAX_POINTERS][2];
1042 
1043 private:
1045  void operator=(const vtkRenderWindowInteractor&) = delete;
1046 };
1047 
1048 VTK_ABI_NAMESPACE_END
1049 #endif
define API for picking subclasses
abstract API for pickers that can pick an instance of vtkProp
a list of nodes that form an assembly path
superclass for callback/observer methods
Definition: vtkCommand.h:396
create a window for renderers to draw into
a simple class to control print indentation
Definition: vtkIndent.h:120
record and play VTK events passing through a vtkRenderWindowInteractor
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
abstract base class for most VTK objects
Definition: vtkObjectBase.h:75
const char * GetClassName() const
Return the class name as a string.
abstract base class for most VTK objects
Definition: vtkObject.h:83
void InternalReleaseFocus()
These methods allow a command to exclusively grab all events.
void InternalGrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
These methods allow a command to exclusively grab all events.
virtual void Modified()
Update the modification time for this object.
manage contention for cursors and other resources
Class defines API to manage the picking process.
platform-independent render window interaction including picking and frame rate control.
unsigned long GetTimerDuration(int timerId)
Get the duration (in milliseconds) for the specified timerId.
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...
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
virtual void FourthButtonReleaseEvent()
Fire various events.
virtual void PinchEvent()
Fire various gesture based events.
virtual void SwipeEvent()
Fire various gesture based events.
virtual void StartRotateEvent()
Fire various gesture based events.
void SetRenderWindow(vtkRenderWindow *aren)
Set/Get the rendering window being controlled by this object.
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.
void UnRegister(vtkObjectBase *o) override
This Method detects loops of RenderWindow-Interactor, so objects are freed properly.
virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
virtual void EndPinchEvent()
Fire various gesture based events.
virtual void KeyReleaseEvent()
Fire various events.
virtual void EndPickCallback()
These methods correspond to the Exit, User and Pick callbacks.
virtual void Enable()
Enable/Disable interactions.
virtual int InternalDestroyTimer(int platformTimerId)
Internal methods for creating and destroying timers that must be implemented by subclasses.
int CreateRepeatingTimer(unsigned long duration)
Create a repeating timer, with the specified duration (in milliseconds).
virtual vtkAbstractPropPicker * CreateDefaultPicker()
Create default picker.
vtkObserverMediator * ObserverMediator
Widget mediators are used to resolve contention for cursors and other resources.
virtual void EndRotateEvent()
Fire various gesture based events.
virtual void ExitEvent()
Fire various events.
void FlyToImage(vtkRenderer *ren, double x, double y)
Given a position x, move the current camera's focal point to x.
void SetRotation(double rotation)
Set/get the rotation for the gesture in degrees, update LastRotation.
virtual void ExposeEvent()
Fire various events.
virtual void EndPanEvent()
Fire various gesture based events.
virtual void Render()
Render the scene.
virtual void MouseWheelLeftEvent()
Fire various events.
virtual void MouseWheelForwardEvent()
Fire various events.
virtual void SetEventPosition(int x, int y)
Set/Get information about the current event.
virtual void UserCallback()
These methods correspond to the Exit, User and Pick callbacks.
void SetHardwareWindow(vtkHardwareWindow *aren)
Set/Get the hardware window being controlled by this object.
virtual void LeftButtonReleaseEvent()
Fire various events.
virtual void CharEvent()
Fire various events.
virtual int DestroyTimer()
int IsOneShotTimer(int timerId)
Query whether the specified timerId is a one shot timer.
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.
vtkObserverMediator * GetObserverMediator()
Return the object used to mediate between vtkInteractorObservers contending for resources.
virtual void TerminateApp(void)
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void UpdateSize(int x, int y)
Event loop notification member for window size change.
virtual int * GetEventPositions(int pointerIndex)
virtual vtkInteractorObserver * GetInteractorStyle()
External switching between joystick/trackball/new? modes.
virtual void LeaveEvent()
Fire various events.
virtual void FourthButtonPressEvent()
Fire various events.
virtual void MouseWheelRightEvent()
Fire various events.
virtual void EnterEvent()
Fire various events.
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Internal methods for creating and destroying timers that must be implemented by subclasses.
static vtkRenderWindowInteractor * New()
~vtkRenderWindowInteractor() override
virtual void RightButtonPressEvent()
Fire various events.
virtual void Start()
Start the event loop.
void SetEventInformation(int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=nullptr)
Set all the event information in one call.
void ShowCursor()
Hide or show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
virtual vtkPickingManager * CreateDefaultPickingManager()
Create default pickingManager.
virtual void ConfigureEvent()
Fire various events.
virtual void FifthButtonPressEvent()
Fire various events.
virtual vtkRenderer * FindPokedRenderer(int, int)
When an event occurs, we must determine which Renderer the event occurred within, since one RenderWin...
virtual void StartPanEvent()
Fire various gesture based events.
virtual int CreateTimer(int timerType)
This class provides two groups of methods for manipulating timers.
int ResetTimer(int timerId)
Reset the specified timer.
int GetCurrentTimerId()
Internal methods for creating and destroying timers that must be implemented by subclasses.
virtual void MouseWheelBackwardEvent()
Fire various events.
virtual void SetInteractorStyle(vtkInteractorObserver *)
External switching between joystick/trackball/new? modes.
void ClearContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
void FlyTo(vtkRenderer *ren, double x, double y, double z)
Given a position x, move the current camera's focal point to x.
int CreateOneShotTimer(unsigned long duration)
Create a one shot timer, with the specified duration (in milliseconds).
void ReInitialize()
Prepare for handling events and set the Enabled flag to true.
virtual void ExitCallback()
These methods correspond to the Exit, User and Pick callbacks.
void SetEventInformationFlipY(int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=nullptr)
Calls SetEventInformation, but flips the Y based on the current Size[1] value (i.e.
int DestroyTimer(int timerId)
Destroy the timer specified by timerId.
vtkSmartPointer< vtkInteractorObserver > InteractorStyle
void SetTranslation(double val[2])
Set/get the translation for pan/swipe gestures, update LastTranslation.
void FlyToImage(vtkRenderer *ren, double *x)
Given a position x, move the current camera's focal point to x.
virtual void PanEvent()
Fire various gesture based events.
virtual void ProcessEvents()
Run the event loop and return.
virtual void RightButtonReleaseEvent()
Fire various events.
virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
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.
virtual void GetMousePosition(int *x, int *y)
Get the current position of the mouse.
virtual void SetEventPositionFlipY(int x, int y)
Set/Get information about the current event.
int GetPointerIndexForContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
virtual void FifthButtonReleaseEvent()
Fire various events.
bool IsPointerIndexSet(int i)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
virtual void LeftButtonPressEvent()
Fire various events.
void GrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
virtual void MiddleButtonPressEvent()
Fire various events.
virtual int * GetLastEventPositions(int pointerIndex)
virtual void StartPickCallback()
These methods correspond to the Exit, User and Pick callbacks.
int GetPointerIndexForExistingContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
virtual void MouseMoveEvent()
Fire various events.
void FlyTo(vtkRenderer *ren, double *x)
Given a position x, move the current camera's focal point to x.
virtual void StartPinchEvent()
Fire various gesture based events.
virtual void SetEventPosition(int pos[2])
Set/Get information about the current event.
virtual void SetPicker(vtkAbstractPicker *)
Set/Get the object used to perform pick operations.
virtual int GetVTKTimerId(int platformTimerId)
Get the VTK timer ID that corresponds to the supplied platform ID.
void SetScale(double scale)
Set/get the scale for the gesture, updates LastScale.
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
virtual void RotateEvent()
Fire various gesture based events.
virtual void TapEvent()
Fire various gesture based events.
virtual void SetEventPositionFlipY(int pos[2])
Set/Get information about the current event.
virtual void SetEventPosition(int x, int y, int pointerIndex)
void ClearPointerIndex(int i)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
virtual void LongTapEvent()
Fire various gesture based events.
virtual void MiddleButtonReleaseEvent()
Fire various events.
virtual void RecognizeGesture(vtkCommand::EventIds)
virtual void SetEventPosition(int pos[2], int pointerIndex)
virtual void SetPickingManager(vtkPickingManager *)
Set the picking manager.
virtual void KeyPressEvent()
Fire various events.
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:183
@ scale
Definition: vtkX3D.h:241
@ rotation
Definition: vtkX3D.h:240
int vtkTypeBool
Definition: vtkABI.h:71
#define VTKI_MAX_POINTERS
#define VTK_INT_MAX
Definition: vtkType.h:156
#define VTK_FLOAT_MAX
Definition: vtkType.h:164