24#ifndef PXR_IMAGING_HDSI_PRIM_MANAGING_SCENE_INDEX_OBSERVER_H
25#define PXR_IMAGING_HDSI_PRIM_MANAGING_SCENE_INDEX_OBSERVER_H
29#include "pxr/imaging/hdsi/api.h"
31#include "pxr/imaging/hd/dataSource.h"
32#include "pxr/imaging/hd/sceneIndexObserver.h"
34PXR_NAMESPACE_OPEN_SCOPE
36#define HDSI_PRIM_MANAGING_SCENE_INDEX_OBSERVER_TOKENS \
40 HDSI_PRIM_MANAGING_SCENE_INDEX_OBSERVER_TOKENS);
86 _Dirty(entry, observer);
94 using PrimBaseHandle = std::shared_ptr<PrimBase>;
105 virtual PrimBaseHandle CreatePrim(
109 using PrimFactoryBaseHandle = std::shared_ptr<PrimFactoryBase>;
115 static HdsiPrimManagingSceneIndexObserverRefPtr
New(
116 HdSceneIndexBaseRefPtr
const &sceneIndex,
117 HdContainerDataSourceHandle
const &inputArgs) {
118 return TfCreateRefPtr(
120 sceneIndex, inputArgs));
141 template<
typename PrimType>
144 return std::dynamic_pointer_cast<PrimType>(
GetPrim(primPath));
167 HdSceneIndexBaseRefPtr
const &sceneIndex,
168 HdContainerDataSourceHandle
const &inputArgs);
170 HdSceneIndexBaseRefPtr
const _sceneIndex;
171 PrimFactoryBaseHandle
const _primFactory;
176 std::map<SdfPath, PrimBaseHandle> _prims;
179PXR_NAMESPACE_CLOSE_SCOPE
Abstract interface to scene data.
Base class for prims managed by the observer.
Base class for a prim factory given to the observer.
A scene index observer that turns prims in the observed scene index into instances (of RAII subclasse...
const HdSceneIndexBaseRefPtr & GetSceneIndex() const
Get observed scene index.
void PrimsRemoved(const HdSceneIndexBase &sender, const RemovedPrimEntries &entries) override
A notification indicating prims have been removed from the scene.
void PrimsRenamed(const HdSceneIndexBase &sender, const RenamedPrimEntries &entries) override
A notification indicating prims (and their descendants) have been renamed or reparented.
HDSI_API const PrimBaseHandle & GetPrim(const SdfPath &primPath) const
Get managed prim at path.
void PrimsAdded(const HdSceneIndexBase &sender, const AddedPrimEntries &entries) override
A notification indicating prims have been added to the scene.
void PrimsDirtied(const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries) override
A notification indicating prim datasources have been invalidated.
std::shared_ptr< PrimType > GetTypedPrim(const SdfPath &primPath) const
Get managed prim cast to a particular type.
static HdsiPrimManagingSceneIndexObserverRefPtr New(HdSceneIndexBaseRefPtr const &sceneIndex, HdContainerDataSourceHandle const &inputArgs)
C'tor.
A path value used to locate objects in layers or scenegraphs.
Enable a concrete base class for use with TfRefPtr.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
A notice indicating a prim of a given type was added to the scene.
A notice indicating a prim was invalidated.