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 * graph_manager.h 00039 * 00040 * Created on: 2012.01.07 00041 * Author: Qinghua Li (qinghua__li@163.com) 00042 */ 00043 00044 #ifndef GRAPH_MANAGER_H_ 00045 #define GRAPH_MANAGER_H_ 00046 00047 #include <QObject> 00048 #include <QPainter> 00049 #include <QTextStream> 00050 #include "dlut_place_recognition/place_recognition.h" 00051 00053 class GraphManager : public QObject 00054 { 00055 Q_OBJECT 00056 public: 00057 GraphManager (); 00058 ~GraphManager (); 00059 00060 Q_SIGNALS: 00061 // User selected to reset the graph 00062 void reset(); 00063 00064 // Connect to these signals to show Bearing-Angle or features images 00065 void newLibBAImage(QImage); 00066 void newQueryBAImage(QImage); 00067 void newFeaturesImage(QImage); 00068 00069 void setGUIStatus(QString message); 00070 00071 public Q_SLOTS: 00072 // Load query or database point cloud 00073 void loadData (); 00074 // Show the Bearing-Angle image 00075 void showBAImage (); 00076 // Extract the global spatial features of point cloud and SURF features of Bearing-Angle image, 00077 // then save to database 00078 void extractFeatures (); 00079 // Place recognition(the target of application) 00080 void placeRecognition (); 00081 00082 public: 00083 // Draw the text on the Bearing-Angle or features image 00084 void drawQImageText (QImage &image, const QString &str); 00085 00086 // Store the point cloud data 00087 static std::vector< std::vector<pcl::PointXYZ> > lib_cloud; 00088 static std::vector< std::vector<pcl::PointXYZ> > query_cloud; 00089 00090 private: 00091 IplImage* BA_iplimage; 00092 int cloud_width, cloud_height; 00093 }; 00094 00095 #endif // GRAPH_MANAGER_H_