36 #include <boost/lexical_cast.hpp>
51 config_widget_(new QWidget()),
61 ui_.color->setColor(Qt::red);
65 p.setColor(QPalette::Background, Qt::white);
69 QPalette p3(
ui_.status->palette());
70 p3.setColor(QPalette::Text, Qt::red);
71 ui_.status->setPalette(p3);
73 QObject::connect(
ui_.select_frame, SIGNAL(clicked()),
this, SLOT(
SelectFrame()));
74 QObject::connect(
ui_.frame, SIGNAL(textEdited(
const QString&)),
this, SLOT(
FrameEdited()));
75 QObject::connect(
ui_.alpha, SIGNAL(valueChanged(
double)),
this, SLOT(
SetAlpha(
double)));
76 QObject::connect(
ui_.x, SIGNAL(valueChanged(
double)),
this, SLOT(
SetX(
double)));
77 QObject::connect(
ui_.y, SIGNAL(valueChanged(
double)),
this, SLOT(
SetY(
double)));
78 QObject::connect(
ui_.size, SIGNAL(valueChanged(
double)),
this, SLOT(
SetSize(
double)));
79 QObject::connect(
ui_.rows, SIGNAL(valueChanged(
int)),
this, SLOT(
SetRows(
int)));
80 QObject::connect(
ui_.columns, SIGNAL(valueChanged(
int)),
this, SLOT(
SetColumns(
int)));
81 connect(
ui_.color, SIGNAL(colorEdited(
const QColor &)),
this, SLOT(
DrawIcon()));
98 icon.fill(Qt::transparent);
100 QPainter painter(&icon);
101 painter.setRenderHint(QPainter::Antialiasing,
true);
103 QPen pen(QColor(
ui_.color->color()));
106 pen.setCapStyle(Qt::SquareCap);
109 painter.drawLine(2, 2, 14, 2);
110 painter.drawLine(2, 2, 2, 14);
111 painter.drawLine(14, 2, 14, 14);
112 painter.drawLine(2, 14, 14, 14);
113 painter.drawLine(8, 2, 8, 14);
114 painter.drawLine(2, 8, 14, 8);
165 ui_.frame->setText(QString::fromStdString(frame));
214 QColor color =
ui_.color->color();
217 glColor4d(color.redF(), color.greenF(), color.blueF(),
alpha_);
224 glVertex2d(transformed_left_it->getX(), transformed_left_it->getY());
225 glVertex2d(transformed_right_it->getX(), transformed_right_it->getY());
227 ++transformed_right_it;
234 glVertex2d(transformed_top_it->getX(), transformed_top_it->getY());
235 glVertex2d(transformed_bottom_it->getX(), transformed_bottom_it->getY());
237 ++transformed_bottom_it;
273 for (
int r = 0; r <=
rows_; r++)
302 std::list<tf::Point>::iterator points_it = src.begin();
303 std::list<tf::Point>::iterator transformed_it = dst.begin();
304 for (; points_it != src.end() && transformed_it != dst.end(); ++points_it)
306 (*transformed_it) =
transform_ * (*points_it);
317 node[
"color"] >> color;
318 ui_.color->setColor(QColor(color.c_str()));
324 node[
"frame"] >> frame;
325 ui_.frame->setText(QString::fromStdString(frame));
350 node[
"size"] >>
size_;
356 node[
"rows"] >>
rows_;
371 emitter << YAML::Key <<
"color" << YAML::Value <<
ui_.color->color().name().toStdString();
373 emitter << YAML::Key <<
"alpha" << YAML::Value <<
alpha_;
375 std::string frame =
ui_.frame->text().toStdString();
376 emitter << YAML::Key <<
"frame" << YAML::Value << frame;
378 emitter << YAML::Key <<
"x" << YAML::Value <<
top_left_.getX();
379 emitter << YAML::Key <<
"y" << YAML::Value <<
top_left_.getY();
380 emitter << YAML::Key <<
"size" << YAML::Value <<
size_;
381 emitter << YAML::Key <<
"rows" << YAML::Value <<
rows_;
382 emitter << YAML::Key <<
"columns" << YAML::Value <<
columns_;