class MAngle

Jump to documentation

Manipulate Angular Data (OpenMaya) (OpenMaya.py)

public members:

enum Unit
Available Unit Systems
kInvalid
kRadians
Radians
kDegrees
Degrees
kAngMinutes
Minutes of Arc
kAngSeconds
Seconds of Arc
kLast
MAngle ()
MAngle ( const MAngle & src )
MAngle ( double value , Unit u = kRadians )
~MAngle ()
MAngle & operator= ( const MAngle & other )
Unit unit () const
double value () const
MStatus setUnit ( Unit newUnit )
MStatus setValue ( double newValue )
double as ( Unit otherUnit, MStatus *ReturnStatus = NULL ) const
double asRadians () const
double asDegrees () const
double asAngMinutes () const
double asAngSeconds () const
static Unit uiUnit ()
static MStatus setUIUnit ( Unit newUnit )
static Unit internalUnit ()
static double internalToUI ( double internalValue )
static double uiToInternal ( double uiValue )
static MStatus setInternalUnit ( Unit internalUnit )
OBSOLETE Changing the internal units is generally not a good idea and using this method may often produce unexpected results.

Documentation

Methods for setting and retreiving angular data in various unit systems
Description

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.

Functions

MAngle:: MAngle ()

Description

The default class constructor. Initialize the MAngle instance to 0 in the current internal units. (See setInternalUnit and internalUnit below).

MAngle:: MAngle ( double value , MAngle::Unit unitSystem )

Description

Class constructor. Initialize the MAngle instance to the given value in the given unit system

Arguments

  • value the initial value of the instance
  • unitSystem the unit system for the initial value

MAngle:: MAngle ( const MAngle & src )

Description

Copy constructor.

Arguments

  • src The source MAngle object.

MAngle:: ~MAngle ()
Description

The class destructor.

MAngle & MAngle:: operator = (const MAngle & src)
Description

The assignment operator.

Arguments

  • src The source MAngle object.

Return Value

  • Copy of an MAngle

MAngle::Unit MAngle:: unit () const

Description

Return the units currently in effect for this instance.

Return Value

  • an element of the MAngle::Unit enum

double MAngle:: value () const

Description

Return the value of the current instance in the currently set units.

Return Value

  • the current value of the instance

MStatus MAngle:: setUnit ( MAngle::Unit newUnit )

Description

Set the units used by this instance. This will not affect the current value of the MAngle.

Arguments

  • newUnit an element of the MAngle::Unit enum

Return Value

  • MS::kSuccess the unit of set succesfully.
  • MS::kFailure the unit is invalid.

MStatus MAngle:: setValue (double newValue)

Description

Set the value of this instance.

Arguments

  • newValue the new value in the units currently in effect

Return Value

  • always returns MS::kSuccess

double MAngle:: as ( MAngle::Unit otherUnit, MStatus *ReturnStatus ) const

Description

Return the current value of this instance in the provided units.

Arguments

  • otherUnit an element of the MAngle::Unit enum specifying the desired units
  • ReturnStatus return status

Return Value

  • the current value in the given units

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

double MAngle:: asRadians () const

Description

Return the current value of this instance in radians.

Return Value

  • the current value in the radians

double MAngle:: asDegrees () const

Description

Return the current value of this instance in degrees.

Return Value

  • the current value in the degrees

double MAngle:: asAngMinutes () const

Description

Return the current value of this instance in minutes of arc.

Return Value

  • the current value in the minutes of arc

double MAngle:: asAngSeconds () const

Description

Return the current value of this instance in seconds of arc.

Return Value

  • the current value in the seconds of arc

MAngle::Unit MAngle:: uiUnit ()

Description

Returns the Working Units (or UI units) chosen in the settings of the prefs window.

Return Value

  • an element of the MAngle::Unit enum

MStatus MAngle:: setUIUnit ( MAngle::Unit newUnit)

Description

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.

Arguments

  • newUnit and element of the MAngle::Unit enum.

Return Value

  • MS::kSuccess if a valid unit was provided, MS::kFailure otherwise

MAngle::Unit MAngle:: internalUnit ()

Description

Returns the internal unit system used by Maya. This is the unit system Maya stores angles in.

Return Value

  • the internal unit for angles

double MAngle:: internalToUI (double internalValue)

Description

Converts a value from Maya's internal units to the current units used in the UI.

Arguments

  • internalValue a value in internal units

Return Value

  • the value in UI units

double MAngle:: uiToInternal (double uiValue)

Description

Converts a value from the units Maya is currently uses in the UI to the Maya internal unit system.

Arguments

  • uiValue a value in UI units

Return Value

  • the value in internal units.

MStatus MAngle:: setInternalUnit ( MAngle::Unit internalUnit )

Description

THIS IS AN OBSOLETE METHOD

This method will be removed in a future Maya release. Changing the internal units is generally not a good idea and using the method may often produce unexpected results. It is recommended to just read the values and convert them to the units desired.

Sets the internal unit system which Maya uses to store angles.

Arguments

  • internalUnit the internal unit for angles

Return Value

  • MS::kSuccess a valid unit was provided
  • MS::kFailure a valid unit was not provided

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright