00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Copyright (c) 2013, Intelligent Robotics Lab, DLUT. 00005 * Author: Qinghua Li, Yan Zhuang, Fei Yan 00006 * 00007 * All rights reserved. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions 00011 * are met: 00012 * 00013 * * Redistributions of source code must retain the above copyright 00014 * notice, this list of conditions and the following disclaimer. 00015 * * Redistributions in binary form must reproduce the above 00016 * copyright notice, this list of conditions and the following 00017 * disclaimer in the documentation and/or other materials provided 00018 * with the distribution. 00019 * * Neither the name of Intelligent Robotics Lab, DLUT. nor the names 00020 * of its contributors may be used to endorse or promote products 00021 * derived from this software without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00024 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00025 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00026 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00027 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00028 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00029 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00030 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00032 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00033 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00034 * POSSIBILITY OF SUCH DAMAGE. 00035 */ 00036 00037 /* 00038 * This is the main widget of the application. 00039 * It sets up some not yet useful menus and three qlabels in the layout 00040 * of the central widget that can be used to show qimages via the slots 00041 * setQueryBAImage, setFeaturesImage and setLibBAImage. 00042 * 00043 * Created on: 2012.01.07 00044 * Author: Qinghua Li (qinghua__li@163.com) 00045 */ 00046 00047 #ifndef QT_GUI_H_ 00048 #define QT_GUI_H_ 00049 00050 #include <QMainWindow> 00051 #include <QGridLayout> 00052 #include "dlut_place_recognition/glviewer.h" 00053 #include "dlut_place_recognition/graph_manager.h" 00054 00055 class QSplitter; 00056 00057 //TODO: 00058 // Buttons for extract features and place recognition 00059 // GUI for switching on/off the individual visualizations 00060 00061 /* 00062 * Small GUI Class to visualize and control place recognition 00063 * See Help->About for a short description 00064 */ 00065 00066 class Graphical_UI : public QMainWindow 00067 { 00068 Q_OBJECT 00069 public: 00070 Graphical_UI (); 00071 ~Graphical_UI (); 00072 00073 Q_SIGNALS: 00074 // User wants to load 3D laser scanning data 00075 void loadData(); 00076 // User wants to show bearing-angle(BA)image 00077 void showBAImage(); 00078 // User wants to extract global spatial features and local SURF features of 00079 // the current scene and save to database 00080 void extractFeatures(); 00081 // User wants to recognize the current scene 00082 void placeRecognition(); 00083 00084 public Q_SLOTS: 00085 void setLibBAImage (QImage); 00086 00087 void setQueryBAImage (QImage); 00088 00089 void setFeaturesImage (QImage); 00090 00091 private Q_SLOTS: 00092 void reset (); /* Start over with new graph */ 00093 00094 void loadDataCmd (); 00095 00096 void showBAImageCmd (); 00097 00098 void showFlowsheet (); 00099 00100 void extractFeaturesCmd (); 00101 00102 void placeRecognitionCmd (); 00103 00104 void set2DImage (bool is_on); 00105 00106 void about (); 00107 00108 void help (); 00109 00110 void setStatus (QString); 00111 00112 private: 00113 // Menus and Menu elements are defined here 00114 void createMenus (); 00115 00116 QString *infoText; 00117 QString *licenseText; 00118 QString *helpText; 00119 00120 QLabel *statusLabel; 00121 QLabel *infoLabel; 00122 QLabel *infoLabel2; 00123 QLabel *lib_BAimage_label; 00124 QLabel *query_BAimage_label; 00125 QLabel *features_image_label; 00126 00127 QSplitter* vsplitter; 00128 GLViewer* lib_glviewer; 00129 GLViewer* query_glviewer; 00130 }; 00131 00132 #endif // QT_GUI_H_