Loading...
Searching...
No Matches
backPlateSceneIndex.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_BACK_PLATE_SCENE_INDEX_H
8#define PXR_IMAGING_HDSI_BACK_PLATE_SCENE_INDEX_H
9
10#include "pxr/imaging/hdsi/api.h"
11#include "pxr/imaging/hd/sceneIndex.h"
12#include "pxr/imaging/hd/filteringSceneIndex.h"
13
14#include <unordered_set>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
19
31{
32public:
33 HDSI_API
34 static HdsiBackPlateSceneIndexRefPtr
35 New(const HdSceneIndexBaseRefPtr &inputSceneIndex);
36
37 HDSI_API
38 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override final;
39
40 HDSI_API
41 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override final;
42
43protected:
44 HDSI_API
45 void _PrimsAdded(
46 const HdSceneIndexBase &sender,
47 const HdSceneIndexObserver::AddedPrimEntries &entries) override final;
48
49 HDSI_API
50 void _PrimsRemoved(
51 const HdSceneIndexBase &sender,
52 const HdSceneIndexObserver::RemovedPrimEntries &entries) override final;
53
54 HDSI_API
55 void _PrimsDirtied(
56 const HdSceneIndexBase &sender,
57 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override final;
58
59 HDSI_API
61 const HdSceneIndexBaseRefPtr &inputSceneIndex);
62
63private:
64 void
65 _RemoveBackPlateChildren(
66 const SdfPath &primPath,
67 SdfPathSet * const removedBackPlatePrims);
68 void
69 _AddBackPlateChildren(
70 const SdfPath &primPath,
71 SdfPathSet * const addedBackPlatePrims);
72 void
73 _DirtyBackPlateChildren(
74 const SdfPath &primPath,
76 dirtiedBackPlatePrims);
77
79 _GetMeshOrMaterialSiPrim(
80 const SdfPath &plateInstancePath,
81 const TfToken &plateChildType) const;
82
83 bool
84 _IsBackPlateInMap(
85 const SdfPath &platePath) const;
86
87 using _BackPlates = std::unordered_set<TfToken,TfToken::HashFunctor>;
88 using _CameraToBackPlatesMap = std::map<SdfPath, _BackPlates>;
89
90 // Maps the camera prim path to all the names of the back plate instances
91 // associated with it.
92 _CameraToBackPlatesMap _cameraToBackPlates;
93};
94
95PXR_NAMESPACE_CLOSE_SCOPE
96
97#endif //PXR_IMAGING_HDSI_BACK_PLATE_SCENE_INDEX_H
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.
The back plate scene index converts back plate prims into mesh and material prims that align with the...
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override final
Returns a pair of (prim type, datasource).
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override final
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
Token for efficient comparison, assignment, and hashing of known strings.
Definition token.h:71
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition declarePtrs.h:72
Small struct representing a 'prim' in the Hydra scene index.
Definition sceneIndex.h:36