![]() |
VR-Forces 4.0.4 Class Documentation
|

Public Types | |
| enum | DtConversionType { DtConvertMeasurement, DtConvertTime } |
Public Member Functions | |
| DtUnitConverterFactory () | |
| virtual | ~DtUnitConverterFactory () |
| virtual void | registerUnitConversion (const QString &from, const QString &to, DtConverterFcn fcn, const QString &title="", const QString &unitTitle="", bool addTimeUnits=false) |
| Use this routine to add a new conversion to the unit converter factory. | |
| virtual void | registerConversion (const QString &from, const QString &to, DtConverterFcn) |
| virtual bool | init () |
| Calls registerConverters. | |
| virtual DtUnit | parse (const QString &) const |
| virtual bool | canConvert (const DtUnit &, const DtUnit &) const |
| virtual double | convert (const DtUnit &from, const DtUnit &to, double val, bool &valid, bool reverse=false) const |
| virtual double | convert (DtConversionType, const DtUnit &from, const DtUnit &to, double val, bool &valid, bool reverse=false) const |
| virtual double | convertReverse (const DtUnit &from, const DtUnit &to, double val, bool &valid) const |
| virtual QList< DtConverter * > | conversion (DtConversionType type, const DtUnit &from, const DtUnit &to) const |
| virtual void | findPath (DtConversionType type, const DtUnit &from, const DtUnit &to, const QHash< QString, DtConverterClass > &, QList< DtConverter * > &path) const |
| virtual double | convertSourceToDestination (double val, const QString &source, const QString &destination) const |
| These routines are convenience functions that call convert methods Converts from the source to the destination units and returns formatted value. | |
| virtual double | convertDestinationToSource (double val, const QString &source, const QString &destination) const |
| Converts from the destination to the source. | |
| virtual QString | unitTitle (const QString &u) const |
Static Public Member Functions | |
| static DtUnitConverterFactory * | create () |
Protected Member Functions | |
| virtual void | registerConverters () |
| virtual void | registerConversion (const QString &from, const QString &to, DtConverterFcn, bool) |
Protected Attributes | |
| QHash< QString, QHash< QString, DtConverterClass > > | myConverters |
| QHash< QString, QList < DtConverter * > > | myConversions |
| virtual DtUnitConverterFactory::~DtUnitConverterFactory | ( | ) | [virtual] |
| virtual void DtUnitConverterFactory::registerUnitConversion | ( | const QString & | from, |
| const QString & | to, | ||
| DtConverterFcn | fcn, | ||
| const QString & | title = "", |
||
| const QString & | unitTitle = "", |
||
| bool | addTimeUnits = false |
||
| ) | [virtual] |
Use this routine to add a new conversion to the unit converter factory.
If addTimeUnits is true, all time unit conversions (except second2) will be added. If title or unitTitle is the empty string, no title will be added
| virtual void DtUnitConverterFactory::registerConversion | ( | const QString & | from, |
| const QString & | to, | ||
| DtConverterFcn | |||
| ) | [virtual] |
| virtual bool DtUnitConverterFactory::init | ( | ) | [virtual] |
Calls registerConverters.
| virtual DtUnit DtUnitConverterFactory::parse | ( | const QString & | ) | const [virtual] |
| virtual bool DtUnitConverterFactory::canConvert | ( | const DtUnit & | , |
| const DtUnit & | |||
| ) | const [virtual] |
| virtual double DtUnitConverterFactory::convert | ( | const DtUnit & | from, |
| const DtUnit & | to, | ||
| double | val, | ||
| bool & | valid, | ||
| bool | reverse = false |
||
| ) | const [virtual] |
| virtual double DtUnitConverterFactory::convert | ( | DtConversionType | , |
| const DtUnit & | from, | ||
| const DtUnit & | to, | ||
| double | val, | ||
| bool & | valid, | ||
| bool | reverse = false |
||
| ) | const [virtual] |
| virtual double DtUnitConverterFactory::convertReverse | ( | const DtUnit & | from, |
| const DtUnit & | to, | ||
| double | val, | ||
| bool & | valid | ||
| ) | const [virtual] |
| virtual QList<DtConverter*> DtUnitConverterFactory::conversion | ( | DtConversionType | type, |
| const DtUnit & | from, | ||
| const DtUnit & | to | ||
| ) | const [virtual] |
| virtual void DtUnitConverterFactory::findPath | ( | DtConversionType | type, |
| const DtUnit & | from, | ||
| const DtUnit & | to, | ||
| const QHash< QString, DtConverterClass > & | , | ||
| QList< DtConverter * > & | path | ||
| ) | const [virtual] |
| virtual double DtUnitConverterFactory::convertSourceToDestination | ( | double | val, |
| const QString & | source, | ||
| const QString & | destination | ||
| ) | const [virtual] |
These routines are convenience functions that call convert methods Converts from the source to the destination units and returns formatted value.
| virtual double DtUnitConverterFactory::convertDestinationToSource | ( | double | val, |
| const QString & | source, | ||
| const QString & | destination | ||
| ) | const [virtual] |
Converts from the destination to the source.
| static DtUnitConverterFactory* DtUnitConverterFactory::create | ( | ) | [static] |
| virtual QString DtUnitConverterFactory::unitTitle | ( | const QString & | u | ) | const [virtual] |
| virtual void DtUnitConverterFactory::registerConverters | ( | ) | [protected, virtual] |
| virtual void DtUnitConverterFactory::registerConversion | ( | const QString & | from, |
| const QString & | to, | ||
| DtConverterFcn | , | ||
| bool | |||
| ) | [protected, virtual] |
QHash<QString, QHash<QString, DtConverterClass> > DtUnitConverterFactory::myConverters [protected] |
QHash<QString, QList<DtConverter*> > DtUnitConverterFactory::myConversions [mutable, protected] |