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 terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
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_RENDER_PRODUCT_SCHEMA_H
19 #define PXR_IMAGING_HD_RENDER_PRODUCT_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
25 
26 #include "pxr/imaging/hd/schema.h"
27 
28 // --(BEGIN CUSTOM CODE: Includes)--
29 // --(END CUSTOM CODE: Includes)--
30 
31 // --(BEGIN CUSTOM CODE: Includes)--
32 // --(END CUSTOM CODE: Includes)--
33 
35 
36 // --(BEGIN CUSTOM CODE: Declares)--
37 // --(END CUSTOM CODE: Declares)--
38 
39 #define HD_RENDER_PRODUCT_SCHEMA_TOKENS \
40  (renderProduct) \
41  (path) \
42  (type) \
43  (name) \
44  (resolution) \
45  (renderVars) \
46  (cameraPrim) \
47  (pixelAspectRatio) \
48  (aspectRatioConformPolicy) \
49  (apertureSize) \
50  (dataWindowNDC) \
51  (disableMotionBlur) \
52  (disableDepthOfField) \
53  (namespacedSettings) \
54 
55 TF_DECLARE_PUBLIC_TOKENS(HdRenderProductSchemaTokens, HD_API,
57 
58 //-----------------------------------------------------------------------------
59 
60 
61 /// \class HdRenderProductSchema
62 ///
64 {
65 public:
66  /// \name Schema retrieval
67  /// @{
68 
69  HdRenderProductSchema(HdContainerDataSourceHandle container)
70  : HdSchema(container) {}
71 
72  /// Retrieves a container data source with the schema's default name token
73  /// "renderProduct" from the parent container and constructs a
74  /// HdRenderProductSchema instance.
75  /// Because the requested container data source may not exist, the result
76  /// should be checked with IsDefined() or a bool comparison before use.
77  HD_API
79  const HdContainerDataSourceHandle &fromParentContainer);
80 
81  /// @}
82 
83 // --(BEGIN CUSTOM CODE: Schema Methods)--
84 // --(END CUSTOM CODE: Schema Methods)--
85 
86  /// \name Member accessor
87  /// @{
88 
89  HD_API
91 
92  HD_API
94 
95  HD_API
97 
98  HD_API
100 
101  HD_API
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
126  HdContainerDataSourceHandle GetNamespacedSettings() const;
127 
128  /// @}
129 
130  /// \name Schema location
131  /// @{
132 
133  /// Returns a token where the container representing this schema is found in
134  /// a container by default.
135  HD_API
136  static const TfToken &GetSchemaToken();
137 
138  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
139  /// where the container representing this schema is found by default.
140  HD_API
141  static const HdDataSourceLocator &GetDefaultLocator();
142 
143  /// @}
144 
145  /// \name Data source locators for members
146  ///
147  /// The following methods return an HdDataSourceLocator (relative to the
148  /// prim-level data source) where the data source for a member can be found.
149  ///
150  /// This is often useful for checking intersection against the
151  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
152  /// @{
153 
154  /// Prim-level relative data source locator to locate resolution.
155  HD_API
157 
158  /// Prim-level relative data source locator to locate renderVars.
159  HD_API
161 
162  /// Prim-level relative data source locator to locate namespacedSettings.
163  HD_API
165  /// @}
166 
167  /// \name Schema construction
168  /// @{
169 
170  /// \deprecated Use Builder instead.
171  ///
172  /// Builds a container data source which includes the provided child data
173  /// sources. Parameters with nullptr values are excluded. This is a
174  /// low-level interface. For cases in which it's desired to define
175  /// the container with a sparse set of child fields, the Builder class
176  /// is often more convenient and readable.
177  HD_API
178  static HdContainerDataSourceHandle
184  const HdVectorDataSourceHandle &renderVars,
185  const HdPathDataSourceHandle &cameraPrim,
188  const HdVec2fDataSourceHandle &apertureSize,
191  const HdBoolDataSourceHandle &disableDepthOfField,
192  const HdContainerDataSourceHandle &namespacedSettings
193  );
194 
195  /// \class HdRenderProductSchema::Builder
196  ///
197  /// Utility class for setting sparse sets of child data source fields to be
198  /// filled as arguments into BuildRetained. Because all setter methods
199  /// return a reference to the instance, this can be used in the "builder
200  /// pattern" form.
201  class Builder
202  {
203  public:
204  HD_API
205  Builder &SetPath(
207  HD_API
208  Builder &SetType(
210  HD_API
211  Builder &SetName(
213  HD_API
216  HD_API
218  const HdVectorDataSourceHandle &renderVars);
219  HD_API
221  const HdPathDataSourceHandle &cameraPrim);
222  HD_API
225  HD_API
228  HD_API
230  const HdVec2fDataSourceHandle &apertureSize);
231  HD_API
234  HD_API
237  HD_API
239  const HdBoolDataSourceHandle &disableDepthOfField);
240  HD_API
242  const HdContainerDataSourceHandle &namespacedSettings);
243 
244  /// Returns a container data source containing the members set thus far.
245  HD_API
246  HdContainerDataSourceHandle Build();
247 
248  private:
252  HdVec2iDataSourceHandle _resolution;
253  HdVectorDataSourceHandle _renderVars;
254  HdPathDataSourceHandle _cameraPrim;
255  HdFloatDataSourceHandle _pixelAspectRatio;
256  HdTokenDataSourceHandle _aspectRatioConformPolicy;
257  HdVec2fDataSourceHandle _apertureSize;
258  HdVec4fDataSourceHandle _dataWindowNDC;
259  HdBoolDataSourceHandle _disableMotionBlur;
260  HdBoolDataSourceHandle _disableDepthOfField;
261  HdContainerDataSourceHandle _namespacedSettings;
262 
263  };
264 
265  /// @}
266 };
267 
269 
270 #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.
HdFloatDataSource::Handle HdFloatDataSourceHandle
static HD_API const TfToken & GetSchemaToken()
HD_API HdFloatDataSourceHandle GetPixelAspectRatio() const
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HD_API HdPathDataSourceHandle GetPath() const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
HD_API Builder & SetDisableMotionBlur(const HdBoolDataSourceHandle &disableMotionBlur)
HD_API HdRenderVarVectorSchema GetRenderVars() const
HD_API HdVec4fDataSourceHandle GetDataWindowNDC() const
HD_API Builder & SetType(const HdTokenDataSourceHandle &type)
HD_API Builder & SetRenderVars(const HdVectorDataSourceHandle &renderVars)
#define HD_API
Definition: api.h:23
HD_API HdBoolDataSourceHandle GetDisableMotionBlur() const
HdVec4fDataSource::Handle HdVec4fDataSourceHandle
HUSD_API const char * aspectRatioConformPolicy()
static HD_API HdRenderProductSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetName(const HdTokenDataSourceHandle &name)
#define HD_RENDER_PRODUCT_SCHEMA_TOKENS
static HD_API const HdDataSourceLocator & GetDefaultLocator()
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
Definition: token.h:70
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)
HD_API HdContainerDataSourceHandle GetNamespacedSettings() const
HD_API HdTokenDataSourceHandle GetAspectRatioConformPolicy() const
HD_API HdBoolDataSourceHandle GetDisableDepthOfField() const
HdBoolDataSource::Handle HdBoolDataSourceHandle
HdVec2fDataSource::Handle HdVec2fDataSourceHandle
HdRenderProductSchema(HdContainerDataSourceHandle container)
HD_API Builder & SetDisableDepthOfField(const HdBoolDataSourceHandle &disableDepthOfField)
HD_API HdVec2iDataSourceHandle GetResolution() const
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 Builder & SetNamespacedSettings(const HdContainerDataSourceHandle &namespacedSettings)
HUSD_API const char * pixelAspectRatio()
HD_API Builder & SetApertureSize(const HdVec2fDataSourceHandle &apertureSize)
HD_API Builder & SetPath(const HdPathDataSourceHandle &path)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API Builder & SetDataWindowNDC(const HdVec4fDataSourceHandle &dataWindowNDC)
HdVec2iDataSource::Handle HdVec2iDataSourceHandle
HD_API HdTokenDataSourceHandle GetName() const
HUSD_API const char * dataWindowNDC()
TF_DECLARE_PUBLIC_TOKENS(HdRenderProductSchemaTokens, HD_API, HD_RENDER_PRODUCT_SCHEMA_TOKENS)
HD_API Builder & SetAspectRatioConformPolicy(const HdTokenDataSourceHandle &aspectRatioConformPolicy)
HD_API HdTokenDataSourceHandle GetType() const
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdPathDataSource::Handle HdPathDataSourceHandle
HD_API HdVec2fDataSourceHandle GetApertureSize() const
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 HdPathDataSourceHandle GetCameraPrim() const
HUSD_API const char * disableMotionBlur()