7 #ifndef PXR_IMAGING_HDSI_PRIM_MANAGING_SCENE_INDEX_OBSERVER_H 8 #define PXR_IMAGING_HDSI_PRIM_MANAGING_SCENE_INDEX_OBSERVER_H 12 #include "pxr/imaging/hdsi/api.h" 14 #include "pxr/imaging/hd/dataSource.h" 15 #include "pxr/imaging/hd/sceneIndexObserver.h" 17 PXR_NAMESPACE_OPEN_SCOPE
19 #define HDSI_PRIM_MANAGING_SCENE_INDEX_OBSERVER_TOKENS \ 23 HDSI_PRIM_MANAGING_SCENE_INDEX_OBSERVER_TOKENS);
69 _Dirty(entry, observer);
77 using PrimBaseHandle = std::shared_ptr<PrimBase>;
88 virtual PrimBaseHandle CreatePrim(
92 using PrimFactoryBaseHandle = std::shared_ptr<PrimFactoryBase>;
98 static HdsiPrimManagingSceneIndexObserverRefPtr
New(
99 HdSceneIndexBaseRefPtr
const &sceneIndex,
100 HdContainerDataSourceHandle
const &inputArgs) {
101 return TfCreateRefPtr(
103 sceneIndex, inputArgs));
124 template<
typename PrimType>
127 return std::dynamic_pointer_cast<PrimType>(
GetPrim(primPath));
133 const AddedPrimEntries &entries)
override;
137 const DirtiedPrimEntries &entries)
override;
141 const RemovedPrimEntries &entries)
override;
145 const RenamedPrimEntries &entries)
override;
150 HdSceneIndexBaseRefPtr
const &sceneIndex,
151 HdContainerDataSourceHandle
const &inputArgs);
153 HdSceneIndexBaseRefPtr
const _sceneIndex;
154 PrimFactoryBaseHandle
const _primFactory;
159 std::map<SdfPath, PrimBaseHandle> _prims;
162 PXR_NAMESPACE_CLOSE_SCOPE
const HdSceneIndexBaseRefPtr & GetSceneIndex() const
Get observed scene index.
Base class for prims managed by the observer.
Base class for a prim factory given to the observer.
void PrimsAdded(const HdSceneIndexBase &sender, const AddedPrimEntries &entries) override
A notification indicating prims have been added to the scene.
static HdsiPrimManagingSceneIndexObserverRefPtr New(HdSceneIndexBaseRefPtr const &sceneIndex, HdContainerDataSourceHandle const &inputArgs)
C'tor.
std::shared_ptr< PrimType > GetTypedPrim(const SdfPath &primPath) const
Get managed prim cast to a particular type.
Enable a concrete base class for use with TfRefPtr.
void PrimsRemoved(const HdSceneIndexBase &sender, const RemovedPrimEntries &entries) override
A notification indicating prims have been removed from the scene.
A scene index observer that turns prims in the observed scene index into instances (of RAII subclasse...
A notice indicating a prim of a given type was added to the scene.
void PrimsRenamed(const HdSceneIndexBase &sender, const RenamedPrimEntries &entries) override
A notification indicating prims (and their descendants) have been renamed or reparented.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Abstract interface to scene data.
HDSI_API const PrimBaseHandle & GetPrim(const SdfPath &primPath) const
Get managed prim at path.
A path value used to locate objects in layers or scenegraphs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
A notice indicating a prim was invalidated.
void PrimsDirtied(const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries) override
A notification indicating prim datasources have been invalidated.