Loading...
Searching...
No Matches
primIdSceneIndex.h
1//
2// Copyright 2026 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_HDSI_PRIM_ID_SCENE_INDEX_H
8#define PXR_IMAGING_HDSI_PRIM_ID_SCENE_INDEX_H
9
10#include "pxr/imaging/hdsi/api.h"
11
12#include "pxr/imaging/hd/filteringSceneIndex.h"
13
14PXR_NAMESPACE_OPEN_SCOPE
15
16namespace HdsiPrimIdSceneIndex_Impl
17{
18class _PrimIdInfo;
19using _PrimIdInfoSharedPtr = std::shared_ptr<_PrimIdInfo>;
20}
21
23
40{
41public:
44 static HdsiPrimIdSceneIndexRefPtr New(
45 HdSceneIndexBaseRefPtr const &inputScene) {
46 return TfCreateRefPtr(
47 new HdsiPrimIdSceneIndex(inputScene));
48 }
49
50 HDSI_API
51 ~HdsiPrimIdSceneIndex() override;
52
53 HDSI_API
54 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
55
56 HDSI_API
57 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
58
59protected:
60 HDSI_API
62 HdSceneIndexBaseRefPtr const &inputScene);
63
64 void _PrimsAdded(
65 const HdSceneIndexBase &sender,
66 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
67
68 void _PrimsRemoved(
69 const HdSceneIndexBase &sender,
70 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
71
72 void _PrimsDirtied(
73 const HdSceneIndexBase &sender,
74 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
75
76private:
77 // State for this scene index.
78 HdsiPrimIdSceneIndex_Impl::_PrimIdInfoSharedPtr const _primIdInfo;
79
80 // Prim-level container ({ sceneGlobals : { primId : <reverse table> } })
81 // overlaid on the root prim.
82 HdContainerDataSourceHandle const _rootPrimOverlayDataSource;
83};
84
85PXR_NAMESPACE_CLOSE_SCOPE
86
87#endif
Abstract interface to scene data.
Definition sceneIndex.h:55
An abstract base class for a filtering scene index that observes a single input scene index.
A filtering scene index assigning an id to each imagable prim.
static HdsiPrimIdSceneIndexRefPtr New(HdSceneIndexBaseRefPtr const &inputScene)
Creates a new prim id scene index.
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
#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:36