VTK  9.7.1
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
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 
28 VTK_ABI_NAMESPACE_BEGIN
29 class VTKRENDERINGOPENXR_EXPORT vtkOpenXRRenderWindowInteractor : public vtkVRRenderWindowInteractor
30 {
31 public:
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;
61  void AddAction(
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 
73 protected:
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 
89 private:
91  void operator=(const vtkOpenXRRenderWindowInteractor&) = delete;
92 };
93 
94 VTK_ABI_NAMESPACE_END
95 #endif
96 // VTK-HeaderTest-Exclude: vtkOpenXRRenderWindowInteractor.h
implements OpenXR specific functions required by vtkRenderWindowInteractor.
virtual void DoOneEvent(vtkVRRenderWindow *renWin, vtkRenderer *ren)=0
Implements the event loop.
Implements VR specific functions required by vtkRenderWindowInteractor.
VR rendering window.
abstract specification for renderers
Definition: vtkRenderer.h:63
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void AddAction(const std::string &path, const vtkCommand::EventIds &, bool isAnalog)=0
Assign an event or std::function to an event path.
void Initialize() override
Initialize the event handler.
static vtkRenderWindowInteractor3D * New()
Construct object so that light follows camera motion.