This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GfTransform Class Reference

Basic type: Compound linear transformation. More...

#include <transform.h>

Public Member Functions

 GfTransform ()
 The default constructor sets the component values to the identity transformation.
 
 GfTransform (const GfVec3d &scale, const GfRotation &pivotOrientation, const GfRotation &rotation, const GfVec3d &pivotPosition, const GfVec3d &translation)
 This constructor initializes the transformation from all component values.
 
 GfTransform (const GfVec3d &translation, const GfRotation &rotation, const GfVec3d &scale, const GfVec3d &pivotPosition, const GfRotation &pivotOrientation)
 This constructor initializes the transformation from all component values.
 
 GfTransform (const GfMatrix4d &m)
 This constructor initializes the transformation with a matrix.
 
GF_API GfTransformSet (const GfVec3d &scale, const GfRotation &pivotOrientation, const GfRotation &rotation, const GfVec3d &pivotPosition, const GfVec3d &translation)
 Sets the transformation from all component values.
 
GfTransformSet (const GfVec3d &translation, const GfRotation &rotation, const GfVec3d &scale, const GfVec3d &pivotPosition, const GfRotation &pivotOrientation)
 Sets the transformation from all component values.
 
GF_API GfTransformSetMatrix (const GfMatrix4d &m)
 Sets the transform components to implement the transformation represented by matrix m , ignoring any projection.
 
GF_API GfTransformSetIdentity ()
 Sets the transformation to the identity transformation.
 
void SetScale (const GfVec3d &scale)
 Sets the scale component, leaving all others untouched.
 
void SetPivotOrientation (const GfRotation &pivotOrient)
 Sets the pivot orientation component, leaving all others untouched.
 
void SetScaleOrientation (const GfRotation &pivotOrient)
 Sets the pivot orientation component, leaving all others untouched.
 
void SetRotation (const GfRotation &rotation)
 Sets the rotation component, leaving all others untouched.
 
void SetPivotPosition (const GfVec3d &pivPos)
 Sets the pivot position component, leaving all others untouched.
 
void SetCenter (const GfVec3d &pivPos)
 Sets the pivot position component, leaving all others untouched.
 
void SetTranslation (const GfVec3d &translation)
 Sets the translation component, leaving all others untouched.
 
const GfVec3dGetScale () const
 Returns the scale component.
 
const GfRotationGetPivotOrientation () const
 Returns the pivot orientation component.
 
const GfRotationGetScaleOrientation () const
 Returns the scale orientation component.
 
const GfRotationGetRotation () const
 Returns the rotation component.
 
const GfVec3dGetPivotPosition () const
 Returns the pivot position component.
 
const GfVec3dGetCenter () const
 Returns the pivot position component.
 
const GfVec3dGetTranslation () const
 Returns the translation component.
 
GF_API GfMatrix4d GetMatrix () const
 Returns a GfMatrix4d that implements the cumulative transformation.
 
GF_API bool operator== (const GfTransform &xf) const
 Component-wise transform equality test.
 
bool operator!= (const GfTransform &xf) const
 Component-wise transform inequality test.
 
GF_API GfTransformoperator*= (const GfTransform &xf)
 Post-multiplies transform xf into this transform.
 

Friends

GfTransform operator* (const GfTransform &xf1, const GfTransform &xf2)
 Returns the product of transforms xf1 and xf2.
 

Detailed Description

Basic type: Compound linear transformation.

This class represents a linear transformation specified as a series of individual components: a translation, a rotation, a scale, a pivotPosition, and a pivotOrientation. When applied to a point, the point will be transformed as follows (in order):

  • Scaled by the scale with respect to pivotPosition and the orientation specified by the pivotOrientation.
  • Rotated by the rotation about pivotPosition.
  • Translated by Translation

That is, the cumulative matrix that this represents looks like this.

M = -P * -O * S * O * R * P * T

where

  • T is the translation matrix
  • P is the matrix that translates by pivotPosition
  • R is the rotation matrix
  • O is the matrix that rotates to pivotOrientation
  • S is the scale matrix

Definition at line 52 of file transform.h.

Constructor & Destructor Documentation

◆ GfTransform() [1/4]

GfTransform ( )
inline

The default constructor sets the component values to the identity transformation.

Definition at line 58 of file transform.h.

◆ GfTransform() [2/4]

GfTransform ( const GfVec3d scale,
const GfRotation pivotOrientation,
const GfRotation rotation,
const GfVec3d pivotPosition,
const GfVec3d translation 
)
inline

This constructor initializes the transformation from all component values.

This is the constructor used by 2x code.

Definition at line 64 of file transform.h.

◆ GfTransform() [3/4]

