HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
collectionMaterialBindingSchema.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_COLLECTION_MATERIAL_BINDING_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_IMAGING_COLLECTION_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_COLLECTION_MATERIAL_BINDING_SCHEMA_TOKENS \
36  (collectionMaterialBinding) \
37  (collectionPath) \
38  (materialPath) \
39  (bindingStrength) \
40 
41 TF_DECLARE_PUBLIC_TOKENS(UsdImagingCollectionMaterialBindingSchemaTokens, USDIMAGING_API,
43 
44 //-----------------------------------------------------------------------------
45 
46 
48 {
49 public:
50  /// \name Schema retrieval
51  /// @{
52 
53  UsdImagingCollectionMaterialBindingSchema(HdContainerDataSourceHandle container)
54  : HdSchema(container) {}
55 
56  /// Retrieves a container data source with the schema's default name token
57  /// "collectionMaterialBinding" from the parent container and constructs a
58  /// UsdImagingCollectionMaterialBindingSchema instance.
59  /// Because the requested container data source may not exist, the result
60  /// should be checked with IsDefined() or a bool comparison before use.
63  const HdContainerDataSourceHandle &fromParentContainer);
64 
65  /// @}
66 
67 // --(BEGIN CUSTOM CODE: Schema Methods)--
68 // --(END CUSTOM CODE: Schema Methods)--
69 
70  /// \name Member accessor
71  /// @{
72 
75 
78 
81 
82  /// @}
83 
84  /// \name Schema location
85  /// @{
86 
87  /// Returns a token where the container representing this schema is found in
88  /// a container by default.
90  static const TfToken &GetSchemaToken();
91 
92  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
93  /// where the container representing this schema is found by default.
95  static const HdDataSourceLocator &GetDefaultLocator();
96 
97  /// @}
98 
99  /// \name Schema construction
100  /// @{
101 
102  /// \deprecated Use Builder instead.
103  ///
104  /// Builds a container data source which includes the provided child data
105  /// sources. Parameters with nullptr values are excluded. This is a
106  /// low-level interface. For cases in which it's desired to define
107  /// the container with a sparse set of child fields, the Builder class
108  /// is often more convenient and readable.
110  static HdContainerDataSourceHandle
112  const HdPathDataSourceHandle &collectionPath,
113  const HdPathDataSourceHandle &materialPath,
114  const HdTokenDataSourceHandle &bindingStrength
115  );
116 
117  /// \class UsdImagingCollectionMaterialBindingSchema::Builder
118  ///
119  /// Utility class for setting sparse sets of child data source fields to be
120  /// filled as arguments into BuildRetained. Because all setter methods
121  /// return a reference to the instance, this can be used in the "builder
122  /// pattern" form.
123  class Builder
124  {
125  public:
128  const HdPathDataSourceHandle &collectionPath);
131  const HdPathDataSourceHandle &materialPath);
134  const HdTokenDataSourceHandle &bindingStrength);
135 
136  /// Returns a container data source containing the members set thus far.
138  HdContainerDataSourceHandle Build();
139 
140  private:
141  HdPathDataSourceHandle _collectionPath;
142  HdPathDataSourceHandle _materialPath;
143  HdTokenDataSourceHandle _bindingStrength;
144 
145  };
146 
147  /// @}
148 };
149 
151 
152 #endif
TF_DECLARE_PUBLIC_TOKENS(UsdImagingCollectionMaterialBindingSchemaTokens, USDIMAGING_API, USD_IMAGING_COLLECTION_MATERIAL_BINDING_SCHEMA_TOKENS)
USDIMAGING_API HdPathDataSourceHandle GetMaterialPath() const
static USDIMAGING_API const TfToken & GetSchemaToken()
#define USDIMAGING_API
Definition: api.h:23
UsdImagingCollectionMaterialBindingSchema(HdContainerDataSourceHandle container)
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
static USDIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &collectionPath, const HdPathDataSourceHandle &materialPath, const HdTokenDataSourceHandle &bindingStrength)
Definition: token.h:70
static USDIMAGING_API UsdImagingCollectionMaterialBindingSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDIMAGING_API HdPathDataSourceHandle GetCollectionPath() const
USDIMAGING_API Builder & SetMaterialPath(const HdPathDataSourceHandle &materialPath)
#define USD_IMAGING_COLLECTION_MATERIAL_BINDING_SCHEMA_TOKENS
USDIMAGING_API HdTokenDataSourceHandle GetBindingStrength() const
USDIMAGING_API Builder & SetBindingStrength(const HdTokenDataSourceHandle &bindingStrength)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API Builder & SetCollectionPath(const HdPathDataSourceHandle &collectionPath)
HdPathDataSource::Handle HdPathDataSourceHandle
HdTokenDataSource::Handle HdTokenDataSourceHandle
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.