Matrix4fWidgets.h
Go to the documentation of this file.
1#pragma once
2
3#include "Basic.h"
4
6{
8 public ValueMixin<PosRPYSpinBoxes, Eigen::Matrix4f, PosRPYSpinBoxesBuilder>,
9 public ToolTipMixin<PosRPYSpinBoxesBuilder>
10 {
11 PosRPYSpinBoxesBuilder(std::string const& name, float limpos = 1000, float limrpy = M_PI) :
12 ValueMixin(name)
13 {
14 widget().stepsPos = toIceI(Eigen::Vector3i::Ones() * static_cast<int>(2 * limpos + 1));
15 widget().stepsRPY =
16 toIceI(Eigen::Vector3i::Ones() * static_cast<int>(200 * limrpy + 1));
17 widget().decimalsPos = toIceI(Eigen::Vector3i::Ones() * 2);
18 widget().decimalsRPY = toIceI(Eigen::Vector3i::Ones() * 2);
19 widget().minPos = toIceF(Eigen::Vector3f::Ones() * -limpos);
20 widget().maxPos = toIceF(Eigen::Vector3f::Ones() * +limpos);
21 widget().minRPY = toIceF(Eigen::Vector3f::Ones() * -limrpy);
22 widget().maxRPY = toIceF(Eigen::Vector3f::Ones() * +limrpy);
23 widget().defaultValue = makeValue(Eigen::Matrix4f{Eigen::Matrix4f::Identity()});
24 }
25
27 minPos(const Eigen::Vector3f min)
28 {
30 return *this;
31 }
32
34 minRPY(const Eigen::Vector3f min)
35 {
37 return *this;
38 }
39
41 maxPos(const Eigen::Vector3f max)
42 {
44 return *this;
45 }
46
48 maxRPY(const Eigen::Vector3f max)
49 {
51 return *this;
52 }
53
55 stepsPos(const Eigen::Vector3i steps)
56 {
57 widget().stepsPos = toIceI(steps);
58 return *this;
59 }
60
62 stepsRPY(const Eigen::Vector3i steps)
63 {
64 widget().stepsRPY = toIceI(steps);
65 return *this;
66 }
67
69 decimalsPos(const Eigen::Vector3i decimals)
70 {
71 widget().decimalsPos = toIceI(decimals);
72 return *this;
73 }
74
76 decimalsRPY(const Eigen::Vector3i decimals)
77 {
78 widget().decimalsRPY = toIceI(decimals);
79 return *this;
80 }
81 };
82} // namespace armarx::RemoteGui::detail
83
84namespace armarx::RemoteGui
85{
86 inline detail::PosRPYSpinBoxesBuilder
87 makePosRPYSpinBoxes(std::string const& name, float limpos = 1000, float limrpy = M_PI)
88 {
89 return {name, limpos, limrpy};
90 }
91} // namespace armarx::RemoteGui
#define M_PI
Definition MathTools.h:17
Vector3f toIceF(Eigen::Vector3f v)
Definition Storage.cpp:80
ValueVariant makeValue(bool value)
Definition Storage.cpp:144
detail::PosRPYSpinBoxesBuilder makePosRPYSpinBoxes(std::string const &name, float limpos=1000, float limrpy=M_PI)
Vector3i toIceI(Eigen::Vector3i v)
Definition Storage.cpp:90
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)
PosRPYSpinBoxesBuilder & stepsPos(const Eigen::Vector3i steps)
PosRPYSpinBoxesBuilder & stepsRPY(const Eigen::Vector3i steps)
PosRPYSpinBoxesBuilder & maxRPY(const Eigen::Vector3f max)
PosRPYSpinBoxesBuilder & decimalsPos(const Eigen::Vector3i decimals)
PosRPYSpinBoxesBuilder & maxPos(const Eigen::Vector3f max)
PosRPYSpinBoxesBuilder & minPos(const Eigen::Vector3f min)
PosRPYSpinBoxesBuilder & decimalsRPY(const Eigen::Vector3i decimals)
PosRPYSpinBoxesBuilder & minRPY(const Eigen::Vector3f min)
PosRPYSpinBoxesBuilder(std::string const &name, float limpos=1000, float limrpy=M_PI)