VTK  9.5.2
vtkOpenVRRenderWindowInteractor.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
109
110#ifndef vtkOpenVRRenderWindowInteractor_h
111#define vtkOpenVRRenderWindowInteractor_h
112
113#include "vtkEventData.h" // for ivar
114#include "vtkRenderingOpenVRModule.h" // For export macro
116
117#include <functional> // for ivar
118#include <map> // for ivar
119#include <openvr.h> // for ivar
120#include <string> // for ivar
121
122VTK_ABI_NAMESPACE_BEGIN
123class VTKRENDERINGOPENVR_EXPORT vtkOpenVRRenderWindowInteractor : public vtkVRRenderWindowInteractor
124{
125public:
128
132 void Initialize() override;
133
137 void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) override;
138
140
143 void AddAction(const std::string& path, const vtkCommand::EventIds&, bool isAnalog) override;
145 const std::string& path, bool isAnalog, const std::function<void(vtkEventData*)>&) override;
147
148protected:
156
158 {
159 public:
160 vr::VRActionHandle_t ActionHandle;
162 std::function<void(vtkEventData*)> Function;
163 bool UseFunction = false;
164 bool IsAnalog = false;
165 };
166
167 std::map<std::string, ActionData> ActionMap;
168 vr::VRActionSetHandle_t ActionsetVTK = vr::k_ulInvalidActionSetHandle;
169
177
179 {
180 vr::VRInputValueHandle_t Source = vr::k_ulInvalidInputValueHandle;
181 vr::TrackedDevicePose_t LastPose;
182 };
183
185
186private:
188 void operator=(const vtkOpenVRRenderWindowInteractor&) = delete;
189};
190
191VTK_ABI_NAMESPACE_END
192#endif
void DoOneEvent(vtkVRRenderWindow *renWin, vtkRenderer *ren) override
Implements the event loop.
~vtkOpenVRRenderWindowInteractor() override=default
void Initialize() override
Initialize the event handler.
static vtkOpenVRRenderWindowInteractor * New()
void AddAction(const std::string &path, bool isAnalog, const std::function< void(vtkEventData *)> &) override
Assign an event or std::function to an event path.
std::map< std::string, ActionData > ActionMap
vtkOpenVRRenderWindowInteractor()
Create and set the openvr style on this Set ActionManifestFileName to vtk_openvr_actions....
TrackerActions Trackers[NUMBER_OF_TRACKERS]
void AddAction(const std::string &path, const vtkCommand::EventIds &, bool isAnalog) override
Assign an event or std::function to an event path.
abstract specification for renderers
VR rendering window.