28 #include <Eigen/Dense>
30 #include <QDoubleSpinBox>
32 #include <VirtualRobot/RobotNodeSet.h>
33 #include <VirtualRobot/Nodes/RobotNode.h>
40 template<
class Qw
id = QDoubleSpinBox, std::
size_t Size = 0>
44 template<
class Scalar,
int Rows,
int Cols>
52 if constexpr(Rows == -1 && Cols == -1)
54 m.resize(_widgets.size(), 1);
56 else if constexpr(Rows == 1 && Cols == -1)
58 m.resize(_widgets.size());
60 else if constexpr(Rows == -1 && Cols == 1)
62 m.resize(_widgets.size());
64 else if constexpr(Cols == -1)
66 m.resize(Rows, _widgets.size() / Rows);
68 else if constexpr(Rows == -1)
70 m.resize(_widgets.size() / Cols, Cols);
75 for (std::size_t i = 0; i < _widgets.size(); ++i)
77 m.data()[i] = _widgets.at(i)->value();
80 template<
class Scalar>
81 void get(std::vector<Scalar>& m)
const
88 m.resize(_widgets.size());
90 for (std::size_t i = 0; i < _widgets.size(); ++i)
92 m.at(i) = _widgets.at(i)->value();
107 template<
class Scalar,
int Rows,
int Cols>
116 for (
int i = 0; i < _widgets.size(); ++i)
118 _widgets.at(i)->setValue(m.data()[i]);
121 void set(
const VirtualRobot::RobotNodeSetPtr&
set)
126 for (std::size_t i = 0; i < _widgets.size(); ++i)
129 _widgets.at(i)->setValue(
set->getNode(i)->getJointValue());
134 for (
auto w : _widgets)
147 _widgets.at(_sz) =
s;
151 _widgets.emplace_back(
s);
166 for (
auto w : _widgets)
173 for (
auto w : _widgets)
180 for (
auto w : _widgets)
198 std::array<Qwid*, Size>,