7 #ifndef PXR_IMAGING_HD_DEPENDENCY_FORWARDING_SCENE_INDEX_H
8 #define PXR_IMAGING_HD_DEPENDENCY_FORWARDING_SCENE_INDEX_H
15 #include <tbb/concurrent_unordered_map.h>
16 #include <tbb/concurrent_unordered_set.h>
29 static HdDependencyForwardingSceneIndexRefPtr
New(
30 HdSceneIndexBaseRefPtr inputScene) {
71 using _LocatorsEntryMap = tbb::concurrent_unordered_map<
77 struct _AffectedPrimDependencyEntry
79 _LocatorsEntryMap locatorsEntryMap;
80 bool flaggedForDeletion =
false;
85 using _AffectedPrimsDependencyMap = tbb::concurrent_unordered_map<
87 _AffectedPrimDependencyEntry,
92 using _DependedOnPrimsAffectedPrimsMap = tbb::concurrent_unordered_map<
94 _AffectedPrimsDependencyMap,
103 mutable _DependedOnPrimsAffectedPrimsMap _dependedOnPrimToDependentsMap;
108 using _PathSet = tbb::concurrent_unordered_set<SdfPath, SdfPath::Hash>;
112 struct _AffectedPrimToDependsOnPathsEntry
114 _PathSet dependsOnPaths;
115 bool flaggedForDeletion =
false;
119 using _AffectedPrimToDependsOnPathsEntryMap = tbb::concurrent_unordered_map<
121 _AffectedPrimToDependsOnPathsEntry,
130 mutable _AffectedPrimToDependsOnPathsEntryMap
131 _affectedPrimToDependsOnPathsMap;
135 void _ClearDependencies(
const SdfPath &primPath);
136 void _UpdateDependencies(
const SdfPath &primPath)
const;
156 inline bool operator==(_VisitedNode
const &rhs)
const noexcept
158 return primPath == rhs.primPath && locator == rhs.locator;
161 template <
class HashState>
162 friend void TfHashAppend(HashState &
h, _VisitedNode
const &myObj) {
163 h.Append(myObj.primPath);
164 h.Append(myObj.locator);
167 inline size_t Hash()
const;
177 _VisitedNode::HashFunctor>;
184 _VisitedNodeSet *visited,
191 mutable _PathSet _potentiallyDeletedDependedOnPaths;
198 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
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