HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
materialNodeSchema.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_MATERIAL_NODE_SCHEMA_H
36 #define PXR_IMAGING_HD_MATERIAL_NODE_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_MATERIAL_NODE_SCHEMA_TOKENS \
54  (parameters) \
55  (inputConnections) \
56  (nodeIdentifier) \
57  (renderContextNodeIdentifiers) \
58  (nodeTypeInfo) \
59 
60 TF_DECLARE_PUBLIC_TOKENS(HdMaterialNodeSchemaTokens, HD_API,
62 
63 //-----------------------------------------------------------------------------
64 
65 
67 {
68 public:
69  /// \name Schema retrieval
70  /// @{
71 
72  HdMaterialNodeSchema(HdContainerDataSourceHandle container)
73  : HdSchema(container) {}
74 
75  /// @}
76 
77 // --(BEGIN CUSTOM CODE: Schema Methods)--
78 // --(END CUSTOM CODE: Schema Methods)--
79 
80  /// \name Member accessor
81  /// @{
82 
83  HD_API
85 
86  HD_API
88 
89  /// This identifies the shader the node represents. The
90  /// renderContextNodeIdentifier container can store alternative values for
91  /// this. A consumer which is interested in a specific render context
92  /// should check for that token within renderContextNodeIdentifiers and
93  /// fall back on this value in its absence.
94  HD_API
96 
97  /// A shading node can hold a nodeIdentifier value for multiple render
98  /// contexts at once. This allows multiple renderer target representations
99  /// to coexist in the same renderable scene. The contents of this
100  /// container are alternate possible values for nodeIdentifier. A consumer
101  /// which is interested in a specific render context should check for that
102  /// token within this container and fall back on nodeIdentifier in its
103  /// absence.
104  HD_API
105  HdContainerDataSourceHandle GetRenderContextNodeIdentifiers();
106 
107  /// Rather than having an identifier, a shader can be specified by other
108  /// information.
109  HD_API
110  HdContainerDataSourceHandle GetNodeTypeInfo();
111 
112  /// @}
113 
114  /// \name Schema construction
115  /// @{
116 
117  /// \deprecated Use Builder instead.
118  ///
119  /// Builds a container data source which includes the provided child data
120  /// sources. Parameters with nullptr values are excluded. This is a
121  /// low-level interface. For cases in which it's desired to define
122  /// the container with a sparse set of child fields, the Builder class
123  /// is often more convenient and readable.
124  HD_API
125  static HdContainerDataSourceHandle
127  const HdContainerDataSourceHandle &parameters,
128  const HdContainerDataSourceHandle &inputConnections,
129  const HdTokenDataSourceHandle &nodeIdentifier,
130  const HdContainerDataSourceHandle &renderContextNodeIdentifiers,
131  const HdContainerDataSourceHandle &nodeTypeInfo
132  );
133 
134  /// \class HdMaterialNodeSchema::Builder
135  ///
136  /// Utility class for setting sparse sets of child data source fields to be
137  /// filled as arguments into BuildRetained. Because all setter methods
138  /// return a reference to the instance, this can be used in the "builder
139  /// pattern" form.
140  class Builder
141  {
142  public:
143  HD_API
145  const HdContainerDataSourceHandle &parameters);
146  HD_API
148  const HdContainerDataSourceHandle &inputConnections);
149  HD_API
151  const HdTokenDataSourceHandle &nodeIdentifier);
152  HD_API
154  const HdContainerDataSourceHandle &renderContextNodeIdentifiers);
155  HD_API
157  const HdContainerDataSourceHandle &nodeTypeInfo);
158 
159  /// Returns a container data source containing the members set thus far.
160  HD_API
161  HdContainerDataSourceHandle Build();
162 
163  private:
164  HdContainerDataSourceHandle _parameters;
165  HdContainerDataSourceHandle _inputConnections;
166  HdTokenDataSourceHandle _nodeIdentifier;
167  HdContainerDataSourceHandle _renderContextNodeIdentifiers;
168  HdContainerDataSourceHandle _nodeTypeInfo;
169 
170  };
171 
172  /// @}
173 };
174 
176 
177 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
#define HD_MATERIAL_NODE_SCHEMA_TOKENS
HD_API Builder & SetNodeTypeInfo(const HdContainerDataSourceHandle &nodeTypeInfo)
HD_API Builder & SetNodeIdentifier(const HdTokenDataSourceHandle &nodeIdentifier)
HdMaterialNodeSchema(HdContainerDataSourceHandle container)
#define HD_API
Definition: api.h:40
static HD_API HdContainerDataSourceHandle BuildRetained(const HdContainerDataSourceHandle &parameters, const HdContainerDataSourceHandle &inputConnections, const HdTokenDataSourceHandle &nodeIdentifier, const HdContainerDataSourceHandle &renderContextNodeIdentifiers, const HdContainerDataSourceHandle &nodeTypeInfo)
HD_API HdTokenDataSourceHandle GetNodeIdentifier()
HD_API HdContainerDataSourceHandle GetNodeTypeInfo()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetParameters(const HdContainerDataSourceHandle &parameters)
HD_API Builder & SetRenderContextNodeIdentifiers(const HdContainerDataSourceHandle &renderContextNodeIdentifiers)
HD_API HdMaterialConnectionVectorContainerSchema GetInputConnections()
HD_API HdContainerDataSourceHandle GetRenderContextNodeIdentifiers()
HD_API HdMaterialNodeParameterContainerSchema GetParameters()
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetInputConnections(const HdContainerDataSourceHandle &inputConnections)
TF_DECLARE_PUBLIC_TOKENS(HdMaterialNodeSchemaTokens, HD_API, HD_MATERIAL_NODE_SCHEMA_TOKENS)