VTK  9.1.0
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 
170 class vtkTimerIdMap;
171 
172 // Timer flags for win32/X compatibility
173 #define VTKI_TIMER_FIRST 0
174 #define VTKI_TIMER_UPDATE 1
175 
176 // maximum pointers active at once
177 // for example in multitouch
178 #define VTKI_MAX_POINTERS 5
179 
180 class vtkAbstractPicker;
182 class vtkAssemblyPath;
183 class vtkHardwareWindow;
185 class vtkRenderWindow;
186 class vtkRenderer;
187 class vtkObserverMediator;
189 class vtkPickingManager;
190 
191 class VTKRENDERINGCORE_EXPORT vtkRenderWindowInteractor : public vtkObject
192 {
193 
195 
196 public:
199  void PrintSelf(ostream& os, vtkIndent indent) override;
200 
202 
209  virtual void Initialize();
211  {
212  this->Initialized = 0;
213  this->Enabled = 0;
214  this->Initialize();
215  }
217 
222  void UnRegister(vtkObjectBase* o) override;
223 
229  virtual void Start();
230 
236  virtual void ProcessEvents() {}
237 
241  vtkGetMacro(Done, bool);
242  vtkSetMacro(Done, bool);
243 
253  virtual void Enable()
254  {
255  this->Enabled = 1;
256  this->Modified();
257  }
258  virtual void Disable()
259  {
260  this->Enabled = 0;
261  this->Modified();
262  }
263  vtkGetMacro(Enabled, int);
264 
266 
270  vtkBooleanMacro(EnableRender, bool);
271  vtkSetMacro(EnableRender, bool);
272  vtkGetMacro(EnableRender, bool);
274 
276 
280  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
282 
284 
290  vtkGetObjectMacro(HardwareWindow, vtkHardwareWindow);
292 
300  virtual void UpdateSize(int x, int y);
301 
318  virtual int CreateTimer(int timerType); // first group, for backward compatibility
319  virtual int DestroyTimer(); // first group, for backward compatibility
320 
325  int CreateRepeatingTimer(unsigned long duration);
326 
331  int CreateOneShotTimer(unsigned long duration);
332 
337  int IsOneShotTimer(int timerId);
338 
342  unsigned long GetTimerDuration(int timerId);
343 
347  int ResetTimer(int timerId);
348 
353  int DestroyTimer(int timerId);
354 
358  virtual int GetVTKTimerId(int platformTimerId);
359 
360  // Moved into the public section of the class so that classless timer procs
361  // can access these enum members without being "friends"...
362  enum
363  {
364  OneShotTimer = 1,
365  RepeatingTimer
366  };
367 
369 
378  vtkSetClampMacro(TimerDuration, unsigned long, 1, 100000);
379  vtkGetMacro(TimerDuration, unsigned long);
381 
383 
395  vtkSetMacro(TimerEventId, int);
396  vtkGetMacro(TimerEventId, int);
397  vtkSetMacro(TimerEventType, int);
398  vtkGetMacro(TimerEventType, int);
399  vtkSetMacro(TimerEventDuration, int);
400  vtkGetMacro(TimerEventDuration, int);
401  vtkSetMacro(TimerEventPlatformId, int);
402  vtkGetMacro(TimerEventPlatformId, int);
404 
410  virtual void TerminateApp(void) { this->Done = true; }
411 
413 
418  vtkGetObjectMacro(InteractorStyle, vtkInteractorObserver);
420 
422 
426  vtkSetMacro(LightFollowCamera, vtkTypeBool);
427  vtkGetMacro(LightFollowCamera, vtkTypeBool);
428  vtkBooleanMacro(LightFollowCamera, vtkTypeBool);
430 
432 
439  vtkSetClampMacro(DesiredUpdateRate, double, 0.0001, VTK_FLOAT_MAX);
440  vtkGetMacro(DesiredUpdateRate, double);
442 
444 
449  vtkSetClampMacro(StillUpdateRate, double, 0.0001, VTK_FLOAT_MAX);
450  vtkGetMacro(StillUpdateRate, double);
452 
454 
458  vtkGetMacro(Initialized, int);
460 
462 
468  virtual void SetPicker(vtkAbstractPicker*);
469  vtkGetObjectMacro(Picker, vtkAbstractPicker);
471 
477 
479 
485  vtkGetObjectMacro(PickingManager, vtkPickingManager);
487 
489 
493  virtual void ExitCallback();
494  virtual void UserCallback();
495  virtual void StartPickCallback();
496  virtual void EndPickCallback();
498 
502  virtual void GetMousePosition(int* x, int* y)
503  {
504  *x = 0;
505  *y = 0;
506  }
507 
509 
513  void HideCursor();
514  void ShowCursor();
516 
521  virtual void Render();
522 
524 
529  void FlyTo(vtkRenderer* ren, double x, double y, double z);
530  void FlyTo(vtkRenderer* ren, double* x) { this->FlyTo(ren, x[0], x[1], x[2]); }
531  void FlyToImage(vtkRenderer* ren, double x, double y);
532  void FlyToImage(vtkRenderer* ren, double* x) { this->FlyToImage(ren, x[0], x[1]); }
534 
536 
539  vtkSetClampMacro(NumberOfFlyFrames, int, 1, VTK_INT_MAX);
540  vtkGetMacro(NumberOfFlyFrames, int);
542 
544 
548  vtkSetMacro(Dolly, double);
549  vtkGetMacro(Dolly, double);
551 
553 
561  vtkGetVector2Macro(EventPosition, int);
562  vtkGetVector2Macro(LastEventPosition, int);
563  vtkSetVector2Macro(LastEventPosition, int);
564  virtual void SetEventPosition(int x, int y)
565  {
566  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting EventPosition to (" << x
567  << "," << y << ")");
568  if (this->EventPosition[0] != x || this->EventPosition[1] != y ||
569  this->LastEventPosition[0] != x || this->LastEventPosition[1] != y)
570  {
571  this->LastEventPosition[0] = this->EventPosition[0];
572  this->LastEventPosition[1] = this->EventPosition[1];
573  this->EventPosition[0] = x;
574  this->EventPosition[1] = y;
575  this->Modified();
576  }
577  }
578  virtual void SetEventPosition(int pos[2]) { this->SetEventPosition(pos[0], pos[1]); }
579  virtual void SetEventPositionFlipY(int x, int y)
580  {
581  this->SetEventPosition(x, this->Size[1] - y - 1);
582  }
583  virtual void SetEventPositionFlipY(int pos[2]) { this->SetEventPositionFlipY(pos[0], pos[1]); }
585 
586  virtual int* GetEventPositions(int pointerIndex)
587  {
588  if (pointerIndex >= VTKI_MAX_POINTERS)
589  {
590  return nullptr;
591  }
592  return this->EventPositions[pointerIndex];
593  }
594  virtual int* GetLastEventPositions(int pointerIndex)
595  {
596  if (pointerIndex >= VTKI_MAX_POINTERS)
597  {
598  return nullptr;
599  }
600  return this->LastEventPositions[pointerIndex];
601  }
602  virtual void SetEventPosition(int x, int y, int pointerIndex)
603  {
604  if (pointerIndex < 0 || pointerIndex >= VTKI_MAX_POINTERS)
605  {
606  return;
607  }
608  if (pointerIndex == 0)
609  {
610  this->LastEventPosition[0] = this->EventPosition[0];
611  this->LastEventPosition[1] = this->EventPosition[1];
612  this->EventPosition[0] = x;
613  this->EventPosition[1] = y;
614  }
615  vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting EventPosition to (" << x
616  << "," << y << ") for pointerIndex number " << pointerIndex);
617  if (this->EventPositions[pointerIndex][0] != x || this->EventPositions[pointerIndex][1] != y ||
618  this->LastEventPositions[pointerIndex][0] != x ||
619  this->LastEventPositions[pointerIndex][1] != y)
620  {
621  this->LastEventPositions[pointerIndex][0] = this->EventPositions[pointerIndex][0];
622  this->LastEventPositions[pointerIndex][1] = this->EventPositions[pointerIndex][1];
623  this->EventPositions[pointerIndex][0] = x;
624  this->EventPositions[pointerIndex][1] = y;
625  this->Modified();
626  }
627  }
628  virtual void SetEventPosition(int pos[2], int pointerIndex)
629  {
630  this->SetEventPosition(pos[0], pos[1], pointerIndex);
631  }
632  virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
633  {
634  this->SetEventPosition(x, this->Size[1] - y - 1, pointerIndex);
635  }
636  virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
637  {
638  this->SetEventPositionFlipY(pos[0], pos[1], pointerIndex);
639  }
640 
642 
645  vtkSetMacro(AltKey, int);
646  vtkGetMacro(AltKey, int);
648 
650 
653  vtkSetMacro(ControlKey, int);
654  vtkGetMacro(ControlKey, int);
656 
658 
661  vtkSetMacro(ShiftKey, int);
662  vtkGetMacro(ShiftKey, int);
664 
666 
669  vtkSetMacro(KeyCode, char);
670  vtkGetMacro(KeyCode, char);
672 
674 
678  vtkSetMacro(RepeatCount, int);
679  vtkGetMacro(RepeatCount, int);
681 
683 
689  vtkSetStringMacro(KeySym);
690  vtkGetStringMacro(KeySym);
692 
694 
697  vtkSetMacro(PointerIndex, int);
698  vtkGetMacro(PointerIndex, int);
700 
702 
705  void SetRotation(double rotation);
706  vtkGetMacro(Rotation, double);
707  vtkGetMacro(LastRotation, double);
709 
711 
714  void SetScale(double scale);
715  vtkGetMacro(Scale, double);
716  vtkGetMacro(LastScale, double);
718 
720 
723  void SetTranslation(double val[2]);
724  vtkGetVector2Macro(Translation, double);
725  vtkGetVector2Macro(LastTranslation, double);
727 
729 
732  void SetEventInformation(int x, int y, int ctrl, int shift, char keycode, int repeatcount,
733  const char* keysym, int pointerIndex)
734  {
735  this->SetEventPosition(x, y, pointerIndex);
736  this->ControlKey = ctrl;
737  this->ShiftKey = shift;
738  this->KeyCode = keycode;
739  this->RepeatCount = repeatcount;
740  this->PointerIndex = pointerIndex;
741  if (keysym)
742  {
743  this->SetKeySym(keysym);
744  }
745  this->Modified();
746  }
747  void SetEventInformation(int x, int y, int ctrl = 0, int shift = 0, char keycode = 0,
748  int repeatcount = 0, const char* keysym = nullptr)
749  {
750  this->SetEventInformation(x, y, ctrl, shift, keycode, repeatcount, keysym, 0);
751  }
753 
755 
759  void SetEventInformationFlipY(int x, int y, int ctrl, int shift, char keycode, int repeatcount,
760  const char* keysym, int pointerIndex)
761  {
762  this->SetEventInformation(
763  x, this->Size[1] - y - 1, ctrl, shift, keycode, repeatcount, keysym, pointerIndex);
764  }
765  void SetEventInformationFlipY(int x, int y, int ctrl = 0, int shift = 0, char keycode = 0,
766  int repeatcount = 0, const char* keysym = nullptr)
767  {
768  this->SetEventInformationFlipY(x, y, ctrl, shift, keycode, repeatcount, keysym, 0);
769  }
771 
773 
776  void SetKeyEventInformation(int ctrl = 0, int shift = 0, char keycode = 0, int repeatcount = 0,
777  const char* keysym = nullptr)
778  {
779  this->ControlKey = ctrl;
780  this->ShiftKey = shift;
781  this->KeyCode = keycode;
782  this->RepeatCount = repeatcount;
783  if (keysym)
784  {
785  this->SetKeySym(keysym);
786  }
787  this->Modified();
788  }
790 
792 
803  vtkSetVector2Macro(Size, int);
804  vtkGetVector2Macro(Size, int);
805  vtkSetVector2Macro(EventSize, int);
806  vtkGetVector2Macro(EventSize, int);
808 
814  virtual vtkRenderer* FindPokedRenderer(int, int);
815 
824 
826 
834  vtkSetMacro(UseTDx, bool);
835  vtkGetMacro(UseTDx, bool);
837 
839 
844  virtual void MouseMoveEvent();
845  virtual void RightButtonPressEvent();
846  virtual void RightButtonReleaseEvent();
847  virtual void LeftButtonPressEvent();
848  virtual void LeftButtonReleaseEvent();
849  virtual void MiddleButtonPressEvent();
850  virtual void MiddleButtonReleaseEvent();
851  virtual void MouseWheelForwardEvent();
852  virtual void MouseWheelBackwardEvent();
853  virtual void MouseWheelLeftEvent();
854  virtual void MouseWheelRightEvent();
855  virtual void ExposeEvent();
856  virtual void ConfigureEvent();
857  virtual void EnterEvent();
858  virtual void LeaveEvent();
859  virtual void KeyPressEvent();
860  virtual void KeyReleaseEvent();
861  virtual void CharEvent();
862  virtual void ExitEvent();
863  virtual void FourthButtonPressEvent();
864  virtual void FourthButtonReleaseEvent();
865  virtual void FifthButtonPressEvent();
866  virtual void FifthButtonReleaseEvent();
868 
870 
874  virtual void StartPinchEvent();
875  virtual void PinchEvent();
876  virtual void EndPinchEvent();
877  virtual void StartRotateEvent();
878  virtual void RotateEvent();
879  virtual void EndRotateEvent();
880  virtual void StartPanEvent();
881  virtual void PanEvent();
882  virtual void EndPanEvent();
883  virtual void TapEvent();
884  virtual void LongTapEvent();
885  virtual void SwipeEvent();
887 
889 
895  vtkSetMacro(RecognizeGestures, bool);
896  vtkGetMacro(RecognizeGestures, bool);
898 
900 
905  vtkGetMacro(PointersDownCount, int);
907 
909 
916  void ClearContact(size_t contactID);
917  int GetPointerIndexForContact(size_t contactID);
918  int GetPointerIndexForExistingContact(size_t contactID);
919  bool IsPointerIndexSet(int i);
920  void ClearPointerIndex(int i);
922 
923 protected:
926 
930 
931  // Used as a helper object to pick instances of vtkProp
934 
935  bool Done; // is the event loop done running
936 
942 
944  int Enabled;
946  int Style;
951 
952  // Event information
953  int AltKey;
955  int ShiftKey;
956  char KeyCode;
957  double Rotation;
958  double LastRotation;
959  double Scale;
960  double LastScale;
961  double Translation[2];
962  double LastTranslation[2];
964  char* KeySym;
965  int EventPosition[2];
966  int LastEventPosition[2];
967  int EventSize[2];
968  int Size[2];
973 
974  int EventPositions[VTKI_MAX_POINTERS][2];
975  int LastEventPositions[VTKI_MAX_POINTERS][2];
977 
978  size_t PointerIndexLookup[VTKI_MAX_POINTERS];
979 
980  // control the fly to
982  double Dolly;
983 
992  friend class vtkInteractorObserver;
993  void GrabFocus(vtkCommand* mouseEvents, vtkCommand* keypressEvents = nullptr)
994  {
995  this->Superclass::InternalGrabFocus(mouseEvents, keypressEvents);
996  }
998 
1003 
1004  // Timer related members
1005  friend struct vtkTimerStruct;
1006  vtkTimerIdMap* TimerMap; // An internal, PIMPLd map of timers and associated attributes
1007  unsigned long TimerDuration; // in milliseconds
1009 
1015  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
1016  virtual int InternalDestroyTimer(int platformTimerId);
1019 
1020  // Force the interactor to handle the Start() event loop, ignoring any
1021  // overrides. (Overrides are registered by observing StartEvent on the
1022  // interactor.)
1024 
1028  virtual void StartEventLoop() {}
1029 
1030  bool UseTDx; // 3DConnexion device.
1031 
1032  // when recognizing gestures VTK will take multitouch events
1033  // if it receives them and convert them to gestures
1036  int PointersDown[VTKI_MAX_POINTERS];
1038  int StartingEventPositions[VTKI_MAX_POINTERS][2];
1040 
1041 private:
1043  void operator=(const vtkRenderWindowInteractor&) = delete;
1044 };
1045 
1046 #endif
vtkRenderWindowInteractor::RepeatCount
int RepeatCount
Definition: vtkRenderWindowInteractor.h:963
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:394
vtkRenderWindowInteractor::StartPanEvent
virtual void StartPanEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::MouseWheelForwardEvent
virtual void MouseWheelForwardEvent()
Fire various events.
vtkRenderWindowInteractor::MouseWheelLeftEvent
virtual void MouseWheelLeftEvent()
Fire various events.
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:48
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkRenderWindowInteractor::ExitEvent
virtual void ExitEvent()
Fire various events.
vtkRenderWindowInteractor::RecognizeGestures
bool RecognizeGestures
Definition: vtkRenderWindowInteractor.h:1034
vtkRenderWindowInteractor::CreateTimer
virtual int CreateTimer(int timerType)
This class provides two groups of methods for manipulating timers.
vtkRenderWindowInteractor::HandleEventLoop
int HandleEventLoop
Definition: vtkRenderWindowInteractor.h:1023
vtkRenderWindowInteractor::TimerEventType
int TimerEventType
Definition: vtkRenderWindowInteractor.h:970
vtkRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
Definition: vtkRenderWindowInteractor.h:1028
vtkInteractorEventRecorder::AltKey
@ AltKey
Definition: vtkInteractorEventRecorder.h:151
vtkRenderWindowInteractor::MiddleButtonPressEvent
virtual void MiddleButtonPressEvent()
Fire various events.
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkRenderWindowInteractor::AltKey
int AltKey
Definition: vtkRenderWindowInteractor.h:953
vtkRenderWindowInteractor::NumberOfFlyFrames
int NumberOfFlyFrames
Definition: vtkRenderWindowInteractor.h:981
vtkRenderWindowInteractor::MouseWheelBackwardEvent
virtual void MouseWheelBackwardEvent()
Fire various events.
vtkRenderWindowInteractor::~vtkRenderWindowInteractor
~vtkRenderWindowInteractor() override
vtkRenderWindowInteractor::ControlKey
int ControlKey
Definition: vtkRenderWindowInteractor.h:954
vtkRenderWindowInteractor::ShiftKey
int ShiftKey
Definition: vtkRenderWindowInteractor.h:955
vtkRenderWindowInteractor::UseTDx
bool UseTDx
Definition: vtkRenderWindowInteractor.h:1030
vtkRenderWindowInteractor::RotateEvent
virtual void RotateEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
Internal methods for creating and destroying timers that must be implemented by subclasses.
vtkRenderWindowInteractor::GetObserverMediator
vtkObserverMediator * GetObserverMediator()
Return the object used to mediate between vtkInteractorObservers contending for resources.
vtkRenderWindowInteractor::EnableRender
bool EnableRender
Definition: vtkRenderWindowInteractor.h:945
vtkRenderWindowInteractor::ReleaseFocus
void ReleaseFocus()
Definition: vtkRenderWindowInteractor.h:997
vtkRenderWindowInteractor::FlyTo
void FlyTo(vtkRenderer *ren, double *x)
Given a position x, move the current camera's focal point to x.
Definition: vtkRenderWindowInteractor.h:530
vtkRenderWindowInteractor::EndPickCallback
virtual void EndPickCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkRenderWindowInteractor::TimerEventPlatformId
int TimerEventPlatformId
Definition: vtkRenderWindowInteractor.h:972
vtkX3D::rotation
@ rotation
Definition: vtkX3D.h:234
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkRenderWindowInteractor::PointersDownCount
int PointersDownCount
Definition: vtkRenderWindowInteractor.h:1035
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkRenderWindowInteractor::UpdateSize
virtual void UpdateSize(int x, int y)
Event loop notification member for window size change.
vtkRenderWindowInteractor::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkRenderWindowInteractor.h:927
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int x, int y)
Set/Get information about the current event.
Definition: vtkRenderWindowInteractor.h:564
vtkRenderWindowInteractor::PanEvent
virtual void PanEvent()
Fire various gesture based events.
vtkObject::InternalGrabFocus
void InternalGrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
These methods allow a command to exclusively grab all events.
vtkRenderWindowInteractor::LeaveEvent
virtual void LeaveEvent()
Fire various events.
vtkRenderWindowInteractor::SetEventInformation
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.
Definition: vtkRenderWindowInteractor.h:747
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:933
vtkAbstractPicker
define API for picking subclasses
Definition: vtkAbstractPicker.h:98
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:91
vtkRenderWindowInteractor::SetPickingManager
virtual void SetPickingManager(vtkPickingManager *)
Set the picking manager.
vtkRenderWindowInteractor::KeyPressEvent
virtual void KeyPressEvent()
Fire various events.
vtkInteractorObserver
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Definition: vtkInteractorObserver.h:85
vtkRenderWindowInteractor::TapEvent
virtual void TapEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::PointerIndex
int PointerIndex
Definition: vtkRenderWindowInteractor.h:976
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:594
vtkRenderWindowInteractor::IsPointerIndexSet
bool IsPointerIndexSet(int i)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindowInteractor::Disable
virtual void Disable()
Definition: vtkRenderWindowInteractor.h:258
vtkObject::InternalReleaseFocus
void InternalReleaseFocus()
These methods allow a command to exclusively grab all events.
vtkRenderWindowInteractor::Dolly
double Dolly
Definition: vtkRenderWindowInteractor.h:982
vtkRenderWindowInteractor::GetPointerIndexForContact
int GetPointerIndexForContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindowInteractor::Initialized
int Initialized
Definition: vtkRenderWindowInteractor.h:943
vtkInteractorEventRecorder::ControlKey
@ ControlKey
Definition: vtkInteractorEventRecorder.h:150
vtkRenderWindowInteractor::GetEventPositions
virtual int * GetEventPositions(int pointerIndex)
Definition: vtkRenderWindowInteractor.h:586
vtkRenderWindowInteractor::CreateOneShotTimer
int CreateOneShotTimer(unsigned long duration)
Create a one shot timer, with the specified duration (in milliseconds).
vtkRenderWindowInteractor::RightButtonReleaseEvent
virtual void RightButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::MouseWheelRightEvent
virtual void MouseWheelRightEvent()
Fire various events.
vtkRenderWindowInteractor::HardwareWindow
vtkHardwareWindow * HardwareWindow
Definition: vtkRenderWindowInteractor.h:928
vtkRenderWindowInteractor::Picker
vtkAbstractPicker * Picker
Definition: vtkRenderWindowInteractor.h:932
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:776
vtkRenderWindowInteractor::RightButtonPressEvent
virtual void RightButtonPressEvent()
Fire various events.
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:502
vtkRenderWindowInteractor::CharEvent
virtual void CharEvent()
Fire various events.
vtkRenderWindowInteractor::GetCurrentTimerId
int GetCurrentTimerId()
Internal methods for creating and destroying timers that must be implemented by subclasses.
vtkRenderWindowInteractor::KeySym
char * KeySym
Definition: vtkRenderWindowInteractor.h:964
vtkRenderWindowInteractor::FlyToImage
void FlyToImage(vtkRenderer *ren, double *x)
Given a position x, move the current camera's focal point to x.
Definition: vtkRenderWindowInteractor.h:532
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:1006
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:70
vtkRenderWindowInteractor::EndPanEvent
virtual void EndPanEvent()
Fire various gesture based events.
vtkInteractorEventRecorder::ShiftKey
@ ShiftKey
Definition: vtkInteractorEventRecorder.h:149
vtkRenderWindowInteractor::ObserverMediator
vtkObserverMediator * ObserverMediator
Widget mediators are used to resolve contention for cursors and other resources.
Definition: vtkRenderWindowInteractor.h:1002
vtkRenderWindowInteractor::SwipeEvent
virtual void SwipeEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::ConfigureEvent
virtual void ConfigureEvent()
Fire various events.
vtkRenderWindowInteractor::SetInteractorStyle
virtual void SetInteractorStyle(vtkInteractorObserver *)
External switching between joystick/trackball/new? modes.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkRenderWindowInteractor::FourthButtonReleaseEvent
virtual void FourthButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int pos[2])
Set/Get information about the current event.
Definition: vtkRenderWindowInteractor.h:578
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()
Fire various gesture based events.
vtkRenderWindowInteractor::LongTapEvent
virtual void LongTapEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::GetPointerIndexForExistingContact
int GetPointerIndexForExistingContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindowInteractor::SetRotation
void SetRotation(double rotation)
Set/get the rotation for the gesture in degrees, update LastRotation.
vtkRenderWindowInteractor::CreateDefaultPickingManager
virtual vtkPickingManager * CreateDefaultPickingManager()
Create default pickingManager.
vtkRenderWindowInteractor::StillUpdateRate
double StillUpdateRate
Definition: vtkRenderWindowInteractor.h:950
vtkRenderWindowInteractor::InteractorStyle
vtkInteractorObserver * InteractorStyle
Definition: vtkRenderWindowInteractor.h:929
vtkRenderWindowInteractor::ReInitialize
void ReInitialize()
Prepare for handling events and set the Enabled flag to true.
Definition: vtkRenderWindowInteractor.h:210
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
vtkRenderWindowInteractor::LeftButtonReleaseEvent
virtual void LeftButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::CreateDefaultPicker
virtual vtkAbstractPropPicker * CreateDefaultPicker()
Create default picker.
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int x, int y, int pointerIndex)
Definition: vtkRenderWindowInteractor.h:602
vtkRenderWindowInteractor::Render
virtual void Render()
Render the scene.
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int pos[2])
Set/Get information about the current event.
Definition: vtkRenderWindowInteractor.h:583
vtkRenderWindowInteractor::DestroyTimer
virtual int DestroyTimer()
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:192
vtkRenderWindowInteractor::EndRotateEvent
virtual void EndRotateEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::FifthButtonPressEvent
virtual void FifthButtonPressEvent()
Fire various events.
vtkRenderWindowInteractor::MiddleButtonReleaseEvent
virtual void MiddleButtonReleaseEvent()
Fire various events.
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:958
vtkRenderWindowInteractor::ActorMode
int ActorMode
Definition: vtkRenderWindowInteractor.h:948
vtkObject.h
vtkRenderWindowInteractor::UserCallback
virtual void UserCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkRenderWindowInteractor::SetScale
void SetScale(double scale)
Set/get the scale for the gesture, updates LastScale.
vtkRenderWindowInteractor::RecognizeGesture
virtual void RecognizeGesture(vtkCommand::EventIds)
vtkRenderWindowInteractor::GrabFocus
void GrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
Definition: vtkRenderWindowInteractor.h:993
vtkRenderWindowInteractor::LightFollowCamera
vtkTypeBool LightFollowCamera
Definition: vtkRenderWindowInteractor.h:947
vtkRenderWindowInteractor::KeyCode
char KeyCode
Definition: vtkRenderWindowInteractor.h:956
vtkRenderWindowInteractor::Enabled
int Enabled
Definition: vtkRenderWindowInteractor.h:944
vtkRenderWindowInteractor::TimerEventDuration
int TimerEventDuration
Definition: vtkRenderWindowInteractor.h:971
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:410
vtkRenderWindowInteractor::LastScale
double LastScale
Definition: vtkRenderWindowInteractor.h:960
vtkRenderWindowInteractor::DesiredUpdateRate
double DesiredUpdateRate
Definition: vtkRenderWindowInteractor.h:949
vtkRenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
Definition: vtkRenderWindowInteractor.h:253
vtkRenderWindowInteractor::EnterEvent
virtual void EnterEvent()
Fire various events.
vtkRenderWindowInteractor::KeyReleaseEvent
virtual void KeyReleaseEvent()
Fire various events.
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:759
vtkCommand::EventIds
EventIds
Definition: vtkCommand.h:461
vtkRenderWindowInteractor::vtkRenderWindowInteractor
vtkRenderWindowInteractor()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkRenderWindowInteractor::StartRotateEvent
virtual void StartRotateEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::Start
virtual void Start()
Start the event loop.
vtkRenderWindowInteractor::FlyToImage
void FlyToImage(vtkRenderer *ren, double x, double y)
Given a position x, move the current camera's focal point to x.
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int pos[2], int pointerIndex)
Definition: vtkRenderWindowInteractor.h:628
vtkRenderWindowInteractor::Style
int Style
Definition: vtkRenderWindowInteractor.h:946
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int x, int y)
Set/Get information about the current event.
Definition: vtkRenderWindowInteractor.h:579
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:178
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:632
vtkRenderWindowInteractor::ProcessEvents
virtual void ProcessEvents()
Run the event loop and return.
Definition: vtkRenderWindowInteractor.h:236
vtkRenderWindowInteractor::CreateRepeatingTimer
int CreateRepeatingTimer(unsigned long duration)
Create a repeating timer, with the specified duration (in milliseconds).
vtkRenderWindowInteractor::Scale
double Scale
Definition: vtkRenderWindowInteractor.h:959
vtkRenderWindowInteractor::LeftButtonPressEvent
virtual void LeftButtonPressEvent()
Fire various events.
vtkRenderWindowInteractor::ExposeEvent
virtual void ExposeEvent()
Fire various events.
vtkRenderWindowInteractor::ShowCursor
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...
vtkRenderWindowInteractor::MouseMoveEvent
virtual void MouseMoveEvent()
Fire various events.
vtkRenderWindowInteractor::ClearPointerIndex
void ClearPointerIndex(int i)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:205
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:636
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()
Fire various gesture based events.
vtkRenderWindowInteractor::FourthButtonPressEvent
virtual void FourthButtonPressEvent()
Fire various events.
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:256
vtkHardwareWindow
create a window for renderers to draw into
Definition: vtkHardwareWindow.h:36
vtkRenderWindowInteractor::CurrentGesture
vtkCommand::EventIds CurrentGesture
Definition: vtkRenderWindowInteractor.h:1039
vtkRenderWindowInteractor::FifthButtonReleaseEvent
virtual void FifthButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::TimerEventId
int TimerEventId
Definition: vtkRenderWindowInteractor.h:969
vtkRenderWindowInteractor::StartPickCallback
virtual void StartPickCallback()
These methods correspond to the Exit, User and Pick callbacks.
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:957
vtkRenderWindowInteractor::TimerDuration
unsigned long TimerDuration
Definition: vtkRenderWindowInteractor.h:1007
vtkRenderWindowInteractor::SetEventInformationFlipY
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.
Definition: vtkRenderWindowInteractor.h:765
vtkRenderWindowInteractor::Done
bool Done
Definition: vtkRenderWindowInteractor.h:935
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:732