Skip to content

Commit

Permalink
1.0 Release Candidate II
Browse files Browse the repository at this point in the history
  • Loading branch information
Harinlen committed Jun 4, 2015
1 parent 1133cb7 commit 1046d6a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
32 changes: 26 additions & 6 deletions groundrealtimepreviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,41 @@ void GroundRealtimePreviewer::paintEvent(QPaintEvent *event)
painter.setRenderHints(QPainter::Antialiasing |
QPainter::TextAntialiasing |
QPainter::SmoothPixmapTransform, true);
QPen robotPen(RobotBase::robotBorder());
robotPen.setWidth(2);
painter.setPen(robotPen);
painter.setBrush(RobotBase::robotColor());
painter.setOpacity(0.2);
int selectedIndex=-1;
for(int i=0; i<m_positions.size(); i++)
{
//Set the preview pos to the preview robot.
m_proxyRobot->setPos(pointFromGround(m_positions.at(i)));
//Check the selected robot
if(m_robots.at(i)==m_selectedRobot)
{
//Draw the parameter.
m_proxyRobot->setAngle(m_angles.at(i));
m_proxyRobot->paintRobotDetectArea(&painter);
m_proxyRobot->paintRobotParameter(&painter);
selectedIndex=i;
continue;
}
//Set the preview pos to the preview robot.
m_proxyRobot->setPos(pointFromGround(m_positions.at(i)));
//Draw the robot.
m_proxyRobot->paintRobot(&painter);
}
//Paint the selected robot.
if(selectedIndex!=-1)
{
painter.setOpacity(1.0);
//Draw the parameter.
m_proxyRobot->setPos(pointFromGround(m_positions.at(selectedIndex)));
m_proxyRobot->setAngle(m_angles.at(selectedIndex));
painter.setPen(Qt::NoPen);
m_proxyRobot->paintRobotDetectArea(&painter);
painter.setPen(RobotBase::directionLineColor());
painter.setBrush(Qt::NoBrush);
m_proxyRobot->paintRobotParameter(&painter);
painter.setPen(robotPen);
painter.setBrush(RobotBase::robotColor());
m_proxyRobot->paintRobot(&painter);
}
}
}

2 changes: 1 addition & 1 deletion robotmanagewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void RobotManageWidget::retranslate()
m_cancel->setText(tr("Cancel"));
m_deletePoint->setText(tr("Delete"));

m_manageBox->setTitle(tr("Robots"));
m_manageBox->setTitle(tr("Robots Force"));

updateHeader();
}
Expand Down

0 comments on commit 1046d6a

Please sign in to comment.