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 /* ** 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_MATERIAL_NODE_SCHEMA_H
32 #define PXR_IMAGING_HD_MATERIAL_NODE_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDMATERIALNODE_SCHEMA_TOKENS \
43  (parameters) \
44  (inputConnections) \
45  (nodeIdentifier) \
46  (renderContextNodeIdentifiers) \
47  (nodeTypeInfo) \
48 
49 TF_DECLARE_PUBLIC_TOKENS(HdMaterialNodeSchemaTokens, HD_API,
51 
52 //-----------------------------------------------------------------------------
53 
55 {
56 public:
57  HdMaterialNodeSchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
60  //ACCESSORS
61 
62  HD_API
63  HdContainerDataSourceHandle GetParameters();
64  HD_API
65  HdContainerDataSourceHandle GetInputConnections();
66 
67  // This identifies the shader the node represents. The
68  // renderContextNodeIdentifier container can store alternative values for
69  // this. A consumer which is interested in a specific render context
70  // should check for that token within renderContextNodeIdentifiers and
71  // fall back on this value in its absence.
72  HD_API
74 
75  // A shading node can hold a nodeIdentifier value for multiple render
76  // contexts at once. This allows multiple renderer target representations
77  // to coexist in the same renderable scene. The contents of this
78  // container are alternate possible values for nodeIdentifier. A consumer
79  // which is interested in a specific render context should check for that
80  // token within this container and fall back on nodeIdentifier in its
81  // absence.
82  HD_API
83  HdContainerDataSourceHandle GetRenderContextNodeIdentifiers();
84 
85  // Rather than having an identifier, a shader can be specified by other
86  // information.
87  HD_API
88  HdContainerDataSourceHandle GetNodeTypeInfo();
89 
90  // RETRIEVING AND CONSTRUCTING
91 
92  /// Builds a container data source which includes the provided child data
93  /// sources. Parameters with nullptr values are excluded. This is a
94  /// low-level interface. For cases in which it's desired to define
95  /// the container with a sparse set of child fields, the Builder class
96  /// is often more convenient and readable.
97  HD_API
98  static HdContainerDataSourceHandle
100  const HdContainerDataSourceHandle &parameters,
101  const HdContainerDataSourceHandle &inputConnections,
102  const HdTokenDataSourceHandle &nodeIdentifier,
103  const HdContainerDataSourceHandle &renderContextNodeIdentifiers,
104  const HdContainerDataSourceHandle &nodeTypeInfo
105  );
106 
107  /// \class HdMaterialNodeSchema::Builder
108  ///
109  /// Utility class for setting sparse sets of child data source fields to be
110  /// filled as arguments into BuildRetained. Because all setter methods
111  /// return a reference to the instance, this can be used in the "builder
112  /// pattern" form.
113  class Builder
114  {
115  public:
116  HD_API
118  const HdContainerDataSourceHandle &parameters);
119  HD_API
121  const HdContainerDataSourceHandle &inputConnections);
122  HD_API
124  const HdTokenDataSourceHandle &nodeIdentifier);
125  HD_API
127  const HdContainerDataSourceHandle &renderContextNodeIdentifiers);
128  HD_API
130  const HdContainerDataSourceHandle &nodeTypeInfo);
131 
132  /// Returns a container data source containing the members set thus far.
133  HD_API
134  HdContainerDataSourceHandle Build();
135 
136  private:
137  HdContainerDataSourceHandle _parameters;
138  HdContainerDataSourceHandle _inputConnections;
139  HdTokenDataSourceHandle _nodeIdentifier;
140  HdContainerDataSourceHandle _renderContextNodeIdentifiers;
141  HdContainerDataSourceHandle _nodeTypeInfo;
142  };
143 
144 };
145 
147 
148 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdContainerDataSourceHandle GetParameters()
HD_API Builder & SetNodeTypeInfo(const HdContainerDataSourceHandle &nodeTypeInfo)
HD_API Builder & SetNodeIdentifier(const HdTokenDataSourceHandle &nodeIdentifier)
#define HDMATERIALNODE_SCHEMA_TOKENS
HdMaterialNodeSchema(HdContainerDataSourceHandle container)
#define HD_API
Definition: api.h:40
HD_API HdContainerDataSourceHandle GetInputConnections()
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:1441
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetParameters(const HdContainerDataSourceHandle &parameters)
HD_API Builder & SetRenderContextNodeIdentifiers(const HdContainerDataSourceHandle &renderContextNodeIdentifiers)
TF_DECLARE_PUBLIC_TOKENS(HdMaterialNodeSchemaTokens, HD_API, HDMATERIALNODE_SCHEMA_TOKENS)
HD_API HdContainerDataSourceHandle GetRenderContextNodeIdentifiers()
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetInputConnections(const HdContainerDataSourceHandle &inputConnections)