VTK  9.4.20251007
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
13
14#ifndef vtkOpenVRRenderWindowInteractor_h
15#define vtkOpenVRRenderWindowInteractor_h
16
17#include "vtkEventData.h" // for ivar
18#include "vtkRenderingOpenVRModule.h" // For export macro
20
21#include <functional> // for ivar
22#include <map> // for ivar
23#include <openvr.h> // for ivar
24#include <string> // for ivar
25
26VTK_ABI_NAMESPACE_BEGIN
27class VTKRENDERINGOPENVR_EXPORT vtkOpenVRRenderWindowInteractor : public vtkVRRenderWindowInteractor
28{
29public:
32
36 void Initialize() override;
37
41 void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) override;
42
44
47 void AddAction(const std::string& path, const vtkCommand::EventIds&, bool isAnalog) override;
49 const std::string& path, bool isAnalog, const std::function<void(vtkEventData*)>&) override;
51
52protected:
60
62 {
63 public:
64 vr::VRActionHandle_t ActionHandle;
66 std::function<void(vtkEventData*)> Function;
67 bool UseFunction = false;
68 bool IsAnalog = false;
69 };
70
71 std::map<std::string, ActionData> ActionMap;
72 vr::VRActionSetHandle_t ActionsetVTK = vr::k_ulInvalidActionSetHandle;
73
81
83 {
84 vr::VRInputValueHandle_t Source = vr::k_ulInvalidInputValueHandle;
85 vr::TrackedDevicePose_t LastPose;
86 };
87
89
90private:
92 void operator=(const vtkOpenVRRenderWindowInteractor&) = delete;
93};
94
95VTK_ABI_NAMESPACE_END
96#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
Definition vtkRenderer.h:63
VR rendering window.