Loading...
Searching...
No Matches
retainedSceneIndex.h
1//
2// Copyright 2021 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_RETAINED_SCENE_INDEX_H
8#define PXR_IMAGING_HD_RETAINED_SCENE_INDEX_H
9
10#include "pxr/pxr.h"
11
12#include "pxr/usd/sdf/pathTable.h"
13
14#include "pxr/imaging/hd/sceneIndex.h"
15
16PXR_NAMESPACE_OPEN_SCOPE
17
20
27{
28public:
29
31 HD_API
32 static HdRetainedSceneIndexRefPtr New() {
33 return TfCreateRefPtr(new HdRetainedSceneIndex);
34 }
35
36 // ------------------------------------------------------------------------
37
38 struct AddedPrimEntry
39 {
40 SdfPath primPath;
41 TfToken primType;
42 HdContainerDataSourceHandle dataSource;
43 };
44
45 using AddedPrimEntries = std::vector<AddedPrimEntry>;
46
51 HD_API
52 virtual void AddPrims(const AddedPrimEntries &entries);
53
56 HD_API
57 virtual void RemovePrims(
59
64 HD_API
65 virtual void DirtyPrims(
67
68 // ------------------------------------------------------------------------
69 // HdSceneIndexBase implementations.
70
71 HD_API
72 HdSceneIndexPrim GetPrim(const SdfPath & primPath) const override;
73
74 HD_API
75 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
76
77protected:
78
79 HD_API
81
82private:
83
84 struct _PrimEntry
85 {
87 };
88
89 using _PrimEntryTable = SdfPathTable<_PrimEntry>;
90 _PrimEntryTable _entries;
91
92};
93
94PXR_NAMESPACE_CLOSE_SCOPE
95
96#endif // PXR_IMAGING_HD_RETAINED_SCENE_INDEX_H
Concrete scene container which can be externally populated and dirtied.
static HD_API HdRetainedSceneIndexRefPtr New()
Creates a new retained scene index.
HD_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
virtual HD_API void AddPrims(const AddedPrimEntries &entries)
Add a prim to the retained scene index.
virtual HD_API void RemovePrims(const HdSceneIndexObserver::RemovedPrimEntries &entries)
Removes a prim subtree from the retained scene index.
virtual HD_API void DirtyPrims(const HdSceneIndexObserver::DirtiedPrimEntries &entries)
Invalidates prim data in the retained scene index.
HD_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
Abstract interface to scene data.
Definition: sceneIndex.h:54
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
A mapping from SdfPath to MappedType, somewhat similar to map<SdfPath, MappedType> and TfHashMap<SdfP...
Definition: pathTable.h:66
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
Small struct representing a 'prim' in the Hydra scene index.
Definition: sceneIndex.h:35