HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
usdRenderVarSchema.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_USD_RENDER_VAR_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_IMAGING_USD_RENDER_VAR_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_USD_RENDER_VAR_SCHEMA_TOKENS \
36  (__usdRenderVar) \
37  (dataType) \
38  (sourceName) \
39  (sourceType) \
40  (namespacedSettings) \
41 
42 TF_DECLARE_PUBLIC_TOKENS(UsdImagingUsdRenderVarSchemaTokens, USDIMAGING_API,
44 
45 //-----------------------------------------------------------------------------
46 
47 
49 {
50 public:
51  /// \name Schema retrieval
52  /// @{
53 
54  UsdImagingUsdRenderVarSchema(HdContainerDataSourceHandle container)
55  : HdSchema(container) {}
56 
57  /// Retrieves a container data source with the schema's default name token
58  /// "__usdRenderVar" from the parent container and constructs a
59  /// UsdImagingUsdRenderVarSchema 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 
84  HdContainerDataSourceHandle GetNamespacedSettings() const;
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 Data source locators for members
104  ///
105  /// The following methods return an HdDataSourceLocator (relative to the
106  /// prim-level data source) where the data source for a member can be found.
107  ///
108  /// This is often useful for checking intersection against the
109  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
110  /// @{
111 
112  /// Prim-level relative data source locator to locate namespacedSettings.
115  /// @}
116 
117  /// \name Schema construction
118  /// @{
119 
120  /// \deprecated Use Builder instead.
121  ///
122  /// Builds a container data source which includes the provided child data
123  /// sources. Parameters with nullptr values are excluded. This is a
124  /// low-level interface. For cases in which it's desired to define
125  /// the container with a sparse set of child fields, the Builder class
126  /// is often more convenient and readable.
128  static HdContainerDataSourceHandle
131  const HdStringDataSourceHandle &sourceName,
132  const HdTokenDataSourceHandle &sourceType,
133  const HdContainerDataSourceHandle &namespacedSettings
134  );
135 
136  /// \class UsdImagingUsdRenderVarSchema::Builder
137  ///
138  /// Utility class for setting sparse sets of child data source fields to be
139  /// filled as arguments into BuildRetained. Because all setter methods
140  /// return a reference to the instance, this can be used in the "builder
141  /// pattern" form.
142  class Builder
143  {
144  public:
150  const HdStringDataSourceHandle &sourceName);
153  const HdTokenDataSourceHandle &sourceType);
156  const HdContainerDataSourceHandle &namespacedSettings);
157 
158  /// Returns a container data source containing the members set thus far.
160  HdContainerDataSourceHandle Build();
161 
162  private:
163  HdTokenDataSourceHandle _dataType;
164  HdStringDataSourceHandle _sourceName;
165  HdTokenDataSourceHandle _sourceType;
166  HdContainerDataSourceHandle _namespacedSettings;
167 
168  };
169 
170  /// @}
171 };
172 
174 
175 #endif
TF_DECLARE_PUBLIC_TOKENS(UsdImagingUsdRenderVarSchemaTokens, USDIMAGING_API, USD_IMAGING_USD_RENDER_VAR_SCHEMA_TOKENS)
static USDIMAGING_API const HdDataSourceLocator & GetNamespacedSettingsLocator()
Prim-level relative data source locator to locate namespacedSettings.
#define USDIMAGING_API
Definition: api.h:23
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdStringDataSource::Handle HdStringDataSourceHandle
USDIMAGING_API Builder & SetNamespacedSettings(const HdContainerDataSourceHandle &namespacedSettings)
USDIMAGING_API Builder & SetSourceType(const HdTokenDataSourceHandle &sourceType)
Definition: token.h:70
static USDIMAGING_API const TfToken & GetSchemaToken()
static USDIMAGING_API UsdImagingUsdRenderVarSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDIMAGING_API Builder & SetSourceName(const HdStringDataSourceHandle &sourceName)
static USDIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &dataType, const HdStringDataSourceHandle &sourceName, const HdTokenDataSourceHandle &sourceType, const HdContainerDataSourceHandle &namespacedSettings)
USDIMAGING_API HdTokenDataSourceHandle GetDataType() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
UsdImagingUsdRenderVarSchema(HdContainerDataSourceHandle container)
USDIMAGING_API HdTokenDataSourceHandle GetSourceType() const
#define USD_IMAGING_USD_RENDER_VAR_SCHEMA_TOKENS
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API HdStringDataSourceHandle GetSourceName() const
USDIMAGING_API HdContainerDataSourceHandle GetNamespacedSettings() const
HUSD_API const char * dataType()
HdTokenDataSource::Handle HdTokenDataSourceHandle
USDIMAGING_API Builder & SetDataType(const HdTokenDataSourceHandle &dataType)