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 /* ** 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_SETTINGS_SCHEMA_H
32 #define PXR_IMAGING_HD_RENDER_SETTINGS_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDRENDERSETTINGS_SCHEMA_TOKENS \
43  (renderSettings) \
44  (namespacedSettings) \
45  (active) \
46  (renderProducts) \
47  (includedPurposes) \
48  (materialBindingPurposes) \
49  (renderingColorSpace) \
50 
51 TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsSchemaTokens, HD_API,
53 
54 //-----------------------------------------------------------------------------
55 
57 {
58 public:
59  HdRenderSettingsSchema(HdContainerDataSourceHandle container)
60  : HdSchema(container) {}
61 
62  //ACCESSORS
63 
64  HD_API
65  HdContainerDataSourceHandle GetNamespacedSettings();
66  HD_API
68  HD_API
70  HD_API
72  HD_API
74  HD_API
76 
77  // RETRIEVING AND CONSTRUCTING
78 
79  /// Builds a container data source which includes the provided child data
80  /// sources. Parameters with nullptr values are excluded. This is a
81  /// low-level interface. For cases in which it's desired to define
82  /// the container with a sparse set of child fields, the Builder class
83  /// is often more convenient and readable.
84  HD_API
85  static HdContainerDataSourceHandle
87  const HdContainerDataSourceHandle &namespacedSettings,
88  const HdBoolDataSourceHandle &active,
89  const HdVectorDataSourceHandle &renderProducts,
90  const HdTokenArrayDataSourceHandle &includedPurposes,
91  const HdTokenArrayDataSourceHandle &materialBindingPurposes,
92  const HdTokenDataSourceHandle &renderingColorSpace
93  );
94 
95  /// \class HdRenderSettingsSchema::Builder
96  ///
97  /// Utility class for setting sparse sets of child data source fields to be
98  /// filled as arguments into BuildRetained. Because all setter methods
99  /// return a reference to the instance, this can be used in the "builder
100  /// pattern" form.
101  class Builder
102  {
103  public:
104  HD_API
106  const HdContainerDataSourceHandle &namespacedSettings);
107  HD_API
109  const HdBoolDataSourceHandle &active);
110  HD_API
112  const HdVectorDataSourceHandle &renderProducts);
113  HD_API
115  const HdTokenArrayDataSourceHandle &includedPurposes);
116  HD_API
118  const HdTokenArrayDataSourceHandle &materialBindingPurposes);
119  HD_API
121  const HdTokenDataSourceHandle &renderingColorSpace);
122 
123  /// Returns a container data source containing the members set thus far.
124  HD_API
125  HdContainerDataSourceHandle Build();
126 
127  private:
128  HdContainerDataSourceHandle _namespacedSettings;
129  HdBoolDataSourceHandle _active;
130  HdVectorDataSourceHandle _renderProducts;
131  HdTokenArrayDataSourceHandle _includedPurposes;
132  HdTokenArrayDataSourceHandle _materialBindingPurposes;
133  HdTokenDataSourceHandle _renderingColorSpace;
134  };
135 
136  /// Retrieves a container data source with the schema's default name token
137  /// "renderSettings" from the parent container and constructs a
138  /// HdRenderSettingsSchema instance.
139  /// Because the requested container data source may not exist, the result
140  /// should be checked with IsDefined() or a bool comparison before use.
141  HD_API
143  const HdContainerDataSourceHandle &fromParentContainer);
144 
145  /// Returns a token where the container representing this schema is found in
146  /// a container by default.
147  HD_API
148  static const TfToken &GetSchemaToken();
149 
150  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
151  /// where the container representing this schema is found by default.
152  HD_API
153  static const HdDataSourceLocator &GetDefaultLocator();
154 
155 
156  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
157  /// where the namespacedsettings data source can be found.
158  /// This is often useful for checking intersection against the
159  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
160  HD_API
162 
163  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
164  /// where the active data source can be found.
165  /// This is often useful for checking intersection against the
166  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
167  HD_API
168  static const HdDataSourceLocator &GetActiveLocator();
169 
170  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
171  /// where the renderproducts data source can be found.
172  /// This is often useful for checking intersection against the
173  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
174  HD_API
176 
177  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
178  /// where the includedpurposes data source can be found.
179  /// This is often useful for checking intersection against the
180  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
181  HD_API
183 
184  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
185  /// where the materialbindingpurposes data source can be found.
186  /// This is often useful for checking intersection against the
187  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
188  HD_API
190 
191  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
192  /// where the renderingcolorspace data source can be found.
193  /// This is often useful for checking intersection against the
194  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
195  HD_API
197 
198 };
199 
201 
202 #endif
static HD_API HdContainerDataSourceHandle BuildRetained(const HdContainerDataSourceHandle &namespacedSettings, const HdBoolDataSourceHandle &active, const HdVectorDataSourceHandle &renderProducts, const HdTokenArrayDataSourceHandle &includedPurposes, const HdTokenArrayDataSourceHandle &materialBindingPurposes, const HdTokenDataSourceHandle &renderingColorSpace)
HD_API Builder & SetActive(const HdBoolDataSourceHandle &active)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
#define HD_API
Definition: api.h:40
HdRenderSettingsSchema(HdContainerDataSourceHandle container)
static HD_API const HdDataSourceLocator & GetRenderProductsLocator()
static HD_API const TfToken & GetSchemaToken()
HD_API Builder & SetRenderingColorSpace(const HdTokenDataSourceHandle &renderingColorSpace)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
TF_DECLARE_PUBLIC_TOKENS(HdRenderSettingsSchemaTokens, HD_API, HDRENDERSETTINGS_SCHEMA_TOKENS)
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
static HD_API const HdDataSourceLocator & GetIncludedPurposesLocator()
Definition: token.h:87
static HD_API const HdDataSourceLocator & GetRenderingColorSpaceLocator()
HD_API HdBoolDataSourceHandle GetActive()
HD_API HdTokenArrayDataSourceHandle GetMaterialBindingPurposes()
HD_API HdRenderProductVectorSchema GetRenderProducts()
static HD_API const HdDataSourceLocator & GetMaterialBindingPurposesLocator()
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API HdTokenArrayDataSourceHandle GetIncludedPurposes()
static HD_API const HdDataSourceLocator & GetActiveLocator()
HD_API HdContainerDataSourceHandle GetNamespacedSettings()
#define HDRENDERSETTINGS_SCHEMA_TOKENS
HD_API Builder & SetMaterialBindingPurposes(const HdTokenArrayDataSourceHandle &materialBindingPurposes)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
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()
HD_API Builder & SetRenderProducts(const HdVectorDataSourceHandle &renderProducts)