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 Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 /* ************************************************************************** */
27 /* ** ** */
28 /* ** This file is generated by a script. ** */
29 /* ** ** */
30 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31 /* ** Edit hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_USD_IMAGING_USD_IMAGING_USD_PRIM_INFO_SCHEMA_H
36 #define PXR_USD_IMAGING_USD_IMAGING_USD_PRIM_INFO_SCHEMA_H
37 
39 
40 #include "pxr/imaging/hd/schema.h"
41 
42 // --(BEGIN CUSTOM CODE: Includes)--
43 // --(END CUSTOM CODE: Includes)--
44 
46 
47 //-----------------------------------------------------------------------------
48 
49 // --(BEGIN CUSTOM CODE: Declares)--
50 // --(END CUSTOM CODE: Declares)--
51 
52 //-----------------------------------------------------------------------------
53 
54 #define USD_IMAGING_USD_PRIM_INFO_SCHEMA_TOKENS \
55  (__usdPrimInfo) \
56  (niPrototypePath) \
57  (isNiPrototype) \
58  (specifier) \
59  (piPropagatedPrototypes) \
60  (isLoaded) \
61  (def) \
62  (over) \
63  ((class_, "class")) \
64 
65 TF_DECLARE_PUBLIC_TOKENS(UsdImagingUsdPrimInfoSchemaTokens, USDIMAGING_API,
67 
68 //-----------------------------------------------------------------------------
70 {
71 public:
72  UsdImagingUsdPrimInfoSchema(HdContainerDataSourceHandle container)
73  : HdSchema(container) {}
74 
75 // --(BEGIN CUSTOM CODE: Schema Methods)--
76 // --(END CUSTOM CODE: Schema Methods)--
77 
78  //ACCESSORS
79 
80 
83 
86 
89 
91  HdContainerDataSourceHandle GetPiPropagatedPrototypes();
92 
95 
96  // RETRIEVING AND CONSTRUCTING
97 
98  /// Builds a container data source which includes the provided child data
99  /// sources. Parameters with nullptr values are excluded. This is a
100  /// low-level interface. For cases in which it's desired to define
101  /// the container with a sparse set of child fields, the Builder class
102  /// is often more convenient and readable.
104  static HdContainerDataSourceHandle
106  const HdPathDataSourceHandle &niPrototypePath,
107  const HdBoolDataSourceHandle &isNiPrototype,
108  const HdTokenDataSourceHandle &specifier,
109  const HdContainerDataSourceHandle &piPropagatedPrototypes,
110  const HdBoolDataSourceHandle &isLoaded
111  );
112 
113  /// \class UsdImagingUsdPrimInfoSchema::Builder
114  ///
115  /// Utility class for setting sparse sets of child data source fields to be
116  /// filled as arguments into BuildRetained. Because all setter methods
117  /// return a reference to the instance, this can be used in the "builder
118  /// pattern" form.
119  class Builder
120  {
121  public:
124  const HdPathDataSourceHandle &niPrototypePath);
127  const HdBoolDataSourceHandle &isNiPrototype);
130  const HdTokenDataSourceHandle &specifier);
133  const HdContainerDataSourceHandle &piPropagatedPrototypes);
136  const HdBoolDataSourceHandle &isLoaded);
137 
138  /// Returns a container data source containing the members set thus far.
140  HdContainerDataSourceHandle Build();
141 
142  private:
143  HdPathDataSourceHandle _niPrototypePath;
144  HdBoolDataSourceHandle _isNiPrototype;
145  HdTokenDataSourceHandle _specifier;
146  HdContainerDataSourceHandle _piPropagatedPrototypes;
147  HdBoolDataSourceHandle _isLoaded;
148  };
149 
150  /// Retrieves a container data source with the schema's default name token
151  /// "__usdPrimInfo" from the parent container and constructs a
152  /// UsdImagingUsdPrimInfoSchema instance.
153  /// Because the requested container data source may not exist, the result
154  /// should be checked with IsDefined() or a bool comparison before use.
157  const HdContainerDataSourceHandle &fromParentContainer);
158 
159  /// Returns a token where the container representing this schema is found in
160  /// a container by default.
162  static const TfToken &GetSchemaToken();
163 
164  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
165  /// where the container representing this schema is found by default.
167  static const HdDataSourceLocator &GetDefaultLocator();
168 
169  // DATA SOURCE LOCATORS FOR MEMBERS
170  //
171  // The following methods return an HdDataSourceLocator (relative to the
172  // prim-level data source) where the data source for a member can be found.
173  //
174  // This is often useful for checking intersection against the
175  // HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
176 
177 
178  /// Prim-level relative data source locator to locate niPrototypePath.
181 
182 
183  /// Returns token data source for use as specifier value.
184  /// Values of...
185  /// - UsdImagingUsdPrimInfoSchemaTokens->def
186  /// - UsdImagingUsdPrimInfoSchemaTokens->over
187  /// - UsdImagingUsdPrimInfoSchemaTokens->class_
188  /// ...will be stored statically and reused for future calls.
191  const TfToken &specifier);
192 
193 };
194 
196 
197 #endif
static USDIMAGING_API UsdImagingUsdPrimInfoSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
#define USDIMAGING_API
Definition: api.h:40
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.
#define USD_IMAGING_USD_PRIM_INFO_SCHEMA_TOKENS
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
USDIMAGING_API HdBoolDataSourceHandle GetIsLoaded()
Definition: token.h:87
static USDIMAGING_API const TfToken & GetSchemaToken()
USDIMAGING_API HdTokenDataSourceHandle GetSpecifier()
HdBoolDataSource::Handle HdBoolDataSourceHandle
USDIMAGING_API Builder & SetNiPrototypePath(const HdPathDataSourceHandle &niPrototypePath)
USDIMAGING_API Builder & SetIsLoaded(const HdBoolDataSourceHandle &isLoaded)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
TF_DECLARE_PUBLIC_TOKENS(UsdImagingUsdPrimInfoSchemaTokens, USDIMAGING_API, USD_IMAGING_USD_PRIM_INFO_SCHEMA_TOKENS)
USDIMAGING_API HdContainerDataSourceHandle GetPiPropagatedPrototypes()
static USDIMAGING_API HdTokenDataSourceHandle BuildSpecifierDataSource(const TfToken &specifier)
static USDIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &niPrototypePath, const HdBoolDataSourceHandle &isNiPrototype, const HdTokenDataSourceHandle &specifier, const HdContainerDataSourceHandle &piPropagatedPrototypes, const HdBoolDataSourceHandle &isLoaded)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
USDIMAGING_API Builder & SetPiPropagatedPrototypes(const HdContainerDataSourceHandle &piPropagatedPrototypes)
USDIMAGING_API HdPathDataSourceHandle GetNiPrototypePath()
USDIMAGING_API HdBoolDataSourceHandle GetIsNiPrototype()
HdPathDataSource::Handle HdPathDataSourceHandle
USDIMAGING_API Builder & SetIsNiPrototype(const HdBoolDataSourceHandle &isNiPrototype)
HdTokenDataSource::Handle HdTokenDataSourceHandle