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_rfid_tag.h"
00023
00024 namespace stdr_gui{
00025
00033 CGuiRfidTag::CGuiRfidTag(QPoint p,std::string name, float resolution):
00034 CGuiSource(p,name,resolution),
00035 message_("")
00036 {
00037
00038 }
00039
00044 CGuiRfidTag::~CGuiRfidTag(void)
00045 {
00046
00047 }
00048
00054 void CGuiRfidTag::draw(QImage *img)
00055 {
00056 QPainter painter(img);
00057 int step = 3;
00058 painter.setPen(QColor(0,200,0,200));
00059 for(unsigned int i = 0 ; i < 4 ; i++)
00060 {
00061 painter.drawEllipse(
00062 position_.x() - i * step,
00063 img->height() - position_.y() - i * step,
00064 2 * i * step,
00065 2 * i * step);
00066 }
00067
00069
00070 int text_size = name_.size();
00071
00072
00073 painter.setPen(QColor(0,0,0,100 * (2)));
00074
00075 painter.drawRect(
00076 position_.x() + 10,
00077 img->height() - position_.y() - 30,
00078 3 + text_size * 9,
00079 20);
00080
00081
00082 painter.setPen(QColor(255,255,255,100 * (2)));
00083
00084 painter.fillRect(
00085 position_.x() + 10,
00086 img->height() - position_.y() - 30,
00087 3 + text_size * 9,
00088 20,
00089 QBrush(QColor(0,0,0,100 * (2))));
00090
00091
00092 painter.setFont(QFont("Courier New"));
00093 painter.drawText(
00094 position_.x() + 12,
00095 img->height() - position_.y() - 15,
00096 QString(name_.c_str()));
00097 }
00098
00104 void CGuiRfidTag::setMessage(QString msg)
00105 {
00106 message_ = msg;
00107 }
00108
00113 QString CGuiRfidTag::getMessage(void)
00114 {
00115 return message_;
00116 }
00117 }