7#ifndef PXR_IMAGING_HD_DEPENDENCY_FORWARDING_SCENE_INDEX_H
8#define PXR_IMAGING_HD_DEPENDENCY_FORWARDING_SCENE_INDEX_H
12#include "pxr/imaging/hd/api.h"
13#include "pxr/imaging/hd/filteringSceneIndex.h"
15#include <tbb/concurrent_unordered_map.h>
16#include <tbb/concurrent_unordered_set.h>
18PXR_NAMESPACE_OPEN_SCOPE
20class HdDependencyForwardingSceneIndex;
24class HdDependencyForwardingSceneIndex
29 static HdDependencyForwardingSceneIndexRefPtr New(
30 HdSceneIndexBaseRefPtr inputScene) {
31 return TfCreateRefPtr(
32 new HdDependencyForwardingSceneIndex(inputScene));
42 HdDependencyForwardingSceneIndex(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;
169 size_t operator()(_VisitedNode
const &node)
const {
177 _VisitedNode::HashFunctor>;
184 _VisitedNodeSet *visited,
191 mutable _PathSet _potentiallyDeletedDependedOnPaths;
198 mutable _PathSet _potentiallyDeletedAffectedPaths;
211 void RemoveDeletedEntries(
212 SdfPathVector *removedAffectedPrimPaths =
nullptr,
213 SdfPathVector *removedDependedOnPrimPaths =
nullptr);
219HdDependencyForwardingSceneIndex::_VisitedNode::Hash()
const
224PXR_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.