#include
<MAngle.h>
Methods for setting and retreiving angular data in various unit systems
The MAngle class provides a fundamental type for the Maya API to hold and manipulate angular data. All API methods that require or return angular information do so through variables of this type.
Public Types |
|
enum | Unit
{ kInvalid, kRadians, kDegrees, kAngMinutes, kAngSeconds, kLast } |
Available Unit Systems. More... |
|
Public Member Functions |
|
MAngle () | |
Default constructor. |
|
MAngle (const MAngle &src) | |
Copy constructor. |
|
MAngle (double value, Unit u=kRadians) | |
Class constructor. |
|
~MAngle () | |
Class destructor. |
|
MAngle & | operator= (const MAngle &other) |
Assignment operator. |
|
Unit | unit () const |
Current unit. |
|
double | value () const |
Current value. |
|
MStatus | setUnit (Unit newUnit) |
Set current unit. |
|
MStatus | setValue (double newValue) |
Set current value. |
|
double | as (Unit otherUnit, MStatus *ReturnStatus=NULL) const |
Unit conversion. |
|
double | asUnits (Unit otherUnit, MStatus *ReturnStatus=NULL) const |
Unit conversion. |
|
double | asRadians () const |
Convert to radians. |
|
double | asDegrees () const |
Convert to degrees. |
|
double | asAngMinutes () const |
Convert to minutes of arc. |
|
double | asAngSeconds () const |
Convert to seconds of arc. |
|
Static Public Member Functions |
|
static Unit | uiUnit () |
Working unit. |
|
static MStatus | setUIUnit (Unit newUnit) |
Set working unit. |
|
static Unit | internalUnit () |
Internal unit. |
|
static double | internalToUI (double internalValue) |
Unit conversion. |
|
static double | uiToInternal (double uiValue) |
Unit conversion. |
|
static MStatus | setInternalUnit (Unit internalUnit) |
This method is obsolete. |
enum MAngle::Unit |
MAngle::MAngle | ( | ) |
Default constructor.
Initialize the MAngle instance to 0 in the current internal units.
MAngle::MAngle | ( | const MAngle & | src | ) |
Copy constructor.
[in] | src | The source MAngle object. |
MAngle::MAngle | ( | double | value, | |
MAngle::Unit | unitSystem =
kRadians |
|||
) |
Class constructor.
Initialize the MAngle instance to the given value in the given unit system.
[in] | value | The initial value of the instance |
[in] | unitSystem | The unit system for the initial value |
MAngle::Unit MAngle::unit | ( | ) | const |
Current unit.
Return the units currently in effect for this instance.
double MAngle::value | ( | ) | const |
Current value.
Return the value of the current instance in the currently set units.
MStatus MAngle::setUnit | ( | MAngle::Unit | newUnit | ) |
Set current unit.
Set the unit used by this instance. This will not affect the current value of the MAngle.
[in] | newUnit | An element of the MAngle::Unit enum |
MStatus MAngle::setValue | ( | double | newValue | ) |
Set current value.
Set the value of this instance.
[in] | newValue | The new value in the units currently in effect |
double MAngle::as | ( | MAngle::Unit | otherUnit, | |
MStatus * | ReturnStatus =
NULL |
|||
) | const |
Unit conversion.
Return the current value of this instance in the provided units.
[in] | otherUnit | An element of the MAngle::Unit enum specifying the desired units |
[out] | ReturnStatus | Return status |
double MAngle::asUnits | ( | MAngle::Unit | otherUnit, | |
MStatus * | ReturnStatus =
NULL |
|||
) | const |
Unit conversion.
Return the current value of this instance in the provided units.
[in] | otherUnit | An element of the MAngle::Unit enum specifying the desired units |
[out] | ReturnStatus | Return status |
double MAngle::asRadians | ( | ) | const |
Convert to radians.
Return the current value of this instance in radians.
double MAngle::asDegrees | ( | ) | const |
Convert to degrees.
Return the current value of this instance in degrees.
double MAngle::asAngMinutes | ( | ) | const |
Convert to minutes of arc.
Return the current value of this instance in minutes of arc.
double MAngle::asAngSeconds | ( | ) | const |
Convert to seconds of arc.
Return the current value of this instance in seconds of arc.
MAngle::Unit MAngle::uiUnit | ( | ) | [static] |
Working unit.
Returns the Working Units (or UI units) chosen in the settings of the prefs window.
MStatus MAngle::setUIUnit | ( | MAngle::Unit | newUnit | ) | [static] |
Set working unit.
Set the unit system to be used by the user in the UI. This will not change the return value of the MAngle::value() method of this instance of MAngle.
[in] | newUnit | and element of the MAngle::Unit enum. |
MAngle::Unit MAngle::internalUnit | ( | ) | [static] |
Internal unit.
Returns the internal unit system used by Maya. This is the unit system Maya stores angles in.
double MAngle::internalToUI | ( | double | internalValue | ) | [static] |
Unit conversion.
Converts a value from Maya's internal units to the current units used in the UI.
[in] | internalValue | a value in internal units |
double MAngle::uiToInternal | ( | double | uiValue | ) | [static] |
Unit conversion.
Converts a value from the units Maya is currently uses in the UI to the Maya internal unit system.
[in] | uiValue | a value in UI units |
MStatus MAngle::setInternalUnit | ( | MAngle::Unit | internalUnit | ) | [static] |
This method is obsolete.
[in] | internalUnit | the internal unit for angles |
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |