VertexDataWidget.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
17 * @date 2021
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
24#include <optional>
25#include <vector>
26
27#include <QWidget>
28#include <qobjectdefs.h>
29#include <qwidget.h>
30
31#include <Eigen/Core>
32
35
36
37class QLineEdit;
38class QDoubleSpinBox;
39class QPushButton;
40class QRadioButton;
41class QComboBox;
42
44{
45 class Connection;
46}
47
49{
50 class Connection;
51}
52
54{
55
56 class VertexDataWidget : public QWidget
57 {
58 Q_OBJECT
59 using This = VertexDataWidget;
60
61
62 public:
64
65
66 std::optional<GuiGraph::Vertex> vertex();
67 void setVertex(GuiGraph::Vertex vertex);
68 void clearVertex();
69
70 Eigen::Vector3d xyz() const;
71 Eigen::Vector3d rpyDeg() const;
72 Eigen::Vector3d rpyRad() const;
73 core::Pose_d pose() const;
74
75
78
79
80 signals:
81
83
84
85 private slots:
86
87 void _updateAngleUnit();
88 void _updateVertexAttribs();
89 void _updateVertexAgent();
90 void _updateVertexFrame();
91 void _removeInstance();
92
93
94 private:
95 void _setFromVertex(const GuiGraph::Vertex& vertex);
96 void _getToVertex(GuiGraph::Vertex& vertex);
97
98 std::vector<QDoubleSpinBox*> _positionSpinBoxes();
99 std::vector<QDoubleSpinBox*> _angleSpinBoxes();
100 std::vector<QDoubleSpinBox*> _allSpinBoxes();
101
102 void _setPose(const core::Pose_d& pose);
103 void _setXyz(const Eigen::Vector3d& xyz);
104
105 Eigen::Vector3d _rpyRaw() const;
106 void _setRpyRaw(const Eigen::Vector3d& rpy) const;
107 void _setRpyDeg(const Eigen::Vector3d& rpyDeg) const;
108 void _setRpyRad(const Eigen::Vector3d& rpyRad) const;
109
110 void _setFromCurrentRobotPose();
111
112 void _loadFramedPoseFromVertex(const GuiGraph::Vertex& vertex);
113 void _updateAgentMenu();
114 void _updateFrameMenu();
115
116 void _framedPoseCoordinateConversion();
117
118
119 private:
120 std::optional<GuiGraph::Vertex> _vertex;
121
122
123 QLineEdit* name = nullptr;
124 QLineEdit* locationID = nullptr;
125 QComboBox* agent = nullptr;
126 QComboBox* frame = nullptr;
127 QPushButton* removeInstanceButton = nullptr;
128
129 QDoubleSpinBox* x = nullptr;
130 QDoubleSpinBox* y = nullptr;
131 QDoubleSpinBox* z = nullptr;
132
133 QDoubleSpinBox* roll = nullptr;
134 QDoubleSpinBox* pitch = nullptr;
135 QDoubleSpinBox* yaw = nullptr;
136
137 QRadioButton* angleUnitDeg = nullptr;
138 QRadioButton* angleUnitRad = nullptr;
139
140
141 robotvisu::Connection* _robotConnection = nullptr;
142 QPushButton* _useCurrentRobotPose = nullptr;
143
144 objectposes::Connection* _objectPosesConnection = nullptr;
145 };
146
147} // namespace armarx::navigation::qt_plugins::location_graph_editor
Eigen::Isometry3d Pose_d
Definition basic_types.h:32
This file offers overloads of toIce() and fromIce() functions for STL container types.