vtkOpenXRSceneObserver
is a wrapper around OpenXR scene understanding extensions
vtkOpenXRSceneObserver
is a wrapper around OpenXR scene understanding extensions
vtkOpenXRSceneObserver
uses an event based mecanism to retrieve components. vtkOpenXRSceneObserver
will invoke vtkCommand::UpdateDataEvent
when a new component is detected by the runtime. This event will forward the new component as calldata.
A vtkOpenXRSceneObserver
is instanciated, initialized and updated by vtkOpenXRRenderWindow
if vtkOpenXRRenderWindow::EnableSceneUnderstanding
is true
. vtkOpenXRSceneObserver::Initialize
will be called by vtkOpenXRRenderWindow
when initialized vtkOpenXRSceneObserver::UpdateSceneData
is automatically called by vtkOpenXRRenderWindow::Render()
for the window scene observer.
You may instantiate it manually and handle it's lifetime and updates on your own.
- See also
vtkOpenXRRenderWindow::SetEnableSceneUnderstanding
-
vtkOpenXRRenderWindow::GetSceneObserver
-
vtkOpenXRSceneComponent
void OnNewComponent(
vtkObject*
object,
unsigned long,
void* calldata) {
}
renderWindow->SetEnableSceneUnderstanding(true);
renderWindow->Initialize();
assert(sceneObserver && "Something went wrong!");
callback->SetCallback(OnNewComponent);
Allocate and hold a VTK object.
abstract base class for most VTK objects
unsigned long AddObserver(unsigned long event, vtkCommand *, float priority=0.0f)
Allow people to add/remove/invoke observers (callbacks) to any VTK object.
#ifndef vtkOpenXRSceneObserver_h
#define vtkOpenXRSceneObserver_h
#include "vtkRenderingOpenXRModule.h"
#include <memory>
VTK_ABI_NAMESPACE_BEGIN
{
struct vtkInternals;
public:
bool Initialize();
bool UpdateSceneData();
enum SceneConsistency
{
SnapshotComplete = 1,
SnapshotIncompleteFast = 2,
OcclusionOptimized = 3,
};
vtkGetMacro(ComputeConsistency, SceneConsistency);
vtkSetMacro(ComputeConsistency, SceneConsistency);
vtkGetMacro(ClippingRadius, double);
vtkSetClampMacro(ClippingRadius, double, 0.0, 1e100);
enum SceneFeature
{
Markers = 1000147000,
};
bool EnableComputeFeature(SceneFeature feature);
void DisableComputeFeature(SceneFeature feature);
bool IsComputeFeatureEnabled(SceneFeature feature) const;
bool IsComputeFeatureSupported(SceneFeature feature) const;
vtkSetMacro(MinimumInterval, double);
vtkGetMacro(MinimumInterval, double);
protected:
private:
bool CreateMSFTSceneObserver();
std::unique_ptr<vtkInternals> Impl{};
double MinimumInterval{ 2.0 };
double ClippingRadius{ 2.0 };
SceneConsistency ComputeConsistency{ SceneConsistency::SnapshotComplete };
};
VTK_ABI_NAMESPACE_END
#endif
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.