24#ifndef PXR_USD_IMAGING_USD_IMAGING_STAGE_SCENE_INDEX_H
25#define PXR_USD_IMAGING_USD_IMAGING_STAGE_SCENE_INDEX_H
29#include "pxr/usdImaging/usdImaging/api.h"
30#include "pxr/usdImaging/usdImaging/dataSourceStageGlobals.h"
31#include "pxr/usdImaging/usdImaging/types.h"
33#include "pxr/imaging/hd/sceneIndex.h"
35#include "pxr/usd/usd/notice.h"
41PXR_NAMESPACE_OPEN_SCOPE
43#define USDIMAGING_STAGE_SCENE_INDEX_TOKENS \
44 (includeUnloadedPrims) \
47 USDIMAGING_STAGE_SCENE_INDEX_TOKENS);
49using UsdImagingPrimAdapterSharedPtr =
50 std::shared_ptr<class UsdImagingPrimAdapter>;
51class UsdImaging_AdapterManager;
58 static UsdImagingStageSceneIndexRefPtr New(
59 HdContainerDataSourceHandle
const &inputArgs =
nullptr) {
60 return TfCreateRefPtr(
new UsdImagingStageSceneIndex(inputArgs));
64 ~UsdImagingStageSceneIndex();
81 void SetStage(UsdStageRefPtr stage);
88 void SetTime(
UsdTimeCode time,
bool forceDirtyingTimeDeps =
false);
100 void ApplyPendingUpdates();
104 UsdImagingStageSceneIndex(HdContainerDataSourceHandle
const &inputArgs);
106 Usd_PrimFlagsConjunction _GetTraversalPredicate()
const;
108 void _ApplyPendingResyncs();
109 void _ComputeDirtiedEntries(
110 const std::map<SdfPath, TfTokenVector> &pathToUsdProperties,
111 SdfPathVector * primPathsToResync,
112 UsdImagingPropertyInvalidationType invalidationType,
119 void FlagAsTimeVarying(
123 void FlagAsAssetPathDependent(
124 const SdfPath & usdPath)
const override;
132 void RemoveAssetPathDependentsUnder(
const SdfPath &path);
134 void InvalidateAssetPathDependentsUnder(
136 std::vector<SdfPath> *primsToInvalidate,
137 std::map<SdfPath, TfTokenVector> *propertiesToInvalidate)
const;
142 struct _PathHashCompare {
146 static size_t hash(
const SdfPath &p) {
150 using _VariabilityMap = tbb::concurrent_hash_map<
SdfPath,
152 mutable _VariabilityMap _timeVaryingLocators;
154 using _AssetPathDependentsSet = std::set<SdfPath>;
155 mutable _AssetPathDependentsSet _assetPathDependents;
156 mutable std::mutex _assetPathDependentsMutex;
161 const bool _includeUnloadedPrims;
163 UsdStageRefPtr _stage;
164 _StageGlobals _stageGlobals;
168 void _PopulateSubtree(
UsdPrim subtreeRoot);
172 UsdStageWeakPtr
const& sender);
176 SdfPathVector _usdPrimsToResync;
178 std::map<SdfPath, TfTokenVector> _usdPropertiesToUpdate;
179 std::map<SdfPath, TfTokenVector> _usdPropertiesToResync;
181 using _PrimAdapterPair = std::pair<UsdPrim, UsdImagingPrimAdapterSharedPtr>;
182 _PrimAdapterPair _FindResponsibleAncestor(
const UsdPrim &prim)
const;
184 std::unique_ptr<UsdImaging_AdapterManager>
const _adapterManager;
187PXR_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.
Abstract interface to scene data.
virtual SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const =0
Returns the paths of all scene index prims located immediately below primPath.
virtual HdSceneIndexPrim GetPrim(const SdfPath &primPath) const =0
Returns a pair of (prim type, datasource) for the object at primPath.
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...
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.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Small struct representing a 'prim' in the Hydra scene index.
size_t hash_value(const TfToken &x)
Overload hash_value for TfToken.