optionWidgets.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00030
00032
00033
00034 #ifndef __MIP_OPTION_WIDGETS_
00035 #define __MIP_OPTION_WIDGETS_
00036
00037 #ifdef MIP_HOST_APPLE
00038 #include <applePatch.h>
00039 #endif
00040
00041 #include <vector>
00042 #include <string>
00043 #include <sstream>
00044 #include <iostream>
00045 #include <assert.h>
00046 #include <stdlib.h>
00047
00048 #include <Types.h>
00049 #include <R2.h>
00050 #include <SsUtils.h>
00051
00052
00053 #include <QWidget>
00054 #include <QLabel>
00055 #include <QSpinBox>
00056 #include <QVBoxLayout>
00057 #include <QLineEdit>
00058 #include <QCheckBox>
00059 #include <QGroupBox>
00060
00061 #define DEBUG_OPTION_WIDG 0
00062
00063 using namespace std;
00064
00065
00069 class OptionWidget : public QWidget{
00070 Q_OBJECT
00071 public:
00072 virtual void updateValue();
00073 OptionWidget(QWidget *parent = 0);
00074 };
00075
00076
00080 class IntSpinBox: public QSpinBox{
00081 Q_OBJECT
00082
00083 public:
00087 IntSpinBox(int initValue,QWidget *parent = 0);
00088 };
00089
00090
00094 class DecimalSpinBox: public QDoubleSpinBox{
00095 Q_OBJECT
00096
00097 public:
00101 DecimalSpinBox(Decimal initValue,QWidget *parent = 0);
00102 };
00103
00104
00108 class NameWidget: public QLabel{
00109 Q_OBJECT
00110
00111 private:
00112 string _name;
00113 string _description;
00114
00115 public:
00120 NameWidget(string &name,string &description,QWidget *parent = 0);
00121 };
00122
00123
00128 class IntWidget: public OptionWidget{
00129 Q_OBJECT
00130
00131 private:
00132 int *_pValue;
00133 QSpinBox *_spinBox;
00134
00135 private slots:
00136 void setValue(int v);
00137 public slots:
00138 void updateValue();
00139 public:
00145 IntWidget(string &name,string &description,int *pValue,QWidget *parent = 0);
00146 };
00147
00148
00153 class DecimalWidget: public OptionWidget{
00154 Q_OBJECT
00155
00156 private:
00157 Decimal *_pValue;
00158 QDoubleSpinBox *_spinBox;
00159
00160 private slots:
00161 void setValue(double v);
00162 public slots:
00163 void updateValue();
00164 public:
00170 DecimalWidget(string &name,string &description,Decimal *pValue,QWidget *parent = 0);
00171 };
00172
00173
00178 class PositionWidget: public OptionWidget{
00179 Q_OBJECT
00180 private:
00181 Position *_pValue;
00182 DecimalSpinBox *_xSpinBox,*_ySpinBox;
00183
00184 private slots:
00185 void _setXValue(double v);
00186 void _setYValue(double v);
00187 public slots:
00188 void updateValue();
00189 public:
00195 PositionWidget(string &name,string &description,Position *pValue,QWidget *parent = 0);
00196 };
00197
00198
00203 class Position3DWidget: public OptionWidget{
00204 Q_OBJECT
00205 private:
00206 Position3D *_pValue;
00207 DecimalSpinBox *_xSpinBox,*_ySpinBox,*_zSpinBox;
00208
00209 private slots:
00210 void _setXValue(double v);
00211 void _setYValue(double v);
00212 void _setZValue(double v);
00213 public slots:
00214 void updateValue();
00215 public:
00221 Position3DWidget(string &name,string &description,Position3D *pValue,QWidget *parent = 0);
00222 };
00223
00224
00229 class PoseWidget: public OptionWidget{
00230 Q_OBJECT
00231 private:
00232 Pose *_pValue;
00233 DecimalSpinBox *_xSpinBox,*_ySpinBox,*_oriSpinBox;
00234
00235 private slots:
00236 void _setXValue(double v);
00237 void _setYValue(double v);
00238 void _setOriValue(double v);
00239 public slots:
00240 void updateValue();
00241 public:
00247 PoseWidget(string &name,string &description,Pose *pValue,QWidget *parent = 0);
00248 };
00249
00250
00255 class StringWidget: public OptionWidget{
00256 Q_OBJECT
00257 private:
00258 string *_pValue;
00259 QLineEdit *_lineEdit;
00260
00261 private slots:
00262 void setValue();
00263 public slots:
00264 void updateValue();
00265 public:
00271 StringWidget(string &name,string &description,string *pValue,QWidget *parent = 0);
00272 };
00273
00274
00279 class BoolWidget: public OptionWidget{
00280 Q_OBJECT
00281 private:
00282 bool *_pValue;
00283 QCheckBox *_checkBox;
00284
00285 private slots:
00286 void setValue(int v);
00287 public slots:
00288 void updateValue();
00289 public:
00295 BoolWidget(string &name,string &description,bool *pValue,QWidget *parent = 0);
00296 };
00297
00298
00299
00300
00301
00302
00303 #endif
00304
00305
00306
00307
00308
00309