Loading...
Searching...
No Matches
sceneGlobalsSchema.h
Go to the documentation of this file.
1//
2// Copyright 2023 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
25
26/* ************************************************************************** */
27/* ** ** */
28/* ** This file is generated by a script. ** */
29/* ** ** */
30/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31/* ** Edit hdSchemaDefs.py instead to make changes. ** */
32/* ** ** */
33/* ************************************************************************** */
34
35#ifndef PXR_IMAGING_HD_SCENE_GLOBALS_SCHEMA_H
36#define PXR_IMAGING_HD_SCENE_GLOBALS_SCHEMA_H
37
39
40#include "pxr/imaging/hd/api.h"
41
42#include "pxr/imaging/hd/schema.h"
43
44// --(BEGIN CUSTOM CODE: Includes)--
45#include "pxr/usd/sdf/path.h"
46#include "pxr/imaging/hd/sceneIndex.h"
47// --(END CUSTOM CODE: Includes)--
48
49PXR_NAMESPACE_OPEN_SCOPE
50
51// --(BEGIN CUSTOM CODE: Declares)--
52// --(END CUSTOM CODE: Declares)--
53
54#define HD_SCENE_GLOBALS_SCHEMA_TOKENS \
55 (sceneGlobals) \
56 (activeRenderPassPrim) \
57 (activeRenderSettingsPrim) \
58 (startTimeCode) \
59 (endTimeCode) \
60
61TF_DECLARE_PUBLIC_TOKENS(HdSceneGlobalsSchemaTokens, HD_API,
62 HD_SCENE_GLOBALS_SCHEMA_TOKENS);
63
64//-----------------------------------------------------------------------------
65
66// The HdSceneGlobalsSchema encapsulates "global" state to orchestrate a
67// render. It currently houses the active render settings prim path that
68// describes the information necessary to generate images from a single
69// invocation of a renderer, and the active time sample range that may be
70// relevant to downstream scene indices (e.g. procedural evaluation).
71//
72// We shall use the convention of a container data source at the root prim of
73// the scene index that is populated with this global state. The renderer and
74// downstream scene indices can query it to configure their behavior as
75// necessary.
76//
77
78class HdSceneGlobalsSchema : public HdSchema
79{
80public:
83
84 HdSceneGlobalsSchema(HdContainerDataSourceHandle container)
85 : HdSchema(container) {}
86
92 HD_API
93 static HdSceneGlobalsSchema GetFromParent(
94 const HdContainerDataSourceHandle &fromParentContainer);
95
97
98// --(BEGIN CUSTOM CODE: Schema Methods)--
99
106 HD_API
107 static HdSceneGlobalsSchema
108 GetFromSceneIndex(
109 const HdSceneIndexBaseRefPtr &si);
110
113 static const SdfPath&
114 GetDefaultPrimPath() {
116 }
117
118// --(END CUSTOM CODE: Schema Methods)--
119
122
123 HD_API
124 HdPathDataSourceHandle GetActiveRenderPassPrim() const;
125
126 HD_API
127 HdPathDataSourceHandle GetActiveRenderSettingsPrim() const;
128
129 HD_API
130 HdDoubleDataSourceHandle GetStartTimeCode() const;
131
132 HD_API
133 HdDoubleDataSourceHandle GetEndTimeCode() const;
134
136
139
142 HD_API
143 static const TfToken &GetSchemaToken();
144
147 HD_API
148 static const HdDataSourceLocator &GetDefaultLocator();
149
151
160
162 HD_API
163 static const HdDataSourceLocator &GetActiveRenderPassPrimLocator();
164
166 HD_API
167 static const HdDataSourceLocator &GetActiveRenderSettingsPrimLocator();
168
170 HD_API
171 static const HdDataSourceLocator &GetStartTimeCodeLocator();
172
174 HD_API
175 static const HdDataSourceLocator &GetEndTimeCodeLocator();
177
180
188 HD_API
189 static HdContainerDataSourceHandle
190 BuildRetained(
191 const HdPathDataSourceHandle &activeRenderPassPrim,
192 const HdPathDataSourceHandle &activeRenderSettingsPrim,
193 const HdDoubleDataSourceHandle &startTimeCode,
194 const HdDoubleDataSourceHandle &endTimeCode
195 );
196
204 {
205 public:
206 HD_API
207 Builder &SetActiveRenderPassPrim(
208 const HdPathDataSourceHandle &activeRenderPassPrim);
209 HD_API
210 Builder &SetActiveRenderSettingsPrim(
211 const HdPathDataSourceHandle &activeRenderSettingsPrim);
212 HD_API
213 Builder &SetStartTimeCode(
214 const HdDoubleDataSourceHandle &startTimeCode);
215 HD_API
216 Builder &SetEndTimeCode(
217 const HdDoubleDataSourceHandle &endTimeCode);
218
220 HD_API
221 HdContainerDataSourceHandle Build();
222
223 private:
224 HdPathDataSourceHandle _activeRenderPassPrim;
225 HdPathDataSourceHandle _activeRenderSettingsPrim;
226 HdDoubleDataSourceHandle _startTimeCode;
227 HdDoubleDataSourceHandle _endTimeCode;
228
229 };
230
232};
233
234PXR_NAMESPACE_CLOSE_SCOPE
235
236#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:43
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
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:88
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:98