1 #ifndef CCTWDOUBLEMATRIX3X3PROPERTY_H
2 #define CCTWDOUBLEMATRIX3X3PROPERTY_H
4 #include "qcepproperty.h"
14 double r0c0,
double r0c1,
double r0c2,
15 double r1c0,
double r1c1,
double r1c2,
16 double r2c0,
double r2c1,
double r2c2,
22 double subValue(
int row,
int col)
const;
28 void linkTo(
int row,
int col, QDoubleSpinBox *spinBox);
36 void setSubValue(
int row,
int col,
double value,
int index);
58 void setSubValue(
int row,
int col,
double value,
int index);
71 #define CCTW_DOUBLEMATRIX3X3_PROPERTY(propname) \
73 CctwDoubleMatrix3x3 get_##propname() const \
75 return m_##propname.value(); \
78 void set_##propname(CctwDoubleMatrix3x3 val) \
80 m_##propname.setValue(val); \
83 CctwDoubleMatrix3x3 def_##propname() const \
85 return m_##propname.defaultValue(); \
88 void setdef_##propname(CctwDoubleMatrix3x3 val) \
90 m_##propname.setDefaultValue(val); \
93 void reset_##propname() \
95 m_##propname.resetValue(); \
98 CctwDoubleMatrix3x3Property *prop_##propname() { \
99 return &m_##propname; \
103 CctwDoubleMatrix3x3Property m_##propname;
105 #ifndef QT_NO_DATASTREAM
107 template <
typename T>
108 QDataStream &operator<<(QDataStream &stream, const CctwMatrix3x3<T> &matrix)
110 for (
int row = 0; row < 3; ++row)
111 for (
int col = 0; col < 3; ++col)
112 stream <<
double(matrix(row, col));
116 template <
typename T>
120 for (
int row = 0; row < 3; ++row) {
121 for (
int col = 0; col < 3; ++col) {
123 matrix(row, col) = T(x);
131 #endif // CCTWDOUBLEMATRIX3X3PROPERTY_H
void incValue(CctwDoubleMatrix3x3 step)
static void fromScriptValue(const QScriptValue &obj, CctwDoubleMatrix3x3 &mat)
CctwDoubleMatrix3x3Property(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, CctwDoubleMatrix3x3 value, QString toolTip)
void setValue(double value)
static void registerMetaTypes()
void subValueChanged(int row, int col, double val, int index)
double subValue(int row, int col) const
void setDefaultValue(CctwDoubleMatrix3x3 val)
void setSubValue(int row, int col, double value, int index)
QDoubleSpinBox * m_DoubleSpinBox
CctwDoubleMatrix3x3Property * m_Property
CctwDoubleMatrix3x3 value() const
CctwDoubleMatrix3x3 defaultValue() const
void setValue(CctwDoubleMatrix3x3 val, int index)
void setSubValue(int row, int col, double value, int index)
void valueChanged(CctwDoubleMatrix3x3 val, int index)
CctwDoubleMatrix3x3PropertyDoubleSpinBoxHelper(QDoubleSpinBox *spinBox, CctwDoubleMatrix3x3Property *property, int row, int col)
static QScriptValue toScriptValue(QScriptEngine *engine, const CctwDoubleMatrix3x3 &mat)
QString toString(const CctwDoubleMatrix3x3 &mat)
void subValueChanged(int row, int col, double value, int index)
CctwDoubleMatrix3x3 m_Default
QDataStream & operator>>(QDataStream &stream, CctwMatrix3x3< T > &matrix)
void linkTo(int row, int col, QDoubleSpinBox *spinBox)
CctwDoubleMatrix3x3 m_Value