| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| #ifndef RS_UNITS_H |
| #define RS_UNITS_H |
|
|
| #include "rs.h" |
|
|
| class RS_Vector; |
| class QString; |
|
|
| |
| |
| |
| |
| |
| class RS_Units{ |
| private: |
| static RS2::Unit currentDrawingUnits; |
| public: |
| static void setCurrentDrawingUnits(RS2::Unit input_units){ |
| currentDrawingUnits = input_units; |
| } |
|
|
| static RS2::Unit getCurrentDrawingUnits(){ |
| return currentDrawingUnits; |
| } |
|
|
| |
|
|
| |
| |
|
|
| static RS2::Unit dxfint2unit(int dxfint); |
|
|
| static QString unitToString(RS2::Unit u, bool t = true); |
| static RS2::Unit stringToUnit(const QString& u); |
|
|
| static bool isMetric(RS2::Unit u); |
| static double getFactorToMM(RS2::Unit u); |
| static double convert(double val); |
| static double convert(double val, RS2::Unit src, RS2::Unit dest); |
| static RS_Vector convert(const RS_Vector& val, RS2::Unit src, RS2::Unit dest); |
|
|
| static QString unitToSign(RS2::Unit u); |
|
|
| static QString formatLinear(double length, RS2::Unit unit, |
| RS2::LinearFormat format, |
| int prec, bool showUnit=false); |
| static QString formatScientific(double length, RS2::Unit unit, |
| int prec, bool showUnit=false); |
| static QString formatDecimal(double length, RS2::Unit unit, |
| int prec, bool showUnit=false); |
| static QString formatEngineering(double length, RS2::Unit unit, |
| int prec, bool showUnit=false); |
| static QString formatArchitectural(double length, RS2::Unit unit, |
| int prec, bool showUnit=false); |
| static QString formatFractional(double length, RS2::Unit unit, |
| int prec, bool showUnit=false); |
| static QString formatArchitecturalMetric(double length, RS2::Unit unit, |
| int prec, bool showUnit=false); |
|
|
| static QString formatAngle(double angle, RS2::AngleFormat format, |
| int prec); |
| static RS2::AngleFormat numberToAngleFormat(int num); |
|
|
| static RS_Vector paperFormatToSize(RS2::PaperFormat p); |
| static RS2::PaperFormat paperSizeToFormat(const RS_Vector& s); |
|
|
| static QString paperFormatToString(RS2::PaperFormat p); |
| static RS2::PaperFormat stringToPaperFormat(const QString& p); |
|
|
| static void test(); |
| static double dpiToScale(double dpi, RS2::Unit unit); |
| static double scaleToDpi(double scale, RS2::Unit unit); |
|
|
| static QString replaceSurveyorsAnglesByDecimalDegrees(QString val, bool *ok, QString& errorMsg); |
| static QString replaceRadiantAnglesByDecimalDegrees(QString& val, bool *ok); |
| static QString replaceGradAnglesByDecimalDegrees(QString& val, bool *ok); |
| static QString replaceExplicitDegreesByDecimalDegrees(QString& val, bool *ok); |
| static QString replaceExplicitBearingAnglesByDecimalDegrees(QString& val, bool *ok); |
| static QString replaceAllPotentialAnglesByDecimalDegrees(const QString& val, bool *ok); |
| static double evalAngleValue(const QString &c, bool *ok); |
| }; |
| #endif |
|
|