24#ifndef PXR_IMAGING_HD_DEPENDENCY_FORWARDING_SCENE_INDEX_H
25#define PXR_IMAGING_HD_DEPENDENCY_FORWARDING_SCENE_INDEX_H
29#include "pxr/imaging/hd/api.h"
30#include "pxr/imaging/hd/filteringSceneIndex.h"
32#include <tbb/concurrent_unordered_map.h>
33#include <tbb/concurrent_unordered_set.h>
35PXR_NAMESPACE_OPEN_SCOPE
37class HdDependencyForwardingSceneIndex;
41class HdDependencyForwardingSceneIndex
46 static HdDependencyForwardingSceneIndexRefPtr New(
47 HdSceneIndexBaseRefPtr inputScene) {
48 return TfCreateRefPtr(
49 new HdDependencyForwardingSceneIndex(inputScene));
59 HdDependencyForwardingSceneIndex(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;
186 size_t operator()(_VisitedNode
const &node)
const {
194 _VisitedNode::HashFunctor>;
201 _VisitedNodeSet *visited,
208 mutable _PathSet _potentiallyDeletedDependedOnPaths;
215 mutable _PathSet _potentiallyDeletedAffectedPaths;
228 void RemoveDeletedEntries(
229 SdfPathVector *removedAffectedPrimPaths =
nullptr,
230 SdfPathVector *removedDependedOnPrimPaths =
nullptr);
236HdDependencyForwardingSceneIndex::_VisitedNode::Hash()
const
241PXR_NAMESPACE_CLOSE_SCOPE
Represents an object that can identify the location of a data source.
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.
This is a space efficient container that mimics the TfHashSet API that uses a vector for storage when...
A user-extensible hashing mechanism for use with runtime hash tables.
Token for efficient comparison, assignment, and hashing of known strings.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Small struct representing a 'prim' in the Hydra scene index.
Functor to use for hash maps from tokens to other things.