File indexing completed on 2024-05-19 05:41:19

0001 #ifndef CONVERTOROPERATOR_H
0002 #define CONVERTOROPERATOR_H
0003 
0004 #include "rwidgets_global.h"
0005 #include <Qt>
0006 namespace GMTOOL
0007 {
0008 /**
0009  * @brief The ConvertorOperator class manages an afine function to make any convertions.
0010  *
0011  */
0012 class RWIDGET_EXPORT ConvertorOperator
0013 {
0014 public:
0015     ConvertorOperator(double a, double b= 0, bool fraction= false, bool readOnly= true);
0016 
0017     qreal convert(qreal convert) const;
0018     double a() const;
0019     void setA(double a);
0020 
0021     double b() const;
0022     void setB(double b);
0023 
0024     bool fraction() const;
0025     void setFraction(bool fraction);
0026 
0027     bool isReadOnly() const;
0028 
0029 private:
0030     double m_a;
0031     double m_b;
0032     bool m_fraction;
0033     bool m_readOnly;
0034 };
0035 
0036 } // namespace GMTOOL
0037 #endif // CONVERTOROPERATOR_H