Loading...
Searching...
No Matches
overrideAPI.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 USDLOD_GENERATED_OVERRIDEAPI_H
8#define USDLOD_GENERATED_OVERRIDEAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdLod/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// LODOVERRIDEAPI //
34// -------------------------------------------------------------------------- //
35
52{
53public:
58
63 explicit UsdLodOverrideAPI(const UsdPrim& prim=UsdPrim())
64 : UsdAPISchemaBase(prim)
65 {
66 }
67
71 explicit UsdLodOverrideAPI(const UsdSchemaBase& schemaObj)
72 : UsdAPISchemaBase(schemaObj)
73 {
74 }
75
77 USDLOD_API
79
83 USDLOD_API
84 static const TfTokenVector &
85 GetSchemaAttributeNames(bool includeInherited=true);
86
96 USDLOD_API
98 Get(const UsdStagePtr &stage, const SdfPath &path);
99
100
117 USDLOD_API
118 static bool
119 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
120
136 USDLOD_API
137 static UsdLodOverrideAPI
138 Apply(const UsdPrim &prim);
139
140protected:
144 USDLOD_API
146
147private:
148 // needs to invoke _GetStaticTfType.
149 friend class UsdSchemaRegistry;
150 USDLOD_API
151 static const TfType &_GetStaticTfType();
152
153 static bool _IsTypedSchema();
154
155 // override SchemaBase virtuals.
156 USDLOD_API
157 const TfType &_GetTfType() const override;
158
159public:
160 // --------------------------------------------------------------------- //
161 // LODOVERRIDEMODE
162 // --------------------------------------------------------------------- //
179 USDLOD_API
181
187 USDLOD_API
188 UsdAttribute CreateLodOverrideModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
189
190public:
191 // --------------------------------------------------------------------- //
192 // LODOVERRIDEINDEX
193 // --------------------------------------------------------------------- //
208 USDLOD_API
210
216 USDLOD_API
217 UsdAttribute CreateLodOverrideIndexAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
218
219public:
220 // ===================================================================== //
221 // Feel free to add custom code below this line, it will be preserved by
222 // the code generator.
223 //
224 // Just remember to:
225 // - Close the class declaration with };
226 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
227 // - Close the include guard with #endif
228 // ===================================================================== //
229 // --(BEGIN CUSTOM CODE)--
230
239
240 USDLOD_API
242 float* overrideIndex,
243 UsdTimeCode time = UsdTimeCode::Default()) const;
244};
245
246PXR_NAMESPACE_CLOSE_SCOPE
247
248#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.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition attribute.h:183
API for overriding Level of Detail (LOD) choices.
Definition overrideAPI.h:52
USDLOD_API UsdAttribute CreateLodOverrideModeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetLodOverrideModeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition overrideAPI.h:57
USDLOD_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
UsdLodOverrideAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdLodOverrideAPI on UsdPrim prim .
Definition overrideAPI.h:63
virtual USDLOD_API ~UsdLodOverrideAPI()
Destructor.
static USDLOD_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.
USDLOD_API UsdAttribute GetLodOverrideIndexAttr() const
The index value to use when lod:override:mode is "indexedLOD".
static USDLOD_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...
UsdLodOverrideAPI(const UsdSchemaBase &schemaObj)
Construct a UsdLodOverrideAPI on the prim held by schemaObj .
Definition overrideAPI.h:71
static USDLOD_API UsdLodOverrideAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdLodOverrideAPI holding the prim adhering to this schema at path on stage.
static USDLOD_API UsdLodOverrideAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
USDLOD_API UsdAttribute CreateLodOverrideIndexAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetLodOverrideIndexAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDLOD_API TfToken ComputeLODOverride(float *overrideIndex, UsdTimeCode time=UsdTimeCode::Default()) const
Compute the current the LOD override (if any) for this prim.
USDLOD_API UsdAttribute GetLodOverrideModeAttr() const
How to apply override to LOD decisions.
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...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition timeCode.h:72
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition timeCode.h:113
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
@ 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