24 #ifndef PXR_IMAGING_HD_DEPENDENCY_FORWARDING_SCENE_INDEX_H
25 #define PXR_IMAGING_HD_DEPENDENCY_FORWARDING_SCENE_INDEX_H
32 #include <tbb/concurrent_unordered_map.h>
33 #include <tbb/concurrent_unordered_set.h>
46 static HdDependencyForwardingSceneIndexRefPtr
New(
47 HdSceneIndexBaseRefPtr inputScene) {
88 using _LocatorsEntryMap = tbb::concurrent_unordered_map<
94 struct _AffectedPrimDependencyEntry
96 _LocatorsEntryMap locatorsEntryMap;
97 bool flaggedForDeletion =
false;
102 using _AffectedPrimsDependencyMap = tbb::concurrent_unordered_map<
104 _AffectedPrimDependencyEntry,
109 using _DependedOnPrimsAffectedPrimsMap = tbb::concurrent_unordered_map<
111 _AffectedPrimsDependencyMap,
120 mutable _DependedOnPrimsAffectedPrimsMap _dependedOnPrimToDependentsMap;
125 using _PathSet = tbb::concurrent_unordered_set<SdfPath, SdfPath::Hash>;
129 struct _AffectedPrimToDependsOnPathsEntry
131 _PathSet dependsOnPaths;
132 bool flaggedForDeletion =
false;
136 using _AffectedPrimToDependsOnPathsEntryMap = tbb::concurrent_unordered_map<
138 _AffectedPrimToDependsOnPathsEntry,
147 mutable _AffectedPrimToDependsOnPathsEntryMap
148 _affectedPrimToDependsOnPathsMap;
152 void _ClearDependencies(
const SdfPath &primPath);
153 void _UpdateDependencies(
const SdfPath &primPath)
const;
173 inline bool operator==(_VisitedNode
const &rhs)
const noexcept
175 return primPath == rhs.primPath && locator == rhs.locator;
178 template <
class HashState>
179 friend void TfHashAppend(HashState &
h, _VisitedNode
const &myObj) {
180 h.Append(myObj.primPath);
181 h.Append(myObj.locator);
184 inline size_t Hash()
const;
194 _VisitedNode::HashFunctor>;
201 _VisitedNodeSet *visited,
208 mutable _PathSet _potentiallyDeletedDependedOnPaths;
215 mutable _PathSet _potentiallyDeletedAffectedPaths;
TfRefPtr< T > TfCreateRefPtr(T *ptr)
void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
void TfHashAppend(HashState &h, const T &ptr)
STATIC_INLINE size_t Hash(const char *s, size_t len)
HD_API HdDependencyForwardingSceneIndex(HdSceneIndexBaseRefPtr inputScene)
SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Functor to use for hash maps from tokens to other things.
void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) override
size_t operator()(_VisitedNode const &node) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
GLfloat GLfloat GLfloat GLfloat h
TF_DECLARE_REF_PTRS(HdDependencyForwardingSceneIndex)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
#define PXR_NAMESPACE_CLOSE_SCOPE
HD_API void RemoveDeletedEntries(SdfPathVector *removedAffectedPrimPaths=nullptr, SdfPathVector *removedDependedOnPrimPaths=nullptr)
static HdDependencyForwardingSceneIndexRefPtr New(HdSceneIndexBaseRefPtr inputScene)
void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) override