HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
directMaterialBindingSchema.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_USD_IMAGING_USD_IMAGING_DIRECT_MATERIAL_BINDING_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_IMAGING_DIRECT_MATERIAL_BINDING_SCHEMA_H
20 
21 /// \file
22 
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 USD_IMAGING_DIRECT_MATERIAL_BINDING_SCHEMA_TOKENS \
36  (directMaterialBinding) \
37  (materialPath) \
38  (bindingStrength) \
39 
40 TF_DECLARE_PUBLIC_TOKENS(UsdImagingDirectMaterialBindingSchemaTokens, USDIMAGING_API,
42 
43 //-----------------------------------------------------------------------------
44 
45 
47 {
48 public:
49  /// \name Schema retrieval
50  /// @{
51 
52  UsdImagingDirectMaterialBindingSchema(HdContainerDataSourceHandle container)
53  : HdSchema(container) {}
54 
55  /// Retrieves a container data source with the schema's default name token
56  /// "directMaterialBinding" from the parent container and constructs a
57  /// UsdImagingDirectMaterialBindingSchema instance.
58  /// Because the requested container data source may not exist, the result
59  /// should be checked with IsDefined() or a bool comparison before use.
62  const HdContainerDataSourceHandle &fromParentContainer);
63 
64  /// @}
65 
66 // --(BEGIN CUSTOM CODE: Schema Methods)--
67 // --(END CUSTOM CODE: Schema Methods)--
68 
69  /// \name Member accessor
70  /// @{
71 
74 
77 
78  /// @}
79 
80  /// \name Schema location
81  /// @{
82 
83  /// Returns a token where the container representing this schema is found in
84  /// a container by default.
86  static const TfToken &GetSchemaToken();
87 
88  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
89  /// where the container representing this schema is found by default.
91  static const HdDataSourceLocator &GetDefaultLocator();
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.
106  static HdContainerDataSourceHandle
108  const HdPathDataSourceHandle &materialPath,
109  const HdTokenDataSourceHandle &bindingStrength
110  );
111 
112  /// \class UsdImagingDirectMaterialBindingSchema::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:
123  const HdPathDataSourceHandle &materialPath);
126  const HdTokenDataSourceHandle &bindingStrength);
127 
128  /// Returns a container data source containing the members set thus far.
130  HdContainerDataSourceHandle Build();
131 
132  private:
133  HdPathDataSourceHandle _materialPath;
134  HdTokenDataSourceHandle _bindingStrength;
135 
136  };
137 
138  /// @}
139 };
140 
142 
143 #endif
static USDIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &materialPath, const HdTokenDataSourceHandle &bindingStrength)
#define USDIMAGING_API
Definition: api.h:23
UsdImagingDirectMaterialBindingSchema(HdContainerDataSourceHandle container)
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static USDIMAGING_API const TfToken & GetSchemaToken()
USDIMAGING_API Builder & SetBindingStrength(const HdTokenDataSourceHandle &bindingStrength)
TF_DECLARE_PUBLIC_TOKENS(UsdImagingDirectMaterialBindingSchemaTokens, USDIMAGING_API, USD_IMAGING_DIRECT_MATERIAL_BINDING_SCHEMA_TOKENS)
USDIMAGING_API HdTokenDataSourceHandle GetBindingStrength() const
Definition: token.h:70
USDIMAGING_API HdPathDataSourceHandle GetMaterialPath() const
static USDIMAGING_API UsdImagingDirectMaterialBindingSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API Builder & SetMaterialPath(const HdPathDataSourceHandle &materialPath)
HdPathDataSource::Handle HdPathDataSourceHandle
#define USD_IMAGING_DIRECT_MATERIAL_BINDING_SCHEMA_TOKENS
HdTokenDataSource::Handle HdTokenDataSourceHandle