HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderProductSchema.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 //
24 ////////////////////////////////////////////////////////////////////////
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 hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_IMAGING_HD_RENDER_PRODUCT_SCHEMA_H
36 #define PXR_IMAGING_HD_RENDER_PRODUCT_SCHEMA_H
37 
38 /// \file
39 
40 #include "pxr/imaging/hd/api.h"
42 
43 #include "pxr/imaging/hd/schema.h"
44 
45 // --(BEGIN CUSTOM CODE: Includes)--
46 // --(END CUSTOM CODE: Includes)--
47 
48 // --(BEGIN CUSTOM CODE: Includes)--
49 // --(END CUSTOM CODE: Includes)--
50 
52 
53 // --(BEGIN CUSTOM CODE: Declares)--
54 // --(END CUSTOM CODE: Declares)--
55 
56 #define HD_RENDER_PRODUCT_SCHEMA_TOKENS \
57  (renderProduct) \
58  (path) \
59  (type) \
60  (name) \
61  (resolution) \
62  (renderVars) \
63  (cameraPrim) \
64  (pixelAspectRatio) \
65  (aspectRatioConformPolicy) \
66  (apertureSize) \
67  (dataWindowNDC) \
68  (disableMotionBlur) \
69  (disableDepthOfField) \
70  (namespacedSettings) \
71 
72 TF_DECLARE_PUBLIC_TOKENS(HdRenderProductSchemaTokens, HD_API,
74 
75 //-----------------------------------------------------------------------------
76 
77 
79 {
80 public:
81  /// \name Schema retrieval
82  /// @{
83 
84  HdRenderProductSchema(HdContainerDataSourceHandle container)
85  : HdSchema(container) {}
86 
87  /// Retrieves a container data source with the schema's default name token
88  /// "renderProduct" from the parent container and constructs a
89  /// HdRenderProductSchema instance.
90  /// Because the requested container data source may not exist, the result
91  /// should be checked with IsDefined() or a bool comparison before use.
92  HD_API
94  const HdContainerDataSourceHandle &fromParentContainer);
95 
96  /// @}
97 
98 // --(BEGIN CUSTOM CODE: Schema Methods)--
99 // --(END CUSTOM CODE: Schema Methods)--
100 
101  /// \name Member accessor
102  /// @{
103 
104  HD_API
106 
107  HD_API
109 
110  HD_API
112 
113  HD_API
115 
116  HD_API
118 
119  HD_API
121 
122  HD_API
124 
125  HD_API
127 
128  HD_API
130 
131  HD_API
133 
134  HD_API
136 
137  HD_API
139 
140  HD_API
141  HdContainerDataSourceHandle GetNamespacedSettings();
142 
143  /// @}
144 
145  /// \name Schema location
146  /// @{
147 
148  /// Returns a token where the container representing this schema is found in
149  /// a container by default.
150  HD_API
151  static const TfToken &GetSchemaToken();
152 
153  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
154  /// where the container representing this schema is found by default.
155  HD_API
156  static const HdDataSourceLocator &GetDefaultLocator();
157 
158  /// @}
159 
160  /// \name Data source locators for members
161  ///
162  /// The following methods return an HdDataSourceLocator (relative to the
163  /// prim-level data source) where the data source for a member can be found.
164  ///
165  /// This is often useful for checking intersection against the
166  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
167  /// @{
168 
169  /// Prim-level relative data source locator to locate resolution.
170  HD_API
172 
173  /// Prim-level relative data source locator to locate renderVars.
174  HD_API
176 
177  /// Prim-level relative data source locator to locate namespacedSettings.
178  HD_API
180  /// @}
181 
182  /// \name Schema construction
183  /// @{
184 
185  /// \deprecated Use Builder instead.
186  ///
187  /// Builds a container data source which includes the provided child data
188  /// sources. Parameters with nullptr values are excluded. This is a
189  /// low-level interface. For cases in which it's desired to define
190  /// the container with a sparse set of child fields, the Builder class
191  /// is often more convenient and readable.
192  HD_API
193  static HdContainerDataSourceHandle
199  const HdVectorDataSourceHandle &renderVars,
200  const HdPathDataSourceHandle &cameraPrim,
203  const HdVec2fDataSourceHandle &apertureSize,
206  const HdBoolDataSourceHandle &disableDepthOfField,
207  const HdContainerDataSourceHandle &namespacedSettings
208  );
209 
210  /// \class HdRenderProductSchema::Builder
211  ///
212  /// Utility class for setting sparse sets of child data source fields to be
213  /// filled as arguments into BuildRetained. Because all setter methods
214  /// return a reference to the instance, this can be used in the "builder
215  /// pattern" form.
216  class Builder
217  {
218  public:
219  HD_API
220  Builder &SetPath(
222  HD_API
223  Builder &SetType(
225  HD_API
226  Builder &SetName(
228  HD_API
231  HD_API
233  const HdVectorDataSourceHandle &renderVars);
234  HD_API
236  const HdPathDataSourceHandle &cameraPrim);
237  HD_API
240  HD_API
243  HD_API
245  const HdVec2fDataSourceHandle &apertureSize);
246  HD_API
249  HD_API
252  HD_API
254  const HdBoolDataSourceHandle &disableDepthOfField);
255  HD_API
257  const HdContainerDataSourceHandle &namespacedSettings);
258 
259  /// Returns a container data source containing the members set thus far.
260  HD_API
261  HdContainerDataSourceHandle Build();
262 
263  private:
267  HdVec2iDataSourceHandle _resolution;
268  HdVectorDataSourceHandle _renderVars;
269  HdPathDataSourceHandle _cameraPrim;
270  HdFloatDataSourceHandle _pixelAspectRatio;
271  HdTokenDataSourceHandle _aspectRatioConformPolicy;
272  HdVec2fDataSourceHandle _apertureSize;
273  HdVec4fDataSourceHandle _dataWindowNDC;
274  HdBoolDataSourceHandle _disableMotionBlur;
275  HdBoolDataSourceHandle _disableDepthOfField;
276  HdContainerDataSourceHandle _namespacedSettings;
277 
278  };
279 
280  /// @}
281 };
282 
284 
285 #endif
static HD_API const HdDataSourceLocator & GetResolutionLocator()
Prim-level relative data source locator to locate resolution.
static HD_API const HdDataSourceLocator & GetNamespacedSettingsLocator()
Prim-level relative data source locator to locate namespacedSettings.
HD_API HdVec2fDataSourceHandle GetApertureSize()
HdFloatDataSource::Handle HdFloatDataSourceHandle
static HD_API const TfToken & GetSchemaToken()
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
HD_API Builder & SetDisableMotionBlur(const HdBoolDataSourceHandle &disableMotionBlur)
HD_API Builder & SetType(const HdTokenDataSourceHandle &type)
HD_API Builder & SetRenderVars(const HdVectorDataSourceHandle &renderVars)
#define HD_API
Definition: api.h:40
HdVec4fDataSource::Handle HdVec4fDataSourceHandle
HUSD_API const char * aspectRatioConformPolicy()
static HD_API HdRenderProductSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetName(const HdTokenDataSourceHandle &name)
HD_API HdVec2iDataSourceHandle GetResolution()
HD_API HdBoolDataSourceHandle GetDisableDepthOfField()
#define HD_RENDER_PRODUCT_SCHEMA_TOKENS
static HD_API const HdDataSourceLocator & GetDefaultLocator()
Definition: token.h:87
static HD_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &path, const HdTokenDataSourceHandle &type, const HdTokenDataSourceHandle &name, const HdVec2iDataSourceHandle &resolution, const HdVectorDataSourceHandle &renderVars, const HdPathDataSourceHandle &cameraPrim, const HdFloatDataSourceHandle &pixelAspectRatio, const HdTokenDataSourceHandle &aspectRatioConformPolicy, const HdVec2fDataSourceHandle &apertureSize, const HdVec4fDataSourceHandle &dataWindowNDC, const HdBoolDataSourceHandle &disableMotionBlur, const HdBoolDataSourceHandle &disableDepthOfField, const HdContainerDataSourceHandle &namespacedSettings)
HdBoolDataSource::Handle HdBoolDataSourceHandle
HdVec2fDataSource::Handle HdVec2fDataSourceHandle
HdRenderProductSchema(HdContainerDataSourceHandle container)
HD_API Builder & SetDisableDepthOfField(const HdBoolDataSourceHandle &disableDepthOfField)
HD_API Builder & SetResolution(const HdVec2iDataSourceHandle &resolution)
HD_API Builder & SetCameraPrim(const HdPathDataSourceHandle &cameraPrim)
HUSD_API const char * resolution()
GLuint const GLchar * name
Definition: glcorearb.h:786
HD_API HdVec4fDataSourceHandle GetDataWindowNDC()
HD_API Builder & SetNamespacedSettings(const HdContainerDataSourceHandle &namespacedSettings)
HUSD_API const char * pixelAspectRatio()
HD_API HdContainerDataSourceHandle GetNamespacedSettings()
HD_API HdBoolDataSourceHandle GetDisableMotionBlur()
HD_API Builder & SetApertureSize(const HdVec2fDataSourceHandle &apertureSize)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HD_API Builder & SetPath(const HdPathDataSourceHandle &path)
HD_API HdPathDataSourceHandle GetCameraPrim()
HD_API HdTokenDataSourceHandle GetAspectRatioConformPolicy()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetDataWindowNDC(const HdVec4fDataSourceHandle &dataWindowNDC)
HD_API HdTokenDataSourceHandle GetType()
HdVec2iDataSource::Handle HdVec2iDataSourceHandle
HUSD_API const char * dataWindowNDC()
HD_API HdPathDataSourceHandle GetPath()
HD_API HdTokenDataSourceHandle GetName()
TF_DECLARE_PUBLIC_TOKENS(HdRenderProductSchemaTokens, HD_API, HD_RENDER_PRODUCT_SCHEMA_TOKENS)
HD_API Builder & SetAspectRatioConformPolicy(const HdTokenDataSourceHandle &aspectRatioConformPolicy)
type
Definition: core.h:1059
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdPathDataSource::Handle HdPathDataSourceHandle
HD_API HdFloatDataSourceHandle GetPixelAspectRatio()
static HD_API const HdDataSourceLocator & GetRenderVarsLocator()
Prim-level relative data source locator to locate renderVars.
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetPixelAspectRatio(const HdFloatDataSourceHandle &pixelAspectRatio)
HD_API HdRenderVarVectorSchema GetRenderVars()
HUSD_API const char * disableMotionBlur()