materialNodeSchema.h
1 //
2 // Copyright 2021 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 //
25 // This file is generated by a script. Do not edit directly. Edit the
26 // schema.template.h file to make changes.
27 
28 #ifndef PXR_IMAGING_HD_MATERIAL_NODE_SCHEMA_H
29 #define PXR_IMAGING_HD_MATERIAL_NODE_SCHEMA_H
30 
31 #include "pxr/imaging/hd/api.h"
32 
33 #include "pxr/imaging/hd/schema.h"
34 
35 PXR_NAMESPACE_OPEN_SCOPE
36 
37 //-----------------------------------------------------------------------------
38 
39 #define HDMATERIALNODE_SCHEMA_TOKENS \
40  (parameters) \
41  (inputConnections) \
42  (nodeIdentifier) \
43  (renderContextNodeIdentifiers) \
44 
45 TF_DECLARE_PUBLIC_TOKENS(HdMaterialNodeSchemaTokens, HD_API,
46  HDMATERIALNODE_SCHEMA_TOKENS);
47 
48 //-----------------------------------------------------------------------------
49 
50 class HdMaterialNodeSchema : public HdSchema
51 {
52 public:
53  HdMaterialNodeSchema(HdContainerDataSourceHandle container)
54  : HdSchema(container) {}
55 
56  //ACCESSORS
57 
58  HD_API
59  HdContainerDataSourceHandle GetParameters();
60  HD_API
61  HdContainerDataSourceHandle GetInputConnections();
62 
63  // This identifies the shader the node represents. The
64  // renderContextNodeIdentifier container can store alternative values for
65  // this. A consumer which is interested in a specific render context
66  // should check for that token within renderContextNodeIdentifiers and
67  // fall back on this value in its absence.
68  HD_API
69  HdTokenDataSourceHandle GetNodeIdentifier();
70 
71  // A shading node can hold a nodeIdentifier value for multiple render
72  // contexts at once. This allows multiple renderer target representations
73  // to coexist in the same renderable scene. The contents of this
74  // container are alternate possible values for nodeIdentifier. A consumer
75  // which is interested in a specific render context should check for that
76  // token within this container and fall back on nodeIdentifier in its
77  // absence.
78  HD_API
79  HdContainerDataSourceHandle GetRenderContextNodeIdentifiers();
80 
81  // RETRIEVING AND CONSTRUCTING
82 
88  HD_API
89  static HdContainerDataSourceHandle
90  BuildRetained(
91  const HdContainerDataSourceHandle &parameters,
92  const HdContainerDataSourceHandle &inputConnections,
93  const HdTokenDataSourceHandle &nodeIdentifier,
94  const HdContainerDataSourceHandle &renderContextNodeIdentifiers
95  );
96 
103  class Builder
104  {
105  public:
106  HD_API
107  Builder &SetParameters(
108  const HdContainerDataSourceHandle &parameters);
109  HD_API
110  Builder &SetInputConnections(
111  const HdContainerDataSourceHandle &inputConnections);
112  HD_API
113  Builder &SetNodeIdentifier(
114  const HdTokenDataSourceHandle &nodeIdentifier);
115  HD_API
116  Builder &SetRenderContextNodeIdentifiers(
117  const HdContainerDataSourceHandle &renderContextNodeIdentifiers);
118 
120  HD_API
121  HdContainerDataSourceHandle Build();
122 
123  private:
124  HdContainerDataSourceHandle _parameters;
125  HdContainerDataSourceHandle _inputConnections;
126  HdTokenDataSourceHandle _nodeIdentifier;
127  HdContainerDataSourceHandle _renderContextNodeIdentifiers;
128  };
129 
130 };
131 
132 PXR_NAMESPACE_CLOSE_SCOPE
133 
134 #endif
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:43