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 /* ** This file is generated by a script. Do not edit directly. Edit ** */
28 /* ** defs.py or the (*)Schema.template.h files to make changes. ** */
29 /* ************************************************************************** */
30 
31 #ifndef PXR_IMAGING_HD_RENDER_PRODUCT_SCHEMA_H
32 #define PXR_IMAGING_HD_RENDER_PRODUCT_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDRENDERPRODUCT_SCHEMA_TOKENS \
43  (renderProduct) \
44  (path) \
45  (type) \
46  (name) \
47  (resolution) \
48  (renderVars) \
49  (cameraPrim) \
50  (pixelAspectRatio) \
51  (aspectRatioConformPolicy) \
52  (apertureSize) \
53  (dataWindowNDC) \
54  (disableMotionBlur) \
55  (namespacedSettings) \
56 
57 TF_DECLARE_PUBLIC_TOKENS(HdRenderProductSchemaTokens, HD_API,
59 
60 //-----------------------------------------------------------------------------
61 
63 {
64 public:
65  HdRenderProductSchema(HdContainerDataSourceHandle container)
66  : HdSchema(container) {}
67 
68  //ACCESSORS
69 
70  HD_API
72  HD_API
74  HD_API
76  HD_API
78  HD_API
80  HD_API
82  HD_API
84  HD_API
86  HD_API
88  HD_API
90  HD_API
92  HD_API
93  HdContainerDataSourceHandle GetNamespacedSettings();
94 
95  // RETRIEVING AND CONSTRUCTING
96 
97  /// Builds a container data source which includes the provided child data
98  /// sources. Parameters with nullptr values are excluded. This is a
99  /// low-level interface. For cases in which it's desired to define
100  /// the container with a sparse set of child fields, the Builder class
101  /// is often more convenient and readable.
102  HD_API
103  static HdContainerDataSourceHandle
109  const HdVectorDataSourceHandle &renderVars,
110  const HdPathDataSourceHandle &cameraPrim,
113  const HdVec2fDataSourceHandle &apertureSize,
116  const HdContainerDataSourceHandle &namespacedSettings
117  );
118 
119  /// \class HdRenderProductSchema::Builder
120  ///
121  /// Utility class for setting sparse sets of child data source fields to be
122  /// filled as arguments into BuildRetained. Because all setter methods
123  /// return a reference to the instance, this can be used in the "builder
124  /// pattern" form.
125  class Builder
126  {
127  public:
128  HD_API
129  Builder &SetPath(
131  HD_API
132  Builder &SetType(
134  HD_API
135  Builder &SetName(
137  HD_API
140  HD_API
142  const HdVectorDataSourceHandle &renderVars);
143  HD_API
145  const HdPathDataSourceHandle &cameraPrim);
146  HD_API
149  HD_API
152  HD_API
154  const HdVec2fDataSourceHandle &apertureSize);
155  HD_API
158  HD_API
161  HD_API
163  const HdContainerDataSourceHandle &namespacedSettings);
164 
165  /// Returns a container data source containing the members set thus far.
166  HD_API
167  HdContainerDataSourceHandle Build();
168 
169  private:
173  HdVec2iDataSourceHandle _resolution;
174  HdVectorDataSourceHandle _renderVars;
175  HdPathDataSourceHandle _cameraPrim;
176  HdFloatDataSourceHandle _pixelAspectRatio;
177  HdTokenDataSourceHandle _aspectRatioConformPolicy;
178  HdVec2fDataSourceHandle _apertureSize;
179  HdVec4fDataSourceHandle _dataWindowNDC;
180  HdBoolDataSourceHandle _disableMotionBlur;
181  HdContainerDataSourceHandle _namespacedSettings;
182  };
183 
184  /// Retrieves a container data source with the schema's default name token
185  /// "renderProduct" from the parent container and constructs a
186  /// HdRenderProductSchema instance.
187  /// Because the requested container data source may not exist, the result
188  /// should be checked with IsDefined() or a bool comparison before use.
189  HD_API
191  const HdContainerDataSourceHandle &fromParentContainer);
192 
193  /// Returns a token where the container representing this schema is found in
194  /// a container by default.
195  HD_API
196  static const TfToken &GetSchemaToken();
197 
198  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
199  /// where the container representing this schema is found by default.
200  HD_API
201  static const HdDataSourceLocator &GetDefaultLocator();
202 
203 
204  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
205  /// where the resolution data source can be found.
206  /// This is often useful for checking intersection against the
207  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
208  HD_API
210 
211  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
212  /// where the rendervars data source can be found.
213  /// This is often useful for checking intersection against the
214  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
215  HD_API
217 
218  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
219  /// where the namespacedsettings data source can be found.
220  /// This is often useful for checking intersection against the
221  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
222  HD_API
224 
225 };
226 
228 
229 #endif
static HD_API const HdDataSourceLocator & GetResolutionLocator()
static HD_API const HdDataSourceLocator & GetNamespacedSettingsLocator()
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()
static HD_API const HdDataSourceLocator & GetDefaultLocator()
Definition: token.h:87
HdBoolDataSource::Handle HdBoolDataSourceHandle
HdVec2fDataSource::Handle HdVec2fDataSourceHandle
HdRenderProductSchema(HdContainerDataSourceHandle container)
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:1441
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)
TF_DECLARE_PUBLIC_TOKENS(HdRenderProductSchemaTokens, HD_API, HDRENDERPRODUCT_SCHEMA_TOKENS)
HD_API HdTokenDataSourceHandle GetType()
HdVec2iDataSource::Handle HdVec2iDataSourceHandle
HUSD_API const char * dataWindowNDC()
HD_API HdPathDataSourceHandle GetPath()
HD_API HdTokenDataSourceHandle GetName()
HD_API Builder & SetAspectRatioConformPolicy(const HdTokenDataSourceHandle &aspectRatioConformPolicy)
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 HdContainerDataSourceHandle &namespacedSettings)
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()
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetPixelAspectRatio(const HdFloatDataSourceHandle &pixelAspectRatio)
HD_API HdRenderVarVectorSchema GetRenderVars()
#define HDRENDERPRODUCT_SCHEMA_TOKENS
HUSD_API const char * disableMotionBlur()