Loading...
Searching...
No Matches
legacyGeomSubsetSceneIndex.h
1//
2// Copyright 2024 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_LEGACY_GEOM_SUBSET_SCENE_INDEX_H
8#define PXR_IMAGING_HD_LEGACY_GEOM_SUBSET_SCENE_INDEX_H
9
10#include "pxr/imaging/hd/api.h"
11#include "pxr/imaging/hd/filteringSceneIndex.h"
12#include "pxr/imaging/hd/sceneIndex.h"
13#include "pxr/imaging/hd/sceneIndexObserver.h"
14
15#include "pxr/usd/sdf/path.h"
16
18
19#include "pxr/pxr.h"
20
21#include <map>
22
23PXR_NAMESPACE_OPEN_SCOPE
24
26
43{
44public:
45 HD_API
46 static HdLegacyGeomSubsetSceneIndexRefPtr New(
47 const HdSceneIndexBaseRefPtr& inputSceneIndex);
48
49 HD_API
51
52 HD_API
53 HdSceneIndexPrim GetPrim(const SdfPath& primPath) const override;
54
55 HD_API
56 SdfPathVector GetChildPrimPaths(const SdfPath& primPath) const override;
57
58protected:
60 const HdSceneIndexBaseRefPtr& inputSceneIndex);
61
62 void _PrimsAdded(
63 const HdSceneIndexBase& sender,
64 const HdSceneIndexObserver::AddedPrimEntries& entries) override;
65
66 void _PrimsRemoved(
67 const HdSceneIndexBase& sender,
68 const HdSceneIndexObserver::RemovedPrimEntries& entries) override;
69
70 void _PrimsDirtied(
71 const HdSceneIndexBase& sender,
72 const HdSceneIndexObserver::DirtiedPrimEntries& entries) override;
73
74private:
75 static SdfPathVector
76 _ListDelegateSubsets(
77 const SdfPath& parentPath,
78 const HdSceneIndexPrim& parentPrim);
79
80 // Unordered map of parent path -> [subset paths...]
81 // XXX: Do not use SdfPathTable because we do not want it
82 // to implicitly include the extra ancestor paths.
83 std::map<SdfPath, SdfPathVector> _parentPrims;
84};
85
86PXR_NAMESPACE_CLOSE_SCOPE
87
88#endif // PXR_IMAGING_HD_LEGACY_GEOM_SUBSET_SCENE_INDEX_H
HdLegacyGeomSubsetSceneIndex.
HD_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
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
An abstract base class for a filtering scene index that observes a single input scene index.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Standard pointer typedefs.
#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