GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: include/gepetto/gui/dialog/dialogloadrobot.hh Lines: 2 8 25.0 %
Date: 2020-05-14 11:23:33 Branches: 12 58 20.7 %

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 <QDialog>
21
#include <QComboBox>
22
23
namespace Ui {
24
  class DialogLoadRobot;
25
}
26
27
namespace gepetto {
28
  namespace gui {
29
    class DialogLoadRobot : public QDialog
30
    {
31
      Q_OBJECT
32
33
      public:
34








3
        struct RobotDefinition {
35
          QString name_, robotName_, urdfSuf_, srdfSuf_, package_, modelName_, rootJointType_;
36



1
          RobotDefinition () : rootJointType_ ("Freeflyer") {}
37
          RobotDefinition (QString name,
38
              QString robotName,
39
              QString rootJointType,
40
              QString modelName,
41
              QString package,
42
              QString urdfSuffix,
43
              QString srdfSuffix) :
44
            name_(name), robotName_ (robotName), urdfSuf_(urdfSuffix), srdfSuf_(srdfSuffix),
45
            package_ (package), modelName_ (modelName),
46
            rootJointType_ (rootJointType){}
47
        };
48
49
        explicit DialogLoadRobot(QWidget *parent = 0);
50
        ~DialogLoadRobot();
51
52
        static void addRobotDefinition (QString name,
53
            QString robotName,
54
            QString rootJointType,
55
            QString modelName,
56
            QString package,
57
            QString urdfSuffix,
58
            QString srdfSuffix);
59
        static QList <RobotDefinition> getRobotDefinitions ();
60
61
        RobotDefinition getSelectedRobotDescription () {
62
          return selected_;
63
        }
64
65
        private slots:
66
          void accept();
67
        void robotSelect(int index);
68
69
      private:
70
        ::Ui::DialogLoadRobot *ui_;
71
        QComboBox* defs_;
72
        RobotDefinition selected_;
73
74
        static QList <RobotDefinition> definitions;
75
        static QStringList rootJointTypes;
76
    };
77
  } // namespace gui
78
} // namespace gepetto
79
80
Q_DECLARE_METATYPE (gepetto::gui::DialogLoadRobot::RobotDefinition)
81
82
#endif // GEPETTO_GUI_DIALOGLOADROBOT_HH