GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: include/gepetto/gui/dialog/dialogloadenvironment.hh Lines: 1 6 16.7 %
Date: 2023-03-14 11:04:37 Branches: 0 2 0.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_DIALOGLOADENVIRONMENT_HH
18
#define GEPETTO_GUI_DIALOGLOADENVIRONMENT_HH
19
20
#include <QComboBox>
21
#include <QDialog>
22
23
namespace Ui {
24
class DialogLoadEnvironment;
25
}
26
27
namespace gepetto {
28
namespace gui {
29
class DialogLoadEnvironment : public QDialog {
30
  Q_OBJECT
31
32
 public:
33
  explicit DialogLoadEnvironment(QWidget *parent = 0);
34
  ~DialogLoadEnvironment();
35
36
  struct EnvironmentDefinition {
37
    QString name_, envName_, urdfFilename_, package_, urdfSuf_, srdfSuf_;
38
1
    EnvironmentDefinition() {}
39
    EnvironmentDefinition(QString name, QString envName, QString package,
40
                          QString urdfFilename, QString urdfSuffix,
41
                          QString srdfSuffix)
42
        : name_(name),
43
          envName_(envName),
44
          urdfFilename_(urdfFilename),
45
          package_(package),
46
          urdfSuf_(urdfSuffix),
47
          srdfSuf_(srdfSuffix) {}
48
  };
49
50
  static void addEnvironmentDefinition(QString name, QString envName,
51
                                       QString package, QString urdfFilename,
52
                                       QString urdfSuffix, QString srdfSuffix);
53
  static QList<EnvironmentDefinition> getEnvironmentDefinitions();
54
55
  EnvironmentDefinition getSelectedDescription() { return selected_; }
56
57
 private slots:
58
  void accept();
59
  void envSelect(int index);
60
61
 private:
62
  ::Ui::DialogLoadEnvironment *ui_;
63
  QComboBox *defs_;
64
  EnvironmentDefinition selected_;
65
66
  static QList<EnvironmentDefinition> definitions;
67
};
68
}  // namespace gui
69
}  // namespace gepetto
70
71
Q_DECLARE_METATYPE(gepetto::gui::DialogLoadEnvironment::EnvironmentDefinition)
72
73
#endif  // GEPETTO_GUI_DIALOGLOADENVIRONMENT_HH