HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
materialInterfaceMappingSchema.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_INTERFACE_MAPPING_SCHEMA_H
19 #define PXR_IMAGING_HD_MATERIAL_INTERFACE_MAPPING_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define HD_MATERIAL_INTERFACE_MAPPING_SCHEMA_TOKENS \
36  (nodePath) \
37  (inputName) \
38 
39 TF_DECLARE_PUBLIC_TOKENS(HdMaterialInterfaceMappingSchemaTokens, HD_API,
41 
42 //-----------------------------------------------------------------------------
43 
44 // The MaterialInterfaceMapping schema identifies a material node parameter
45 // using its two members 'nodePath' and 'inputName'.
46 //
47 // See MaterialNetwork schema's documentation on its 'interfaceMappings'
48 // member for an example.
49 //
50 
52 {
53 public:
54  /// \name Schema retrieval
55  /// @{
56 
57  HdMaterialInterfaceMappingSchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
60  /// @}
61 
62 // --(BEGIN CUSTOM CODE: Schema Methods)--
63 
64  /// Returns the data source locator relative to the material network for the
65  /// material node parameter indicated by the interface mapping.
66  /// Ie. Returns locator: nodes/<nodePath>/parameters/<inputName>
68 
69 // --(END CUSTOM CODE: Schema Methods)--
70 
71  /// \name Member accessor
72  /// @{
73 
74  HD_API
76 
77  HD_API
79 
80  /// @}
81 
82  /// \name Schema construction
83  /// @{
84 
85  /// \deprecated Use Builder instead.
86  ///
87  /// Builds a container data source which includes the provided child data
88  /// sources. Parameters with nullptr values are excluded. This is a
89  /// low-level interface. For cases in which it's desired to define
90  /// the container with a sparse set of child fields, the Builder class
91  /// is often more convenient and readable.
92  HD_API
93  static HdContainerDataSourceHandle
95  const HdTokenDataSourceHandle &nodePath,
96  const HdTokenDataSourceHandle &inputName
97  );
98 
99  /// \class HdMaterialInterfaceMappingSchema::Builder
100  ///
101  /// Utility class for setting sparse sets of child data source fields to be
102  /// filled as arguments into BuildRetained. Because all setter methods
103  /// return a reference to the instance, this can be used in the "builder
104  /// pattern" form.
105  class Builder
106  {
107  public:
108  HD_API
110  const HdTokenDataSourceHandle &nodePath);
111  HD_API
113  const HdTokenDataSourceHandle &inputName);
114 
115  /// Returns a container data source containing the members set thus far.
116  HD_API
117  HdContainerDataSourceHandle Build();
118 
119  private:
120  HdTokenDataSourceHandle _nodePath;
121  HdTokenDataSourceHandle _inputName;
122 
123  };
124 
125  /// @}
126 };
127 
129 
130 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
#define HD_API
Definition: api.h:23
TF_DECLARE_PUBLIC_TOKENS(HdMaterialInterfaceMappingSchemaTokens, HD_API, HD_MATERIAL_INTERFACE_MAPPING_SCHEMA_TOKENS)
HD_API Builder & SetInputName(const HdTokenDataSourceHandle &inputName)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &nodePath, const HdTokenDataSourceHandle &inputName)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API Builder & SetNodePath(const HdTokenDataSourceHandle &nodePath)
#define HD_MATERIAL_INTERFACE_MAPPING_SCHEMA_TOKENS
HdDataSourceLocator BuildNetworkRelativeLocator()
HD_API HdTokenDataSourceHandle GetNodePath() const
HdMaterialInterfaceMappingSchema(HdContainerDataSourceHandle container)
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdTokenDataSourceHandle GetInputName() const