HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
materialConnectionSchema.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_CONNECTION_SCHEMA_H
19 #define PXR_IMAGING_HD_MATERIAL_CONNECTION_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_CONNECTION_SCHEMA_TOKENS \
36  (upstreamNodePath) \
37  (upstreamNodeOutputName) \
38 
39 TF_DECLARE_PUBLIC_TOKENS(HdMaterialConnectionSchemaTokens, HD_API,
41 
42 //-----------------------------------------------------------------------------
43 
44 
45 /// \class HdMaterialConnectionSchema
46 ///
47 /// The MaterialConnection schema defines an upstream connected node and
48 /// output.
49 ///
50 /// See MaterialNode schema's documentation on its 'inputConnections' member
51 /// for an example.
52 ///
54 {
55 public:
56  /// \name Schema retrieval
57  /// @{
58 
59  HdMaterialConnectionSchema(HdContainerDataSourceHandle container)
60  : HdSchema(container) {}
61 
62  /// @}
63 
64 // --(BEGIN CUSTOM CODE: Schema Methods)--
65 // --(END CUSTOM CODE: Schema Methods)--
66 
67  /// \name Member accessor
68  /// @{
69 
70  HD_API
72 
73  HD_API
75 
76  /// @}
77 
78  /// \name Schema construction
79  /// @{
80 
81  /// \deprecated Use Builder instead.
82  ///
83  /// Builds a container data source which includes the provided child data
84  /// sources. Parameters with nullptr values are excluded. This is a
85  /// low-level interface. For cases in which it's desired to define
86  /// the container with a sparse set of child fields, the Builder class
87  /// is often more convenient and readable.
88  HD_API
89  static HdContainerDataSourceHandle
91  const HdTokenDataSourceHandle &upstreamNodePath,
92  const HdTokenDataSourceHandle &upstreamNodeOutputName
93  );
94 
95  /// \class HdMaterialConnectionSchema::Builder
96  ///
97  /// Utility class for setting sparse sets of child data source fields to be
98  /// filled as arguments into BuildRetained. Because all setter methods
99  /// return a reference to the instance, this can be used in the "builder
100  /// pattern" form.
101  class Builder
102  {
103  public:
104  HD_API
106  const HdTokenDataSourceHandle &upstreamNodePath);
107  HD_API
109  const HdTokenDataSourceHandle &upstreamNodeOutputName);
110 
111  /// Returns a container data source containing the members set thus far.
112  HD_API
113  HdContainerDataSourceHandle Build();
114 
115  private:
116  HdTokenDataSourceHandle _upstreamNodePath;
117  HdTokenDataSourceHandle _upstreamNodeOutputName;
118 
119  };
120 
121  /// @}
122 };
123 
125 
126 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
TF_DECLARE_PUBLIC_TOKENS(HdMaterialConnectionSchemaTokens, HD_API, HD_MATERIAL_CONNECTION_SCHEMA_TOKENS)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HD_API HdTokenDataSourceHandle GetUpstreamNodeOutputName() const
#define HD_MATERIAL_CONNECTION_SCHEMA_TOKENS
#define HD_API
Definition: api.h:23
HdMaterialConnectionSchema(HdContainerDataSourceHandle container)
HD_API HdTokenDataSourceHandle GetUpstreamNodePath() const
HD_API Builder & SetUpstreamNodeOutputName(const HdTokenDataSourceHandle &upstreamNodeOutputName)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &upstreamNodePath, const HdTokenDataSourceHandle &upstreamNodeOutputName)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API Builder & SetUpstreamNodePath(const HdTokenDataSourceHandle &upstreamNodePath)
HdTokenDataSource::Handle HdTokenDataSourceHandle