GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: include/gepetto/gui/dialog/dialogloadrobot.hh Lines: 1 6 16.7 %
Date: 2024-04-14 11:13:22 Branches: 1 4 25.0 %

Line Branch Exec Source
1
// Copyright (c) 2015-2018, LAAS-CNRS
2
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3
//
4
// This file is part of gepetto-viewer.
5
// gepetto-viewer is free software: you can redistribute it
6
// and/or modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation, either version
8
// 3 of the License, or (at your option) any later version.
9
//
10
// gepetto-viewer is distributed in the hope that it will be
11
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// General Lesser Public License for more details. You should have
14
// received a copy of the GNU Lesser General Public License along with
15
// gepetto-viewer. If not, see <http://www.gnu.org/licenses/>.
16
17
#ifndef GEPETTO_GUI_DIALOGLOADROBOT_HH
18
#define GEPETTO_GUI_DIALOGLOADROBOT_HH
19
20
#include <QComboBox>
21
#include <QDialog>
22
23
namespace Ui {
24
class DialogLoadRobot;
25
}
26
27
namespace gepetto {
28
namespace gui {
29
class DialogLoadRobot : public QDialog {
30
  Q_OBJECT
31
32
 public:
33
  struct RobotDefinition {
34
    QString name_, robotName_, urdfSuf_, srdfSuf_, package_, modelName_,
35
        rootJointType_;
36
1
    RobotDefinition() : rootJointType_("Freeflyer") {}
37
    RobotDefinition(QString name, QString robotName, QString rootJointType,
38
                    QString modelName, QString package, QString urdfSuffix,
39
                    QString srdfSuffix)
40
        : name_(name),
41
          robotName_(robotName),
42
          urdfSuf_(urdfSuffix),
43
          srdfSuf_(srdfSuffix),
44
          package_(package),
45
          modelName_(modelName),
46
          rootJointType_(rootJointType) {}
47
  };
48
49
  explicit DialogLoadRobot(QWidget *parent = 0);
50
  ~DialogLoadRobot();
51
52
  static void addRobotDefinition(QString name, QString robotName,
53
                                 QString rootJointType, QString modelName,
54
                                 QString package, QString urdfSuffix,
55
                                 QString srdfSuffix);
56
  static QList<RobotDefinition> getRobotDefinitions();
57
58
  RobotDefinition getSelectedRobotDescription() { return selected_; }
59
60
 private slots:
61
  void accept();
62
  void robotSelect(int index);
63
64
 private:
65
  ::Ui::DialogLoadRobot *ui_;
66
  QComboBox *defs_;
67
  RobotDefinition selected_;
68
69
  static QList<RobotDefinition> definitions;
70
  static QStringList rootJointTypes;
71
};
72
}  // namespace gui
73
}  // namespace gepetto
74
75
Q_DECLARE_METATYPE(gepetto::gui::DialogLoadRobot::RobotDefinition)
76
77
#endif  // GEPETTO_GUI_DIALOGLOADROBOT_HH