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
10
11#ifndef vtkOpenVRRenderWindowInteractor_h
12#define vtkOpenVRRenderWindowInteractor_h
13
14#include "vtkEventData.h" // for ivar
15#include "vtkRenderingOpenVRModule.h" // For export macro
17
18#include <functional> // for ivar
19#include <map> // for ivar
20#include <openvr.h> // for ivar
21#include <string> // for ivar
22
23VTK_ABI_NAMESPACE_BEGIN
24class VTKRENDERINGOPENVR_EXPORT vtkOpenVRRenderWindowInteractor : public vtkVRRenderWindowInteractor
25{
26public:
29
33 void Initialize() override;
34
38 void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) override;
39
41
44 void AddAction(const std::string& path, const vtkCommand::EventIds&, bool isAnalog) override;
46 const std::string& path, bool isAnalog, const std::function<void(vtkEventData*)>&) override;
48
49protected:
57
59 {
60 public:
61 vr::VRActionHandle_t ActionHandle;
63 std::function<void(vtkEventData*)> Function;
64 bool UseFunction = false;
65 bool IsAnalog = false;
66 };
67
68 std::map<std::string, ActionData> ActionMap;
69 vr::VRActionSetHandle_t ActionsetVTK = vr::k_ulInvalidActionSetHandle;
70
78
80 {
81 vr::VRInputValueHandle_t Source = vr::k_ulInvalidInputValueHandle;
82 vr::TrackedDevicePose_t LastPose;
83 };
84
86
87private:
89 void operator=(const vtkOpenVRRenderWindowInteractor&) = delete;
90};
91
92VTK_ABI_NAMESPACE_END
93#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:60
VR rendering window.