28 #include <QDoubleSpinBox>
30 #include <Eigen/Dense>
32 #include <VirtualRobot/Nodes/RobotNode.h>
33 #include <VirtualRobot/RobotNodeSet.h>
40 template <
class Qw
id = QDoubleSpinBox, std::
size_t Size = 0>
44 template <
class Scalar,
int Rows,
int Cols>
53 if constexpr (Rows == -1 && Cols == -1)
55 m.resize(_widgets.size(), 1);
57 else if constexpr (Rows == 1 && Cols == -1)
59 m.resize(_widgets.size());
61 else if constexpr (Rows == -1 && Cols == 1)
63 m.resize(_widgets.size());
65 else if constexpr (Cols == -1)
67 m.resize(Rows, _widgets.size() / Rows);
69 else if constexpr (Rows == -1)
71 m.resize(_widgets.size() / Cols, Cols);
76 for (std::size_t i = 0; i < _widgets.size(); ++i)
78 m.data()[i] = _widgets.at(i)->value();
82 template <
class Scalar>
84 get(std::vector<Scalar>& m)
const
91 m.resize(_widgets.size());
93 for (std::size_t i = 0; i < _widgets.size(); ++i)
95 m.at(i) = _widgets.at(i)->value();
113 template <
class Scalar,
int Rows,
int Cols>
123 for (
int i = 0; i < _widgets.size(); ++i)
125 _widgets.at(i)->setValue(m.data()[i]);
130 set(
const VirtualRobot::RobotNodeSetPtr&
set)
135 for (std::size_t i = 0; i < _widgets.size(); ++i)
138 _widgets.at(i)->setValue(
set->getNode(i)->getJointValue());
145 for (
auto w : _widgets)
160 _widgets.at(_sz) =
s;
164 _widgets.emplace_back(
s);
183 for (
auto w : _widgets)
192 for (
auto w : _widgets)
201 for (
auto w : _widgets)
222 std::conditional_t<Size, std::array<Qwid*, Size>, std::vector<Qwid*>> _widgets;