stdr_map_connector.h
Go to the documentation of this file.
00001 /******************************************************************************
00002    STDR Simulator - Simple Two DImensional Robot Simulator
00003    Copyright (C) 2013 STDR Simulator
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; either version 3 of the License, or
00007    (at your option) any later version.
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011    GNU General Public License for more details.
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software Foundation,
00014    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
00015    
00016    Authors : 
00017    * Manos Tsardoulias, etsardou@gmail.com
00018    * Aris Thallas, aris.thallas@gmail.com
00019    * Chris Zalidis, zalidis@gmail.com 
00020 ******************************************************************************/
00021 
00022 #ifndef STDR_MAP_CONNECTOR
00023 #define STDR_MAP_CONNECTOR
00024 
00025 #include "stdr_gui/stdr_map_loader.h"
00026 
00031 namespace stdr_gui
00032 {
00037   enum EStdrMapState
00038   {
00039     NORMAL,
00040     ZOOMIN,
00041     ZOOMOUT,
00042     SETPLACE,
00043     SETREPLACE,
00044     SETPLACECO2,
00045     SETPLACESOUND,
00046     SETPLACERFID,
00047     SETPLACETHERMAL
00048   };
00049   
00050   
00055   class CMapConnector : 
00056     public QObject
00057   {
00058     Q_OBJECT
00059     //------------------------------------------------------------------------//
00060     private:
00061     
00063       int argc_;
00065       char** argv_;
00066       
00068       std::string current_robot_frame_id_;
00069       
00071       QCursor zoom_in_cursor_;
00073       QCursor zoom_out_cursor_;
00074       
00076       EStdrMapState map_state_;
00077       
00079       CMapLoader loader_;
00080       
00082       bool map_initialized_;
00083     
00084     //------------------------------------------------------------------------//
00085     public:
00086     
00093       CMapConnector(int argc, char **argv);
00094       
00099       ~CMapConnector(void);
00100       
00106       void updateImage(QImage *img);  
00107       
00113       void setInitialImageSize(QSize s);
00114       
00121       void updateZoom(QPoint p,bool z);
00122       
00128       void updateCenter(QPoint p);
00129       
00135       QPoint getGlobalPoint(QPoint p);
00136       
00143       void drawGrid(QImage *img,float resolution);
00144       
00150       QPoint mapToGlobal(QPoint p);
00151       
00156       QWidget* getLoader(void);
00157       
00163       void setMapInitialized(bool mi);
00164     
00165     //------------------------------------------------------------------------//
00166     public Q_SLOTS:
00167     
00174       bool eventFilter( QObject* watched, QEvent* event);
00175       
00181       void serveImage(QImage *img);
00182       
00188       void setCursorZoomIn(bool state);
00189       
00195       void setCursorZoomOut(bool state);
00196       
00202       void setCursorAdjusted(bool state);
00203       
00208       void waitForPlace(void);
00209       
00214       void waitForThermalPlace(void);
00215       
00220       void waitForCo2Place(void);
00221       
00226       void waitForSoundPlace(void);
00227       
00232       void waitForRfidPlace(void);
00233       
00239       void waitForReplace(std::string robotFrameId);
00240     
00241     //------------------------------------------------------------------------//
00242     Q_SIGNALS:
00243     
00249       void signalUpdateImage(QImage *img);  
00250       
00256       void zoomInPressed(QPoint p);  
00257       
00263       void zoomOutPressed(QPoint p);  
00264       
00270       void robotPlaceSet(QPoint p);
00271       
00277       void thermalPlaceSet(QPoint p);
00278       
00284       void co2PlaceSet(QPoint p);
00285       
00291       void soundPlaceSet(QPoint p);
00292       
00298       void rfidPlaceSet(QPoint p);
00299       
00306       void itemClicked(QPoint p,Qt::MouseButton b);
00307       
00314       void robotReplaceSet(QPoint p,std::string robotName);
00315   };  
00316 }
00317 
00318 #endif


stdr_gui
Author(s): Manos Tsardoulias
autogenerated on Thu Jun 6 2019 18:57:38