All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
limitAPI.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 USDPHYSICS_GENERATED_LIMITAPI_H
8#define USDPHYSICS_GENERATED_LIMITAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdPhysics/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// PHYSICSLIMITAPI //
34// -------------------------------------------------------------------------- //
35
47{
48public:
52 static const UsdSchemaKind schemaKind = UsdSchemaKind::MultipleApplyAPI;
53
64 const UsdPrim& prim=UsdPrim(), const TfToken &name=TfToken())
65 : UsdAPISchemaBase(prim, /*instanceName*/ name)
66 { }
67
73 const UsdSchemaBase& schemaObj, const TfToken &name)
74 : UsdAPISchemaBase(schemaObj, /*instanceName*/ name)
75 { }
76
78 USDPHYSICS_API
80
84 USDPHYSICS_API
85 static const TfTokenVector &
86 GetSchemaAttributeNames(bool includeInherited=true);
87
93 USDPHYSICS_API
94 static TfTokenVector
95 GetSchemaAttributeNames(bool includeInherited, const TfToken &instanceName);
96
98 TfToken GetName() const {
99 return _GetInstanceName();
100 }
101
116 USDPHYSICS_API
117 static UsdPhysicsLimitAPI
118 Get(const UsdStagePtr &stage, const SdfPath &path);
119
122 USDPHYSICS_API
123 static UsdPhysicsLimitAPI
124 Get(const UsdPrim &prim, const TfToken &name);
125
128 USDPHYSICS_API
129 static std::vector<UsdPhysicsLimitAPI>
130 GetAll(const UsdPrim &prim);
131
134 USDPHYSICS_API
135 static bool
137
141 USDPHYSICS_API
142 static bool
144
161 USDPHYSICS_API
162 static bool
163 CanApply(const UsdPrim &prim, const TfToken &name,
164 std::string *whyNot=nullptr);
165
185 USDPHYSICS_API
186 static UsdPhysicsLimitAPI
187 Apply(const UsdPrim &prim, const TfToken &name);
188
189protected:
193 USDPHYSICS_API
195
196private:
197 // needs to invoke _GetStaticTfType.
198 friend class UsdSchemaRegistry;
199 USDPHYSICS_API
200 static const TfType &_GetStaticTfType();
201
202 static bool _IsTypedSchema();
203
204 // override SchemaBase virtuals.
205 USDPHYSICS_API
206 const TfType &_GetTfType() const override;
207
208public:
209 // --------------------------------------------------------------------- //
210 // LOW
211 // --------------------------------------------------------------------- //
220 USDPHYSICS_API
222
228 USDPHYSICS_API
229 UsdAttribute CreateLowAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
230
231public:
232 // --------------------------------------------------------------------- //
233 // HIGH
234 // --------------------------------------------------------------------- //
243 USDPHYSICS_API
245
251 USDPHYSICS_API
252 UsdAttribute CreateHighAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
253
254public:
255 // ===================================================================== //
256 // Feel free to add custom code below this line, it will be preserved by
257 // the code generator.
258 //
259 // Just remember to:
260 // - Close the class declaration with };
261 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
262 // - Close the include guard with #endif
263 // ===================================================================== //
264 // --(BEGIN CUSTOM CODE)--
265};
266
267PXR_NAMESPACE_CLOSE_SCOPE
268
269#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
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:160
The PhysicsLimitAPI can be applied to a PhysicsJoint and will restrict the movement along an axis.
Definition: limitAPI.h:47
static USDPHYSICS_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,...
static USDPHYSICS_API bool IsSchemaPropertyBaseName(const TfToken &baseName)
Checks if the given name baseName is the base name of a property of PhysicsLimitAPI.
UsdPhysicsLimitAPI(const UsdSchemaBase &schemaObj, const TfToken &name)
Construct a UsdPhysicsLimitAPI on the prim held by schemaObj with name name.
Definition: limitAPI.h:72
static USDPHYSICS_API UsdPhysicsLimitAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdPhysicsLimitAPI holding the prim adhering to this schema at path on stage.
static USDPHYSICS_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...
TfToken GetName() const
Returns the name of this multiple-apply schema instance.
Definition: limitAPI.h:98
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: limitAPI.h:52
static USDPHYSICS_API UsdPhysicsLimitAPI Apply(const UsdPrim &prim, const TfToken &name)
Applies this multiple-apply API schema to the given prim along with the given instance name,...
USDPHYSICS_API UsdAttribute CreateHighAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetHighAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static USDPHYSICS_API UsdPhysicsLimitAPI Get(const UsdPrim &prim, const TfToken &name)
Return a UsdPhysicsLimitAPI with name name holding the prim prim.
static USDPHYSICS_API bool IsPhysicsLimitAPIPath(const SdfPath &path, TfToken *name)
Checks if the given path path is of an API schema of type PhysicsLimitAPI.
UsdPhysicsLimitAPI(const UsdPrim &prim=UsdPrim(), const TfToken &name=TfToken())
Construct a UsdPhysicsLimitAPI on UsdPrim prim with name name .
Definition: limitAPI.h:63
static USDPHYSICS_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...
USDPHYSICS_API UsdAttribute GetHighAttr() const
Upper limit.
virtual USDPHYSICS_API ~UsdPhysicsLimitAPI()
Destructor.
static USDPHYSICS_API std::vector< UsdPhysicsLimitAPI > GetAll(const UsdPrim &prim)
Return a vector of all named instances of UsdPhysicsLimitAPI on the given prim.
USDPHYSICS_API UsdAttribute GetLowAttr() const
Lower limit.
USDPHYSICS_API UsdAttribute CreateLowAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetLowAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDPHYSICS_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
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...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
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