A class implementing various units for measuring quantities. More...
#include <Units.h>
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. |
A class implementing various units for measuring quantities.
Units::Units | ( | ) |
Default constructor.
OpenSim::Units::Units | ( | const std::string | aString | ) |
Units::Units | ( | UnitType | aType | ) |
Constructor from a unit type.
aType | the unit type. |
Units::~Units | ( | ) | [virtual] |
Destructor.
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.
aUnit | the units to convert to |
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.
aType | the units to convert to |
double Units::convertTo | ( | UnitType | aType, | |
double | aValue | |||
) | const |
Convert a number from the units of this object to the units of aType.
aType | the unit type to convert to | |
aValue | the number to convert |
string Units::getAbbreviation | ( | ) | const |
Get the text label for the units.
string Units::getLabel | ( | ) | const |
Get the text label for the units.
UnitType OpenSim::Units::getType | ( | ) | const [inline] |