VTK  9.2.6
vtkOpenVRRenderWindowInteractor.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOpenVRRenderWindowInteractor.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=========================================================================*/
122#ifndef vtkOpenVRRenderWindowInteractor_h
123#define vtkOpenVRRenderWindowInteractor_h
124
125#include "vtkEventData.h" // for ivar
126#include "vtkRenderingOpenVRModule.h" // For export macro
128
129#include <functional> // for ivar
130#include <map> // for ivar
131#include <openvr.h> // for ivar
132#include <string> // for ivar
133
134class VTKRENDERINGOPENVR_EXPORT vtkOpenVRRenderWindowInteractor : public vtkVRRenderWindowInteractor
135{
136public:
139
143 void Initialize() override;
144
148 void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) override;
149
151
154 void AddAction(std::string path, vtkCommand::EventIds, bool isAnalog);
155 void AddAction(std::string path, bool isAnalog, std::function<void(vtkEventData*)>);
157
158protected:
161
163 {
164 public:
165 vr::VRActionHandle_t ActionHandle;
168 bool UseFunction = false;
169 bool IsAnalog = false;
170 };
171
172 std::map<std::string, ActionData> ActionMap;
173 vr::VRActionSetHandle_t ActionsetVTK = vr::k_ulInvalidActionSetHandle;
174
176 {
177 LEFT_HAND = 0,
180 NUMBER_OF_TRACKERS
181 };
182
184 {
185 vr::VRInputValueHandle_t Source = vr::k_ulInvalidInputValueHandle;
186 vr::TrackedDevicePose_t LastPose;
187 };
188
189 TrackerActions Trackers[NUMBER_OF_TRACKERS];
190
191private:
193 void operator=(const vtkOpenVRRenderWindowInteractor&) = delete;
194};
195
196#endif
Implements OpenVR specific functions required by vtkVRRenderWindowInteractor.
void AddAction(std::string path, bool isAnalog, std::function< void(vtkEventData *)>)
Assign an event or std::function to an event path.
void DoOneEvent(vtkVRRenderWindow *renWin, vtkRenderer *ren) override
Implements the event loop.
~vtkOpenVRRenderWindowInteractor() override=default
void Initialize() override
Initialize the event handler.
static vtkOpenVRRenderWindowInteractor * New()
std::map< std::string, ActionData > ActionMap
void AddAction(std::string path, vtkCommand::EventIds, bool isAnalog)
Assign an event or std::function to an event path.
abstract specification for renderers
Definition: vtkRenderer.h:179
Implements VR specific functions required by vtkRenderWindowInteractor.
VR rendering window.
@ function
Definition: vtkX3D.h:255
@ string
Definition: vtkX3D.h:496