VTK: Rendering/Core/vtkRenderWindowInteractor.h Source File

| VTK 9.3.1

vtkRenderWindowInteractor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
51 #ifndef vtkRenderWindowInteractor_h
52 #define vtkRenderWindowInteractor_h
53
54 #include "vtkCommand.h" // for method sig
55 #include "vtkObject.h"
56 #include "vtkRenderingCoreModule.h" // For export macro
57 #include "vtkSmartPointer.h" // For InteractorStyle
58
59 VTK_ABI_NAMESPACE_BEGIN
60 class vtkTimerIdMap;
61
62 // Timer flags for win32/X compatibility
63 #define VTKI_TIMER_FIRST 0
64 #define VTKI_TIMER_UPDATE 1
65
66 // maximum pointers active at once
67 // for example in multitouch
68 #define VTKI_MAX_POINTERS 5
69
70 class vtkAbstractPicker;
71 class vtkAbstractPropPicker;
72 class vtkAssemblyPath;
73 class vtkHardwareWindow;
74 class vtkInteractorObserver;
75 class vtkRenderWindow;
76 class vtkRenderer;
77 class vtkObserverMediator;
78 class vtkInteractorEventRecorder;
79 class vtkPickingManager;
80
81 class VTKRENDERINGCORE_EXPORT vtkRenderWindowInteractor : public vtkObject
82 {
83
84 friend class vtkInteractorEventRecorder;
85
86 public:
87 static vtkRenderWindowInteractor* New();
88 vtkTypeMacro(vtkRenderWindowInteractor, vtkObject);
89 void PrintSelf(ostream& os, vtkIndent indent) override;
90
92
99 virtual void Initialize();
100 void ReInitialize()
101 {
102 this->Initialized = 0;
103 this->Enabled = 0;
104 this->Initialize();
105 }
107
112 void UnRegister(vtkObjectBase* o) override;
113
119 virtual void Start();
120
127 virtual void ProcessEvents() {}
128
132 vtkGetMacro(Done, bool);
133 vtkSetMacro(Done, bool);
134
144 virtual void Enable()
145 {
146 this->Enabled = 1;
147 this->Modified();
148 }
149 virtual void Disable()
150 {
151 this->Enabled = 0;
152 this->Modified();
153 }
154 vtkGetMacro(Enabled, int);
155
157
161 vtkBooleanMacro(EnableRender, bool);
162 vtkSetMacro(EnableRender, bool);
163 vtkGetMacro(EnableRender, bool);
165
167
170 void SetRenderWindow(vtkRenderWindow* aren);
171 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
173
175
180 void SetHardwareWindow(vtkHardwareWindow* aren);
181 vtkGetObjectMacro(HardwareWindow, vtkHardwareWindow);
183
191 virtual void UpdateSize(int x, int y);
192
209 virtual int CreateTimer(int timerType); // first group, for backward compatibility
210 virtual int DestroyTimer(); // first group, for backward compatibility
211
216 int CreateRepeatingTimer(unsigned long duration);
217
222 int CreateOneShotTimer(unsigned long duration);
223
228 int IsOneShotTimer(int timerId);
229
233 unsigned long GetTimerDuration(int timerId);
234
238 int ResetTimer(int timerId);
239
244 int DestroyTimer(int timerId);
245
249 virtual int GetVTKTimerId(int platformTimerId);
250
251 // Moved into the public section of the class so that classless timer procs
252 // can access these enum members without being "friends"...
253 enum
254 {
255 OneShotTimer = 1,
256 RepeatingTimer
257 };
258
260
269 vtkSetClampMacro(TimerDuration, unsigned long, 1, 100000);
270 vtkGetMacro(TimerDuration, unsigned long);
272
274
286 vtkSetMacro(TimerEventId, int);
287 vtkGetMacro(TimerEventId, int);
288 vtkSetMacro(TimerEventType, int);
289 vtkGetMacro(TimerEventType, int);
290 vtkSetMacro(TimerEventDuration, int);
291 vtkGetMacro(TimerEventDuration, int);
292 vtkSetMacro(TimerEventPlatformId, int);
293 vtkGetMacro(TimerEventPlatformId, int);
295
301 virtual void TerminateApp() { this->Done = true; }
302
304
308 virtual void SetInteractorStyle(vtkInteractorObserver*);
309 virtual vtkInteractorObserver* GetInteractorStyle();
311
313
317 vtkSetMacro(LightFollowCamera, vtkTypeBool);
318 vtkGetMacro(LightFollowCamera, vtkTypeBool);
319 vtkBooleanMacro(LightFollowCamera, vtkTypeBool);
321
323
330 vtkSetClampMacro(DesiredUpdateRate, double, 0.0001, VTK_FLOAT_MAX);
331 vtkGetMacro(DesiredUpdateRate, double);
333
335
340 vtkSetClampMacro(StillUpdateRate, double, 0.0001, VTK_FLOAT_MAX);
341 vtkGetMacro(StillUpdateRate, double);
343
345
349 vtkGetMacro(Initialized, int);
351
353
359 virtual void SetPicker(vtkAbstractPicker*);
360 vtkGetObjectMacro(Picker, vtkAbstractPicker);
362
367 virtual vtkAbstractPropPicker* CreateDefaultPicker();
368
370
375 virtual void SetPickingManager(vtkPickingManager*);
376 vtkGetObjectMacro(PickingManager, vtkPickingManager);
378
380
384 virtual void ExitCallback();
385 virtual void UserCallback();
386 virtual void StartPickCallback();
387 virtual void EndPickCallback();
389
393 virtual void GetMousePosition(int* x, int* y)
394 {
395 *x = 0;
396 *y = 0;
397 }
398
400
404 void HideCursor();
405 void ShowCursor();
407
412 virtual void Render();
413
415
420 void FlyTo(vtkRenderer* ren, double x, double y, double z);
421 void FlyTo(vtkRenderer* ren, double* x) { this->FlyTo(ren, x[0], x[1], x[2]); }
422 void FlyToImage(vtkRenderer* ren, double x, double y);
423 void FlyToImage(vtkRenderer* ren, double* x) { this->FlyToImage(ren, x[0], x[1]); }
425
427
430 vtkSetClampMacro(NumberOfFlyFrames, int, 1, VTK_INT_MAX);
431 vtkGetMacro(NumberOfFlyFrames, int);
433
435
439 vtkSetMacro(Dolly, double);
440 vtkGetMacro(Dolly, double);
442
444
452 vtkGetVector2Macro(EventPosition, int);
453 vtkGetVector2Macro(LastEventPosition, int);
454 vtkSetVector2Macro(LastEventPosition, int);
455 virtual void SetEventPosition(int x, int y)
456 {
457 vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting EventPosition to (" << x
458 << "," << y << ")");
459 if (this->EventPosition[0] != x || this->EventPosition[1] != y ||
460 this->LastEventPosition[0] != x || this->LastEventPosition[1] != y)
461 {
462 this->LastEventPosition[0] = this->EventPosition[0];
463 this->LastEventPosition[1] = this->EventPosition[1];
464 this->EventPosition[0] = x;
465 this->EventPosition[1] = y;
466 this->Modified();
467 }
468 }
469 virtual void SetEventPosition(int pos[2]) { this->SetEventPosition(pos[0], pos[1]); }
470 virtual void SetEventPositionFlipY(int x, int y)
471 {
472 this->SetEventPosition(x, this->Size[1] - y - 1);
473 }
474 virtual void SetEventPositionFlipY(int pos[2]) { this->SetEventPositionFlipY(pos[0], pos[1]); }
476
477 virtual int* GetEventPositions(int pointerIndex)
478 {
479 if (pointerIndex >= VTKI_MAX_POINTERS)
480 {
481 return nullptr;
482 }
483 return this->EventPositions[pointerIndex];
484 }
485 virtual int* GetLastEventPositions(int pointerIndex)
486 {
487 if (pointerIndex >= VTKI_MAX_POINTERS)
488 {
489 return nullptr;
490 }
491 return this->LastEventPositions[pointerIndex];
492 }
493 virtual void SetEventPosition(int x, int y, int pointerIndex)
494 {
495 if (pointerIndex < 0 || pointerIndex >= VTKI_MAX_POINTERS)
496 {
497 return;
498 }
499 if (pointerIndex == 0)
500 {
501 this->LastEventPosition[0] = this->EventPosition[0];
502 this->LastEventPosition[1] = this->EventPosition[1];
503 this->EventPosition[0] = x;
504 this->EventPosition[1] = y;
505 }
506 vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting EventPosition to (" << x
507 << "," << y << ") for pointerIndex number " << pointerIndex);
508 if (this->EventPositions[pointerIndex][0] != x || this->EventPositions[pointerIndex][1] != y ||
509 this->LastEventPositions[pointerIndex][0] != x ||
510 this->LastEventPositions[pointerIndex][1] != y)
511 {
512 this->LastEventPositions[pointerIndex][0] = this->EventPositions[pointerIndex][0];
513 this->LastEventPositions[pointerIndex][1] = this->EventPositions[pointerIndex][1];
514 this->EventPositions[pointerIndex][0] = x;
515 this->EventPositions[pointerIndex][1] = y;
516 this->Modified();
517 }
518 }
519 virtual void SetEventPosition(int pos[2], int pointerIndex)
520 {
521 this->SetEventPosition(pos[0], pos[1], pointerIndex);
522 }
523 virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
524 {
525 this->SetEventPosition(x, this->Size[1] - y - 1, pointerIndex);
526 }
527 virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
528 {
529 this->SetEventPositionFlipY(pos[0], pos[1], pointerIndex);
530 }
531
533
536 vtkSetMacro(AltKey, int);
537 vtkGetMacro(AltKey, int);
539
541
544 vtkSetMacro(ControlKey, int);
545 vtkGetMacro(ControlKey, int);
547
549
552 vtkSetMacro(ShiftKey, int);
553 vtkGetMacro(ShiftKey, int);
555
557
560 vtkSetMacro(KeyCode, char);
561 vtkGetMacro(KeyCode, char);
563
565
569 vtkSetMacro(RepeatCount, int);
570 vtkGetMacro(RepeatCount, int);
572
574
580 vtkSetStringMacro(KeySym);
581 vtkGetStringMacro(KeySym);
583
585
588 vtkSetMacro(PointerIndex, int);
589 vtkGetMacro(PointerIndex, int);
591
593
596 void SetRotation(double rotation);
597 vtkGetMacro(Rotation, double);
598 vtkGetMacro(LastRotation, double);
600
602
605 void SetScale(double scale);
606 vtkGetMacro(Scale, double);
607 vtkGetMacro(LastScale, double);
609
611
614 void SetTranslation(double val[2]);
615 vtkGetVector2Macro(Translation, double);
616 vtkGetVector2Macro(LastTranslation, double);
618
620
623 void SetEventInformation(int x, int y, int ctrl, int shift, char keycode, int repeatcount,
624 const char* keysym, int pointerIndex)
625 {
626 this->SetEventPosition(x, y, pointerIndex);
627 this->ControlKey = ctrl;
628 this->ShiftKey = shift;
629 this->KeyCode = keycode;
630 this->RepeatCount = repeatcount;
631 this->PointerIndex = pointerIndex;
632 if (keysym)
633 {
634 this->SetKeySym(keysym);
635 }
636 this->Modified();
637 }
638 void SetEventInformation(int x, int y, int ctrl = 0, int shift = 0, char keycode = 0,
639 int repeatcount = 0, const char* keysym = nullptr)
640 {
641 this->SetEventInformation(x, y, ctrl, shift, keycode, repeatcount, keysym, 0);
642 }
644
646
650 void SetEventInformationFlipY(int x, int y, int ctrl, int shift, char keycode, int repeatcount,
651 const char* keysym, int pointerIndex)
652 {
653 this->SetEventInformation(
654 x, this->Size[1] - y - 1, ctrl, shift, keycode, repeatcount, keysym, pointerIndex);
655 }
656 void SetEventInformationFlipY(int x, int y, int ctrl = 0, int shift = 0, char keycode = 0,
657 int repeatcount = 0, const char* keysym = nullptr)
658 {
659 this->SetEventInformationFlipY(x, y, ctrl, shift, keycode, repeatcount, keysym, 0);
660 }
662
664
667 void SetKeyEventInformation(int ctrl = 0, int shift = 0, char keycode = 0, int repeatcount = 0,
668 const char* keysym = nullptr)
669 {
670 this->ControlKey = ctrl;
671 this->ShiftKey = shift;
672 this->KeyCode = keycode;
673 this->RepeatCount = repeatcount;
674 if (keysym)
675 {
676 this->SetKeySym(keysym);
677 }
678 this->Modified();
679 }
681
683
694 vtkSetVector2Macro(Size, int);
695 vtkGetVector2Macro(Size, int);
696 vtkSetVector2Macro(EventSize, int);
697 vtkGetVector2Macro(EventSize, int);
699
705 virtual vtkRenderer* FindPokedRenderer(int, int);
706
714 vtkObserverMediator* GetObserverMediator();
715
717
725 vtkSetMacro(UseTDx, bool);
726 vtkGetMacro(UseTDx, bool);
728
730
735 virtual void MouseMoveEvent();
736 virtual void RightButtonPressEvent();
737 virtual void RightButtonReleaseEvent();
738 virtual void LeftButtonPressEvent();
739 virtual void LeftButtonReleaseEvent();
740 virtual void MiddleButtonPressEvent();
741 virtual void MiddleButtonReleaseEvent();
742 virtual void MouseWheelForwardEvent();
743 virtual void MouseWheelBackwardEvent();
744 virtual void MouseWheelLeftEvent();
745 virtual void MouseWheelRightEvent();
746 virtual void ExposeEvent();
747 virtual void ConfigureEvent();
748 virtual void EnterEvent();
749 virtual void LeaveEvent();
750 virtual void KeyPressEvent();
751 virtual void KeyReleaseEvent();
752 virtual void CharEvent();
753 virtual void ExitEvent();
754 virtual void FourthButtonPressEvent();
755 virtual void FourthButtonReleaseEvent();
756 virtual void FifthButtonPressEvent();
757 virtual void FifthButtonReleaseEvent();
759
761
765 virtual void StartPinchEvent();
766 virtual void PinchEvent();
767 virtual void EndPinchEvent();
768 virtual void StartRotateEvent();
769 virtual void RotateEvent();
770 virtual void EndRotateEvent();
771 virtual void StartPanEvent();
772 virtual void PanEvent();
773 virtual void EndPanEvent();
774 virtual void TapEvent();
775 virtual void LongTapEvent();
776 virtual void SwipeEvent();
778
780
786 vtkSetMacro(RecognizeGestures, bool);
787 vtkGetMacro(RecognizeGestures, bool);
789
791
796 vtkGetMacro(PointersDownCount, int);
798
800
807 void ClearContact(size_t contactID);
808 int GetPointerIndexForContact(size_t contactID);
809 int GetPointerIndexForExistingContact(size_t contactID);
810 bool IsPointerIndexSet(int i);
811 void ClearPointerIndex(int i);
813
814 protected:
815 vtkRenderWindowInteractor();
816 ~vtkRenderWindowInteractor() override;
817
818 vtkRenderWindow* RenderWindow;
819 vtkHardwareWindow* HardwareWindow;
820 vtkSmartPointer<vtkInteractorObserver> InteractorStyle;
821
822 // Used as a helper object to pick instances of vtkProp
823 vtkAbstractPicker* Picker;
824 vtkPickingManager* PickingManager;
825
826 bool Done; // is the event loop done running
827
832 virtual vtkPickingManager* CreateDefaultPickingManager();
833
834 int Initialized;
835 int Enabled;
836 bool EnableRender;
837 int Style;
838 vtkTypeBool LightFollowCamera;
839 int ActorMode;
840 double DesiredUpdateRate;
841 double StillUpdateRate;
842
843 // Event information
844 int AltKey;
845 int ControlKey;
846 int ShiftKey;
847 char KeyCode;
848 double Rotation;
849 double LastRotation;
850 double Scale;
851 double LastScale;
852 double Translation[2];
853 double LastTranslation[2];
854 int RepeatCount;
855 char* KeySym;
856 int EventPosition[2];
857 int LastEventPosition[2];
858 int EventSize[2];
859 int Size[2];
860 int TimerEventId;
861 int TimerEventType;
862 int TimerEventDuration;
863 int TimerEventPlatformId;
864
865 int EventPositions[VTKI_MAX_POINTERS][2];
866 int LastEventPositions[VTKI_MAX_POINTERS][2];
867 int PointerIndex;
868
869 size_t PointerIndexLookup[VTKI_MAX_POINTERS];
870
871 // control the fly to
872 int NumberOfFlyFrames;
873 double Dolly;
874
883 friend class vtkInteractorObserver;
884 void GrabFocus(vtkCommand* mouseEvents, vtkCommand* keypressEvents = nullptr)
885 {
886 this->Superclass::InternalGrabFocus(mouseEvents, keypressEvents);
887 }
888 void ReleaseFocus() { this->Superclass::InternalReleaseFocus(); }
889
893 vtkObserverMediator* ObserverMediator;
894
895 // Timer related members
896 friend struct vtkTimerStruct;
897 vtkTimerIdMap* TimerMap; // An internal, PIMPLd map of timers and associated attributes
898 unsigned long TimerDuration; // in milliseconds
900
906 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
907 virtual int InternalDestroyTimer(int platformTimerId);
908 int GetCurrentTimerId();
910
911 // Force the interactor to handle the Start() event loop, ignoring any
912 // overrides. (Overrides are registered by observing StartEvent on the
913 // interactor.)
914 int HandleEventLoop;
915
919 virtual void StartEventLoop() {}
920
921 bool UseTDx; // 3DConnexion device.
922
923 // when recognizing gestures VTK will take multitouch events
924 // if it receives them and convert them to gestures
925 bool RecognizeGestures;
926 int PointersDownCount;
927 int PointersDown[VTKI_MAX_POINTERS];
928 virtual void RecognizeGesture(vtkCommand::EventIds);
929 int StartingEventPositions[VTKI_MAX_POINTERS][2];
930 vtkCommand::EventIds CurrentGesture;
931
932 private:
933 vtkRenderWindowInteractor(const vtkRenderWindowInteractor&) = delete;
934 void operator=(const vtkRenderWindowInteractor&) = delete;
935 };
936
937 VTK_ABI_NAMESPACE_END
938 #endif
vtkAbstractPicker
define API for picking subclasses
Definition: vtkAbstractPicker.h:67
vtkAbstractPropPicker
abstract API for pickers that can pick an instance of vtkProp
Definition: vtkAbstractPropPicker.h:69
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:43
vtkCommand
superclass for callback/observer methods
Definition: vtkCommand.h:384
vtkCommand::EventIds
EventIds
Definition: vtkCommand.h:451
vtkHardwareWindow
create a window for renderers to draw into
Definition: vtkHardwareWindow.h:26
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInteractorEventRecorder
record and play VTK events passing through a vtkRenderWindowInteractor
Definition: vtkInteractorEventRecorder.h:47
vtkInteractorEventRecorder::AltKey
@ AltKey
Definition: vtkInteractorEventRecorder.h:173
vtkInteractorEventRecorder::ShiftKey
@ ShiftKey
Definition: vtkInteractorEventRecorder.h:171
vtkInteractorEventRecorder::ControlKey
@ ControlKey
Definition: vtkInteractorEventRecorder.h:172
vtkInteractorObserver
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Definition: vtkInteractorObserver.h:64
vtkInteractorObserver::Enabled
int Enabled
Definition: vtkInteractorObserver.h:235
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:72
vtkObjectBase::GetClassName
const char * GetClassName() const
Return the class name as a string.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkObject::InternalReleaseFocus
void InternalReleaseFocus()
These methods allow a command to exclusively grab all events.
vtkObject::InternalGrabFocus
void InternalGrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
These methods allow a command to exclusively grab all events.
vtkObject::Modified
virtual void Modified()
Update the modification time for this object.
vtkObserverMediator
manage contention for cursors and other resources
Definition: vtkObserverMediator.h:31
vtkPickingManager
Class defines API to manage the picking process.
Definition: vtkPickingManager.h:55
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:82
vtkRenderWindowInteractor::GetTimerDuration
unsigned long GetTimerDuration(int timerId)
Get the duration (in milliseconds) for the specified timerId.
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::StartEventLoop
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
Definition: vtkRenderWindowInteractor.h:919
vtkRenderWindowInteractor::FourthButtonReleaseEvent
virtual void FourthButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::PinchEvent
virtual void PinchEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::SwipeEvent
virtual void SwipeEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::HardwareWindow
vtkHardwareWindow * HardwareWindow
Definition: vtkRenderWindowInteractor.h:819
vtkRenderWindowInteractor::Done
bool Done
Definition: vtkRenderWindowInteractor.h:826
vtkRenderWindowInteractor::StartRotateEvent
virtual void StartRotateEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::SetRenderWindow
void SetRenderWindow(vtkRenderWindow *aren)
Set/Get the rendering window being controlled by this object.
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:667
vtkRenderWindowInteractor::RecognizeGestures
bool RecognizeGestures
Definition: vtkRenderWindowInteractor.h:925
vtkRenderWindowInteractor::UnRegister
void UnRegister(vtkObjectBase *o) override
This Method detects loops of RenderWindow-Interactor, so objects are freed properly.
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
Definition: vtkRenderWindowInteractor.h:527
vtkRenderWindowInteractor::EndPinchEvent
virtual void EndPinchEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::AltKey
int AltKey
Definition: vtkRenderWindowInteractor.h:844
vtkRenderWindowInteractor::KeySym
char * KeySym
Definition: vtkRenderWindowInteractor.h:855
vtkRenderWindowInteractor::KeyReleaseEvent
virtual void KeyReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::EndPickCallback
virtual void EndPickCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkRenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
Definition: vtkRenderWindowInteractor.h:144
vtkRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
Internal methods for creating and destroying timers that must be implemented by subclasses.
vtkRenderWindowInteractor::CreateRepeatingTimer
int CreateRepeatingTimer(unsigned long duration)
Create a repeating timer, with the specified duration (in milliseconds).
vtkRenderWindowInteractor::CreateDefaultPicker
virtual vtkAbstractPropPicker * CreateDefaultPicker()
Create default picker.
vtkRenderWindowInteractor::ObserverMediator
vtkObserverMediator * ObserverMediator
Widget mediators are used to resolve contention for cursors and other resources.
Definition: vtkRenderWindowInteractor.h:893
vtkRenderWindowInteractor::EndRotateEvent
virtual void EndRotateEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::HandleEventLoop
int HandleEventLoop
Definition: vtkRenderWindowInteractor.h:914
vtkRenderWindowInteractor::ExitEvent
virtual void ExitEvent()
Fire various events.
vtkRenderWindowInteractor::RepeatCount
int RepeatCount
Definition: vtkRenderWindowInteractor.h:854
vtkRenderWindowInteractor::FlyToImage
void FlyToImage(vtkRenderer *ren, double x, double y)
Given a position x, move the current camera's focal point to x.
vtkRenderWindowInteractor::DesiredUpdateRate
double DesiredUpdateRate
Definition: vtkRenderWindowInteractor.h:840
vtkRenderWindowInteractor::SetRotation
void SetRotation(double rotation)
Set/get the rotation for the gesture in degrees, update LastRotation.
vtkRenderWindowInteractor::ExposeEvent
virtual void ExposeEvent()
Fire various events.
vtkRenderWindowInteractor::EndPanEvent
virtual void EndPanEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::Render
virtual void Render()
Render the scene.
vtkRenderWindowInteractor::PointerIndex
int PointerIndex
Definition: vtkRenderWindowInteractor.h:867
vtkRenderWindowInteractor::LastScale
double LastScale
Definition: vtkRenderWindowInteractor.h:851
vtkRenderWindowInteractor::TimerEventType
int TimerEventType
Definition: vtkRenderWindowInteractor.h:861
vtkRenderWindowInteractor::MouseWheelLeftEvent
virtual void MouseWheelLeftEvent()
Fire various events.
vtkRenderWindowInteractor::MouseWheelForwardEvent
virtual void MouseWheelForwardEvent()
Fire various events.
vtkRenderWindowInteractor::TimerEventPlatformId
int TimerEventPlatformId
Definition: vtkRenderWindowInteractor.h:863
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int x, int y)
Set/Get information about the current event.
Definition: vtkRenderWindowInteractor.h:455
vtkRenderWindowInteractor::KeyCode
char KeyCode
Definition: vtkRenderWindowInteractor.h:847
vtkRenderWindowInteractor::TerminateApp
virtual void TerminateApp()
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...
Definition: vtkRenderWindowInteractor.h:301
vtkRenderWindowInteractor::UserCallback
virtual void UserCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkRenderWindowInteractor::EnableRender
bool EnableRender
Definition: vtkRenderWindowInteractor.h:836
vtkRenderWindowInteractor::SetHardwareWindow
void SetHardwareWindow(vtkHardwareWindow *aren)
Set/Get the hardware window being controlled by this object.
vtkRenderWindowInteractor::LeftButtonReleaseEvent
virtual void LeftButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::CharEvent
virtual void CharEvent()
Fire various events.
vtkRenderWindowInteractor::DestroyTimer
virtual int DestroyTimer()
vtkRenderWindowInteractor::IsOneShotTimer
int IsOneShotTimer(int timerId)
Query whether the specified timerId is a one shot timer.
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:623
vtkRenderWindowInteractor::GetObserverMediator
vtkObserverMediator * GetObserverMediator()
Return the object used to mediate between vtkInteractorObservers contending for resources.
vtkRenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRenderWindowInteractor::UpdateSize
virtual void UpdateSize(int x, int y)
Event loop notification member for window size change.
vtkRenderWindowInteractor::GetEventPositions
virtual int * GetEventPositions(int pointerIndex)
Definition: vtkRenderWindowInteractor.h:477
vtkRenderWindowInteractor::GetInteractorStyle
virtual vtkInteractorObserver * GetInteractorStyle()
External switching between joystick/trackball/new? modes.
vtkRenderWindowInteractor::StillUpdateRate
double StillUpdateRate
Definition: vtkRenderWindowInteractor.h:841
vtkRenderWindowInteractor::UseTDx
bool UseTDx
Definition: vtkRenderWindowInteractor.h:921
vtkRenderWindowInteractor::LeaveEvent
virtual void LeaveEvent()
Fire various events.
vtkRenderWindowInteractor::FourthButtonPressEvent
virtual void FourthButtonPressEvent()
Fire various events.
vtkRenderWindowInteractor::MouseWheelRightEvent
virtual void MouseWheelRightEvent()
Fire various events.
vtkRenderWindowInteractor::EnterEvent
virtual void EnterEvent()
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.
vtkRenderWindowInteractor::New
static vtkRenderWindowInteractor * New()
vtkRenderWindowInteractor::TimerEventDuration
int TimerEventDuration
Definition: vtkRenderWindowInteractor.h:862
vtkRenderWindowInteractor::~vtkRenderWindowInteractor
~vtkRenderWindowInteractor() override
vtkRenderWindowInteractor::RightButtonPressEvent
virtual void RightButtonPressEvent()
Fire various events.
vtkRenderWindowInteractor::Start
virtual void Start()
Start the event loop.
vtkRenderWindowInteractor::Dolly
double Dolly
Definition: vtkRenderWindowInteractor.h:873
vtkRenderWindowInteractor::PointersDownCount
int PointersDownCount
Definition: vtkRenderWindowInteractor.h:926
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:638
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::CreateDefaultPickingManager
virtual vtkPickingManager * CreateDefaultPickingManager()
Create default pickingManager.
vtkRenderWindowInteractor::ConfigureEvent
virtual void ConfigureEvent()
Fire various events.
vtkRenderWindowInteractor::FifthButtonPressEvent
virtual void FifthButtonPressEvent()
Fire various events.
vtkRenderWindowInteractor::FindPokedRenderer
virtual vtkRenderer * FindPokedRenderer(int, int)
When an event occurs, we must determine which Renderer the event occurred within, since one RenderWin...
vtkRenderWindowInteractor::StartPanEvent
virtual void StartPanEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::CreateTimer
virtual int CreateTimer(int timerType)
This class provides two groups of methods for manipulating timers.
vtkRenderWindowInteractor::ReleaseFocus
void ReleaseFocus()
Definition: vtkRenderWindowInteractor.h:888
vtkRenderWindowInteractor::ShiftKey
int ShiftKey
Definition: vtkRenderWindowInteractor.h:846
vtkRenderWindowInteractor::ResetTimer
int ResetTimer(int timerId)
Reset the specified timer.
vtkRenderWindowInteractor::GetCurrentTimerId
int GetCurrentTimerId()
Internal methods for creating and destroying timers that must be implemented by subclasses.
vtkRenderWindowInteractor::MouseWheelBackwardEvent
virtual void MouseWheelBackwardEvent()
Fire various events.
vtkRenderWindowInteractor::Scale
double Scale
Definition: vtkRenderWindowInteractor.h:850
vtkRenderWindowInteractor::SetInteractorStyle
virtual void SetInteractorStyle(vtkInteractorObserver *)
External switching between joystick/trackball/new? modes.
vtkRenderWindowInteractor::ControlKey
int ControlKey
Definition: vtkRenderWindowInteractor.h:845
vtkRenderWindowInteractor::ClearContact
void ClearContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
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::ActorMode
int ActorMode
Definition: vtkRenderWindowInteractor.h:839
vtkRenderWindowInteractor::CreateOneShotTimer
int CreateOneShotTimer(unsigned long duration)
Create a one shot timer, with the specified duration (in milliseconds).
vtkRenderWindowInteractor::ReInitialize
void ReInitialize()
Prepare for handling events and set the Enabled flag to true.
Definition: vtkRenderWindowInteractor.h:100
vtkRenderWindowInteractor::ExitCallback
virtual void ExitCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkRenderWindowInteractor::PickingManager
vtkPickingManager * PickingManager
Definition: vtkRenderWindowInteractor.h:824
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:656
vtkRenderWindowInteractor::DestroyTimer
int DestroyTimer(int timerId)
Destroy the timer specified by timerId.
vtkRenderWindowInteractor::InteractorStyle
vtkSmartPointer< vtkInteractorObserver > InteractorStyle
Definition: vtkRenderWindowInteractor.h:820
vtkRenderWindowInteractor::Initialized
int Initialized
Definition: vtkRenderWindowInteractor.h:834
vtkRenderWindowInteractor::SetTranslation
void SetTranslation(double val[2])
Set/get the translation for pan/swipe gestures, update LastTranslation.
vtkRenderWindowInteractor::Enabled
int Enabled
Definition: vtkRenderWindowInteractor.h:835
vtkRenderWindowInteractor::TimerMap
vtkTimerIdMap * TimerMap
Definition: vtkRenderWindowInteractor.h:897
vtkRenderWindowInteractor::FlyToImage
void FlyToImage(vtkRenderer *ren, double *x)
Given a position x, move the current camera's focal point to x.
Definition: vtkRenderWindowInteractor.h:423
vtkRenderWindowInteractor::PanEvent
virtual void PanEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::ProcessEvents
virtual void ProcessEvents()
Process all user-interaction, timer events and return.
Definition: vtkRenderWindowInteractor.h:127
vtkRenderWindowInteractor::TimerDuration
unsigned long TimerDuration
Definition: vtkRenderWindowInteractor.h:898
vtkRenderWindowInteractor::RightButtonReleaseEvent
virtual void RightButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::CurrentGesture
vtkCommand::EventIds CurrentGesture
Definition: vtkRenderWindowInteractor.h:930
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
Definition: vtkRenderWindowInteractor.h:523
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:650
vtkRenderWindowInteractor::GetMousePosition
virtual void GetMousePosition(int *x, int *y)
Get the current position of the mouse.
Definition: vtkRenderWindowInteractor.h:393
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int x, int y)
Set/Get information about the current event.
Definition: vtkRenderWindowInteractor.h:470
vtkRenderWindowInteractor::GetPointerIndexForContact
int GetPointerIndexForContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindowInteractor::FifthButtonReleaseEvent
virtual void FifthButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::IsPointerIndexSet
bool IsPointerIndexSet(int i)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindowInteractor::LeftButtonPressEvent
virtual void LeftButtonPressEvent()
Fire various events.
vtkRenderWindowInteractor::GrabFocus
void GrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
Definition: vtkRenderWindowInteractor.h:884
vtkRenderWindowInteractor::NumberOfFlyFrames
int NumberOfFlyFrames
Definition: vtkRenderWindowInteractor.h:872
vtkRenderWindowInteractor::MiddleButtonPressEvent
virtual void MiddleButtonPressEvent()
Fire various events.
vtkRenderWindowInteractor::GetLastEventPositions
virtual int * GetLastEventPositions(int pointerIndex)
Definition: vtkRenderWindowInteractor.h:485
vtkRenderWindowInteractor::StartPickCallback
virtual void StartPickCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkRenderWindowInteractor::GetPointerIndexForExistingContact
int GetPointerIndexForExistingContact(size_t contactID)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindowInteractor::MouseMoveEvent
virtual void MouseMoveEvent()
Fire various events.
vtkRenderWindowInteractor::FlyTo
void FlyTo(vtkRenderer *ren, double *x)
Given a position x, move the current camera's focal point to x.
Definition: vtkRenderWindowInteractor.h:421
vtkRenderWindowInteractor::Picker
vtkAbstractPicker * Picker
Definition: vtkRenderWindowInteractor.h:823
vtkRenderWindowInteractor::StartPinchEvent
virtual void StartPinchEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int pos[2])
Set/Get information about the current event.
Definition: vtkRenderWindowInteractor.h:469
vtkRenderWindowInteractor::SetPicker
virtual void SetPicker(vtkAbstractPicker *)
Set/Get the object used to perform pick operations.
vtkRenderWindowInteractor::GetVTKTimerId
virtual int GetVTKTimerId(int platformTimerId)
Get the VTK timer ID that corresponds to the supplied platform ID.
vtkRenderWindowInteractor::SetScale
void SetScale(double scale)
Set/get the scale for the gesture, updates LastScale.
vtkRenderWindowInteractor::Initialize
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
vtkRenderWindowInteractor::RotateEvent
virtual void RotateEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::TapEvent
virtual void TapEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::SetEventPositionFlipY
virtual void SetEventPositionFlipY(int pos[2])
Set/Get information about the current event.
Definition: vtkRenderWindowInteractor.h:474
vtkRenderWindowInteractor::TimerEventId
int TimerEventId
Definition: vtkRenderWindowInteractor.h:860
vtkRenderWindowInteractor::LightFollowCamera
vtkTypeBool LightFollowCamera
Definition: vtkRenderWindowInteractor.h:838
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int x, int y, int pointerIndex)
Definition: vtkRenderWindowInteractor.h:493
vtkRenderWindowInteractor::ClearPointerIndex
void ClearPointerIndex(int i)
Most multitouch systems use persistent contact/pointer ids to track events/motion during multitouch e...
vtkRenderWindowInteractor::LongTapEvent
virtual void LongTapEvent()
Fire various gesture based events.
vtkRenderWindowInteractor::MiddleButtonReleaseEvent
virtual void MiddleButtonReleaseEvent()
Fire various events.
vtkRenderWindowInteractor::LastRotation
double LastRotation
Definition: vtkRenderWindowInteractor.h:849
vtkRenderWindowInteractor::RecognizeGesture
virtual void RecognizeGesture(vtkCommand::EventIds)
vtkRenderWindowInteractor::Disable
virtual void Disable()
Definition: vtkRenderWindowInteractor.h:149
vtkRenderWindowInteractor::SetEventPosition
virtual void SetEventPosition(int pos[2], int pointerIndex)
Definition: vtkRenderWindowInteractor.h:519
vtkRenderWindowInteractor::SetPickingManager
virtual void SetPickingManager(vtkPickingManager *)
Set the picking manager.
vtkRenderWindowInteractor::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkRenderWindowInteractor.h:818
vtkRenderWindowInteractor::Rotation
double Rotation
Definition: vtkRenderWindowInteractor.h:848
vtkRenderWindowInteractor::Style
int Style
Definition: vtkRenderWindowInteractor.h:837
vtkRenderWindowInteractor::vtkRenderWindowInteractor
vtkRenderWindowInteractor()
vtkRenderWindowInteractor::KeyPressEvent
virtual void KeyPressEvent()
Fire various events.
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:95
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkSmartPointer< vtkInteractorObserver >
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkX3D::rotation
@ rotation
Definition: vtkX3D.h:228
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkCommand.h
vtkObject.h
VTKI_MAX_POINTERS
#define VTKI_MAX_POINTERS
Definition: vtkRenderWindowInteractor.h:68
vtkSmartPointer.h
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:144
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:152