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

#include <rotation.h>

Public Member Functions

 GfRotation ()
 The default constructor leaves the rotation undefined. More...
 
 GfRotation (const GfVec3d &axis, double angle)
 
 GfRotation (const GfQuaternion &quaternion)
 This constructor initializes the rotation from a quaternion. More...
 
 GfRotation (const GfQuatd &quat)
 
GF_API GfRotation (const GfVec3d &rotateFrom, const GfVec3d &rotateTo)
 
GfRotationSetAxisAngle (const GfVec3d &axis, double angle)
 Sets the rotation to be angle degrees about axis. More...
 
GF_API GfRotationSetQuat (const GfQuatd &quat)
 
GfRotationSetQuaternion (const GfQuaternion &quat)
 Sets the rotation from a quaternion. More...
 
GF_API GfRotationSetRotateInto (const GfVec3d &rotateFrom, const GfVec3d &rotateTo)
 
GfRotationSetIdentity ()
 
const GfVec3dGetAxis () const
 Returns the axis of rotation. More...
 
double GetAngle () const
 Returns the rotation angle in degrees. More...
 
GfQuaternion GetQuaternion () const
 Returns the rotation expressed as a quaternion. More...
 
GF_API GfQuatd GetQuat () const
 Returns the rotation expressed as a quaternion. More...
 
GfRotation GetInverse () const
 Returns the inverse of this rotation. More...
 
GF_API GfVec3d Decompose (const GfVec3d &axis0, const GfVec3d &axis1, const GfVec3d &axis2) const
 
GF_API GfVec3f TransformDir (const GfVec3f &vec) const
 Transforms row vector vec by the rotation, returning the result. More...
 
GF_API GfVec3d TransformDir (const GfVec3d &vec) const
 
bool operator== (const GfRotation &r) const
 
bool operator!= (const GfRotation &r) const
 
GF_API GfRotationoperator*= (const GfRotation &r)
 Post-multiplies rotation r into this rotation. More...
 
GfRotationoperator*= (double scale)
 Scales rotation angle by multiplying by scale. More...
 
GfRotationoperator/= (double scale)
 Scales rotation angle by dividing by scale. More...
 

Static Public Member Functions

static GF_API void DecomposeRotation (const GfMatrix4d &rot, const GfVec3d &TwAxis, const GfVec3d &FBAxis, const GfVec3d &LRAxis, double handedness, double *thetaTw, double *thetaFB, double *thetaLR, double *thetaSw=NULL, bool useHint=false, const double *swShift=NULL)
 
static GF_API GfRotation RotateOntoProjected (const GfVec3d &v1, const GfVec3d &v2, const GfVec3d &axis)
 

Friends

size_t hash_value (const GfRotation &r)
 Hash. More...
 
GfRotation operator* (const GfRotation &r1, const GfRotation &r2)
 Returns composite rotation of rotations r1 and r2. More...
 
GfRotation operator* (const GfRotation &r, double scale)
 
GfRotation operator* (double scale, const GfRotation &r)
 
GfRotation operator/ (const GfRotation &r, double scale)
 

Detailed Description

Basic type: 3-space rotation specification.

This class represents a rotation in 3-space. This stores an axis as a normalized vector of 3 doubles and an angle in degrees (as a double). Rotations follow the right-hand rule: a positive rotation about an axis vector appears counter-clockwise when looking from the end of the vector toward the origin.

Definition at line 55 of file rotation.h.

Constructor & Destructor Documentation

GfRotation::GfRotation ( )
inline

The default constructor leaves the rotation undefined.

Definition at line 60 of file rotation.h.

GfRotation::GfRotation ( const GfVec3d axis,
double  angle 
)
inline

This constructor initializes the rotation to be angle degrees about axis.

Definition at line 65 of file rotation.h.

GfRotation::GfRotation ( const GfQuaternion quaternion)
inline

This constructor initializes the rotation from a quaternion.

Definition at line 70 of file rotation.h.

GfRotation::GfRotation ( const GfQuatd quat)
inline

This constructor initializes the rotation from a quaternion. Note that this constructor accepts GfQuatf and GfQuath since they implicitly convert to GfQuatd.

Definition at line 77 of file rotation.h.

GF_API GfRotation::GfRotation ( const GfVec3d rotateFrom,
const GfVec3d rotateTo 
)
inline

This constructor initializes the rotation to one that brings the rotateFrom vector to align with rotateTo. The passed vectors need not be unit length.

Definition at line 83 of file rotation.h.

Member Function Documentation

