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 #ifndef _graspcapturedlg_h_
00027 #define _graspcapturedlg_h_
00028
00029 #include <QDialog>
00030 #include <list>
00031
00032 class World;
00033 class GraspPlanningState;
00034 class QualEpsilon;
00035 class QualVolume;
00036 class Hand;
00037
00038 #include "ui_graspCaptureDlg.h"
00039 #include "ui_qualityIndicator.h"
00040
00042
00046 class QualityIndicator : public QDialog, public Ui::QualityIndicatorUI
00047 {
00048 public:
00049 QualityIndicator(QWidget *parent=0) : QDialog(parent) {
00050 setupUi(this);
00051 qualityBar->setMinimum(0);
00052 qualityBar->setMaximum(100);
00053 }
00054 void setBar(double value) {
00055 qualityBar->setValue((value/0.25)*100);
00056 if (value > 0.0){
00057 fcLabel->setEnabled(TRUE);
00058 } else {
00059 fcLabel->setEnabled(FALSE);
00060 }
00061 }
00062 };
00063
00065
00088 class GraspCaptureDlg : public QDialog, public Ui::GraspCaptureDlgUI
00089 {
00090 Q_OBJECT
00091 private:
00093 World *mWorld;
00095 Hand *mCurrentHand;
00097 QualityIndicator *mIndicator;
00099 std::list<GraspPlanningState*> mGrasps;
00100
00102 QualEpsilon *mQualEpsilon;
00104 QualVolume *mQualVolume;
00105
00107 void updateNumGrasps();
00109 void init(World *w);
00111
00116 bool checkHandSelection();
00117 private slots:
00118 void captureButtonClicked();
00119 void saveToFileButtonClicked();
00120 void saveToDBaseButtonClicked();
00121 void clearListButtonClicked();
00122 void exitButtonClicked(){QDialog::accept();}
00123 public:
00124 GraspCaptureDlg(World *w, QWidget *parent=0) : QDialog(parent) {
00125 setupUi(this);
00126 init(w);
00127 QObject::connect(captureButton, SIGNAL(clicked()), this, SLOT(captureButtonClicked()));
00128 QObject::connect(saveToFileButton, SIGNAL(clicked()), this, SLOT(saveToFileButtonClicked()));
00129 QObject::connect(saveToDBaseButton, SIGNAL(clicked()), this, SLOT(saveToDBaseButtonClicked()));
00130 QObject::connect(clearListButton, SIGNAL(clicked()), this, SLOT(clearListButtonClicked()));
00131 QObject::connect(exitButton, SIGNAL(clicked()), this, SLOT(exitButtonClicked()));
00132 }
00133 ~GraspCaptureDlg();
00134 public slots:
00135 void updateQuality();
00136 };
00137
00138 #endif