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;
49 static UsdImagingStageSceneIndexRefPtr New(
50 HdContainerDataSourceHandle
const &inputArgs =
nullptr) {
72 void SetStage(UsdStageRefPtr stage);
79 void SetTime(
UsdTimeCode time,
bool forceDirtyingTimeDeps =
false);
91 void ApplyPendingUpdates();
97 Usd_PrimFlagsPredicate _GetPrimPredicate()
const;
99 void _ApplyPendingResyncs();
100 void _ComputeDirtiedEntries(
101 const std::map<SdfPath, TfTokenVector> &pathToUsdProperties,
102 SdfPathVector * primPathsToResync,
103 UsdImagingPropertyInvalidationType invalidationType,
110 void FlagAsTimeVarying(
114 void FlagAsAssetPathDependent(
115 const SdfPath & usdPath)
const override;
123 void RemoveAssetPathDependentsUnder(
const SdfPath &path);
125 void InvalidateAssetPathDependentsUnder(
127 std::vector<SdfPath> *primsToInvalidate,
128 std::map<SdfPath, TfTokenVector> *propertiesToInvalidate)
const;
133 struct _PathHashCompare {
137 static size_t hash(
const SdfPath &p) {
141 using _VariabilityMap = tbb::concurrent_hash_map<
SdfPath,
143 mutable _VariabilityMap _timeVaryingLocators;
145 using _AssetPathDependentsSet = std::set<SdfPath>;
146 mutable _AssetPathDependentsSet _assetPathDependents;
147 mutable std::mutex _assetPathDependentsMutex;
152 const bool _includeUnloadedPrims;
154 UsdStageRefPtr _stage;
155 _StageGlobals _stageGlobals;
159 void _PopulateSubtree(
UsdPrim subtreeRoot,
164 UsdStageWeakPtr
const& sender);
168 SdfPathSet _populatedPaths;
171 SdfPathVector _usdPrimsToResync;
173 std::map<SdfPath, TfTokenVector> _usdPropertiesToUpdate;
174 std::map<SdfPath, TfTokenVector> _usdPropertiesToResync;
176 using _PrimAdapterPair = std::pair<UsdPrim, UsdImagingPrimAdapterSharedPtr>;
177 _PrimAdapterPair _FindResponsibleAncestor(
const UsdPrim &prim)
const;
179 std::unique_ptr<UsdImaging_AdapterManager>
const _adapterManager;
182PXR_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.
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).
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.