GF_API GfVec3d GfRotation::Decompose ( const GfVec3d axis0,
const GfVec3d axis1,
const GfVec3d axis2 
) const

Decompose rotation about 3 orthogonal axes. If the axes are not orthogonal, warnings will be spewed.

static GF_API void GfRotation::DecomposeRotation ( const GfMatrix4d rot,
const GfVec3d TwAxis,
const GfVec3d FBAxis,
const GfVec3d LRAxis,
double  handedness,
double *  thetaTw,
double *  thetaFB,
double *  thetaLR,
double *  thetaSw = NULL,
bool  useHint = false,
const double *  swShift = NULL 
)
static
double GfRotation::GetAngle ( ) const
inline

Returns the rotation angle in degrees.

Definition at line 127 of file rotation.h.

const GfVec3d& GfRotation::GetAxis ( ) const
inline

Returns the axis of rotation.

Definition at line 122 of file rotation.h.

GfRotation GfRotation::GetInverse ( ) const
inline

Returns the inverse of this rotation.

Definition at line 142 of file rotation.h.

GF_API GfQuatd GfRotation::GetQuat ( ) const

Returns the rotation expressed as a quaternion.

GfQuaternion GfRotation::GetQuaternion ( ) const
inline

Returns the rotation expressed as a quaternion.

Definition at line 132 of file rotation.h.

bool GfRotation::operator!= ( const GfRotation r) const
inline

Component-wise rotation inequality test. The axes and angles must match exactly for rotations to be considered equal. (To compare equality of the actual rotations, you can convert both to quaternions and test the results for equality.)

Definition at line 229 of file rotation.h.

GF_API GfRotation& GfRotation::operator*= ( const GfRotation r)

Post-multiplies rotation r into this rotation.

GfRotation& GfRotation::operator*= ( double  scale)
inline

Scales rotation angle by multiplying by scale.

Definition at line 238 of file rotation.h.

GfRotation& GfRotation::operator/= ( double  scale)
inline

Scales rotation angle by dividing by scale.

Definition at line 244 of file rotation.h.

bool GfRotation::operator== ( const GfRotation r) const
inline

Component-wise rotation equality test. The axes and angles must match exactly for rotations to be considered equal. (To compare equality of the actual rotations, you can convert both to quaternions and test the results for equality.)

Definition at line 220 of file rotation.h.

static GF_API GfRotation GfRotation::RotateOntoProjected ( const GfVec3d v1,
const GfVec3d v2,
const GfVec3d axis 
)
static
GfRotation& GfRotation::SetAxisAngle ( const GfVec3d axis,
double  angle 
)
inline

Sets the rotation to be angle degrees about axis.

Definition at line 88 of file rotation.h.

GfRotation& GfRotation::SetIdentity ( )
inline

Sets the rotation to an identity rotation. (This is chosen to be 0 degrees around the positive X axis.)

Definition at line 115 of file rotation.h.

GF_API GfRotation& GfRotation::SetQuat ( const GfQuatd quat)

Sets the rotation from a quaternion. Note that this method accepts GfQuatf and GfQuath since they implicitly convert to GfQuatd.

GfRotation& GfRotation::SetQuaternion ( const GfQuaternion quat)
inline

Sets the rotation from a quaternion.

Definition at line 102 of file rotation.h.

GF_API GfRotation& GfRotation::SetRotateInto ( const GfVec3d rotateFrom,
const GfVec3d rotateTo 
)

Sets the rotation to one that brings the rotateFrom vector to align with rotateTo. The passed vectors need not be unit length.

GF_API GfVec3f GfRotation::TransformDir ( const GfVec3f vec) const

Transforms row vector vec by the rotation, returning the result.

GF_API GfVec3d GfRotation::TransformDir ( const GfVec3d vec) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Friends And Related Function Documentation

size_t hash_value ( const GfRotation r)
friend

Hash.

Definition at line 209 of file rotation.h.

GfRotation operator* ( const GfRotation r1,
const GfRotation r2 
)
friend

Returns composite rotation of rotations r1 and r2.

Definition at line 250 of file rotation.h.

GfRotation operator* ( const GfRotation r,
double  scale 
)
friend

Returns a rotation equivalent to r with its angle multiplied by scale.

Definition at line 258 of file rotation.h.

GfRotation operator* ( double  scale,
const GfRotation r 
)
friend

Returns a rotation equivalent to r with its angle multiplied by scale.

Definition at line 265 of file rotation.h.

GfRotation operator/ ( const GfRotation r,
double  scale 
)
friend

Returns a rotation equivalent to r with its angle divided by scale.

Definition at line 271 of file rotation.h.


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