GfTransform ( const GfVec3d translation,
const GfRotation rotation,
const GfVec3d scale,
const GfVec3d pivotPosition,
const GfRotation pivotOrientation 
)
inline

This constructor initializes the transformation from all component values.

This is the constructor used by 3x code.

Definition at line 74 of file transform.h.

◆ GfTransform() [4/4]

GfTransform ( const GfMatrix4d m)
inline

This constructor initializes the transformation with a matrix.

See SetMatrix() for more information.

Definition at line 84 of file transform.h.

Member Function Documentation

◆ GetCenter()

const GfVec3d & GetCenter ( ) const
inline

Returns the pivot position component.

Definition at line 180 of file transform.h.

◆ GetMatrix()

GF_API GfMatrix4d GetMatrix ( ) const

Returns a GfMatrix4d that implements the cumulative transformation.

◆ GetPivotOrientation()

const GfRotation & GetPivotOrientation ( ) const
inline

Returns the pivot orientation component.

Definition at line 160 of file transform.h.

◆ GetPivotPosition()

const GfVec3d & GetPivotPosition ( ) const
inline

Returns the pivot position component.

Definition at line 175 of file transform.h.

◆ GetRotation()

const GfRotation & GetRotation ( ) const
inline

Returns the rotation component.

Definition at line 170 of file transform.h.

◆ GetScale()

const GfVec3d & GetScale ( ) const
inline

Returns the scale component.

Definition at line 155 of file transform.h.

◆ GetScaleOrientation()

const GfRotation & GetScaleOrientation ( ) const
inline

Returns the scale orientation component.

Definition at line 165 of file transform.h.

◆ GetTranslation()

const GfVec3d & GetTranslation ( ) const
inline

Returns the translation component.

Definition at line 185 of file transform.h.

◆ operator!=()

bool operator!= ( const GfTransform xf) const
inline

Component-wise transform inequality test.

All components must match exactly for transforms to be considered equal.

Definition at line 200 of file transform.h.

◆ operator*=()

GF_API GfTransform & operator*= ( const GfTransform xf)

Post-multiplies transform xf into this transform.

◆ operator==()

GF_API bool operator== ( const GfTransform xf) const

Component-wise transform equality test.

All components must match exactly for transforms to be considered equal.

◆ Set() [1/2]

GF_API GfTransform & Set ( const GfVec3d scale,
const GfRotation pivotOrientation,
const GfRotation rotation,
const GfVec3d pivotPosition,
const GfVec3d translation 
)

Sets the transformation from all component values.

This constructor orders its arguments the way that 2x expects.

◆ Set() [2/2]

GfTransform & Set ( const GfVec3d translation,
const GfRotation rotation,
const GfVec3d scale,
const GfVec3d pivotPosition,
const GfRotation pivotOrientation 
)
inline

Sets the transformation from all component values.

This constructor orders its arguments the way that 3x expects.

Definition at line 100 of file transform.h.

◆ SetCenter()

void SetCenter ( const GfVec3d pivPos)
inline

Sets the pivot position component, leaving all others untouched.

Definition at line 145 of file transform.h.

◆ SetIdentity()

GF_API GfTransform & SetIdentity ( )

Sets the transformation to the identity transformation.

◆ SetMatrix()

GF_API GfTransform & SetMatrix ( const GfMatrix4d m)

Sets the transform components to implement the transformation represented by matrix m , ignoring any projection.

This tries to leave the current center unchanged.

◆ SetPivotOrientation()

void SetPivotOrientation ( const GfRotation pivotOrient)
inline

Sets the pivot orientation component, leaving all others untouched.

Definition at line 125 of file transform.h.

◆ SetPivotPosition()

void SetPivotPosition ( const GfVec3d pivPos)
inline

Sets the pivot position component, leaving all others untouched.

Definition at line 140 of file transform.h.

◆ SetRotation()

void SetRotation ( const GfRotation rotation)
inline

Sets the rotation component, leaving all others untouched.

Definition at line 135 of file transform.h.

◆ SetScale()

void SetScale ( const GfVec3d scale)
inline

Sets the scale component, leaving all others untouched.

Definition at line 120 of file transform.h.

◆ SetScaleOrientation()

void SetScaleOrientation ( const GfRotation pivotOrient)
inline

Sets the pivot orientation component, leaving all others untouched.

Definition at line 130 of file transform.h.

◆ SetTranslation()

void SetTranslation ( const GfVec3d translation)
inline

Sets the translation component, leaving all others untouched.

Definition at line 150 of file transform.h.

Friends And Related Function Documentation

◆ operator*

GfTransform operator* ( const GfTransform xf1,
const GfTransform xf2 
)
friend

Returns the product of transforms xf1 and xf2.

Definition at line 209 of file transform.h.


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