Project

General

Profile

Statistics
| Branch: | Revision:

root / rgbdslam / src / qt_gui.h @ 9240aaa3

History | View | Annotate | Download (4.09 KB)

1 9240aaa3 Alex
/* This file is part of RGBDSLAM.
2
 * 
3
 * RGBDSLAM is free software: you can redistribute it and/or modify
4
 * it under the terms of the GNU General Public License as published by
5
 * the Free Software Foundation, either version 3 of the License, or
6
 * (at your option) any later version.
7
 * 
8
 * RGBDSLAM is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 * GNU General Public License for more details.
12
 * 
13
 * You should have received a copy of the GNU General Public License
14
 * along with RGBDSLAM.  If not, see <http://www.gnu.org/licenses/>.
15
 */
16
17
18
/* This is the main widget of the application.
19
* It sets up some not yet useful menus and
20
* three qlabels in the layout of the central widget
21
* that can be used to show qimages via the slots
22
* setDepthImage and setVisualImage.
23
*
24
* there is an alternative: RosUI for headless use of the rgbdslam
25
*/
26
#ifndef QTCV_H
27
#define QTCV_H
28
29
#include <QMainWindow>
30
#include <QGridLayout>
31
#include "glviewer.h"
32
#include "parameter_server.h"
33
34
class QAction;
35
class QActionGroup;
36
class QLabel;
37
class QMenu;
38
39
//TODO:
40
//Choice between Binary and ASCII outputfiles
41
//Buttons for start/stop
42
//GUI/Commandline options for switching on/off the individual visualizations
43
44
//!Constructs a QT GUI for easy control of RGBD-SLAM
45
/** Small GUI Class to visualize and control rgbdslam
46
* See Help->About for a short description */
47
class Graphical_UI: public QMainWindow
48
{
49
    Q_OBJECT
50
51
public:
52
    Graphical_UI();
53
    GLViewer* getGLViewer();
54
Q_SIGNALS:
55
    ///User selected to reset the graph
56
    void reset(); 
57
    ///User selected to start or resume processing
58
    void togglePause();
59
    ///User selected to start or resume bag recording
60
    void toggleBagRecording();
61
    ///User wants the next frame to be processed
62
    void getOneFrame();
63
    ///User wants the last node to be removed from the graph
64
    void deleteLastFrame();
65
    void sendAllClouds(); ///< Signifies the sending of the whole model
66
    ///User wants the current world model to be saved to a pcd-file or ply file
67
    void saveAllClouds(QString filename);
68
    void saveTrajectory(QString filename);
69
    ///User wants the current world model to be saved to one pcd-file per node
70
    void saveIndividualClouds(QString file_basename);
71
    void setMaxDepth(float max_depth);
72
    void evaluation();
73
    void optimizeGraph();
74
    void printEdgeErrors(QString);
75
    void pruneEdgesWithErrorAbove(float);
76
     
77
public Q_SLOTS:
78
    void setVisualImage(QImage);
79
    void setFeatureFlowImage(QImage);
80
    void setDepthImage(QImage);
81
    void setTransformation(QString);
82
    void sendFinished(); ///< Call to display, that sending finished
83
    void addPointCloud(pointcloud_type * pc, QMatrix4x4 transform);
84
    void updateTransforms(QList<QMatrix4x4>* transforms);
85
    void setGraphEdges(QList<QPair<int, int> >* list);
86
    void deleteLastNode();
87
    void resetGLViewer();
88
89
private Q_SLOTS:
90
    void resetCmd();
91
    void sendAll();
92
    void setMax();
93
    void saveAll();
94
    void saveIndividual();
95
    void quickSaveAll();
96
    void pause(bool);
97
    void bagRecording(bool);
98
    void about();
99
    void help();
100
    void lastTransformationMatrix();
101
    void setInfo(QString);
102
    void setInfo2(QString);
103
    void setStatus(QString);
104
    void getOneFrameCmd();
105
    void deleteLastFrameCmd();
106
    void set3DDisplay(bool is_on);
107
    void set2DStream(bool is_on);
108
    void toggleTriangulation();
109
    void saveTrajectoryDialog();
110
    void optimizeGraphTrig();
111
    void showEdgeErrors();
112
    void pruneEdgesWithHighError();
113
private:
114
    //!Menus and Menu elements are defined here
115
    void createMenus();
116
117
    //QString *menuHelpText;
118
    QString *mouseHelpText;
119
    QString *infoText;
120
    QString *licenseText;
121
    QString transformationMatrix;
122
    QLabel *infoLabel;
123
    QLabel *infoLabel2;
124
    QLabel *tmpLabel;
125
    QLabel *visual_image_label;
126
    QLabel *feature_flow_image_label;
127
    QLabel *depth_image_label;
128
    QLabel *stats_image_label;
129
    //QLabel *transform_label;
130
    QGridLayout* gridlayout;
131
    QString filename;
132
    GLViewer* glviewer;
133
    bool pause_on;
134
};
135
136
#endif