Loading...
Searching...
No Matches
claimsAPI.h
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 USDPROFILES_GENERATED_CLAIMSAPI_H
8#define USDPROFILES_GENERATED_CLAIMSAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdProfiles/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
17
19#include "pxr/base/tf/token.h"
20#include "pxr/base/vt/array.h"
22
23
24#include "pxr/base/vt/value.h"
25
26#include "pxr/base/gf/vec3d.h"
27#include "pxr/base/gf/vec3f.h"
29
30#include "pxr/base/tf/token.h"
31#include "pxr/base/tf/type.h"
32
33PXR_NAMESPACE_OPEN_SCOPE
34
35class SdfAssetPath;
36
37// -------------------------------------------------------------------------- //
38// CLAIMSAPI //
39// -------------------------------------------------------------------------- //
40
117{
118public:
123
128 explicit UsdProfilesClaimsAPI(const UsdPrim& prim=UsdPrim())
129 : UsdAPISchemaBase(prim)
130 {
131 }
132
136 explicit UsdProfilesClaimsAPI(const UsdSchemaBase& schemaObj)
137 : UsdAPISchemaBase(schemaObj)
138 {
139 }
140
142 USDPROFILES_API
144
148 USDPROFILES_API
149 static const TfTokenVector &
150 GetSchemaAttributeNames(bool includeInherited=true);
151
161 USDPROFILES_API
163 Get(const UsdStagePtr &stage, const SdfPath &path);
164
165
182 USDPROFILES_API
183 static bool
184 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
185
201 USDPROFILES_API
203 Apply(const UsdPrim &prim);
204
205protected:
209 USDPROFILES_API
211
212private:
213 // needs to invoke _GetStaticTfType.
214 friend class UsdSchemaRegistry;
215 USDPROFILES_API
216 static const TfType &_GetStaticTfType();
217
218 static bool _IsTypedSchema();
219
220 // override SchemaBase virtuals.
221 USDPROFILES_API
222 const TfType &_GetTfType() const override;
223
224public:
225 // ===================================================================== //
226 // Feel free to add custom code below this line, it will be preserved by
227 // the code generator.
228 //
229 // Just remember to:
230 // - Close the class declaration with };
231 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
232 // - Close the include guard with #endif
233 // ===================================================================== //
234 // --(BEGIN CUSTOM CODE)--
235
249
250 // ---------------------------------------------------------------------- //
251 // Raw dictionary access
252 // ---------------------------------------------------------------------- //
253
256 USDPROFILES_API
258
261 USDPROFILES_API
262 void SetProfilesInfo(const VtDictionary &info) const;
263
264 // ---------------------------------------------------------------------- //
265 // Capability Usage (DCC-authored tier)
266 // ---------------------------------------------------------------------- //
267
273 USDPROFILES_API
275
280 USDPROFILES_API
281 void SetCapabilityUsages(const VtDictionary &usages) const;
282
287 USDPROFILES_API
288 void SetCapabilityUsage(const TfToken &capability,
289 const TfToken &degradationClass) const;
290
293 USDPROFILES_API
294 TfToken GetCapabilityUsage(const TfToken &capability) const;
295
296 // ---------------------------------------------------------------------- //
297 // Profile Compatibility (pipeline-authored tier)
298 // ---------------------------------------------------------------------- //
299
305 USDPROFILES_API
307
311 USDPROFILES_API
312 void SetProfileCompatible(const TfToken &profile) const;
313
318 USDPROFILES_API
320 const TfToken &profile,
321 const VtArray<TfToken> &exceptions) const;
322
328 USDPROFILES_API
330
334 USDPROFILES_API
335 void ClearProfileCompatibility(const TfToken &profile) const;
336
337 // ---------------------------------------------------------------------- //
338 // Compatibility query
339 // ---------------------------------------------------------------------- //
340
358 USDPROFILES_API
360 const TfToken &profile,
361 std::vector<UsdProfileRegistry::CapabilityResult> *results = nullptr)
362 const;
363
365
366private:
367 template <typename T>
368 bool _GetProfilesInfoByKey(const TfToken &keyPath, T *val) const;
369};
370
371PXR_NAMESPACE_CLOSE_SCOPE
372
373#endif
Contains an asset path and optional evaluated and resolved paths.
Definition assetPath.h:79
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
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.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition prim.h:117
QueryStatus
Result of a predecessor reachability query.
UsdClaimsAPI records a prim's profile compatibility claims and per-capability usage declarations.
Definition claimsAPI.h:117
USDPROFILES_API void SetCapabilityUsage(const TfToken &capability, const TfToken &degradationClass) const
Sets the degradation class for a single capability.
USDPROFILES_API void SetCapabilityUsages(const VtDictionary &usages) const
Replaces the entire capability usage map.
UsdProfilesClaimsAPI(const UsdSchemaBase &schemaObj)
Construct a UsdProfilesClaimsAPI on the prim held by schemaObj .
Definition claimsAPI.h:136
USDPROFILES_API void ClearProfileCompatibility(const TfToken &profile) const
Removes the compatibility entry for profile entirely.
USDPROFILES_API void SetProfilesInfo(const VtDictionary &info) const
Replaces the entire profilesInfo dictionary on the current edit target.
USDPROFILES_API TfToken GetCapabilityUsage(const TfToken &capability) const
Returns the degradation class string for capability, or an empty TfToken if capability has not been r...
USDPROFILES_API VtDictionary GetCapabilityUsages() const
Returns the capability usage map as a VtDictionary whose keys are capability token strings and whose ...
USDPROFILES_API void SetProfileCompatible(const TfToken &profile) const
Declares this prim fully compatible with profile (no exceptions).
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition claimsAPI.h:122
UsdProfilesClaimsAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdProfilesClaimsAPI on UsdPrim prim .
Definition claimsAPI.h:128
static USDPROFILES_API UsdProfilesClaimsAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
USDPROFILES_API VtDictionary GetProfilesInfo() const
Returns the composed profilesInfo dictionary, or an empty dictionary if none has been authored.
static USDPROFILES_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...
virtual USDPROFILES_API ~UsdProfilesClaimsAPI()
Destructor.
USDPROFILES_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDPROFILES_API void SetProfileCompatibleWithExceptions(const TfToken &profile, const VtArray< TfToken > &exceptions) const
Declares this prim compatible with profile subject to the given exceptions — capabilities that are in...
static USDPROFILES_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
Returns true if this single-apply API schema can be applied to the given prim.
USDPROFILES_API VtArray< TfToken > GetProfileExceptions(const TfToken &profile) const
Returns the exception set for profile — the capabilities that are intentionally unsupported in the co...
USDPROFILES_API UsdProfileRegistry::QueryStatus IsCompatibleWith(const TfToken &profile, std::vector< UsdProfileRegistry::CapabilityResult > *results=nullptr) const
Returns the QueryStatus representing how well this prim satisfies profile, taking into account any ex...
USDPROFILES_API VtArray< TfToken > GetCompatibleProfiles() const
Returns all profiles that this prim has been declared compatible with, as an unordered array of profi...
static USDPROFILES_API UsdProfilesClaimsAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdProfilesClaimsAPI holding the prim adhering to this schema at path on stage.
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...
Represents an arbitrary dimensional rectangular container class.
Definition array.h:213
A map with string keys and VtValue values.
Definition dictionary.h:52
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition common.h:112
@ SingleApplyAPI
Single Apply API schema.
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