GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: include/gepetto/gui/dialog/dialogloadenvironment.hh Lines: 2 8 25.0 %
Date: 2020-05-14 11:23:33 Branches: 10 46 21.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_DIALOGLOADENVIRONMENT_HH
18
#define GEPETTO_GUI_DIALOGLOADENVIRONMENT_HH
19
20
#include <QDialog>
21
#include <QComboBox>
22
23
namespace Ui {
24
  class DialogLoadEnvironment;
25
}
26
27
namespace gepetto {
28
  namespace gui {
29
    class DialogLoadEnvironment : public QDialog
30
    {
31
      Q_OBJECT
32
33
      public:
34
        explicit DialogLoadEnvironment(QWidget *parent = 0);
35
        ~DialogLoadEnvironment();
36
37






3
        struct EnvironmentDefinition {
38
          QString name_, envName_, urdfFilename_, package_, urdfSuf_,
39
	    srdfSuf_;
40


1
          EnvironmentDefinition () {}
41
          EnvironmentDefinition (QString name, QString envName,
42
	    QString package,
43
	    QString urdfFilename, QString urdfSuffix, QString srdfSuffix) :
44
            name_(name), envName_ (envName), urdfFilename_(urdfFilename),
45
            package_ (package), urdfSuf_(urdfSuffix), srdfSuf_(srdfSuffix)
46
          {}
47
        };
48
49
        static void addEnvironmentDefinition (QString name,
50
            QString envName,
51
            QString package,
52
            QString urdfFilename,
53
	    QString urdfSuffix,
54
	    QString srdfSuffix);
55
        static QList <EnvironmentDefinition> getEnvironmentDefinitions ();
56
57
        EnvironmentDefinition getSelectedDescription () {
58
          return selected_;
59
        }
60
61
        private slots:
62
          void accept();
63
        void envSelect(int index);
64
65
      private:
66
        ::Ui::DialogLoadEnvironment *ui_;
67
        QComboBox* defs_;
68
        EnvironmentDefinition selected_;
69
70
        static QList <EnvironmentDefinition> definitions;
71
    };
72
  } // namespace gui
73
} // namespace gepetto
74
75
Q_DECLARE_METATYPE (gepetto::gui::DialogLoadEnvironment::EnvironmentDefinition)
76
77
#endif // GEPETTO_GUI_DIALOGLOADENVIRONMENT_HH