Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "stdr_gui/stdr_map_metainformation/stdr_gui_thermal_source.h"
00023
00024 namespace stdr_gui{
00025
00032 CGuiThermalSource::CGuiThermalSource(QPoint p,std::string name, float resolution):
00033 CGuiSource(p,name,resolution),
00034 degrees_(0.0)
00035 {
00036
00037 }
00038
00043 CGuiThermalSource::~CGuiThermalSource(void)
00044 {
00045
00046 }
00047
00053 void CGuiThermalSource::draw(QImage *img)
00054 {
00055 QPainter painter(img);
00056 int step = 3;
00057 painter.setPen(QColor(200, 0, 0, 200));
00058 for(unsigned int i = 0 ; i < 4 ; i++)
00059 {
00060 painter.drawEllipse(
00061 position_.x() - i * step,
00062 img->height() - position_.y() - i * step,
00063 2 * i * step,
00064 2 * i * step);
00065 }
00066
00068
00069 int text_size = name_.size();
00070
00071 painter.setPen(QColor(0,0,0,100 * (2)));
00072
00073 painter.drawRect(
00074 position_.x() + 10,
00075 img->height() - position_.y() - 30,
00076 3 + text_size * 9,
00077 20);
00078
00079 painter.setPen(QColor(255,255,255,100 * (2)));
00080
00081 painter.fillRect(
00082 position_.x() + 10,
00083 img->height() - position_.y() - 30,
00084 3 + text_size * 9,
00085 20,
00086 QBrush(QColor(0,0,0,100 * (2))));
00087
00088 painter.setFont(QFont("Courier New"));
00089 painter.drawText(
00090 position_.x() + 12,
00091 img->height() - position_.y() - 15,
00092 QString(name_.c_str()));
00093 }
00094
00100 void CGuiThermalSource::setDegrees(float degrees)
00101 {
00102 degrees_ = degrees;
00103 }
00104
00109 float CGuiThermalSource::getDegrees(void)
00110 {
00111 return degrees_;
00112 }
00113 }
00114