ViewerGui.h
Go to the documentation of this file.
1 /*
2  * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping
3  * Framework Based on Octrees
4  * http://octomap.github.io
5  *
6  * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg
7  * All rights reserved. License for the viewer octovis: GNU GPL v2
8  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
9  *
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  * for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see http://www.gnu.org/licenses/.
23  */
24 
25 #ifndef VIEWERGUI_H
26 #define VIEWERGUI_H
27 
28 #include <QtGui/QMainWindow>
29 #include <QFileDialog>
30 #include <QMessageBox>
31 #include <QDockWidget>
32 #include <string>
33 #include <cmath>
34 #include "TrajectoryDrawer.h"
35 #include "PointcloudDrawer.h"
36 #include "OcTreeDrawer.h"
37 #include "CameraFollowMode.h"
38 #include "ViewerWidget.h"
39 #include "ViewerSettings.h"
40 #include "ViewerSettingsPanel.h"
42 #include "ui_ViewerGui.h"
43 
44 #include <octomap/AbstractOcTree.h>
45 #include <octomap/OcTreeBase.h>
46 #include <octovis/OcTreeRecord.h>
47 
48 namespace octomap {
49 
50  class ViewerGui : public QMainWindow {
51  Q_OBJECT
52 
53  public:
54  ViewerGui(const std::string& filename="", QWidget *parent = 0);
55  ~ViewerGui();
56 
57  static const unsigned int LASERTYPE_URG = 0;
58  static const unsigned int LASERTYPE_SICK = 1;
59 
60  // use this drawer id if loading files or none is specified in msg
61  static const unsigned int DEFAULT_OCTREE_ID = 0;
62 
63  public slots:
64 
65  void changeTreeDepth(int depth);
66  void addNextScans(unsigned scans);
67  void gotoFirstScan();
68 
69  bool isShown();
70 
71  private slots:
72 
73  // auto-connected Slots (by name))
74 
80  void on_actionExport_sequence_triggered(bool checked);
95  void on_actionPrintout_mode_toggled(bool checked);
96  void on_actionSelection_box_toggled(bool checked);
97  void on_actionHeight_map_toggled(bool checked);
98  void on_actionSemanticColoring_toggled(bool checked);
101  void on_actionPointcloud_toggled(bool checked);
102  void on_actionTrajectory_toggled(bool checked);
103  void on_actionOctree_cells_toggled(bool enabled);
104  void on_actionOctree_structure_toggled(bool enabled);
105  void on_actionFree_toggled(bool enabled);
106  void on_actionSelected_toggled(bool enabled);
107  void on_actionAxes_toggled(bool checked);
108  void on_actionHideBackground_toggled(bool checked);
110 
114 
117 
118  // use it for testcases etc.
120 
121  signals:
122  void updateStatusBar(QString message, int duration);
123  void changeNumberOfScans(unsigned scans);
124  void changeCurrentScan(unsigned scans);
125  void changeResolution(double resolution);
126  void changeCamPosition(double x, double y, double z, double lookX, double lookY, double lookZ);
127 
128  private:
133  void openFile();
134 
139  void openPointcloud();
140 
145  void openGraph(bool completeGraph = true);
146 
150  void loadGraph(bool completeGraph = true);
151 
155  void addNextScan();
156 
160  void openPC();
161 
163  void openOcTree();
164 
166  void openTree();
167 
168  // EXPERIMENTAL
169  // open a map collection (.hot-file)
170  void openMapCollection();
171 
172 
173  void setOcTreeUISwitches();
174 
178  void generateOctree();
179  void showOcTree();
180 
181  void showInfo(QString string, bool newline=false);
182 
183  void addOctree(AbstractOcTree* tree, int id, pose6d origin);
184  void addOctree(AbstractOcTree* tree, int id);
185  bool getOctreeRecord(int id, OcTreeRecord*& otr);
186 
187  void saveCameraPosition(const char* filename) const;
188  void loadCameraPosition(const char* filename);
189 
190  void updateNodesInBBX(const point3d& min, const point3d& max, bool occupied);
191  void setNodesInBBX(const point3d& min, const point3d& max, bool occupied);
192  void setNonNodesInBBX(const point3d& min, const point3d& max, bool occupied);
193 
194  std::map<int, OcTreeRecord> m_octrees;
195 
198 
199  Ui::ViewerGuiClass ui;
206  double m_occupancyThresh; // FIXME: This is not really used at the moment...
207  unsigned int m_max_tree_depth;
208  unsigned int m_laserType; // SICK or Hokuyo /URG
212 
214  std::string m_filename;
215  };
216 
217 } // namespace
218 
219 
220 #endif // VIEWERGUI_H
void on_actionRestore_camera_triggered()
Definition: ViewerGui.cpp:1007
QLabel * m_mapMemoryStatus
Definition: ViewerGui.h:211
ViewerWidget * m_glwidget
Definition: ViewerGui.h:200
ScanGraph::iterator m_nextScanToAdd
Definition: ViewerGui.h:197
static const unsigned int LASERTYPE_URG
Definition: ViewerGui.h:57
void on_actionStore_camera_triggered()
Definition: ViewerGui.cpp:1000
void on_actionOctree_cells_toggled(bool enabled)
Definition: ViewerGui.cpp:1126
void openOcTree()
open "regular" file containing an octree
Definition: ViewerGui.cpp:486
void on_action_bg_black_triggered()
Definition: ViewerGui.cpp:1170
double m_octreeResolution
Definition: ViewerGui.h:204
void on_actionTest_triggered()
Definition: ViewerGui.cpp:1059
void loadGraph(bool completeGraph=true)
Definition: ViewerGui.cpp:545
void openGraph(bool completeGraph=true)
Definition: ViewerGui.cpp:418
void changeCurrentScan(unsigned scans)
void on_actionClear_selection_triggered()
Definition: ViewerGui.cpp:754
void addNextScans(unsigned scans)
Definition: ViewerGui.cpp:381
void on_actionClear_unknown_in_selection_triggered()
Definition: ViewerGui.cpp:762
void on_action_bg_white_triggered()
Definition: ViewerGui.cpp:1175
void on_actionReload_Octree_triggered()
Definition: ViewerGui.cpp:1063
void on_actionSemanticColoring_toggled(bool checked)
Definition: ViewerGui.cpp:990
void saveCameraPosition(const char *filename) const
Definition: ViewerGui.cpp:1201
void changeNumberOfScans(unsigned scans)
void on_actionFill_nodes_in_selection_triggered()
Definition: ViewerGui.cpp:788
void on_actionSave_file_triggered()
Definition: ViewerGui.cpp:694
void on_actionFree_toggled(bool enabled)
Definition: ViewerGui.cpp:1142
std::string m_filename
Filename of last loaded file, in case it is necessary to reload it.
Definition: ViewerGui.h:214
void on_actionHideBackground_toggled(bool checked)
Definition: ViewerGui.cpp:1039
void on_actionClear_nodes_in_selection_triggered()
Definition: ViewerGui.cpp:746
void updateNodesInBBX(const point3d &min, const point3d &max, bool occupied)
Definition: ViewerGui.cpp:852
void on_actionDelete_nodes_outside_of_selection_triggered()
Definition: ViewerGui.cpp:819
TrajectoryDrawer * m_trajectoryDrawer
Definition: ViewerGui.h:201
Ui::ViewerGuiClass ui
Definition: ViewerGui.h:199
void on_actionAxes_toggled(bool checked)
Definition: ViewerGui.cpp:1031
static const unsigned int LASERTYPE_SICK
Definition: ViewerGui.h:58
void showInfo(QString string, bool newline=false)
Definition: ViewerGui.cpp:157
std::vector< ScanNode * >::iterator iterator
ViewerGui(const std::string &filename="", QWidget *parent=0)
Definition: ViewerGui.cpp:39
void on_actionClear_triggered()
Definition: ViewerGui.cpp:1048
void on_actionFill_selection_triggered()
Definition: ViewerGui.cpp:780
void addOctree(AbstractOcTree *tree, int id, pose6d origin)
Definition: ViewerGui.cpp:178
void on_actionExport_view_triggered()
Definition: ViewerGui.cpp:941
double m_laserMaxRange
Definition: ViewerGui.h:205
void on_actionHeight_map_toggled(bool checked)
Definition: ViewerGui.cpp:982
void on_action_bg_gray_triggered()
Definition: ViewerGui.cpp:1180
unsigned int m_laserType
Definition: ViewerGui.h:208
void changeResolution(double resolution)
void on_savecampose_triggered()
Definition: ViewerGui.cpp:1185
void on_actionSelection_box_toggled(bool checked)
Definition: ViewerGui.cpp:969
void setNonNodesInBBX(const point3d &min, const point3d &max, bool occupied)
Definition: ViewerGui.cpp:911
unsigned int m_max_tree_depth
Definition: ViewerGui.h:207
void on_actionPrune_tree_triggered()
Definition: ViewerGui.cpp:1092
void on_actionExport_sequence_triggered(bool checked)
Definition: ViewerGui.cpp:946
void on_actionDelete_nodes_in_selection_triggered()
Definition: ViewerGui.cpp:796
void on_actionTrajectory_toggled(bool checked)
Definition: ViewerGui.cpp:1022
QLabel * m_mapSizeStatus
Definition: ViewerGui.h:210
void on_actionOpen_graph_incremental_triggered()
Definition: ViewerGui.cpp:677
ScanGraph * m_scanGraph
Definition: ViewerGui.h:196
void on_actionSettings_triggered()
Definition: ViewerGui.cpp:628
void on_actionExit_triggered()
Definition: ViewerGui.cpp:620
CameraFollowMode * m_cameraFollowMode
Definition: ViewerGui.h:203
void updateStatusBar(QString message, int duration)
void setOcTreeUISwitches()
Definition: ViewerGui.cpp:459
void on_loadcampose_triggered()
Definition: ViewerGui.cpp:1192
PointcloudDrawer * m_pointcloudDrawer
Definition: ViewerGui.h:202
void on_actionOpen_file_triggered()
Definition: ViewerGui.cpp:662
void on_actionSelected_toggled(bool enabled)
Definition: ViewerGui.cpp:1151
void on_actionOctree_structure_toggled(bool enabled)
Definition: ViewerGui.cpp:1134
static const unsigned int DEFAULT_OCTREE_ID
Definition: ViewerGui.h:61
void setNodesInBBX(const point3d &min, const point3d &max, bool occupied)
Definition: ViewerGui.cpp:883
double m_occupancyThresh
Definition: ViewerGui.h:206
void loadCameraPosition(const char *filename)
Definition: ViewerGui.cpp:1209
std::map< int, OcTreeRecord > m_octrees
Definition: ViewerGui.h:194
void on_actionPrintout_mode_toggled(bool checked)
Definition: ViewerGui.cpp:960
void on_actionFill_unknown_in_selection_triggered()
Definition: ViewerGui.cpp:771
void openMapCollection()
Definition: ViewerGui.cpp:513
void on_actionHelp_triggered()
Definition: ViewerGui.cpp:624
void changeTreeDepth(int depth)
Definition: ViewerGui.cpp:608
bool getOctreeRecord(int id, OcTreeRecord *&otr)
Definition: ViewerGui.cpp:167
void on_actionConvert_ml_tree_triggered()
Definition: ViewerGui.cpp:1071
void changeCamPosition(double x, double y, double z, double lookX, double lookY, double lookZ)
void on_actionPointcloud_toggled(bool checked)
Definition: ViewerGui.cpp:1013
void on_actionExpand_tree_triggered()
Definition: ViewerGui.cpp:1107
void openTree()
open binary format OcTree
Definition: ViewerGui.cpp:474


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Mon Jun 10 2019 14:00:25