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