VTK  9.3.0
vtkVRRenderWindowInteractor.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
8#ifndef vtkVRRenderWindowInteractor_h
9#define vtkVRRenderWindowInteractor_h
10
11#include "vtkEventData.h" // for ivar
12#include "vtkNew.h" // for ivar
14#include "vtkRenderingVRModule.h" // for export macro
15
16#include <string> // for ivar
17
18VTK_ABI_NAMESPACE_BEGIN
19class vtkMatrix4x4;
21
22class VTKRENDERINGVR_EXPORT vtkVRRenderWindowInteractor : public vtkRenderWindowInteractor3D
23{
24public:
26 void PrintSelf(ostream& os, vtkIndent indent) override;
27
31 void Initialize() override;
32
37 void ProcessEvents() override;
38
42 virtual void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) = 0;
43
45
51 static void SetClassExitMethod(void (*f)(void*), void* arg);
52 static void SetClassExitMethodArgDelete(void (*f)(void*));
54
58 void ExitCallback() override;
59
61
64 void SetPhysicalViewDirection(double, double, double) override;
65 double* GetPhysicalViewDirection() override;
67
69
72 void SetPhysicalViewUp(double, double, double) override;
73 double* GetPhysicalViewUp() override;
75
77
80 void SetPhysicalTranslation(vtkCamera*, double, double, double) override;
83
85
88 void SetPhysicalScale(double) override;
89 double GetPhysicalScale() override;
91
92 /*
93 * Return the pointer index as a device.
94 */
96
97 /*
98 * Convert a device pose to a world coordinate position and orientation.
99 * \param pos Output world position
100 * \param wxyz Output world orientation quaternion
101 * \param ppos Output physical position
102 * \param wdir Output world view direction (-Z)
103 */
104 void ConvertPoseToWorldCoordinates(vtkMatrix4x4* poseInTrackingCoordinates, double pos[3],
105 double wxyz[4], double ppos[3], double wdir[3]);
106
107 /*
108 * Return starting physical to world matrix.
109 */
110 void GetStartingPhysicalToWorldMatrix(vtkMatrix4x4* startingPhysicalToWorldMatrix);
111
113
118 vtkGetMacro(ActionManifestFileName, std::string);
119 vtkSetMacro(ActionManifestFileName, std::string);
121
123
127 vtkGetMacro(ActionManifestDirectory, std::string);
128 vtkSetMacro(ActionManifestDirectory, std::string);
130
132
135 vtkGetMacro(ActionSetName, std::string);
136 vtkSetMacro(ActionSetName, std::string);
138
139protected:
142
144
148 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
149 int InternalDestroyTimer(int platformTimerId) override;
151
156 void StartEventLoop() override;
157
159
178
180
184 static void (*ClassExitMethod)(void*);
185 static void (*ClassExitMethodArgDelete)(void*);
186 static void* ClassExitMethodArg;
188
193
194 int DeviceInputDownCount[vtkEventDataNumberOfDevices];
195
198
199 std::string ActionSetName;
200
201private:
203 void operator=(const vtkVRRenderWindowInteractor&) = delete;
204};
205
206VTK_ABI_NAMESPACE_END
207#endif
a virtual camera for 3D rendering
Definition vtkCamera.h:41
a simple class to control print indentation
Definition vtkIndent.h:29
represent and manipulate 4x4 transformation matrices
Allocate and hold a VTK object.
Definition vtkNew.h:51
adds support for 3D events to vtkRenderWindowInteractor.
abstract specification for renderers
Definition vtkRenderer.h:59
Implements VR specific functions required by vtkRenderWindowInteractor.
void ProcessEvents() override
Run the event loop and return.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetPhysicalScale(double) override
Set/get the physical scale (world / physical distance ratio)
double GetPhysicalScale() override
Set/get the physical scale (world / physical distance ratio)
void Initialize() override
Initialize the event handler.
static void * ClassExitMethodArg
Class variables so an exit method can be defined for this class (used to set different exit methods f...
double * GetPhysicalViewDirection() override
Set/get the direction of the physical coordinate system -Z axis in world coordinates.
vtkNew< vtkMatrix4x4 > StartingPhysicalToWorldMatrix
Store physical to world matrix at the start of a complex gesture.
double * GetPhysicalTranslation(vtkCamera *) override
Set/get position of the physical coordinate system origin in world coordinates.
void ExitCallback() override
This method corresponds to the Exit callback, allowing for the style to invoke it.
int InternalDestroyTimer(int platformTimerId) override
internal timer methods.
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override
internal timer methods.
vtkEventDataDevice GetPointerDevice()
virtual void RecognizeComplexGesture(vtkEventDataDevice3D *edata)
Handle complex gesture events.
void SetPhysicalTranslation(vtkCamera *, double, double, double) override
Set/get position of the physical coordinate system origin in world coordinates.
void SetPhysicalViewUp(double, double, double) override
Set/get the direction of the physical coordinate system +Y axis in world coordinates.
void GetStartingPhysicalToWorldMatrix(vtkMatrix4x4 *startingPhysicalToWorldMatrix)
static void SetClassExitMethodArgDelete(void(*f)(void *))
Methods to set the default exit method for the class.
double * GetPhysicalViewUp() override
Set/get the direction of the physical coordinate system +Y axis in world coordinates.
~vtkVRRenderWindowInteractor() override
virtual void HandleComplexGestureEvents(vtkEventData *ed)
Handle complex gesture events.
void StartEventLoop() override
This will start up the event loop and never return.
void ConvertPoseToWorldCoordinates(vtkMatrix4x4 *poseInTrackingCoordinates, double pos[3], double wxyz[4], double ppos[3], double wdir[3])
virtual void DoOneEvent(vtkVRRenderWindow *renWin, vtkRenderer *ren)=0
Implements the event loop.
void SetPhysicalViewDirection(double, double, double) override
Set/get the direction of the physical coordinate system -Z axis in world coordinates.
static void SetClassExitMethod(void(*f)(void *), void *arg)
Methods to set the default exit method for the class.
VR rendering window.
vtkEventDataDevice
platform-independent event data structures
const int vtkEventDataNumberOfDevices