QXRD  0.11.16
qxrdpowderpointproperty.h
Go to the documentation of this file.
1 #ifndef QXRDPOWDERPOINTPROPERTY_H
2 #define QXRDPOWDERPOINTPROPERTY_H
3 
4 #include "qcepobject.h"
5 #include "qcepproperty.h"
6 #include "qxrdpowderpoint.h"
7 
9 {
10  Q_OBJECT
11 public:
12  explicit QxrdPowderPointProperty(QcepSettingsSaverWPtr saver, QcepObject *parent, const char *name, QxrdPowderPoint value, QString toolTip);
13  explicit QxrdPowderPointProperty(QcepSettingsSaverWPtr saver, QcepObject *parent, const char *name, int n1, int n2, int n3, double x, double y, double r1, double r2, double az, QString toolTip);
14 
15  QxrdPowderPoint value() const;
17  QString toString(const QxrdPowderPoint& pt);
18  double subValue(int axis) const;
19 
20  void linkTo(QSpinBox *n1SpinBox, QSpinBox *n2SpinBox, QSpinBox *n3SpinBox, QDoubleSpinBox *xSpinBox, QDoubleSpinBox *ySpinBox, QDoubleSpinBox *r1SpinBox, QDoubleSpinBox *r2SpinBox, QDoubleSpinBox *azSpinBox);
21  void linkTo(int axis, QSpinBox *spinBox);
22  void linkTo(int axis, QDoubleSpinBox *spinBox);
23 
24 public slots:
25  void setValue(QxrdPowderPoint val, int index);
26  void setValue(QxrdPowderPoint val);
28  void resetValue();
29  void setSubValue(int axis, int value, int index);
30  void setSubValue(int axis, int value);
31  void setSubValue(int axis, double value, int index);
32  void setSubValue(int axis, double value);
33 
34 signals:
35  void valueChanged(QxrdPowderPoint val, int index);
36  void subValueChanged(int axis, int val, int index);
37  void subValueChanged(int axis, double val, int index);
38 
39 private:
42 };
43 
44 class QxrdPowderPointPropertySpinBoxHelper : public QObject {
45  Q_OBJECT
46 
47 public:
48  QxrdPowderPointPropertySpinBoxHelper(QSpinBox *spinBox, QxrdPowderPointProperty *property, int axis);
49  void connect();
50 
51 public slots:
52  void setSubValue(int axis, int value, int index);
53  void setValue(int value);
54 
55 signals:
56  void subValueChanged(int axis, int value, int index);
57 
58 private:
59  QSpinBox *m_SpinBox;
61  int m_Axis;
62 };
63 
65  Q_OBJECT
66 
67 public:
68  QxrdPowderPointPropertyDoubleSpinBoxHelper(QDoubleSpinBox *spinBox, QxrdPowderPointProperty *property, int axis);
69  void connect();
70 
71 public slots:
72  void setSubValue(int axis, double value, int index);
73  void setValue(double value);
74 
75 signals:
76  void subValueChanged(int axis, double value, int index);
77 
78 private:
79  QDoubleSpinBox *m_DoubleSpinBox;
81  int m_Axis;
82 };
83 
85  Q_OBJECT
86 public:
88  QcepObject *parent,
89  const char *name,
91  QString toolTip);
92 
95  QString toString(const QxrdPowderPointVector &vec);
96 
97 public slots:
98  void setValue(QxrdPowderPointVector val, int index);
101  void resetValue();
102  void clear();
103  void appendValue(QxrdPowderPoint val);
104 
105 signals:
106  void valueChanged(QxrdPowderPointVector val, int index);
107 
108 private:
111 };
112 
113 #define QXRD_POWDERPOINT_PROPERTY(propname) \
114 public: \
115  QxrdPowderPoint get_##propname() const \
116 { \
117  return m_##propname.value(); \
118 } \
119  \
120  void set_##propname(QxrdPowderPoint val) \
121 { \
122  m_##propname.setValue(val); \
123 } \
124  \
125  QxrdPowderPoint def_##propname() const \
126 { \
127  return m_##propname.defaultValue(); \
128 } \
129  \
130  void setdef_##propname(QxrdPowderPoint val) \
131 { \
132  m_##propname.setDefaultValue(val); \
133 } \
134  \
135  void reset_##propname() \
136 { \
137  m_##propname.resetValue(); \
138 } \
139  \
140 QxrdPowderPointProperty *prop_##propname() { \
141  return &m_##propname; \
142 } \
143  \
144 private: \
145 QxrdPowderPointProperty m_##propname;
146 
147 #define QXRD_POWDERPOINTVECTOR_PROPERTY(propname) \
148 public: \
149  QxrdPowderPointVector get_##propname() const \
150 { \
151  return m_##propname.value(); \
152 } \
153  \
154  void set_##propname(QxrdPowderPointVector val) \
155 { \
156  m_##propname.setValue(val); \
157 } \
158  \
159  QxrdPowderPointVector def_##propname() const \
160 { \
161  return m_##propname.defaultValue(); \
162 } \
163  \
164  void setdef_##propname(QxrdPowderPointVector val) \
165 { \
166  m_##propname.setDefaultValue(val); \
167 } \
168  \
169  void reset_##propname() \
170 { \
171  m_##propname.resetValue(); \
172 } \
173  \
174 QxrdPowderPointVectorProperty *prop_##propname() { \
175  return &m_##propname; \
176 } \
177  \
178 private: \
179 QxrdPowderPointVectorProperty m_##propname;
180 
181 #endif // QXRDPOWDERPOINTPROPERTY_H
void appendValue(QxrdPowderPoint val)
void subValueChanged(int axis, double value, int index)
void setSubValue(int axis, int value, int index)
double subValue(int axis) const
void subValueChanged(int axis, int value, int index)
QxrdPowderPoint value() const
QxrdPowderPointPropertySpinBoxHelper(QSpinBox *spinBox, QxrdPowderPointProperty *property, int axis)
QString toString(const QxrdPowderPoint &pt)
QString toString(const QxrdPowderPointVector &vec)
QxrdPowderPointVector defaultValue() const
void valueChanged(QxrdPowderPointVector val, int index)
void subValueChanged(int axis, int val, int index)
QxrdPowderPointVector value() const
void setValue(QxrdPowderPointVector val, int index)
void linkTo(QSpinBox *n1SpinBox, QSpinBox *n2SpinBox, QSpinBox *n3SpinBox, QDoubleSpinBox *xSpinBox, QDoubleSpinBox *ySpinBox, QDoubleSpinBox *r1SpinBox, QDoubleSpinBox *r2SpinBox, QDoubleSpinBox *azSpinBox)
void valueChanged(QxrdPowderPoint val, int index)
QxrdPowderPointVectorProperty(QcepSettingsSaverWPtr saver, QcepObject *parent, const char *name, QxrdPowderPointVector value, QString toolTip)
QxrdPowderPointPropertyDoubleSpinBoxHelper(QDoubleSpinBox *spinBox, QxrdPowderPointProperty *property, int axis)
QxrdPowderPointProperty(QcepSettingsSaverWPtr saver, QcepObject *parent, const char *name, QxrdPowderPoint value, QString toolTip)
QxrdPowderPoint defaultValue() const
void setDefaultValue(QxrdPowderPointVector val)
QString name() const
void setValue(QxrdPowderPoint val, int index)
void setSubValue(int axis, double value, int index)
QString toolTip() const
void setSubValue(int axis, int value, int index)
void setDefaultValue(QxrdPowderPoint val)
QWeakPointer< QcepSettingsSaver > QcepSettingsSaverWPtr