VTK  9.7.0
vtkOpenXRRenderWindowInteractor.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
15
16#ifndef vtkOpenXRRenderWindowInteractor_h
17#define vtkOpenXRRenderWindowInteractor_h
18
19#include "vtkRenderingOpenXRModule.h" // For export macro
21
22#include "vtkEventData.h" // for ivar
23
24#include <functional> // for std::function
25#include <map> // for std::map
26#include <memory>
27
28VTK_ABI_NAMESPACE_BEGIN
29class VTKRENDERINGOPENXR_EXPORT vtkOpenXRRenderWindowInteractor : public vtkVRRenderWindowInteractor
30{
31public:
34
38 void Initialize() override;
39
40 void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) override;
41
43
47 void AddAction(const std::string& path, const vtkCommand::EventIds&);
48 void AddAction(const std::string& path, const std::function<void(vtkEventData*)>&);
50
52
60 void AddAction(const std::string& path, const vtkCommand::EventIds&, bool isAnalog) override;
62 const std::string& path, bool isAnalog, const std::function<void(vtkEventData*)>&) override;
64
70 bool ApplyVibration(const std::string& actionName, int hand, float amplitude = 0.5,
71 float duration = 25000000.0, float frequency = 0.0);
72
73protected:
80
82 void PrintSelf(ostream& os, vtkIndent indent) override;
83
84 class vtkInternal;
85 std::unique_ptr<vtkInternal> Internal;
86
87 vtkNew<vtkMatrix4x4> PoseToWorldMatrix; // used in calculations
88
89private:
91 void operator=(const vtkOpenXRRenderWindowInteractor&) = delete;
92};
93
94VTK_ABI_NAMESPACE_END
95#endif
96// VTK-HeaderTest-Exclude: vtkOpenXRRenderWindowInteractor.h
a simple class to control print indentation
Definition vtkIndent.h:29
Allocate and hold a VTK object.
Definition vtkNew.h:59
void AddAction(const std::string &path, bool isAnalog, const std::function< void(vtkEventData *)> &) override
Assign an event or std::function to an event path.
void DoOneEvent(vtkVRRenderWindow *renWin, vtkRenderer *ren) override
Implements the event loop.
void AddAction(const std::string &path, const std::function< void(vtkEventData *)> &)
Assign an event or std::function to an event path.
bool ApplyVibration(const std::string &actionName, int hand, float amplitude=0.5, float duration=25000000.0, float frequency=0.0)
Apply haptic vibration using the provided action action to emit vibration on hand to emit on amplitud...
void AddAction(const std::string &path, const vtkCommand::EventIds &)
Assign an event or std::function to an event path.
void AddAction(const std::string &path, const vtkCommand::EventIds &, bool isAnalog) override
Assign an event or std::function to an event path.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkOpenXRRenderWindowInteractor * New()
void Initialize() override
Initialize the event handler.
vtkOpenXRRenderWindowInteractor()
Create and set the openxr style on this Set ActionManifestFileName to vtk_openxr_actions....
abstract specification for renderers
Definition vtkRenderer.h:64
VR rendering window.