VTK  9.6.20260523
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
34
35#ifndef vtkOpenXRRenderWindowInteractor_h
36#define vtkOpenXRRenderWindowInteractor_h
37
38#include "vtkRenderingOpenXRModule.h" // For export macro
40
41#include "vtkEventData.h" // for ivar
42
43#include <functional> // for std::function
44#include <map> // for std::map
45#include <memory>
46
47VTK_ABI_NAMESPACE_BEGIN
48class VTKRENDERINGOPENXR_EXPORT vtkOpenXRRenderWindowInteractor : public vtkVRRenderWindowInteractor
49{
50public:
53
57 void Initialize() override;
58
59 void DoOneEvent(vtkVRRenderWindow* renWin, vtkRenderer* ren) override;
60
62
66 void AddAction(const std::string& path, const vtkCommand::EventIds&);
67 void AddAction(const std::string& path, const std::function<void(vtkEventData*)>&);
69
71
79 void AddAction(const std::string& path, const vtkCommand::EventIds&, bool isAnalog) override;
81 const std::string& path, bool isAnalog, const std::function<void(vtkEventData*)>&) override;
83
89 bool ApplyVibration(const std::string& actionName, int hand, float amplitude = 0.5,
90 float duration = 25000000.0, float frequency = 0.0);
91
92protected:
99
101 void PrintSelf(ostream& os, vtkIndent indent) override;
102
103 class vtkInternal;
104 std::unique_ptr<vtkInternal> Internal;
105
107
108private:
110 void operator=(const vtkOpenXRRenderWindowInteractor&) = delete;
111};
112
113VTK_ABI_NAMESPACE_END
114#endif
115// VTK-HeaderTest-Exclude: vtkOpenXRRenderWindowInteractor.h
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:168
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
VR rendering window.