16 #include "ui_scenepanel.h" 18 using namespace se2ez;
26 cm_ = std::make_shared<Box2DCollisionManager>(
scene_->getSceneRobot());
33 connect(
ui_->generateGoalsButton, SIGNAL(pressed()),
this, SLOT(
generateGoals()));
39 for (
const auto &panel : *
panels)
49 bool isActive = (jpanel->getSignature().compare(
scene_->getSignature()) == 0);
58 ui_->robotComboBox->clear();
61 ui_->robotComboBox->addItem(tr(
name.c_str()));
65 auto box =
new QCheckBox(tr(
name.c_str()));
66 box->setChecked(
true);
67 connect(box, SIGNAL(clicked()),
this, SLOT(
updateScene()));
68 ui_->passiveBoxes->addWidget(box);
79 for (
int i = 0; i <
ui_->passiveBoxes->count(); i++)
81 auto box =
static_cast<QCheckBox *
>(
ui_->passiveBoxes->itemAt(i)->widget());
82 auto name = box->text();
89 if (
ui_->collide->isChecked())
102 auto ee =
getEE(
ui_->robotComboBox->currentText());
103 auto prefix =
ui_->lineEditPrefix->text().toStdString();
104 auto builder = std::make_shared<MotionBuilder>(
scene_->getSceneRobot(), ee, prefix);
107 scene_->getSceneRobot()->setNamedStates(goals);
114 auto srobot =
scene_->getSceneRobot();
116 if (
ui_->geometry->isChecked())
119 std::make_shared<RenderArea::CollideDrawer>(
ui_->collide->isChecked(),
123 if (
ui_->frames->isChecked())
129 auto state = std::make_shared<State>(
scene_->getSceneRobot());
134 auto entry =
panels->find(name);
139 SE2EZ_WARN(
"JointPanel %s does not exist, returning empty state", name);
149 auto entry =
panels->find(name);
150 auto jp =
dynamic_cast<JointPanel *
>(entry->second);
155 SE2EZ_WARN(
"JointPanel %s does not exist, returning the first EE %s from the robot", name, ee);
165 auto entry =
panels->find(name);
166 auto jp =
dynamic_cast<JointPanel *
>(entry->second);
170 SE2EZ_WARN(
"JointPanel %s does not exist, returning empty Robot", name);
171 return std::make_shared<Robot>();
const StatePtr getState(const QString &s)
A shared pointer wrapper for se2ez::State.
genGoals() returns only states found with IK
ScenePanel(ScenePtr scene, std::string name, QWidget *parent=0)
A shared pointer wrapper for se2ez::Scene.
std::set< std::string > colliding_
void drawGeometry(QPainter &painter, RobotPtr robot, StatePtr state, GeometryDrawerPtr drawer=nullptr)
void draw(QPainter &painter, RenderArea *canvas) override
#define SE2EZ_WARN(fmt,...)
const std::string & getEE()
void getState(StatePtr state)
const std::string getEE(const QString &s)
MainWindow::PanelMapPtr panels
void drawAllFrames(QPainter &painter, RobotPtr robot, StatePtr state)
A shared pointer wrapper for se2ez::Robot.
std::set< std::string > panelnames_
names of all panels
The canvas widget. It contains all the drawing functions as well as all the general settings for draw...
const RobotPtr & getRobot()
std::set< std::string > anames_
names of jpanels of active robots
void update(boost::posix_time::ptime last, boost::posix_time::ptime current) override
const RobotPtr getRobot(const QString &s)
std::set< std::string > pnames_
names of jpanels of passive robots