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
26using UsdImagingPrimAdapterSharedPtr =
27 std::shared_ptr<class UsdImagingPrimAdapter>;
28class UsdImaging_AdapterManager;
43 static UsdImagingStageSceneIndexRefPtr New(
44 HdContainerDataSourceHandle
const &inputArgs =
nullptr) {
94 Usd_PrimFlagsPredicate _GetPrimPredicate()
const;
96 void _ApplyPendingResyncs();
97 void _ComputeDirtiedEntries(
98 const std::map<SdfPath, TfTokenVector> &pathToUsdProperties,
99 SdfPathVector * primPathsToResync,
100 UsdImagingPropertyInvalidationType invalidationType,
107 void FlagAsTimeVarying(
111 void FlagAsAssetPathDependent(
112 const SdfPath & usdPath)
const override;
120 void RemoveAssetPathDependentsUnder(
const SdfPath &path);
122 void InvalidateAssetPathDependentsUnder(
124 std::vector<SdfPath> *primsToInvalidate,
125 std::map<SdfPath, TfTokenVector> *propertiesToInvalidate)
const;
130 struct _PathHashCompare {
134 static size_t hash(
const SdfPath &p) {
138 using _VariabilityMap = tbb::concurrent_hash_map<
SdfPath,
140 mutable _VariabilityMap _timeVaryingLocators;
142 using _AssetPathDependentsSet = std::set<SdfPath>;
143 mutable _AssetPathDependentsSet _assetPathDependents;
144 mutable std::mutex _assetPathDependentsMutex;
149 const bool _includeUnloadedPrims;
151 UsdStageRefPtr _stage;
152 _StageGlobals _stageGlobals;
156 void _PopulateSubtree(
UsdPrim subtreeRoot,
161 UsdStageWeakPtr
const& sender);
165 SdfPathSet _populatedPaths;
168 SdfPathVector _usdPrimsToResync;
170 std::map<SdfPath, TfTokenVector> _usdPropertiesToUpdate;
171 std::map<SdfPath, TfTokenVector> _usdPropertiesToResync;
173 using _PrimAdapterPair = std::pair<UsdPrim, UsdImagingPrimAdapterSharedPtr>;
174 _PrimAdapterPair _FindResponsibleAncestor(
const UsdPrim &prim)
const;
176 std::unique_ptr<UsdImaging_AdapterManager>
const _adapterManager;
179PXR_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 UsdTimeCode GetTime() const
Return the current time.
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 SetStage(UsdStageRefPtr stage)
Set the USD stage to pull data from.
USDIMAGING_API void SetTime(UsdTimeCode time, bool forceDirtyingTimeDeps=false)
Set the time, and call PrimsDirtied for any time-varying attributes.
USDIMAGING_API void ApplyPendingUpdates()
Apply queued stage edits to imaging scene.
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.