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"
14#include "pxr/usdImaging/usdImaging/types.h"
16#include "pxr/imaging/hd/sceneIndex.h"
18#include "pxr/usd/usd/notice.h"
24PXR_NAMESPACE_OPEN_SCOPE
26#define USDIMAGING_STAGE_SCENE_INDEX_TOKENS \
27 (includeUnloadedPrims) \
30 USDIMAGING_STAGE_SCENE_INDEX_TOKENS);
32using UsdImagingPrimAdapterSharedPtr =
33 std::shared_ptr<class UsdImagingPrimAdapter>;
34class UsdImaging_AdapterManager;
41 static UsdImagingStageSceneIndexRefPtr New(
42 HdContainerDataSourceHandle
const &inputArgs =
nullptr) {
43 return TfCreateRefPtr(
new UsdImagingStageSceneIndex(inputArgs));
47 ~UsdImagingStageSceneIndex();
64 void SetStage(UsdStageRefPtr stage);
71 void SetTime(
UsdTimeCode time,
bool forceDirtyingTimeDeps =
false);
83 void ApplyPendingUpdates();
87 UsdImagingStageSceneIndex(HdContainerDataSourceHandle
const &inputArgs);
89 Usd_PrimFlagsPredicate _GetPrimPredicate()
const;
91 void _ApplyPendingResyncs();
92 void _ComputeDirtiedEntries(
93 const std::map<SdfPath, TfTokenVector> &pathToUsdProperties,
94 SdfPathVector * primPathsToResync,
95 UsdImagingPropertyInvalidationType invalidationType,
102 void FlagAsTimeVarying(
106 void FlagAsAssetPathDependent(
107 const SdfPath & usdPath)
const override;
115 void RemoveAssetPathDependentsUnder(
const SdfPath &path);
117 void InvalidateAssetPathDependentsUnder(
119 std::vector<SdfPath> *primsToInvalidate,
120 std::map<SdfPath, TfTokenVector> *propertiesToInvalidate)
const;
125 struct _PathHashCompare {
129 static size_t hash(
const SdfPath &p) {
133 using _VariabilityMap = tbb::concurrent_hash_map<
SdfPath,
135 mutable _VariabilityMap _timeVaryingLocators;
137 using _AssetPathDependentsSet = std::set<SdfPath>;
138 mutable _AssetPathDependentsSet _assetPathDependents;
139 mutable std::mutex _assetPathDependentsMutex;
144 const bool _includeUnloadedPrims;
146 UsdStageRefPtr _stage;
147 _StageGlobals _stageGlobals;
151 void _PopulateSubtree(
UsdPrim subtreeRoot);
155 UsdStageWeakPtr
const& sender);
159 SdfPathVector _usdPrimsToResync;
161 std::map<SdfPath, TfTokenVector> _usdPropertiesToUpdate;
162 std::map<SdfPath, TfTokenVector> _usdPropertiesToResync;
164 using _PrimAdapterPair = std::pair<UsdPrim, UsdImagingPrimAdapterSharedPtr>;
165 _PrimAdapterPair _FindResponsibleAncestor(
const UsdPrim &prim)
const;
167 std::unique_ptr<UsdImaging_AdapterManager>
const _adapterManager;
170PXR_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.