OpenSim::Units Class Reference

A class implementing various units for measuring quantities. More...

#include <Units.h>

List of all members.

Public Types

enum  UnitType {
  UnknownUnits = 0, Radians, Degrees, Millimeters,
  Centimeters, Meters, Seconds, Milliseconds,
  Newtons
}

Public Member Functions

 Units ()
 Default constructor.
 Units (const Units &aUnits)
 Copy constructor.
 Units (const std::string aString)
 Units (UnitType aType)
 Constructor from a unit type.
virtual ~Units ()
 Destructor.
double convertTo (UnitType aType, double aValue) const
 Convert a number from the units of this object to the units of aType.
double convertTo (UnitType aType) const
 Return a conversion factor for converting a number from the units of this object to the units of aType.
double convertTo (const Units &aUnit) const
 Return a conversion factor for converting a number from the units of this object to the units of aUnit.
UnitType getType () const
std::string getLabel () const
 Get the text label for the units.
std::string getAbbreviation () const
 Get the text label for the units.

Detailed Description

A class implementing various units for measuring quantities.

Author:
Peter Loan
Version:
1.0

Member Enumeration Documentation

Enumerator:
UnknownUnits 
Radians 
Degrees 
Millimeters 
Centimeters 
Meters 
Seconds 
Milliseconds 
Newtons 

Constructor & Destructor Documentation

Units::Units (  ) 

Default constructor.

Units::Units ( const Units aUnits  ) 

Copy constructor.

Parameters:
aUnits Units to be copied.
OpenSim::Units::Units ( const std::string  aString  ) 
Units::Units ( UnitType  aType  ) 

Constructor from a unit type.

Parameters:
aType the unit type.
Units::~Units (  )  [virtual]

Destructor.


Member Function Documentation

double Units::convertTo ( const Units aUnit  )  const

Return a conversion factor for converting a number from the units of this object to the units of aUnit.

Parameters:
aUnit the units to convert to
Returns:
The conversion factor
double Units::convertTo ( UnitType  aType  )  const

Return a conversion factor for converting a number from the units of this object to the units of aType.

Parameters:
aType the units to convert to
Returns:
The conversion factor
double Units::convertTo ( UnitType  aType,
double  aValue 
) const

Convert a number from the units of this object to the units of aType.

Parameters:
aType the unit type to convert to
aValue the number to convert
Returns:
The number converted to the new units
string Units::getAbbreviation (  )  const

Get the text label for the units.

Returns:
String label.
string Units::getLabel (  )  const

Get the text label for the units.

Returns:
String label.
UnitType OpenSim::Units::getType (  )  const [inline]

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

Generated on Sun Sep 25 00:19:52 2011 for OpenSim by  doxygen 1.6.1