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  (collectionPrimPath) \
38  (collectionName) \
39  (materialPath) \
40  (bindingStrength) \
41 
42 TF_DECLARE_PUBLIC_TOKENS(UsdImagingCollectionMaterialBindingSchemaTokens, USDIMAGING_API,
44 
45 //-----------------------------------------------------------------------------
46 
47 
49 {
50 public:
51  /// \name Schema retrieval
52  /// @{
53 
54  UsdImagingCollectionMaterialBindingSchema(HdContainerDataSourceHandle container)
55  : HdSchema(container) {}
56 
57  /// Retrieves a container data source with the schema's default name token
58  /// "collectionMaterialBinding" from the parent container and constructs a
59  /// UsdImagingCollectionMaterialBindingSchema instance.
60  /// Because the requested container data source may not exist, the result
61  /// should be checked with IsDefined() or a bool comparison before use.
64  const HdContainerDataSourceHandle &fromParentContainer);
65 
66  /// @}
67 
68 // --(BEGIN CUSTOM CODE: Schema Methods)--
69 // --(END CUSTOM CODE: Schema Methods)--
70 
71  /// \name Member accessor
72  /// @{
73 
76 
79 
82 
85 
86  /// @}
87 
88  /// \name Schema location
89  /// @{
90 
91  /// Returns a token where the container representing this schema is found in
92  /// a container by default.
94  static const TfToken &GetSchemaToken();
95 
96  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
97  /// where the container representing this schema is found by default.
99  static const HdDataSourceLocator &GetDefaultLocator();
100 
101  /// @}
102 
103  /// \name Schema construction
104  /// @{
105 
106  /// \deprecated Use Builder instead.
107  ///
108  /// Builds a container data source which includes the provided child data
109  /// sources. Parameters with nullptr values are excluded. This is a
110  /// low-level interface. For cases in which it's desired to define
111  /// the container with a sparse set of child fields, the Builder class
112  /// is often more convenient and readable.
114  static HdContainerDataSourceHandle
116  const HdPathDataSourceHandle &collectionPrimPath,
117  const HdTokenDataSourceHandle &collectionName,
118  const HdPathDataSourceHandle &materialPath,
119  const HdTokenDataSourceHandle &bindingStrength
120  );
121 
122  /// \class UsdImagingCollectionMaterialBindingSchema::Builder
123  ///
124  /// Utility class for setting sparse sets of child data source fields to be
125  /// filled as arguments into BuildRetained. Because all setter methods
126  /// return a reference to the instance, this can be used in the "builder
127  /// pattern" form.
128  class Builder
129  {
130  public:
133  const HdPathDataSourceHandle &collectionPrimPath);
136  const HdTokenDataSourceHandle &collectionName);
139  const HdPathDataSourceHandle &materialPath);
142  const HdTokenDataSourceHandle &bindingStrength);
143 
144  /// Returns a container data source containing the members set thus far.
146  HdContainerDataSourceHandle Build();
147 
148  private:
149  HdPathDataSourceHandle _collectionPrimPath;
150  HdTokenDataSourceHandle _collectionName;
151  HdPathDataSourceHandle _materialPath;
152  HdTokenDataSourceHandle _bindingStrength;
153 
154  };
155 
156  /// @}
157 };
158 
160 
161 #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
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
USDIMAGING_API HdPathDataSourceHandle GetCollectionPrimPath() const
UsdImagingCollectionMaterialBindingSchema(HdContainerDataSourceHandle container)
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
USDIMAGING_API Builder & SetCollectionPrimPath(const HdPathDataSourceHandle &collectionPrimPath)
Definition: token.h:70
static USDIMAGING_API UsdImagingCollectionMaterialBindingSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDIMAGING_API Builder & SetMaterialPath(const HdPathDataSourceHandle &materialPath)
#define USD_IMAGING_COLLECTION_MATERIAL_BINDING_SCHEMA_TOKENS
static USDIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &collectionPrimPath, const HdTokenDataSourceHandle &collectionName, const HdPathDataSourceHandle &materialPath, const HdTokenDataSourceHandle &bindingStrength)
USDIMAGING_API HdTokenDataSourceHandle GetBindingStrength() const
USDIMAGING_API Builder & SetBindingStrength(const HdTokenDataSourceHandle &bindingStrength)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API HdTokenDataSourceHandle GetCollectionName() const
HdPathDataSource::Handle HdPathDataSourceHandle
USDIMAGING_API Builder & SetCollectionName(const HdTokenDataSourceHandle &collectionName)
HdTokenDataSource::Handle HdTokenDataSourceHandle
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.