HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderSettingsSchema.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_SETTINGS_SCHEMA_H
19 #define PXR_IMAGING_HD_RENDER_SETTINGS_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_SETTINGS_SCHEMA_TOKENS \
40  (renderSettings) \
41  (namespacedSettings) \
42  (active) \
43  (renderProducts) \
44  (includedPurposes) \
45  (materialBindingPurposes) \
46  (renderingColorSpace) \
47  (shutterInterval) \
48 
49 TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsSchemaTokens, HD_API,
51 
52 //-----------------------------------------------------------------------------
53 
54 
56 {
57 public:
58  /// \name Schema retrieval
59  /// @{
60 
61  HdRenderSettingsSchema(HdContainerDataSourceHandle container)
62  : HdSchema(container) {}
63 
64  /// Retrieves a container data source with the schema's default name token
65  /// "renderSettings" from the parent container and constructs a
66  /// HdRenderSettingsSchema instance.
67  /// Because the requested container data source may not exist, the result
68  /// should be checked with IsDefined() or a bool comparison before use.
69  HD_API
71  const HdContainerDataSourceHandle &fromParentContainer);
72 
73  /// @}
74 
75 // --(BEGIN CUSTOM CODE: Schema Methods)--
76 
77  /// This locator is to pass along dirtying of the currentFrame locator
78  /// on the Scene Globals Scene Index through the render Settings prim.
79  HD_API
80  static const HdDataSourceLocator &GetFrameLocator();
81 
82 // --(END CUSTOM CODE: Schema Methods)--
83 
84  /// \name Member accessor
85  /// @{
86 
87  HD_API
88  HdContainerDataSourceHandle GetNamespacedSettings() const;
89 
90  HD_API
92 
93  HD_API
95 
96  HD_API
98 
99  HD_API
101 
102  HD_API
104 
105  /// Frame-relative time interval representing the sampling window for data
106  /// relevant to motion blur. Renderers can use this interval when querying
107  /// time-sampled data (e.g., xforms, points, velocities, ...) to simulate
108  /// motion blur effects. Note: This closely relates to the (frame-
109  /// relative) shutter interval of a camera specified via shutter open and
110  /// close times and is expected to span the union of the shutter intervals
111  /// of cameras used in generating the render artifacts.
112  HD_API
114 
115  /// @}
116 
117  /// \name Schema location
118  /// @{
119 
120  /// Returns a token where the container representing this schema is found in
121  /// a container by default.
122  HD_API
123  static const TfToken &GetSchemaToken();
124 
125  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
126  /// where the container representing this schema is found by default.
127  HD_API
128  static const HdDataSourceLocator &GetDefaultLocator();
129 
130  /// @}
131 
132  /// \name Data source locators for members
133  ///
134  /// The following methods return an HdDataSourceLocator (relative to the
135  /// prim-level data source) where the data source for a member can be found.
136  ///
137  /// This is often useful for checking intersection against the
138  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
139  /// @{
140 
141  /// Prim-level relative data source locator to locate namespacedSettings.
142  HD_API
144 
145  /// Prim-level relative data source locator to locate active.
146  HD_API
147  static const HdDataSourceLocator &GetActiveLocator();
148 
149  /// Prim-level relative data source locator to locate renderProducts.
150  HD_API
152 
153  /// Prim-level relative data source locator to locate includedPurposes.
154  HD_API
156 
157  /// Prim-level relative data source locator to locate materialBindingPurposes.
158  HD_API
160 
161  /// Prim-level relative data source locator to locate renderingColorSpace.
162  HD_API
164 
165  /// Prim-level relative data source locator to locate shutterInterval.
166  HD_API
168  /// @}
169 
170  /// \name Schema construction
171  /// @{
172 
173  /// \deprecated Use Builder instead.
174  ///
175  /// Builds a container data source which includes the provided child data
176  /// sources. Parameters with nullptr values are excluded. This is a
177  /// low-level interface. For cases in which it's desired to define
178  /// the container with a sparse set of child fields, the Builder class
179  /// is often more convenient and readable.
180  HD_API
181  static HdContainerDataSourceHandle
183  const HdContainerDataSourceHandle &namespacedSettings,
185  const HdVectorDataSourceHandle &renderProducts,
186  const HdTokenArrayDataSourceHandle &includedPurposes,
187  const HdTokenArrayDataSourceHandle &materialBindingPurposes,
188  const HdTokenDataSourceHandle &renderingColorSpace,
189  const HdVec2dDataSourceHandle &shutterInterval
190  );
191 
192  /// \class HdRenderSettingsSchema::Builder
193  ///
194  /// Utility class for setting sparse sets of child data source fields to be
195  /// filled as arguments into BuildRetained. Because all setter methods
196  /// return a reference to the instance, this can be used in the "builder
197  /// pattern" form.
198  class Builder
199  {
200  public:
201  HD_API
203  const HdContainerDataSourceHandle &namespacedSettings);
204  HD_API
207  HD_API
209  const HdVectorDataSourceHandle &renderProducts);
210  HD_API
212  const HdTokenArrayDataSourceHandle &includedPurposes);
213  HD_API
215  const HdTokenArrayDataSourceHandle &materialBindingPurposes);
216  HD_API
218  const HdTokenDataSourceHandle &renderingColorSpace);
219  HD_API
221  const HdVec2dDataSourceHandle &shutterInterval);
222 
223  /// Returns a container data source containing the members set thus far.
224  HD_API
225  HdContainerDataSourceHandle Build();
226 
227  private:
228  HdContainerDataSourceHandle _namespacedSettings;
229  HdBoolDataSourceHandle _active;
230  HdVectorDataSourceHandle _renderProducts;
231  HdTokenArrayDataSourceHandle _includedPurposes;
232  HdTokenArrayDataSourceHandle _materialBindingPurposes;
233  HdTokenDataSourceHandle _renderingColorSpace;
234  HdVec2dDataSourceHandle _shutterInterval;
235 
236  };
237 
238  /// @}
239 };
240 
242 
243 #endif
#define HD_RENDER_SETTINGS_SCHEMA_TOKENS
HD_API Builder & SetActive(const HdBoolDataSourceHandle &active)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API const HdDataSourceLocator & GetFrameLocator()
HD_API Builder & SetShutterInterval(const HdVec2dDataSourceHandle &shutterInterval)
HD_API HdTokenDataSourceHandle GetRenderingColorSpace() const
HD_API HdContainerDataSourceHandle GetNamespacedSettings() const
#define HD_API
Definition: api.h:23
static HD_API HdContainerDataSourceHandle BuildRetained(const HdContainerDataSourceHandle &namespacedSettings, const HdBoolDataSourceHandle &active, const HdVectorDataSourceHandle &renderProducts, const HdTokenArrayDataSourceHandle &includedPurposes, const HdTokenArrayDataSourceHandle &materialBindingPurposes, const HdTokenDataSourceHandle &renderingColorSpace, const HdVec2dDataSourceHandle &shutterInterval)
HdRenderSettingsSchema(HdContainerDataSourceHandle container)
static HD_API const HdDataSourceLocator & GetRenderProductsLocator()
Prim-level relative data source locator to locate renderProducts.
static HD_API const TfToken & GetSchemaToken()
TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsSchemaTokens, HD_API, HD_RENDER_SETTINGS_SCHEMA_TOKENS)
HD_API Builder & SetRenderingColorSpace(const HdTokenDataSourceHandle &renderingColorSpace)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
static HD_API const HdDataSourceLocator & GetIncludedPurposesLocator()
Prim-level relative data source locator to locate includedPurposes.
Definition: token.h:70
static HD_API const HdDataSourceLocator & GetRenderingColorSpaceLocator()
Prim-level relative data source locator to locate renderingColorSpace.
static HD_API const HdDataSourceLocator & GetMaterialBindingPurposesLocator()
Prim-level relative data source locator to locate materialBindingPurposes.
HdBoolDataSource::Handle HdBoolDataSourceHandle
static HD_API const HdDataSourceLocator & GetActiveLocator()
Prim-level relative data source locator to locate active.
that also have some descendant prim *whose name begins with which in turn has a child named baz where *the predicate active
HD_API Builder & SetMaterialBindingPurposes(const HdTokenArrayDataSourceHandle &materialBindingPurposes)
HD_API HdBoolDataSourceHandle GetActive() const
static HD_API const HdDataSourceLocator & GetShutterIntervalLocator()
Prim-level relative data source locator to locate shutterInterval.
HD_API HdTokenArrayDataSourceHandle GetIncludedPurposes() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
HD_API Builder & SetIncludedPurposes(const HdTokenArrayDataSourceHandle &includedPurposes)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdVec2dDataSourceHandle GetShutterInterval() const
HD_API Builder & SetNamespacedSettings(const HdContainerDataSourceHandle &namespacedSettings)
static HD_API HdRenderSettingsSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdRenderProductVectorSchema GetRenderProducts() const
HdTokenDataSource::Handle HdTokenDataSourceHandle
static HD_API const HdDataSourceLocator & GetNamespacedSettingsLocator()
Prim-level relative data source locator to locate namespacedSettings.
HD_API HdTokenArrayDataSourceHandle GetMaterialBindingPurposes() const
HdVec2dDataSource::Handle HdVec2dDataSourceHandle
HD_API Builder & SetRenderProducts(const HdVectorDataSourceHandle &renderProducts)