HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdGeomXformCache Class Reference

#include <xformCache.h>

Public Member Functions

USDGEOM_API UsdGeomXformCache (const UsdTimeCode time)
 Construct a new XformCache for the specified time. More...
 
USDGEOM_API UsdGeomXformCache ()
 Construct a new XformCache for UsdTimeCode::Default(). More...
 
USDGEOM_API GfMatrix4d GetLocalToWorldTransform (const UsdPrim &prim)
 
USDGEOM_API GfMatrix4d GetParentToWorldTransform (const UsdPrim &prim)
 
USDGEOM_API GfMatrix4d GetLocalTransformation (const UsdPrim &prim, bool *resetsXformStack)
 
USDGEOM_API GfMatrix4d ComputeRelativeTransform (const UsdPrim &prim, const UsdPrim &ancestor, bool *resetXformStack)
 
USDGEOM_API bool IsAttributeIncludedInLocalTransform (const UsdPrim &prim, const TfToken &attrName)
 
USDGEOM_API bool TransformMightBeTimeVarying (const UsdPrim &prim)
 
USDGEOM_API bool GetResetXformStack (const UsdPrim &prim)
 
USDGEOM_API void Clear ()
 Clears all pre-cached values. More...
 
USDGEOM_API void SetTime (UsdTimeCode time)
 
UsdTimeCode GetTime ()
 Get the current time from which this cache is reading values. More...
 
USDGEOM_API void Swap (UsdGeomXformCache &other)
 Swap the contents of this XformCache with other. More...
 

Detailed Description

A caching mechanism for transform matrices. For best performance, this object should be reused for multiple CTM queries.

Instances of this type can be copied, though using Swap() may result in better performance.

It is valid to cache prims from multiple stages in a single XformCache.

WARNING: this class does not automatically invalidate cached values based on changes to the stage from which values were cached. Additionally, a separate instance of this class should be used per-thread, calling the Get* methods from multiple threads is not safe, as they mutate internal state.

Definition at line 57 of file xformCache.h.

Constructor & Destructor Documentation

USDGEOM_API UsdGeomXformCache::UsdGeomXformCache ( const UsdTimeCode  time)
explicit

Construct a new XformCache for the specified time.

USDGEOM_API UsdGeomXformCache::UsdGeomXformCache ( )

Construct a new XformCache for UsdTimeCode::Default().

Member Function Documentation

USDGEOM_API void UsdGeomXformCache::Clear ( )

Clears all pre-cached values.

USDGEOM_API GfMatrix4d UsdGeomXformCache::ComputeRelativeTransform ( const UsdPrim prim,
const UsdPrim ancestor,
bool *  resetXformStack 
)

Returns the result of concatenating all transforms beneath ancestor that affect prim. This includes the local transform of prim itself, but not the local transform of ancestor. If ancestor is not an ancestor of prim, the resulting transform is the local-to-world transformation of prim. The resetXformTsack pointer must be valid. If any intermediate prims reset the transform stack, resetXformStack will be set to true. Intermediate transforms are cached, but the result of this call itself is not cached.

USDGEOM_API GfMatrix4d UsdGeomXformCache::GetLocalToWorldTransform ( const UsdPrim prim)

Compute the transformation matrix for the given prim, including the transform authored on the Prim itself, if present.

Note
This method may mutate internal cache state and is not thread safe.
USDGEOM_API GfMatrix4d UsdGeomXformCache::GetLocalTransformation ( const UsdPrim prim,
bool *  resetsXformStack 
)

Returns the local transformation of the prim. Uses the cached XformQuery to compute the result quickly. The resetsXformStack pointer must be valid. It will be set to true if prim resets the transform stack. The result of this call is cached.

USDGEOM_API GfMatrix4d UsdGeomXformCache::GetParentToWorldTransform ( const UsdPrim prim)

Compute the transformation matrix for the given prim, but do NOT include the transform authored on the prim itself.

Note
This method may mutate internal cache state and is not thread safe.
USDGEOM_API bool UsdGeomXformCache::GetResetXformStack ( const UsdPrim prim)

Whether the xform stack is reset at the given prim.

Note
This method may mutate internal cache state and is not thread safe.
UsdTimeCode UsdGeomXformCache::GetTime ( )
inline

Get the current time from which this cache is reading values.

Definition at line 141 of file xformCache.h.

USDGEOM_API bool UsdGeomXformCache::IsAttributeIncludedInLocalTransform ( const UsdPrim prim,
const TfToken attrName 
)

Whether the attribute named attrName, belonging to the given prim affects the local transform value at the prim.

Note
This method may mutate internal cache state and is not thread safe.
USDGEOM_API void UsdGeomXformCache::SetTime ( UsdTimeCode  time)

Use the new time when computing values and may clear any existing values cached for the previous time. Setting time to the current time is a no-op.

USDGEOM_API void UsdGeomXformCache::Swap ( UsdGeomXformCache other)

Swap the contents of this XformCache with other.

USDGEOM_API bool UsdGeomXformCache::TransformMightBeTimeVarying ( const UsdPrim prim)

Whether the local transformation value at the prim may vary over time.

Note
This method may mutate internal cache state and is not thread safe.

The documentation for this class was generated from the following file: