24 #ifndef PXR_IMAGING_HD_PRIM_TYPE_INDEX_H
25 #define PXR_IMAGING_HD_PRIM_TYPE_INDEX_H
28 #include "pxr/imaging/hd/types.h"
29 #include "pxr/imaging/hd/sortedIds.h"
31 #include "pxr/usd/sdf/path.h"
35 #include <unordered_map>
37 PXR_NAMESPACE_OPEN_SCOPE
40 class HdRenderDelegate;
44 using HdSceneDelegatePtrVector = std::vector<HdSceneDelegate*>;
49 template <
class PrimType>
50 class Hd_PrimTypeIndex {
79 void InsertPrim(
const TfToken &typeId,
83 HdRenderDelegate *renderDelegate);
90 void RemovePrim(
const TfToken &typeId,
93 HdRenderDelegate *renderDelegate);
102 void RemoveSubtree(
const SdfPath &root,
105 HdRenderDelegate *renderDelegate);
110 PrimType *GetPrim(
const TfToken &typeId,
121 PrimType *GetFallbackPrim(
TfToken const &typeId)
const;
129 void GetPrimSubtree(
const TfToken &typeId,
131 SdfPathVector *outPaths);
141 bool CreateFallbackPrims(HdRenderDelegate *renderDelegate);
148 void DestroyFallbackPrims(HdRenderDelegate *renderDelegate);
162 const HdSceneDelegatePtrVector& GetSceneDelegatesForDirtyPrims();
170 typedef std::unordered_map<SdfPath, _PrimInfo, SdfPath::Hash> _PrimMap;
172 struct _PrimTypeEntry
175 Hd_SortedIds primIds;
176 PrimType *fallbackPrim;
181 , fallbackPrim(nullptr)
186 typedef std::unordered_map<TfToken, size_t, TfToken::HashFunctor> _TypeIndex;
188 typedef std::vector<_PrimTypeEntry> _PrimTypeList;
190 _PrimTypeList _entries;
192 HdSceneDelegatePtrVector _dirtyPrimDelegates;
199 HdDirtyBits initialDirtyState);
209 HdDirtyBits dirtyBits);
211 static PrimType *_RenderDelegateCreatePrim(HdRenderDelegate *renderDelegate,
214 static PrimType *_RenderDelegateCreateFallbackPrim(
215 HdRenderDelegate *renderDelegate,
218 static void _RenderDelegateDestroyPrim(HdRenderDelegate *renderDelegate,
222 Hd_PrimTypeIndex(
const Hd_PrimTypeIndex &) =
delete;
223 Hd_PrimTypeIndex &operator =(
const Hd_PrimTypeIndex &) =
delete;
226 PXR_NAMESPACE_CLOSE_SCOPE
228 #endif // PXR_IMAGING_HD_PRIM_TYPE_INDEX_H
Tracks changes from the HdSceneDelegate, providing invalidation cues to the render engine...
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
Token for efficient comparison, assignment, and hashing of known strings.
Adapter class providing data exchange with the client scene graph.
std::vector< TfToken > TfTokenVector
Convenience types.
A path value used to locate objects in layers or scenegraphs.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...