VTK  9.2.6
vtkVRRenderWindowInteractor.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkVRRenderWindowInteractor.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=========================================================================*/
20#ifndef vtkVRRenderWindowInteractor_h
21#define vtkVRRenderWindowInteractor_h
22
23#include "vtkEventData.h" // for ivar
24#include "vtkNew.h" // for ivar
26#include "vtkRenderingVRModule.h" // for export macro
27
28#include <string> // for ivar
29
30class vtkMatrix4x4;
32
33class VTKRENDERINGVR_EXPORT vtkVRRenderWindowInteractor : public vtkRenderWindowInteractor3D
34{
35public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
42 void Initialize() override;
43
48 void ProcessEvents() override;
49
53 virtual void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) = 0;
54
56
62 static void SetClassExitMethod(void (*f)(void*), void* arg);
63 static void SetClassExitMethodArgDelete(void (*f)(void*));
65
69 void ExitCallback() override;
70
72
75 void SetPhysicalViewDirection(double, double, double) override;
76 double* GetPhysicalViewDirection() override;
78
80
83 void SetPhysicalViewUp(double, double, double) override;
84 double* GetPhysicalViewUp() override;
86
88
91 void SetPhysicalTranslation(vtkCamera*, double, double, double) override;
94
96
99 void SetPhysicalScale(double) override;
100 double GetPhysicalScale() override;
102
103 /*
104 * Return the pointer index as a device.
105 */
107
108 /*
109 * Convert a device pose to a world coordinate position and orientation.
110 * \param pos Output world position
111 * \param wxyz Output world orientation quaternion
112 * \param ppos Output physical position
113 * \param wdir Output world view direction (-Z)
114 */
115 void ConvertPoseToWorldCoordinates(vtkMatrix4x4* poseInTrackingCoordinates, double pos[3],
116 double wxyz[4], double ppos[3], double wdir[3]);
117
118 /*
119 * Return starting physical to world matrix.
120 */
121 void GetStartingPhysicalToWorldMatrix(vtkMatrix4x4* startingPhysicalToWorldMatrix);
122
124
128 vtkGetMacro(ActionManifestFileName, std::string);
129 vtkSetMacro(ActionManifestFileName, std::string);
131
133
136 vtkGetMacro(ActionSetName, std::string);
137 vtkSetMacro(ActionSetName, std::string);
139
140protected:
143
145
149 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
150 int InternalDestroyTimer(int platformTimerId) override;
152
157 void StartEventLoop() override;
158
160
167
169
173 static void (*ClassExitMethod)(void*);
174 static void (*ClassExitMethodArgDelete)(void*);
175 static void* ClassExitMethodArg;
177
182 int DeviceInputDownCount[vtkEventDataNumberOfDevices];
185
186private:
188 void operator=(const vtkVRRenderWindowInteractor&) = delete;
189};
190
191#endif
a virtual camera for 3D rendering
Definition: vtkCamera.h:161
a simple class to control print indentation
Definition: vtkIndent.h:119
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:151
adds support for 3D events to vtkRenderWindowInteractor.
abstract specification for renderers
Definition: vtkRenderer.h:179
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 HandleGripEvents(vtkEventData *ed)
Handle multitouch events.
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 multitouch gesture.
void RecognizeComplexGesture(vtkEventDataDevice3D *edata)
Handle multitouch events.
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()
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
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.
@ string
Definition: vtkX3D.h:496
vtkEventDataDevice
platform-independent event data structures
Definition: vtkEventData.h:26
const int vtkEventDataNumberOfDevices
Definition: vtkEventData.h:36