RobotWidget.cpp
Go to the documentation of this file.
1 #include "RobotWidget.h"
2 
3 namespace armarx
4 {
5  void RobotWidget::addTo(viz::Layer& layer) const
6  {
7  const auto adr = reinterpret_cast<std::intptr_t>(this);
8  auto r = viz::Robot("Robot_" + std::to_string(adr))
9  .file(_ui.lineEditProject->text().toStdString(),
10  _ui.comboBoxFile->currentText().toStdString())
11  .position(_ui.doubleSpinBoxTX->value(),
12  _ui.doubleSpinBoxTY->value(),
13  _ui.doubleSpinBoxTZ->value())
14  .orientation(_ui.doubleSpinBoxRX->value(),
15  _ui.doubleSpinBoxRY->value(),
16  _ui.doubleSpinBoxRZ->value());
17  if (_ui.checkBoxColor->isChecked())
18  {
19  r.overrideColor(viz::Color{static_cast<float>(_ui.doubleSpinBoxR->value()),
20  static_cast<float>(_ui.doubleSpinBoxG->value()),
21  static_cast<float>(_ui.doubleSpinBoxB->value()),
22  static_cast<float>(_ui.doubleSpinBoxA->value())});
23  }
24  layer.add(r);
25  }
26 }
armarx::viz::Layer::add
void add(ElementT const &element)
Definition: Layer.h:29
armarx::ElementWidgetBaseTemplate< Ui::RobotWidget >::_ui
Ui::RobotWidget _ui
Definition: ElementWidgetBase.h:33
armarx::armem::human::Robot
@ Robot
Definition: util.h:14
armarx::viz::Color
Definition: Color.h:13
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:40
RobotWidget.h
armarx::RobotWidget::addTo
void addTo(viz::Layer &layer) const override
Definition: RobotWidget.cpp:5
armarx::viz::Layer
Definition: Layer.h:12
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28