ParametersToolBox.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 //
29 // Original version from Find-Object: https://github.com/introlab/find-object
30 //
31 
32 #ifndef RTABMAP_PARAMETERSTOOLBOX_H_
33 #define RTABMAP_PARAMETERSTOOLBOX_H_
34 
35 #include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
36 
38 #include <QWidget>
39 #include <QSet>
40 
41 class QVBoxLayout;
42 class QStackedWidget;
43 class QComboBox;
44 
45 namespace rtabmap {
46 
47 class RTABMAPGUI_EXP ParametersToolBox: public QWidget
48 {
49  Q_OBJECT
50 
51 public:
52  ParametersToolBox(QWidget *parent = 0);
53  virtual ~ParametersToolBox();
54 
55  void setupUi(const ParametersMap & parameters);
56  QWidget * getParameterWidget(const QString & key);
57  void updateParameter(const std::string & key, const std::string & value);
58  const ParametersMap & getParameters() const {return parameters_;}
59 
60 private:
61  void addParameter(QVBoxLayout * layout, const std::string & key, const std::string & value);
62  void addParameter(QVBoxLayout * layout, const QString & key, const QString & value);
63  void addParameter(QVBoxLayout * layout, const QString & key, const int & value);
64  void addParameter(QVBoxLayout * layout, const QString & key, const double & value);
65  void addParameter(QVBoxLayout * layout, const QString & key, const bool & value);
66  void addParameter(QVBoxLayout * layout, const QString & name, QWidget * widget);
67 
68 Q_SIGNALS:
69  void parametersChanged(const QStringList & name);
70 
71 private Q_SLOTS:
72  void changeParameter();
73  void changeParameter(const QString & value);
74  void changeParameter(const int & value);
75  void resetCurrentPage();
76  void resetAllPages();
77 
78 private:
79  QStringList resetPage(int index);
80  void updateParametersVisibility();
81 
82 private:
83  QComboBox * comboBox_;
84  QStackedWidget * stackedWidget_;
86 };
87 
88 } // namespace find_object
89 
90 #endif /* PARAMETERSTOOLBOX_H_ */
#define RTABMAPGUI_EXP
Definition: RtabmapGuiExp.h:38
std::map< std::string, std::string > ParametersMap
Definition: Parameters.h:43
string name
QStackedWidget * stackedWidget_
const ParametersMap & getParameters() const


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:37:29