Loading...
Searching...
No Matches
sceneGlobalsSceneIndex.h
1//
2// Copyright 2023 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_SCENE_GLOBALS_SCENE_INDEX_H
8#define PXR_IMAGING_HDSI_SCENE_GLOBALS_SCENE_INDEX_H
9
10#include "pxr/imaging/hdsi/api.h"
11
12#include "pxr/imaging/hd/filteringSceneIndex.h"
13#include "pxr/usd/sdf/path.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
18
19// undefined -> 2 : Make SGSI a filtering scene index.
20#define HDSI_SGSI_API_VERSION 2
21
28{
29public:
30 HDSI_API
31 static HdsiSceneGlobalsSceneIndexRefPtr
32 New(const HdSceneIndexBaseRefPtr &inputSceneIndex);
33
34 // ------------------------------------------------------------------------
35 // Public (non-virtual) API
36 // ------------------------------------------------------------------------
37
41 HDSI_API
43
47 HDSI_API
49
51 HDSI_API
52 void SetCurrentFrame(const double &);
53
54 // ------------------------------------------------------------------------
55 // Satisfying HdSceneIndexBase
56 // ------------------------------------------------------------------------
57 HDSI_API
59 GetPrim(const SdfPath &primPath) const override final;
60
61 HDSI_API
62 SdfPathVector
63 GetChildPrimPaths(const SdfPath &primPath) const override final;
64
65protected:
66 HDSI_API
67 HdsiSceneGlobalsSceneIndex(const HdSceneIndexBaseRefPtr &inputSceneIndex);
68
69 // ------------------------------------------------------------------------
70 // Satisfying HdSingleInputFilteringSceneIndexBase
71 // ------------------------------------------------------------------------
72 HDSI_API
73 void _PrimsAdded(
74 const HdSceneIndexBase &sender,
75 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
76
77 HDSI_API
78 void _PrimsRemoved(
79 const HdSceneIndexBase &sender,
80 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
81
82 HDSI_API
83 void _PrimsDirtied(
84 const HdSceneIndexBase &sender,
85 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
86
87private:
88 friend class _SceneGlobalsDataSource;
89
90 SdfPath _activeRenderPassPrimPath;
91 SdfPath _activeRenderSettingsPrimPath;
92 double _time = std::numeric_limits<double>::quiet_NaN();
93};
94
95PXR_NAMESPACE_CLOSE_SCOPE
96
97#endif //PXR_IMAGING_HDSI_SCENE_GLOBALS_SCENE_INDEX_H
Abstract interface to scene data.
Definition: sceneIndex.h:48
An abstract base class for a filtering scene index that observes a single input scene index.
Scene index that populates a "sceneGlobals" data source as modeled by HdSceneGlobalsSchema and provid...
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override final
Returns a pair of (prim type, datasource) for the object at primPath.
HDSI_API void SetActiveRenderSettingsPrimPath(const SdfPath &)
Caches the provided path and notifies any observers when the active render settings prim path is modi...
HDSI_API void SetActiveRenderPassPrimPath(const SdfPath &)
Caches the provided path and notifies any observers when the active render pass prim path is modified...
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:274
#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:35