7#ifndef PXR_USD_IMAGING_USD_IMAGING_STAGE_SCENE_INDEX_H
8#define PXR_USD_IMAGING_USD_IMAGING_STAGE_SCENE_INDEX_H
12#include "pxr/usdImaging/usdImaging/api.h"
13#include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h"
15#include "pxr/usdImaging/usdImaging/types.h"
17#include "pxr/imaging/hd/sceneIndex.h"
19#include "pxr/usd/usd/notice.h"
25PXR_NAMESPACE_OPEN_SCOPE
27using UsdImagingPrimAdapterSharedPtr =
28 std::shared_ptr<class UsdImagingPrimAdapter>;
29class UsdImaging_AdapterManager;
44 static UsdImagingStageSceneIndexRefPtr New(
45 HdContainerDataSourceHandle
const &inputArgs =
nullptr) {
101 Usd_PrimFlagsPredicate _GetPrimPredicate()
const;
103 void _ApplyPendingResyncs();
104 void _ComputeDirtiedEntries(
105 const std::map<SdfPath, TfTokenVector> &pathToUsdProperties,
106 SdfPathVector * primPathsToResync,
107 UsdImagingPropertyInvalidationType invalidationType,
114 void FlagAsTimeVarying(
118 void FlagAsAssetPathDependent(
119 const SdfPath & usdPath)
const override;
127 void RemoveAssetPathDependentsUnder(
const SdfPath &path);
129 void InvalidateAssetPathDependentsUnder(
131 std::vector<SdfPath> *primsToInvalidate,
132 std::map<SdfPath, TfTokenVector> *propertiesToInvalidate)
const;
137 struct _PathHashCompare {
141 static size_t hash(
const SdfPath &p) {
145 using _VariabilityMap = tbb::concurrent_hash_map<
SdfPath,
147 mutable _VariabilityMap _timeVaryingLocators;
149 using _AssetPathDependentsSet = std::set<SdfPath>;
150 mutable _AssetPathDependentsSet _assetPathDependents;
151 mutable std::mutex _assetPathDependentsMutex;
156 const bool _includeUnloadedPrims;
158 UsdStageRefPtr _stage;
159 _StageGlobals _stageGlobals;
165 void _PopulateSubtree(
UsdPrim subtreeRoot,
170 UsdStageWeakPtr
const& sender);
174 SdfPathSet _populatedPaths;
177 SdfPathVector _usdPrimsToResync;
179 std::map<SdfPath, TfTokenVector> _usdPropertiesToUpdate;
180 std::map<SdfPath, TfTokenVector> _usdPropertiesToResync;
182 using _PrimAdapterPair = std::pair<UsdPrim, UsdImagingPrimAdapterSharedPtr>;
183 using _PrimAdapterPairVec = std::vector<_PrimAdapterPair>;
184 _PrimAdapterPairVec _FindResponsibleAncestors(
const UsdPrim &prim)
const;
185 bool _HasResponsibleAncestor(
const UsdPrim &prim)
const;
187 std::unique_ptr<UsdImaging_AdapterManager>
const _adapterManager;
190PXR_NAMESPACE_CLOSE_SCOPE
Represents an object that can identify the location of a data source.
Represents a set of data source locators closed under descendancy.
A path value used to locate objects in layers or scenegraphs.
Handle-object returned by TfNotice::Register().
This class is used as a context object with global stage information, that gets passed down to dataso...
A scene index consuming a UsdStage.
USDIMAGING_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
USDIMAGING_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
USDIMAGING_API void ApplyPendingUpdates() override
Apply queued stage edits to imaging scene.
USDIMAGING_API UsdTimeCode GetTime() const override
Return the current time.
USDIMAGING_API void SetStage(UsdStageRefPtr stage) override
Set the USD stage to pull data from.
USDIMAGING_API void SetTime(UsdTimeCode time) override
Set the time, and call PrimsDirtied for any time-varying attributes.
USDIMAGING_API void SetTime(UsdTimeCode time, bool forceDirtyingTimeDeps)
Set the time, and call PrimsDirtied for any time-varying attributes.
An interface for initial scene indices that populate the Hydra scene with prims and data sources from...
Notice sent in response to authored changes that affect UsdObjects.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Small struct representing a 'prim' in the Hydra scene index.
size_t hash_value(const TfToken &x)
Overload hash_value for TfToken.