00001 /******************************************************************************* 00002 * ObjectImagesControl.h 00003 * 00004 * (C) 2008 AG Aktives Sehen <agas@uni-koblenz.de> 00005 * Universitaet Koblenz-Landau 00006 * 00007 * §Author: SG; 00008 * 00009 *******************************************************************************/ 00010 00011 00012 00013 #ifndef ObjectImagesControl_H 00014 #define ObjectImagesControl_H 00015 00016 #include <ros/ros.h> 00017 00018 #include <QObject> 00019 #include <QWidget> 00020 #include <QTableWidget> 00021 #include <QRadioButton> 00022 #include <QComboBox> 00023 #include <vector> 00024 #include <QKeyEvent> 00025 00026 // #include "Workers/ObjectRecognition/ImageProperties.h" // TODO delete this 00027 00028 class QTableWidget; 00029 class QLineEdit; 00030 class QPushButton; 00031 00037 class ObjectImagesControl : public QWidget 00038 { 00039 00040 Q_OBJECT 00041 00042 public: 00048 ObjectImagesControl ( ros::NodeHandle *nh, QWidget *parent = 0 ); 00052 ~ObjectImagesControl(); 00053 void updateImageTable(std::vector<std::string> &imageNames, std::string &objType); 00054 00055 protected: 00056 void keyReleaseEvent(QKeyEvent*); 00057 00058 private slots: 00059 void saveImage( ); 00060 void removeImage(); 00061 void saveObject(); 00062 void rowSelected ( int, int ); 00063 void objectNameFieldEdited ( QString ); 00064 void setObjectType ( QString ); 00065 void loadObject( ); 00066 00067 private: 00068 00069 void updateTable(); 00070 00071 ros::Publisher m_ORLearnCommandPublisher; 00072 00073 QLineEdit* m_ObjectNameField; 00074 QTableWidget* m_ImageTable; 00075 00076 QLineEdit* m_ImageNameField; 00077 00078 QString m_LastImageFolder; 00079 00080 QPushButton* m_saveObjectButton; 00081 QPushButton* m_removeImageButton; 00082 QPushButton* m_resetImagesButton; 00083 00084 QComboBox* m_TypeComboBox; 00085 00086 int m_SelectedRow; 00087 00088 // set to true after object is constructed, used to avoid publishing on ros topics in slots too early 00089 bool m_Ready; 00090 }; 00091 00092 #endif