7 #ifndef PXR_USD_IMAGING_USD_IMAGING_SCENE_INDEX_H 8 #define PXR_USD_IMAGING_USD_IMAGING_SCENE_INDEX_H 12 #include "pxr/usd/usd/timeCode.h" 14 #include "pxr/usdImaging/usdImaging/api.h" 16 #include "pxr/imaging/hd/filteringSceneIndex.h" 17 #include "pxr/imaging/hd/sceneIndex.h" 19 PXR_NAMESPACE_OPEN_SCOPE
21 using UsdImagingSceneIndexAppendCallback =
23 HdSceneIndexBaseRefPtr(HdSceneIndexBaseRefPtr
const &)>;
42 HdSceneIndexBaseRefPtr(
43 HdSceneIndexBaseRefPtr
const &,
44 HdContainerDataSourceHandle
const &sceneIndexCreateArgs)>;
65 static UsdImagingSceneIndexRefPtr
New(
66 HdContainerDataSourceHandle
const &sceneIndexCreateArgs,
69 return TfCreateRefPtr(
71 sceneIndexCreateArgs, sceneIndexAppendCallbacks));
75 static UsdImagingSceneIndexRefPtr
New(
76 HdContainerDataSourceHandle
const &sceneIndexCreateArgs,
77 const UsdImagingSceneIndexAppendCallback &
78 overridesSceneIndexCallback) {
80 if (overridesSceneIndexCallback) {
82 [overridesSceneIndexCallback](
83 HdSceneIndexBaseRefPtr
const &inputScene,
84 HdContainerDataSourceHandle
const &) {
85 return overridesSceneIndexCallback(inputScene);
88 return New(sceneIndexCreateArgs, callbacks);
104 HdSceneIndexBaseRefPtrVector GetEncapsulatedScenes()
const override;
112 void SetStage(UsdStageRefPtr stage);
119 void SetTime(
UsdTimeCode time,
bool forceDirtyingTimeDeps =
false);
131 void ApplyPendingUpdates();
145 const HdNoticeBatchingSceneIndexRefPtr &
147 return _postInstancingNoticeBatchingSceneIndex;
159 const AddedPrimEntries &entries)
override 161 _owner->_SendPrimsAdded(entries);
166 const RemovedPrimEntries &entries)
override 168 _owner->_SendPrimsRemoved(entries);
173 const DirtiedPrimEntries &entries)
override 175 _owner->_SendPrimsDirtied(entries);
180 const RenamedPrimEntries &entries)
override 182 _owner->_SendPrimsRenamed(entries);
190 HdContainerDataSourceHandle
const &sceneIndexCreateArgs,
191 const SceneIndexAppendCallbacks &sceneIndexAppendCallbacks);
197 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
198 HdNoticeBatchingSceneIndexRefPtr _postInstancingNoticeBatchingSceneIndex;
199 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
200 HdSceneIndexBaseRefPtr _finalSceneIndex;
205 PXR_NAMESPACE_CLOSE_SCOPE
USDIMAGING_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
A scene index consuming a UsdStage.
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
USDIMAGING_API void AddSelection(const SdfPath &path)
Given a path (including usd proxy path inside a native instance) of a USD prim, determine the corresp...
A mix-in class for scene indices that implement their behaviour by creating other scene indices (inte...
Small struct representing a 'prim' in the Hydra scene index.
Some scene indices in the chain of filtering scene indices created by UsdImagingCreateSceneIndices.
USDIMAGING_API void ClearSelection()
Reset the scene index selection state.
USDIMAGING_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Abstract interface to scene data.
A simple scene index adding HdSelectionsSchema to all prims selected with AddSelection.
const HdNoticeBatchingSceneIndexRefPtr & GetPostInstancingNoticeBatchingSceneIndex() const
Can be used to batch notices.
A path value used to locate objects in layers or scenegraphs.
std::function< HdSceneIndexBaseRefPtr(HdSceneIndexBaseRefPtr const &, HdContainerDataSourceHandle const &sceneIndexCreateArgs)> SceneIndexAppendCallback
A callback to insert additional scene indices into the UsdImaging chain.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Callbacks a client can use to insert scene indices at specific points in the UsdImaging chain.
static UsdImagingSceneIndexRefPtr New(HdContainerDataSourceHandle const &sceneIndexCreateArgs, const UsdImagingSceneIndexAppendCallback &overridesSceneIndexCallback)
SceneIndexAppendCallback overridesSceneIndexCallback
Inserts scene indices right after the stage scene index (and its material caching scene index).
static UsdImagingSceneIndexRefPtr New(HdContainerDataSourceHandle const &sceneIndexCreateArgs, const SceneIndexAppendCallbacks &sceneIndexAppendCallbacks={})
Create the chain of scene indices.
A scene index encapsulating the chain of scene indices (resolving, e.g., USD native instancing) that ...