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=========================================================================*/
22
23#ifndef vtkOpenVRRenderWindowInteractor_h
24#define vtkOpenVRRenderWindowInteractor_h
25
26#include "vtkEventData.h" // for ivar
27#include "vtkRenderingOpenVRModule.h" // For export macro
29
30#include <functional> // for ivar
31#include <map> // for ivar
32#include <openvr.h> // for ivar
33#include <string> // for ivar
34
35class VTKRENDERINGOPENVR_EXPORT vtkOpenVRRenderWindowInteractor : public vtkVRRenderWindowInteractor
36{
37public:
40
44 void Initialize() override;
45
49 void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) override;
50
52
55 void AddAction(std::string path, vtkCommand::EventIds, bool isAnalog);
56 void AddAction(std::string path, bool isAnalog, std::function<void(vtkEventData*)>);
58
59protected:
62
64 {
65 public:
66 vr::VRActionHandle_t ActionHandle;
68 std::function<void(vtkEventData*)> Function;
69 bool UseFunction = false;
70 bool IsAnalog = false;
71 };
72
73 std::map<std::string, ActionData> ActionMap;
74 vr::VRActionSetHandle_t ActionsetVTK = vr::k_ulInvalidActionSetHandle;
75
83
85 {
86 vr::VRInputValueHandle_t Source = vr::k_ulInvalidInputValueHandle;
87 vr::TrackedDevicePose_t LastPose;
88 };
89
91
92private:
94 void operator=(const vtkOpenVRRenderWindowInteractor&) = delete;
95};
96
97#endif
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.
TrackerActions Trackers[NUMBER_OF_TRACKERS]
abstract specification for renderers
Definition vtkRenderer.h:67
VR rendering window.