HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
usdPrimInfoSchema.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_PRIM_INFO_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_IMAGING_USD_PRIM_INFO_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_PRIM_INFO_SCHEMA_TOKENS \
36  (__usdPrimInfo) \
37  (specifier) \
38  (typeName) \
39  (isLoaded) \
40  (apiSchemas) \
41  (kind) \
42  (niPrototypePath) \
43  (isNiPrototype) \
44  (piPropagatedPrototypes) \
45  (def) \
46  (over) \
47  ((class_, "class")) \
48 
49 TF_DECLARE_PUBLIC_TOKENS(UsdImagingUsdPrimInfoSchemaTokens, USDIMAGING_API,
51 
52 //-----------------------------------------------------------------------------
53 
54 
56 {
57 public:
58  /// \name Schema retrieval
59  /// @{
60 
61  UsdImagingUsdPrimInfoSchema(HdContainerDataSourceHandle container)
62  : HdSchema(container) {}
63 
64  /// Retrieves a container data source with the schema's default name token
65  /// "__usdPrimInfo" from the parent container and constructs a
66  /// UsdImagingUsdPrimInfoSchema instance.
67  /// Because the requested container data source may not exist, the result
68  /// should be checked with IsDefined() or a bool comparison before use.
71  const HdContainerDataSourceHandle &fromParentContainer);
72 
73  /// @}
74 
75 // --(BEGIN CUSTOM CODE: Schema Methods)--
76 // --(END CUSTOM CODE: Schema Methods)--
77 
78  /// \name Member accessor
79  /// @{
80 
83 
86 
89 
92 
95 
98 
101 
103  HdContainerDataSourceHandle GetPiPropagatedPrototypes() const;
104 
105  /// @}
106 
107  /// \name Schema location
108  /// @{
109 
110  /// Returns a token where the container representing this schema is found in
111  /// a container by default.
113  static const TfToken &GetSchemaToken();
114 
115  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
116  /// where the container representing this schema is found by default.
118  static const HdDataSourceLocator &GetDefaultLocator();
119 
120  /// @}
121 
122  /// \name Data source locators for members
123  ///
124  /// The following methods return an HdDataSourceLocator (relative to the
125  /// prim-level data source) where the data source for a member can be found.
126  ///
127  /// This is often useful for checking intersection against the
128  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
129  /// @{
130 
131  /// Prim-level relative data source locator to locate niPrototypePath.
134  /// @}
135 
136  /// \name Schema construction
137  /// @{
138 
139  /// \deprecated Use Builder instead.
140  ///
141  /// Builds a container data source which includes the provided child data
142  /// sources. Parameters with nullptr values are excluded. This is a
143  /// low-level interface. For cases in which it's desired to define
144  /// the container with a sparse set of child fields, the Builder class
145  /// is often more convenient and readable.
147  static HdContainerDataSourceHandle
149  const HdTokenDataSourceHandle &specifier,
150  const HdTokenDataSourceHandle &typeName,
151  const HdBoolDataSourceHandle &isLoaded,
152  const HdTokenArrayDataSourceHandle &apiSchemas,
153  const HdTokenDataSourceHandle &kind,
154  const HdPathDataSourceHandle &niPrototypePath,
155  const HdBoolDataSourceHandle &isNiPrototype,
156  const HdContainerDataSourceHandle &piPropagatedPrototypes
157  );
158 
159  /// \class UsdImagingUsdPrimInfoSchema::Builder
160  ///
161  /// Utility class for setting sparse sets of child data source fields to be
162  /// filled as arguments into BuildRetained. Because all setter methods
163  /// return a reference to the instance, this can be used in the "builder
164  /// pattern" form.
165  class Builder
166  {
167  public:
170  const HdTokenDataSourceHandle &specifier);
173  const HdTokenDataSourceHandle &typeName);
176  const HdBoolDataSourceHandle &isLoaded);
179  const HdTokenArrayDataSourceHandle &apiSchemas);
181  Builder &SetKind(
182  const HdTokenDataSourceHandle &kind);
185  const HdPathDataSourceHandle &niPrototypePath);
188  const HdBoolDataSourceHandle &isNiPrototype);
191  const HdContainerDataSourceHandle &piPropagatedPrototypes);
192 
193  /// Returns a container data source containing the members set thus far.
195  HdContainerDataSourceHandle Build();
196 
197  private:
198  HdTokenDataSourceHandle _specifier;
199  HdTokenDataSourceHandle _typeName;
200  HdBoolDataSourceHandle _isLoaded;
201  HdTokenArrayDataSourceHandle _apiSchemas;
203  HdPathDataSourceHandle _niPrototypePath;
204  HdBoolDataSourceHandle _isNiPrototype;
205  HdContainerDataSourceHandle _piPropagatedPrototypes;
206 
207  };
208 
209  /// Returns token data source for use as specifier value.
210  ///
211  /// The following values will be stored statically and reused for future
212  /// calls:
213  /// - UsdImagingUsdPrimInfoSchemaTokens->def
214  /// - UsdImagingUsdPrimInfoSchemaTokens->over
215  /// - UsdImagingUsdPrimInfoSchemaTokens->class_
218  const TfToken &specifier);
219 
220  /// @}
221 };
222 
224 
225 #endif
USDIMAGING_API Builder & SetKind(const HdTokenDataSourceHandle &kind)
USDIMAGING_API HdBoolDataSourceHandle GetIsLoaded() const
static USDIMAGING_API UsdImagingUsdPrimInfoSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDIMAGING_API HdContainerDataSourceHandle GetPiPropagatedPrototypes() const
#define USDIMAGING_API
Definition: api.h:23
USDIMAGING_API HdPathDataSourceHandle GetNiPrototypePath() const
USDIMAGING_API Builder & SetTypeName(const HdTokenDataSourceHandle &typeName)
UsdImagingUsdPrimInfoSchema(HdContainerDataSourceHandle container)
USDIMAGING_API Builder & SetSpecifier(const HdTokenDataSourceHandle &specifier)
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
static USDIMAGING_API const HdDataSourceLocator & GetNiPrototypePathLocator()
Prim-level relative data source locator to locate niPrototypePath.
USDIMAGING_API Builder & SetApiSchemas(const HdTokenArrayDataSourceHandle &apiSchemas)
USDIMAGING_API HdTokenArrayDataSourceHandle GetApiSchemas() const
#define USD_IMAGING_USD_PRIM_INFO_SCHEMA_TOKENS
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
Definition: token.h:70
static USDIMAGING_API const TfToken & GetSchemaToken()
USDIMAGING_API HdTokenDataSourceHandle GetSpecifier() const
static USDIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &specifier, const HdTokenDataSourceHandle &typeName, const HdBoolDataSourceHandle &isLoaded, const HdTokenArrayDataSourceHandle &apiSchemas, const HdTokenDataSourceHandle &kind, const HdPathDataSourceHandle &niPrototypePath, const HdBoolDataSourceHandle &isNiPrototype, const HdContainerDataSourceHandle &piPropagatedPrototypes)
HdBoolDataSource::Handle HdBoolDataSourceHandle
USDIMAGING_API HdTokenDataSourceHandle GetKind() const
USDIMAGING_API Builder & SetNiPrototypePath(const HdPathDataSourceHandle &niPrototypePath)
USDIMAGING_API HdBoolDataSourceHandle GetIsNiPrototype() const
USDIMAGING_API Builder & SetIsLoaded(const HdBoolDataSourceHandle &isLoaded)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
USDIMAGING_API HdTokenDataSourceHandle GetTypeName() const
TF_DECLARE_PUBLIC_TOKENS(UsdImagingUsdPrimInfoSchemaTokens, USDIMAGING_API, USD_IMAGING_USD_PRIM_INFO_SCHEMA_TOKENS)
static USDIMAGING_API HdTokenDataSourceHandle BuildSpecifierDataSource(const TfToken &specifier)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API Builder & SetPiPropagatedPrototypes(const HdContainerDataSourceHandle &piPropagatedPrototypes)
HdPathDataSource::Handle HdPathDataSourceHandle
USDIMAGING_API Builder & SetIsNiPrototype(const HdBoolDataSourceHandle &isNiPrototype)
HdTokenDataSource::Handle HdTokenDataSourceHandle