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 
45 /// \class HdMaterialInterfaceMappingSchema
46 ///
47 /// The MaterialInterfaceMapping schema identifies a material node parameter
48 /// using its two members 'nodePath' and 'inputName'.
49 ///
50 /// For example, if we are looking at some material network at
51 /// material/<renderContext>/... and we have a mapping target defined by the
52 /// following data sources:
53 ///
54 /// ds at: material/<renderContext>/.../nodePath = Color_Manipulate
55 ///
56 /// ds at: material/<renderContext>/.../inputName = adjustVal
57 ///
58 /// The above defines a mapping target to the material node parameter under
59 /// that material network, eg:
60 ///
61 /// ds at: material/<renderContext>/nodes/Color_Manipulate/parameters/
62 /// adjustVal
63 ///
65 {
66 public:
67  /// \name Schema retrieval
68  /// @{
69 
70  HdMaterialInterfaceMappingSchema(HdContainerDataSourceHandle container)
71  : HdSchema(container) {}
72 
73  /// @}
74 
75 // --(BEGIN CUSTOM CODE: Schema Methods)--
76 
77  /// Returns the data source locator relative to the material network for the
78  /// material node parameter indicated by the interface mapping.
79  /// Ie. Returns locator: nodes/<nodePath>/parameters/<inputName>
81 
82 // --(END CUSTOM CODE: Schema Methods)--
83 
84  /// \name Member accessor
85  /// @{
86 
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 HdTokenDataSourceHandle &nodePath,
109  const HdTokenDataSourceHandle &inputName
110  );
111 
112  /// \class HdMaterialInterfaceMappingSchema::Builder
113  ///
114  /// Utility class for setting sparse sets of child data source fields to be
115  /// filled as arguments into BuildRetained. Because all setter methods
116  /// return a reference to the instance, this can be used in the "builder
117  /// pattern" form.
118  class Builder
119  {
120  public:
121  HD_API
123  const HdTokenDataSourceHandle &nodePath);
124  HD_API
126  const HdTokenDataSourceHandle &inputName);
127 
128  /// Returns a container data source containing the members set thus far.
129  HD_API
130  HdContainerDataSourceHandle Build();
131 
132  private:
133  HdTokenDataSourceHandle _nodePath;
134  HdTokenDataSourceHandle _inputName;
135 
136  };
137 
138  /// @}
139 };
140 
142 
143 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
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)
#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