Loading...
Searching...
No Matches
labelsAPI.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef USDSEMANTICS_GENERATED_LABELSAPI_H
8#define USDSEMANTICS_GENERATED_LABELSAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdSemantics/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
19#include "pxr/base/vt/value.h"
20
21#include "pxr/base/gf/vec3d.h"
22#include "pxr/base/gf/vec3f.h"
24
25#include "pxr/base/tf/token.h"
26#include "pxr/base/tf/type.h"
27
28PXR_NAMESPACE_OPEN_SCOPE
29
30class SdfAssetPath;
31
32// -------------------------------------------------------------------------- //
33// SEMANTICSLABELSAPI //
34// -------------------------------------------------------------------------- //
35
45{
46public:
50 static const UsdSchemaKind schemaKind = UsdSchemaKind::MultipleApplyAPI;
51
62 const UsdPrim& prim=UsdPrim(), const TfToken &name=TfToken())
63 : UsdAPISchemaBase(prim, /*instanceName*/ name)
64 { }
65
71 const UsdSchemaBase& schemaObj, const TfToken &name)
72 : UsdAPISchemaBase(schemaObj, /*instanceName*/ name)
73 { }
74
76 USDSEMANTICS_API
78
82 USDSEMANTICS_API
83 static const TfTokenVector &
84 GetSchemaAttributeNames(bool includeInherited=true);
85
91 USDSEMANTICS_API
92 static TfTokenVector
93 GetSchemaAttributeNames(bool includeInherited, const TfToken &instanceName);
94
96 TfToken GetName() const {
97 return _GetInstanceName();
98 }
99
114 USDSEMANTICS_API
116 Get(const UsdStagePtr &stage, const SdfPath &path);
117
120 USDSEMANTICS_API
122 Get(const UsdPrim &prim, const TfToken &name);
123
126 USDSEMANTICS_API
127 static std::vector<UsdSemanticsLabelsAPI>
128 GetAll(const UsdPrim &prim);
129
132 USDSEMANTICS_API
133 static bool
135
139 USDSEMANTICS_API
140 static bool
142
159 USDSEMANTICS_API
160 static bool
161 CanApply(const UsdPrim &prim, const TfToken &name,
162 std::string *whyNot=nullptr);
163
183 USDSEMANTICS_API
185 Apply(const UsdPrim &prim, const TfToken &name);
186
187protected:
191 USDSEMANTICS_API
193
194private:
195 // needs to invoke _GetStaticTfType.
196 friend class UsdSchemaRegistry;
197 USDSEMANTICS_API
198 static const TfType &_GetStaticTfType();
199
200 static bool _IsTypedSchema();
201
202 // override SchemaBase virtuals.
203 USDSEMANTICS_API
204 const TfType &_GetTfType() const override;
205
206public:
207 // --------------------------------------------------------------------- //
208 // LABELS
209 // --------------------------------------------------------------------- //
217 USDSEMANTICS_API
219
225 USDSEMANTICS_API
226 UsdAttribute CreateLabelsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
227
228public:
229 // ===================================================================== //
230 // Feel free to add custom code below this line, it will be preserved by
231 // the code generator.
232 //
233 // Just remember to:
234 // - Close the class declaration with };
235 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
236 // - Close the include guard with #endif
237 // ===================================================================== //
238 // --(BEGIN CUSTOM CODE)--
250 USDSEMANTICS_API
251 static std::vector<TfToken> GetDirectTaxonomies(const UsdPrim& prim);
252
257 USDSEMANTICS_API
258 static std::vector<TfToken> ComputeInheritedTaxonomies(
259 const UsdPrim& prim);
260};
261
262PXR_NAMESPACE_CLOSE_SCOPE
263
264#endif
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
The base class for all API schemas.
Definition: apiSchemaBase.h:99
const TfToken & _GetInstanceName() const
Returns the instance name of the API schema object belonging to a multiple-apply API schema.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:183
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
The base class for all schema types in Usd.
Definition: schemaBase.h:39
Singleton registry that provides access to schema type information and the prim definitions for regis...
Application of labels for a prim for a taxonomy specified by the schema's instance name.
Definition: labelsAPI.h:45
static USDSEMANTICS_API UsdSemanticsLabelsAPI Get(const UsdPrim &prim, const TfToken &name)
Return a UsdSemanticsLabelsAPI with name name holding the prim prim.
static USDSEMANTICS_API bool IsSchemaPropertyBaseName(const TfToken &baseName)
Checks if the given name baseName is the base name of a property of SemanticsLabelsAPI.
static USDSEMANTICS_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
TfToken GetName() const
Returns the name of this multiple-apply schema instance.
Definition: labelsAPI.h:96
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: labelsAPI.h:50
static USDSEMANTICS_API std::vector< TfToken > ComputeInheritedTaxonomies(const UsdPrim &prim)
Get the unique instance names (taxonomies) of all applications of UsdSemanticsLabelsAPI for the speci...
static USDSEMANTICS_API UsdSemanticsLabelsAPI Apply(const UsdPrim &prim, const TfToken &name)
Applies this multiple-apply API schema to the given prim along with the given instance name,...
static USDSEMANTICS_API std::vector< TfToken > GetDirectTaxonomies(const UsdPrim &prim)
Get the instance names (taxonomies) of all applications of UsdSemanticsLabelsAPI for the specified pr...
USDSEMANTICS_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDSEMANTICS_API UsdAttribute CreateLabelsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetLabelsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
UsdSemanticsLabelsAPI(const UsdPrim &prim=UsdPrim(), const TfToken &name=TfToken())
Construct a UsdSemanticsLabelsAPI on UsdPrim prim with name name .
Definition: labelsAPI.h:61
USDSEMANTICS_API UsdAttribute GetLabelsAttr() const
Array of labels specified directly at this prim.
static USDSEMANTICS_API bool CanApply(const UsdPrim &prim, const TfToken &name, std::string *whyNot=nullptr)
Returns true if this multiple-apply API schema can be applied, with the given instance name,...
UsdSemanticsLabelsAPI(const UsdSchemaBase &schemaObj, const TfToken &name)
Construct a UsdSemanticsLabelsAPI on the prim held by schemaObj with name name.
Definition: labelsAPI.h:70
static USDSEMANTICS_API UsdSemanticsLabelsAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdSemanticsLabelsAPI holding the prim adhering to this schema at path on stage.
static USDSEMANTICS_API std::vector< UsdSemanticsLabelsAPI > GetAll(const UsdPrim &prim)
Return a vector of all named instances of UsdSemanticsLabelsAPI on the given prim.
virtual USDSEMANTICS_API ~UsdSemanticsLabelsAPI()
Destructor.
static USDSEMANTICS_API TfTokenVector GetSchemaAttributeNames(bool includeInherited, const TfToken &instanceName)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
static USDSEMANTICS_API bool IsSemanticsLabelsAPIPath(const SdfPath &path, TfToken *name)
Checks if the given path path is of an API schema of type SemanticsLabelsAPI.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:90
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440