HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
imageShaderSchema.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_IMAGE_SHADER_SCHEMA_H
36 #define PXR_IMAGING_HD_IMAGE_SHADER_SCHEMA_H
37 
38 /// \file
39 
40 #include "pxr/imaging/hd/api.h"
42 
43 #include "pxr/imaging/hd/schema.h"
44 
45 // --(BEGIN CUSTOM CODE: Includes)--
46 // --(END CUSTOM CODE: Includes)--
47 
49 
50 // --(BEGIN CUSTOM CODE: Declares)--
51 // --(END CUSTOM CODE: Declares)--
52 
53 #define HD_IMAGE_SHADER_SCHEMA_TOKENS \
54  (imageShader) \
55  (enabled) \
56  (priority) \
57  (filePath) \
58  (constants) \
59 
60 TF_DECLARE_PUBLIC_TOKENS(HdImageShaderSchemaTokens, HD_API,
62 
63 //-----------------------------------------------------------------------------
64 
65 
67 {
68 public:
69  /// \name Schema retrieval
70  /// @{
71 
72  HdImageShaderSchema(HdContainerDataSourceHandle container)
73  : HdSchema(container) {}
74 
75  /// Retrieves a container data source with the schema's default name token
76  /// "imageShader" from the parent container and constructs a
77  /// HdImageShaderSchema instance.
78  /// Because the requested container data source may not exist, the result
79  /// should be checked with IsDefined() or a bool comparison before use.
80  HD_API
82  const HdContainerDataSourceHandle &fromParentContainer);
83 
84  /// @}
85 
86 // --(BEGIN CUSTOM CODE: Schema Methods)--
87 // --(END CUSTOM CODE: Schema Methods)--
88 
89  /// \name Member accessor
90  /// @{
91 
92  HD_API
94 
95  HD_API
97 
98  HD_API
100 
101  HD_API
103 
104  /// @}
105 
106  /// \name Schema location
107  /// @{
108 
109  /// Returns a token where the container representing this schema is found in
110  /// a container by default.
111  HD_API
112  static const TfToken &GetSchemaToken();
113 
114  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
115  /// where the container representing this schema is found by default.
116  HD_API
117  static const HdDataSourceLocator &GetDefaultLocator();
118 
119  /// @}
120 
121  /// \name Data source locators for members
122  ///
123  /// The following methods return an HdDataSourceLocator (relative to the
124  /// prim-level data source) where the data source for a member can be found.
125  ///
126  /// This is often useful for checking intersection against the
127  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
128  /// @{
129 
130  /// Prim-level relative data source locator to locate enabled.
131  HD_API
132  static const HdDataSourceLocator &GetEnabledLocator();
133 
134  /// Prim-level relative data source locator to locate priority.
135  HD_API
136  static const HdDataSourceLocator &GetPriorityLocator();
137 
138  /// Prim-level relative data source locator to locate filePath.
139  HD_API
140  static const HdDataSourceLocator &GetFilePathLocator();
141 
142  /// Prim-level relative data source locator to locate constants.
143  HD_API
145  /// @}
146 
147  /// \name Schema construction
148  /// @{
149 
150  /// \deprecated Use Builder instead.
151  ///
152  /// Builds a container data source which includes the provided child data
153  /// sources. Parameters with nullptr values are excluded. This is a
154  /// low-level interface. For cases in which it's desired to define
155  /// the container with a sparse set of child fields, the Builder class
156  /// is often more convenient and readable.
157  HD_API
158  static HdContainerDataSourceHandle
161  const HdIntDataSourceHandle &priority,
162  const HdStringDataSourceHandle &filePath,
163  const HdContainerDataSourceHandle &constants
164  );
165 
166  /// \class HdImageShaderSchema::Builder
167  ///
168  /// Utility class for setting sparse sets of child data source fields to be
169  /// filled as arguments into BuildRetained. Because all setter methods
170  /// return a reference to the instance, this can be used in the "builder
171  /// pattern" form.
172  class Builder
173  {
174  public:
175  HD_API
178  HD_API
180  const HdIntDataSourceHandle &priority);
181  HD_API
183  const HdStringDataSourceHandle &filePath);
184  HD_API
186  const HdContainerDataSourceHandle &constants);
187 
188  /// Returns a container data source containing the members set thus far.
189  HD_API
190  HdContainerDataSourceHandle Build();
191 
192  private:
193  HdBoolDataSourceHandle _enabled;
194  HdIntDataSourceHandle _priority;
195  HdStringDataSourceHandle _filePath;
196  HdContainerDataSourceHandle _constants;
197 
198  };
199 
200  /// @}
201 };
202 
204 
205 #endif
HdImageShaderSchema(HdContainerDataSourceHandle container)
HD_API Builder & SetEnabled(const HdBoolDataSourceHandle &enabled)
static HD_API HdImageShaderSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
static HD_API const HdDataSourceLocator & GetConstantsLocator()
Prim-level relative data source locator to locate constants.
HD_API HdStringDataSourceHandle GetFilePath()
HdStringDataSource::Handle HdStringDataSourceHandle
#define HD_API
Definition: api.h:40
#define HD_IMAGE_SHADER_SCHEMA_TOKENS
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2539
HD_API HdBoolDataSourceHandle GetEnabled()
HD_API Builder & SetFilePath(const HdStringDataSourceHandle &filePath)
HD_API HdIntDataSourceHandle GetPriority()
HD_API HdSampledDataSourceContainerSchema GetConstants()
HD_API Builder & SetPriority(const HdIntDataSourceHandle &priority)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Definition: token.h:87
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HdBoolDataSource::Handle HdBoolDataSourceHandle
static HD_API HdContainerDataSourceHandle BuildRetained(const HdBoolDataSourceHandle &enabled, const HdIntDataSourceHandle &priority, const HdStringDataSourceHandle &filePath, const HdContainerDataSourceHandle &constants)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
static HD_API const TfToken & GetSchemaToken()
HD_API Builder & SetConstants(const HdContainerDataSourceHandle &constants)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
TF_DECLARE_PUBLIC_TOKENS(HdImageShaderSchemaTokens, HD_API, HD_IMAGE_SHADER_SCHEMA_TOKENS)
static HD_API const HdDataSourceLocator & GetPriorityLocator()
Prim-level relative data source locator to locate priority.
HdIntDataSource::Handle HdIntDataSourceHandle
static HD_API const HdDataSourceLocator & GetFilePathLocator()
Prim-level relative data source locator to locate filePath.
static HD_API const HdDataSourceLocator & GetEnabledLocator()
Prim-level relative data source locator to locate enabled.