28#include <QDoubleSpinBox>
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;
void get(std::vector< Scalar > &m) const
void visitWidgets(const auto &f)
void setMinMax(auto min, auto max)
void get(Eigen::Matrix< Scalar, Rows, Cols > &m) const
void set(const VirtualRobot::RobotNodeSetPtr &set)
void set(const Eigen::Matrix< Scalar, Rows, Cols > &m)
#define ARMARX_CHECK_LESS(lhs, rhs)
This macro evaluates whether lhs is less (<) than rhs and if it turns out to be false it will throw a...
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::vector< T > max(const std::vector< T > &v1, const std::vector< T > &v2)
std::vector< T > min(const std::vector< T > &v1, const std::vector< T > &v2)