Loading...
Searching...
No Matches
sceneGlobalsSchema.h
Go to the documentation of this file.
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//
8
9/* ************************************************************************** */
10/* ** ** */
11/* ** This file is generated by a script. ** */
12/* ** ** */
13/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14/* ** Edit hdSchemaDefs.py instead to make changes. ** */
15/* ** ** */
16/* ************************************************************************** */
17
18#ifndef PXR_IMAGING_HD_SCENE_GLOBALS_SCHEMA_H
19#define PXR_IMAGING_HD_SCENE_GLOBALS_SCHEMA_H
20
22
23#include "pxr/imaging/hd/api.h"
24
25#include "pxr/imaging/hd/schema.h"
26
27// --(BEGIN CUSTOM CODE: Includes)--
28#include "pxr/usd/sdf/path.h"
29#include "pxr/imaging/hd/sceneIndex.h"
30// --(END CUSTOM CODE: Includes)--
31
32PXR_NAMESPACE_OPEN_SCOPE
33
34// --(BEGIN CUSTOM CODE: Declares)--
35// --(END CUSTOM CODE: Declares)--
36
37#define HD_SCENE_GLOBALS_SCHEMA_TOKENS \
38 (sceneGlobals) \
39 (activeRenderPassPrim) \
40 (activeRenderSettingsPrim) \
41 (startTimeCode) \
42 (endTimeCode) \
43 (currentFrame) \
44
45TF_DECLARE_PUBLIC_TOKENS(HdSceneGlobalsSchemaTokens, HD_API,
46 HD_SCENE_GLOBALS_SCHEMA_TOKENS);
47
48//-----------------------------------------------------------------------------
49
50// The HdSceneGlobalsSchema encapsulates "global" state to orchestrate a
51// render. It currently houses the active render settings and pass prim paths
52// that describe the information necessary to generate images from a single
53// invocation of a renderer, and the active time sample range and current
54// frame number that may be relevant to downstream scene indices (e.g.
55// procedural evaluation).
56//
57// We shall use the convention of a container data source at the root prim of
58// the scene index that is populated with this global state. The renderer and
59// downstream scene indices can query it to configure their behavior as
60// necessary.
61//
62
63class HdSceneGlobalsSchema : public HdSchema
64{
65public:
68
69 HdSceneGlobalsSchema(HdContainerDataSourceHandle container)
70 : HdSchema(container) {}
71
77 HD_API
78 static HdSceneGlobalsSchema GetFromParent(
79 const HdContainerDataSourceHandle &fromParentContainer);
80
82
83// --(BEGIN CUSTOM CODE: Schema Methods)--
84
91 HD_API
92 static HdSceneGlobalsSchema
93 GetFromSceneIndex(
94 const HdSceneIndexBaseRefPtr &si);
95
98 static const SdfPath&
99 GetDefaultPrimPath() {
101 }
102
103// --(END CUSTOM CODE: Schema Methods)--
104
107
108 HD_API
109 HdPathDataSourceHandle GetActiveRenderPassPrim() const;
110
111 HD_API
112 HdPathDataSourceHandle GetActiveRenderSettingsPrim() const;
113
114 HD_API
115 HdDoubleDataSourceHandle GetStartTimeCode() const;
116
117 HD_API
118 HdDoubleDataSourceHandle GetEndTimeCode() const;
119
120 HD_API
121 HdDoubleDataSourceHandle GetCurrentFrame() const;
122
124
127
130 HD_API
131 static const TfToken &GetSchemaToken();
132
135 HD_API
136 static const HdDataSourceLocator &GetDefaultLocator();
137
139
148
150 HD_API
151 static const HdDataSourceLocator &GetActiveRenderPassPrimLocator();
152
154 HD_API
155 static const HdDataSourceLocator &GetActiveRenderSettingsPrimLocator();
156
158 HD_API
159 static const HdDataSourceLocator &GetStartTimeCodeLocator();
160
162 HD_API
163 static const HdDataSourceLocator &GetEndTimeCodeLocator();
164
166 HD_API
167 static const HdDataSourceLocator &GetCurrentFrameLocator();
169
172
180 HD_API
181 static HdContainerDataSourceHandle
182 BuildRetained(
183 const HdPathDataSourceHandle &activeRenderPassPrim,
184 const HdPathDataSourceHandle &activeRenderSettingsPrim,
185 const HdDoubleDataSourceHandle &startTimeCode,
186 const HdDoubleDataSourceHandle &endTimeCode,
187 const HdDoubleDataSourceHandle &currentFrame
188 );
189
197 {
198 public:
199 HD_API
200 Builder &SetActiveRenderPassPrim(
201 const HdPathDataSourceHandle &activeRenderPassPrim);
202 HD_API
203 Builder &SetActiveRenderSettingsPrim(
204 const HdPathDataSourceHandle &activeRenderSettingsPrim);
205 HD_API
206 Builder &SetStartTimeCode(
207 const HdDoubleDataSourceHandle &startTimeCode);
208 HD_API
209 Builder &SetEndTimeCode(
210 const HdDoubleDataSourceHandle &endTimeCode);
211 HD_API
212 Builder &SetCurrentFrame(
213 const HdDoubleDataSourceHandle &currentFrame);
214
216 HD_API
217 HdContainerDataSourceHandle Build();
218
219 private:
220 HdPathDataSourceHandle _activeRenderPassPrim;
221 HdPathDataSourceHandle _activeRenderSettingsPrim;
222 HdDoubleDataSourceHandle _startTimeCode;
223 HdDoubleDataSourceHandle _endTimeCode;
224 HdDoubleDataSourceHandle _currentFrame;
225
226 };
227
229};
230
231PXR_NAMESPACE_CLOSE_SCOPE
232
233#endif
Represents an object that can identify the location of a data source.
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:26
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:81