All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
xformCommonAPI.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 USDGEOM_GENERATED_XFORMCOMMONAPI_H
8#define USDGEOM_GENERATED_XFORMCOMMONAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdGeom/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
21
22#include "pxr/base/vt/value.h"
23
24#include "pxr/base/gf/vec3d.h"
25#include "pxr/base/gf/vec3f.h"
27
28#include "pxr/base/tf/token.h"
29#include "pxr/base/tf/type.h"
30
31PXR_NAMESPACE_OPEN_SCOPE
32
33class SdfAssetPath;
34
35// -------------------------------------------------------------------------- //
36// XFORMCOMMONAPI //
37// -------------------------------------------------------------------------- //
38
73{
74public:
78 static const UsdSchemaKind schemaKind = UsdSchemaKind::NonAppliedAPI;
79
84 explicit UsdGeomXformCommonAPI(const UsdPrim& prim=UsdPrim())
85 : UsdAPISchemaBase(prim)
86 {
87 }
88
92 explicit UsdGeomXformCommonAPI(const UsdSchemaBase& schemaObj)
93 : UsdAPISchemaBase(schemaObj)
94 {
95 }
96
98 USDGEOM_API
100
104 USDGEOM_API
105 static const TfTokenVector &
106 GetSchemaAttributeNames(bool includeInherited=true);
107
117 USDGEOM_API
119 Get(const UsdStagePtr &stage, const SdfPath &path);
120
121
122protected:
126 USDGEOM_API
128
129private:
130 // needs to invoke _GetStaticTfType.
131 friend class UsdSchemaRegistry;
132 USDGEOM_API
133 static const TfType &_GetStaticTfType();
134
135 static bool _IsTypedSchema();
136
137 // override SchemaBase virtuals.
138 USDGEOM_API
139 const TfType &_GetTfType() const override;
140
141public:
142 // ===================================================================== //
143 // Feel free to add custom code below this line, it will be preserved by
144 // the code generator.
145 //
146 // Just remember to:
147 // - Close the class declaration with };
148 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
149 // - Close the include guard with #endif
150 // ===================================================================== //
151 // --(BEGIN CUSTOM CODE)--
152
155 RotationOrderXYZ,
156 RotationOrderXZY,
157 RotationOrderYXZ,
158 RotationOrderYZX,
159 RotationOrderZXY,
160 RotationOrderZYX
161 };
162
165 enum OpFlags {
166 OpNone = 0,
167 OpTranslate = 1,
168 OpPivot = 2,
169 OpRotate = 4,
170 OpScale = 8,
171 };
172
177 struct Ops {
178 UsdGeomXformOp translateOp;
179 UsdGeomXformOp pivotOp;
180 UsdGeomXformOp rotateOp;
181 UsdGeomXformOp scaleOp;
182 UsdGeomXformOp inversePivotOp;
183 };
184
197 USDGEOM_API
198 bool SetXformVectors(const GfVec3d &translation,
199 const GfVec3f &rotation,
200 const GfVec3f &scale,
201 const GfVec3f &pivot,
202 RotationOrder rotOrder,
203 const UsdTimeCode time) const;
204
215 USDGEOM_API
216 bool GetXformVectors(GfVec3d *translation,
217 GfVec3f *rotation,
218 GfVec3f *scale,
219 GfVec3f *pivot,
220 RotationOrder *rotOrder,
221 const UsdTimeCode time) const;
222
239 USDGEOM_API
241 GfVec3f* rotation,
242 GfVec3f* scale,
243 GfVec3f* pivot,
245 const UsdTimeCode time) const;
246
249 USDGEOM_API
250 bool GetResetXformStack() const;
251
256
258 USDGEOM_API
259 bool SetTranslate(const GfVec3d &translation,
260 const UsdTimeCode time=UsdTimeCode::Default()) const;
261
263 USDGEOM_API
264 bool SetPivot(const GfVec3f &pivot,
265 const UsdTimeCode time=UsdTimeCode::Default()) const;
266
268 USDGEOM_API
269 bool SetRotate(const GfVec3f &rotation,
270 UsdGeomXformCommonAPI::RotationOrder rotOrder=RotationOrderXYZ,
271 const UsdTimeCode time=UsdTimeCode::Default()) const;
272
274 USDGEOM_API
275 bool SetScale(const GfVec3f &scale,
276 const UsdTimeCode time=UsdTimeCode::Default()) const;
277
280 USDGEOM_API
281 bool SetResetXformStack(bool resetXformStack) const;
282
292 USDGEOM_API
294 RotationOrder rotOrder,
295 OpFlags op1=OpNone,
296 OpFlags op2=OpNone,
297 OpFlags op3=OpNone,
298 OpFlags op4=OpNone) const;
299
306 USDGEOM_API
308 OpFlags op1=OpNone,
309 OpFlags op2=OpNone,
310 OpFlags op3=OpNone,
311 OpFlags op4=OpNone) const;
312
314
317
323 USDGEOM_API
325 const GfVec3f &rotation,
326 const UsdGeomXformCommonAPI::RotationOrder rotationOrder);
327
329
334 USDGEOM_API
336 RotationOrder rotOrder);
337
343 USDGEOM_API
345 UsdGeomXformOp::Type opType);
346
350 USDGEOM_API
352 UsdGeomXformOp::Type opType);
353
354protected:
356 USDGEOM_API
357 bool _IsCompatible() const override;
358};
359
360
361PXR_NAMESPACE_CLOSE_SCOPE
362
363#endif
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Basic type for a vector of 3 double components.
Definition: vec3d.h:46
Basic type for a vector of 3 float components.
Definition: vec3f.h:46
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
TfType represents a dynamic runtime type.
Definition: type.h:48
The base class for all API schemas.
Definition: apiSchemaBase.h:99
This class provides API for authoring and retrieving a standard set of component transformations whic...
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
static USDGEOM_API RotationOrder ConvertOpTypeToRotationOrder(UsdGeomXformOp::Type opType)
Converts the given opType to the corresponding value in the UsdGeomXformCommonAPI::RotationOrder enum...
static USDGEOM_API bool CanConvertOpTypeToRotationOrder(UsdGeomXformOp::Type opType)
Whether the given opType has a corresponding value in the UsdGeomXformCommonAPI::RotationOrder enum (...
USDGEOM_API bool GetXformVectorsByAccumulation(GfVec3d *translation, GfVec3f *rotation, GfVec3f *scale, GfVec3f *pivot, UsdGeomXformCommonAPI::RotationOrder *rotOrder, const UsdTimeCode time) const
Retrieve values of the various component xformOps at a given time.
USDGEOM_API bool GetResetXformStack() const
Returns whether the xformable resets the transform stack.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDGEOM_API bool SetScale(const GfVec3f &scale, const UsdTimeCode time=UsdTimeCode::Default()) const
Set scale at time to scale.
static USDGEOM_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...
OpFlags
Enumerates the categories of ops that can be handled by XformCommonAPI.
USDGEOM_API Ops CreateXformOps(OpFlags op1=OpNone, OpFlags op2=OpNone, OpFlags op3=OpNone, OpFlags op4=OpNone) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDGEOM_API bool SetPivot(const GfVec3f &pivot, const UsdTimeCode time=UsdTimeCode::Default()) const
Set pivot position at time to pivot.
static USDGEOM_API UsdGeomXformCommonAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomXformCommonAPI holding the prim adhering to this schema at path on stage.
USDGEOM_API bool GetXformVectors(GfVec3d *translation, GfVec3f *rotation, GfVec3f *scale, GfVec3f *pivot, RotationOrder *rotOrder, const UsdTimeCode time) const
Retrieve values of the various component xformOps at a given time.
UsdGeomXformCommonAPI(const UsdSchemaBase &schemaObj)
Construct a UsdGeomXformCommonAPI on the prim held by schemaObj .
USDGEOM_API bool SetResetXformStack(bool resetXformStack) const
Set whether the xformable resets the transform stack.
static USDGEOM_API GfMatrix4d GetRotationTransform(const GfVec3f &rotation, const UsdGeomXformCommonAPI::RotationOrder rotationOrder)
Return the 4x4 matrix that applies the rotation encoded by rotation vector rotation using the rotatio...
UsdGeomXformCommonAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomXformCommonAPI on UsdPrim prim .
USDGEOM_API bool SetRotate(const GfVec3f &rotation, UsdGeomXformCommonAPI::RotationOrder rotOrder=RotationOrderXYZ, const UsdTimeCode time=UsdTimeCode::Default()) const
Set rotation at time to rotation.
virtual USDGEOM_API ~UsdGeomXformCommonAPI()
Destructor.
static USDGEOM_API UsdGeomXformOp::Type ConvertRotationOrderToOpType(RotationOrder rotOrder)
Converts the given rotOrder to the corresponding value in the UsdGeomXformOp::Type enum.
USDGEOM_API bool SetXformVectors(const GfVec3d &translation, const GfVec3f &rotation, const GfVec3f &scale, const GfVec3f &pivot, RotationOrder rotOrder, const UsdTimeCode time) const
Set values for the various component xformOps at a given time.
RotationOrder
Enumerates the rotation order of the 3-angle Euler rotation.
USDGEOM_API Ops CreateXformOps(RotationOrder rotOrder, OpFlags op1=OpNone, OpFlags op2=OpNone, OpFlags op3=OpNone, OpFlags op4=OpNone) const
Creates the specified XformCommonAPI-compatible xform ops, or returns the existing ops if they alread...
USDGEOM_API bool SetTranslate(const GfVec3d &translation, const UsdTimeCode time=UsdTimeCode::Default()) const
Set translation at time to translation.
USDGEOM_API bool _IsCompatible() const override
Returns whether the underlying xformable is compatible with the API.
Return type for CreateXformOps().
Schema wrapper for UsdAttribute for authoring and computing transformation operations,...
Definition: xformOp.h:94
Type
Enumerates the set of all transformation operation types.
Definition: xformOp.h:98
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:67
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:95
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