HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
materialNetworkSchema.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_MATERIAL_NETWORK_SCHEMA_H
19 #define PXR_IMAGING_HD_MATERIAL_NETWORK_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_MATERIAL_NETWORK_SCHEMA_TOKENS \
38  (nodes) \
39  (terminals) \
40  (interface) \
41  (config) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(HdMaterialNetworkSchemaTokens, HD_API,
45 
46 //-----------------------------------------------------------------------------
47 
48 
49 /// \class HdMaterialNetworkSchema
50 ///
51 /// The MaterialNetwork schema is a container schema that defines a material
52 /// for a specific render context. A network is composed of nodes, terminals,
53 /// and interface.
54 ///
55 /// See also the Material schema documentation for ASCII art diagram.
56 ///
58 {
59 public:
60  /// \name Schema retrieval
61  /// @{
62 
63  HdMaterialNetworkSchema(HdContainerDataSourceHandle container)
64  : HdSchema(container) {}
65 
66  /// @}
67 
68 // --(BEGIN CUSTOM CODE: Schema Methods)--
69 // --(END CUSTOM CODE: Schema Methods)--
70 
71  /// \name Member accessor
72  /// @{
73 
74  /// Maps node names to material nodes. Each material node is a container
75  /// that is defined by the MaterialNode schema. The topology of the
76  /// network is expressed by the connections found on each material node.
77  HD_API
79 
80  /// Maps terminal names to material connections. Each connection is a
81  /// container defined by the MaterialConnection schema.
82  HD_API
84 
85  /// Describes the material's interface (public UI). A material's public
86  /// interface has user-authored order, grouping, naming, and mappings.
87  HD_API
89 
90  HD_API
92 
93  /// @}
94 
95  /// \name Schema construction
96  /// @{
97 
98  /// \deprecated Use Builder instead.
99  ///
100  /// Builds a container data source which includes the provided child data
101  /// sources. Parameters with nullptr values are excluded. This is a
102  /// low-level interface. For cases in which it's desired to define
103  /// the container with a sparse set of child fields, the Builder class
104  /// is often more convenient and readable.
105  HD_API
106  static HdContainerDataSourceHandle
108  const HdContainerDataSourceHandle &nodes,
109  const HdContainerDataSourceHandle &terminals,
110  const HdContainerDataSourceHandle &interface,
111  const HdContainerDataSourceHandle &config
112  );
113 
114  /// \class HdMaterialNetworkSchema::Builder
115  ///
116  /// Utility class for setting sparse sets of child data source fields to be
117  /// filled as arguments into BuildRetained. Because all setter methods
118  /// return a reference to the instance, this can be used in the "builder
119  /// pattern" form.
120  class Builder
121  {
122  public:
123  HD_API
124  Builder &SetNodes(
125  const HdContainerDataSourceHandle &nodes);
126  HD_API
128  const HdContainerDataSourceHandle &terminals);
129  HD_API
131  const HdContainerDataSourceHandle &interface);
132  HD_API
134  const HdContainerDataSourceHandle &config);
135 
136  /// Returns a container data source containing the members set thus far.
137  HD_API
138  HdContainerDataSourceHandle Build();
139 
140  private:
141  HdContainerDataSourceHandle _nodes;
142  HdContainerDataSourceHandle _terminals;
143  HdContainerDataSourceHandle _interface;
144  HdContainerDataSourceHandle _config;
145 
146  };
147 
148  /// @}
149 };
150 
152 
153 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HD_API
Definition: api.h:23
HD_API HdMaterialNodeContainerSchema GetNodes() const
static HD_API HdContainerDataSourceHandle BuildRetained(const HdContainerDataSourceHandle &nodes, const HdContainerDataSourceHandle &terminals, const HdContainerDataSourceHandle &interface, const HdContainerDataSourceHandle &config)
HD_API HdSampledDataSourceContainerSchema GetConfig() const
HD_API Builder & SetNodes(const HdContainerDataSourceHandle &nodes)
TF_DECLARE_PUBLIC_TOKENS(HdMaterialNetworkSchemaTokens, HD_API, HD_MATERIAL_NETWORK_SCHEMA_TOKENS)
HD_API Builder & SetInterface(const HdContainerDataSourceHandle &interface)
#define HD_MATERIAL_NETWORK_SCHEMA_TOKENS
HD_API Builder & SetTerminals(const HdContainerDataSourceHandle &terminals)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdMaterialInterfaceSchema GetInterface() const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API Builder & SetConfig(const HdContainerDataSourceHandle &config)
HdMaterialNetworkSchema(HdContainerDataSourceHandle container)
HD_API HdMaterialConnectionContainerSchema GetTerminals() const