Open CASCADE Technology 7.8.0
|
This class defines a measurement which is the association of a real value and a unit. More...
#include <Units_Measurement.hxx>
Public Member Functions | |
Units_Measurement () | |
It is the empty constructor of the class. | |
Units_Measurement (const Standard_Real avalue, const Handle< Units_Token > &atoken) | |
Returns an instance of this class. <avalue> defines the measurement, and <atoken> the token which defines the unit used. | |
Units_Measurement (const Standard_Real avalue, const Standard_CString aunit) | |
Returns an instance of this class. <avalue> defines the measurement, and <aunit> the unit used, described in natural language. | |
void | Convert (const Standard_CString aunit) |
Converts (if possible) the measurement object into another unit. <aunit> must have the same dimensionality as the unit contained in the token <thetoken>. | |
Units_Measurement | Integer () const |
Returns a Measurement object with the integer value of the measurement contained in <me>. | |
Units_Measurement | Fractional () const |
Returns a Measurement object with the fractional value of the measurement contained in <me>. | |
Standard_Real | Measurement () const |
Returns the value of the measurement. | |
Handle< Units_Token > | Token () const |
Returns the token contained in <me>. | |
Units_Measurement | Add (const Units_Measurement &ameasurement) const |
Returns (if it is possible) a measurement which is the addition of <me> and <ameasurement>. The chosen returned unit is the unit of <me>. | |
Units_Measurement | operator+ (const Units_Measurement &ameasurement) const |
Units_Measurement | Subtract (const Units_Measurement &ameasurement) const |
Returns (if it is possible) a measurement which is the subtraction of <me> and <ameasurement>. The chosen returned unit is the unit of <me>. | |
Units_Measurement | operator- (const Units_Measurement &ameasurement) const |
Units_Measurement | Multiply (const Units_Measurement &ameasurement) const |
Returns a measurement which is the multiplication of <me> and <ameasurement>. | |
Units_Measurement | operator* (const Units_Measurement &ameasurement) const |
Units_Measurement | Multiply (const Standard_Real avalue) const |
Returns a measurement which is the multiplication of <me> with the value <avalue>. | |
Units_Measurement | operator* (const Standard_Real avalue) const |
Units_Measurement | Divide (const Units_Measurement &ameasurement) const |
Returns a measurement which is the division of <me> by <ameasurement>. | |
Units_Measurement | operator/ (const Units_Measurement &ameasurement) const |
Units_Measurement | Divide (const Standard_Real avalue) const |
Returns a measurement which is the division of <me> by the constant <avalue>. | |
Units_Measurement | operator/ (const Standard_Real avalue) const |
Units_Measurement | Power (const Standard_Real anexponent) const |
Returns a measurement which is <me> powered <anexponent>. | |
Standard_Boolean | HasToken () const |
void | Dump () const |
Useful for debugging. | |
This class defines a measurement which is the association of a real value and a unit.
Units_Measurement::Units_Measurement | ( | ) |
It is the empty constructor of the class.
Units_Measurement::Units_Measurement | ( | const Standard_Real | avalue, |
const Handle< Units_Token > & | atoken | ||
) |
Returns an instance of this class. <avalue> defines the measurement, and <atoken> the token which defines the unit used.
Units_Measurement::Units_Measurement | ( | const Standard_Real | avalue, |
const Standard_CString | aunit | ||
) |
Returns an instance of this class. <avalue> defines the measurement, and <aunit> the unit used, described in natural language.
Units_Measurement Units_Measurement::Add | ( | const Units_Measurement & | ameasurement | ) | const |
Returns (if it is possible) a measurement which is the addition of <me> and <ameasurement>. The chosen returned unit is the unit of <me>.
void Units_Measurement::Convert | ( | const Standard_CString | aunit | ) |
Converts (if possible) the measurement object into another unit. <aunit> must have the same dimensionality as the unit contained in the token <thetoken>.
Units_Measurement Units_Measurement::Divide | ( | const Standard_Real | avalue | ) | const |
Returns a measurement which is the division of <me> by the constant <avalue>.
Units_Measurement Units_Measurement::Divide | ( | const Units_Measurement & | ameasurement | ) | const |
Returns a measurement which is the division of <me> by <ameasurement>.
void Units_Measurement::Dump | ( | ) | const |
Useful for debugging.
Units_Measurement Units_Measurement::Fractional | ( | ) | const |
Returns a Measurement object with the fractional value of the measurement contained in <me>.
Standard_Boolean Units_Measurement::HasToken | ( | ) | const |
Units_Measurement Units_Measurement::Integer | ( | ) | const |
Returns a Measurement object with the integer value of the measurement contained in <me>.
Standard_Real Units_Measurement::Measurement | ( | ) | const |
Returns the value of the measurement.
Units_Measurement Units_Measurement::Multiply | ( | const Standard_Real | avalue | ) | const |
Returns a measurement which is the multiplication of <me> with the value <avalue>.
Units_Measurement Units_Measurement::Multiply | ( | const Units_Measurement & | ameasurement | ) | const |
Returns a measurement which is the multiplication of <me> and <ameasurement>.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Units_Measurement Units_Measurement::Power | ( | const Standard_Real | anexponent | ) | const |
Returns a measurement which is <me> powered <anexponent>.
Units_Measurement Units_Measurement::Subtract | ( | const Units_Measurement & | ameasurement | ) | const |
Returns (if it is possible) a measurement which is the subtraction of <me> and <ameasurement>. The chosen returned unit is the unit of <me>.
Handle< Units_Token > Units_Measurement::Token | ( | ) | const |
Returns the token contained in <me>.