VTK  9.7.1
vtkOpenXRSceneObserver.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
3 
4 #ifndef vtkOpenXRSceneObserver_h
5 #define vtkOpenXRSceneObserver_h
6 
7 #include "vtkObject.h"
8 #include "vtkRenderingOpenXRModule.h" // For export macro
9 
10 #include <memory> // For std::unique_ptr
11 
12 VTK_ABI_NAMESPACE_BEGIN
13 
16 
56 class VTKRENDERINGOPENXR_EXPORT vtkOpenXRSceneObserver : public vtkObject
57 {
58  struct vtkInternals;
59 
60 public:
61  static vtkOpenXRSceneObserver* New();
63 
67  bool Initialize();
68 
74  bool UpdateSceneData();
75 
77 
95  {
96  // enum values from OpenXR
97  SnapshotComplete = 1,
98  SnapshotIncompleteFast = 2,
99  OcclusionOptimized = 3,
100  };
101  vtkGetMacro(ComputeConsistency, SceneConsistency);
102  vtkSetMacro(ComputeConsistency, SceneConsistency);
104 
106 
116  vtkGetMacro(ClippingRadius, double);
117  vtkSetClampMacro(ClippingRadius, double, 0.0, 1e100);
119 
125  {
126  // enum values from XrSceneComputeFeatureMSFT
127  Markers = 1000147000,
128  };
129 
131 
138  bool EnableComputeFeature(SceneFeature feature);
139  void DisableComputeFeature(SceneFeature feature);
140  bool IsComputeFeatureEnabled(SceneFeature feature) const;
141  bool IsComputeFeatureSupported(SceneFeature feature) const;
143 
145 
152  vtkSetMacro(MinimumInterval, double);
153  vtkGetMacro(MinimumInterval, double);
155 
156 protected:
158  ~vtkOpenXRSceneObserver() override;
159 
160 private:
162  void operator=(const vtkOpenXRSceneObserver&) = delete;
163 
164  bool CreateMSFTSceneObserver();
165 
166  std::unique_ptr<vtkInternals> Impl;
167 
168  double MinimumInterval{ 2.0 };
169  double ClippingRadius{ 2.0 };
170  SceneConsistency ComputeConsistency{ SceneConsistency::SnapshotComplete };
171 };
172 
173 VTK_ABI_NAMESPACE_END
174 
175 #endif
vtkOpenXRSceneComponent represent a component in the XR scene.
abstract base class for most VTK objects
Definition: vtkObject.h:52
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkOpenXRSceneObserver is a wrapper around OpenXR scene understanding extensions
OpenXR rendering window.