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 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_SETTINGS_SCHEMA_H
36 #define PXR_IMAGING_HD_RENDER_SETTINGS_SCHEMA_H
37 
38 #include "pxr/imaging/hd/api.h"
40 
41 #include "pxr/imaging/hd/schema.h"
42 
43 // --(BEGIN CUSTOM CODE: Includes)--
44 // --(END CUSTOM CODE: Includes)--
45 
46 // --(BEGIN CUSTOM CODE: Includes)--
47 // --(END CUSTOM CODE: Includes)--
48 
50 
51 //-----------------------------------------------------------------------------
52 
53 // --(BEGIN CUSTOM CODE: Declares)--
54 // --(END CUSTOM CODE: Declares)--
55 
56 //-----------------------------------------------------------------------------
57 
58 #define HD_RENDER_SETTINGS_SCHEMA_TOKENS \
59  (renderSettings) \
60  (namespacedSettings) \
61  (active) \
62  (renderProducts) \
63  (includedPurposes) \
64  (materialBindingPurposes) \
65  (renderingColorSpace) \
66  (shutterInterval) \
67 
68 TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsSchemaTokens, HD_API,
70 
71 //-----------------------------------------------------------------------------
73 {
74 public:
75  HdRenderSettingsSchema(HdContainerDataSourceHandle container)
76  : HdSchema(container) {}
77 
78 // --(BEGIN CUSTOM CODE: Schema Methods)--
79 // --(END CUSTOM CODE: Schema Methods)--
80 
81  //ACCESSORS
82 
83 
84  HD_API
85  HdContainerDataSourceHandle GetNamespacedSettings();
86 
87  HD_API
89 
90  HD_API
92 
93  HD_API
95 
96  HD_API
98 
99  HD_API
101 
102 
103  // Frame-relative time interval representing the sampling window for data
104  // relevant to motion blur. Renderers can use this interval when querying
105  // time-sampled data (e.g., xforms, points, velocities, ...) to simulate
106  // motion blur effects. Note: This closely relates to the (frame-
107  // relative) shutter interval of a camera specified via shutter open and
108  // close times and is expected to span the union of the shutter intervals
109  // of cameras used in generating the render artifacts.
110 
111  HD_API
113 
114  // RETRIEVING AND CONSTRUCTING
115 
116  /// Builds a container data source which includes the provided child data
117  /// sources. Parameters with nullptr values are excluded. This is a
118  /// low-level interface. For cases in which it's desired to define
119  /// the container with a sparse set of child fields, the Builder class
120  /// is often more convenient and readable.
121  HD_API
122  static HdContainerDataSourceHandle
124  const HdContainerDataSourceHandle &namespacedSettings,
126  const HdVectorDataSourceHandle &renderProducts,
127  const HdTokenArrayDataSourceHandle &includedPurposes,
128  const HdTokenArrayDataSourceHandle &materialBindingPurposes,
129  const HdTokenDataSourceHandle &renderingColorSpace,
130  const HdVec2dDataSourceHandle &shutterInterval
131  );
132 
133  /// \class HdRenderSettingsSchema::Builder
134  ///
135  /// Utility class for setting sparse sets of child data source fields to be
136  /// filled as arguments into BuildRetained. Because all setter methods
137  /// return a reference to the instance, this can be used in the "builder
138  /// pattern" form.
139  class Builder
140  {
141  public:
142  HD_API
144  const HdContainerDataSourceHandle &namespacedSettings);
145  HD_API
148  HD_API
150  const HdVectorDataSourceHandle &renderProducts);
151  HD_API
153  const HdTokenArrayDataSourceHandle &includedPurposes);
154  HD_API
156  const HdTokenArrayDataSourceHandle &materialBindingPurposes);
157  HD_API
159  const HdTokenDataSourceHandle &renderingColorSpace);
160  HD_API
162  const HdVec2dDataSourceHandle &shutterInterval);
163 
164  /// Returns a container data source containing the members set thus far.
165  HD_API
166  HdContainerDataSourceHandle Build();
167 
168  private:
169  HdContainerDataSourceHandle _namespacedSettings;
170  HdBoolDataSourceHandle _active;
171  HdVectorDataSourceHandle _renderProducts;
172  HdTokenArrayDataSourceHandle _includedPurposes;
173  HdTokenArrayDataSourceHandle _materialBindingPurposes;
174  HdTokenDataSourceHandle _renderingColorSpace;
175  HdVec2dDataSourceHandle _shutterInterval;
176  };
177 
178  /// Retrieves a container data source with the schema's default name token
179  /// "renderSettings" from the parent container and constructs a
180  /// HdRenderSettingsSchema instance.
181  /// Because the requested container data source may not exist, the result
182  /// should be checked with IsDefined() or a bool comparison before use.
183  HD_API
185  const HdContainerDataSourceHandle &fromParentContainer);
186 
187  /// Returns a token where the container representing this schema is found in
188  /// a container by default.
189  HD_API
190  static const TfToken &GetSchemaToken();
191 
192  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
193  /// where the container representing this schema is found by default.
194  HD_API
195  static const HdDataSourceLocator &GetDefaultLocator();
196 
197  // DATA SOURCE LOCATORS FOR MEMBERS
198  //
199  // The following methods return an HdDataSourceLocator (relative to the
200  // prim-level data source) where the data source for a member can be found.
201  //
202  // This is often useful for checking intersection against the
203  // HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
204 
205 
206  /// Prim-level relative data source locator to locate namespacedSettings.
207  HD_API
209 
210  /// Prim-level relative data source locator to locate active.
211  HD_API
212  static const HdDataSourceLocator &GetActiveLocator();
213 
214  /// Prim-level relative data source locator to locate renderProducts.
215  HD_API
217 
218  /// Prim-level relative data source locator to locate includedPurposes.
219  HD_API
221 
222  /// Prim-level relative data source locator to locate materialBindingPurposes.
223  HD_API
225 
226  /// Prim-level relative data source locator to locate renderingColorSpace.
227  HD_API
229 
230  /// Prim-level relative data source locator to locate shutterInterval.
231  HD_API
233 
234 
235 };
236 
238 
239 #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.
HD_API HdVec2dDataSourceHandle GetShutterInterval()
HD_API Builder & SetShutterInterval(const HdVec2dDataSourceHandle &shutterInterval)
#define HD_API
Definition: api.h:40
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:87
static HD_API const HdDataSourceLocator & GetRenderingColorSpaceLocator()
Prim-level relative data source locator to locate renderingColorSpace.
HD_API HdBoolDataSourceHandle GetActive()
HD_API HdTokenArrayDataSourceHandle GetMaterialBindingPurposes()
HD_API HdRenderProductVectorSchema GetRenderProducts()
static HD_API const HdDataSourceLocator & GetMaterialBindingPurposesLocator()
Prim-level relative data source locator to locate materialBindingPurposes.
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API HdTokenArrayDataSourceHandle GetIncludedPurposes()
static HD_API const HdDataSourceLocator & GetActiveLocator()
Prim-level relative data source locator to locate active.
HD_API HdContainerDataSourceHandle GetNamespacedSettings()
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)
static HD_API const HdDataSourceLocator & GetShutterIntervalLocator()
Prim-level relative data source locator to locate shutterInterval.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HD_API Builder & SetIncludedPurposes(const HdTokenArrayDataSourceHandle &includedPurposes)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetNamespacedSettings(const HdContainerDataSourceHandle &namespacedSettings)
static HD_API HdRenderSettingsSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdTokenDataSourceHandle GetRenderingColorSpace()
HdTokenDataSource::Handle HdTokenDataSourceHandle
static HD_API const HdDataSourceLocator & GetNamespacedSettingsLocator()
Prim-level relative data source locator to locate namespacedSettings.
HdVec2dDataSource::Handle HdVec2dDataSourceHandle
HD_API Builder & SetRenderProducts(const HdVectorDataSourceHandle &renderProducts)