stdr_gui_source.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  STDR Simulator - Simple Two DImensional Robot Simulator
3  Copyright (C) 2013 STDR Simulator
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 3 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 
16  Authors :
17  * Manos Tsardoulias, etsardou@gmail.com
18  * Aris Thallas, aris.thallas@gmail.com
19  * Chris Zalidis, zalidis@gmail.com
20 ******************************************************************************/
21 
23 
24 namespace stdr_gui{
25 
32  CGuiSource::CGuiSource(QPoint p,std::string name, float resolution):
33  position_(p),
34  name_(name),
35  resolution_(resolution)
36  {
37 
38  }
39 
45  {
46 
47  }
48 
53  std::string CGuiSource::getName(void)
54  {
55  return name_;
56  }
57 
64  {
65  float dx = p.x() * resolution_ - position_.x() * resolution_;
66  float dy = p.y() * resolution_ - position_.y() * resolution_;
67  float dist = sqrt( pow(dx,2) + pow(dy,2) );
68  return dist <= 0.3;
69  }
70 
71 }
72 
QPoint position_
< The position of the source in the map
CGuiSource(QPoint p, std::string name, float resolution)
Default contructor.
std::string name_
The OGM resolution.
virtual bool checkProximity(QPoint p)
Checks proximity to a point.
std::string getName(void)
Returns the "name" of the source.
The main namespace for STDR GUI.
virtual ~CGuiSource(void)
Default destructor.


stdr_gui
Author(s): Manos Tsardoulias
autogenerated on Mon Jun 10 2019 15:15:16