9 * Conversion methods for units
11 * @author Andrew Mustun
16 //static char* unit2sign(RS2::Unit unit);
18 //static RS2::Unit string2unit(const char* str, bool* ok=0);
19 //static char* unit2string(RS2::Unit unit);
21 static RS2::Unit dxfint2unit(int dxfint);
23 static QString unitToString(RS2::Unit u, bool t = true);
24 static RS2::Unit stringToUnit(const QString & u);
26 static bool isMetric(RS2::Unit u);
27 static double getFactorToMM(RS2::Unit u);
28 static double convert(double val, RS2::Unit src, RS2::Unit dest);
29 static Vector convert(const Vector val, RS2::Unit src, RS2::Unit dest);
31 static QString unitToSign(RS2::Unit u);
33 static QString formatLinear(double length, RS2::Unit unit,
34 RS2::LinearFormat format, int prec, bool showUnit = false);
35 static QString formatScientific(double length, RS2::Unit unit, int prec, bool showUnit = false);
36 static QString formatDecimal(double length, RS2::Unit unit, int prec, bool showUnit = false);
37 static QString formatEngineering(double length, RS2::Unit unit, int prec, bool showUnit = false);
38 static QString formatArchitectural(double length, RS2::Unit unit, int prec, bool showUnit = false);
39 static QString formatFractional(double length, RS2::Unit unit, int prec, bool showUnit = false);
41 static QString formatAngle(double angle, RS2::AngleFormat format, int prec);
43 static Vector paperFormatToSize(RS2::PaperFormat p);
44 static RS2::PaperFormat paperSizeToFormat(const Vector s);
46 static QString paperFormatToString(RS2::PaperFormat p);
47 static RS2::PaperFormat stringToPaperFormat(const QString & p);