ViewerSettingsPanel.cpp
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 
26 
28  : QWidget(parent), m_currentScan(0), m_numberScans(0), m_treeDepth(_TREE_MAX_DEPTH), m_resolution(0.1)
29 {
30  ui.setupUi(this);
31  connect(ui.treeDepth, SIGNAL(valueChanged(int)), this, SLOT(setTreeDepth(int)));
32 
35 }
36 
38 {
39 
40 }
41 
44  m_currentScan++;
46  emit addNextScans(1);
47  }
48 }
49 
51  unsigned increase = int(m_numberScans)-int(m_currentScan);
52  if (increase > 5) increase = 5;
53  m_currentScan += increase;
55  emit addNextScans(increase);
56 }
57 
59  unsigned increase = int(m_numberScans)-int(m_currentScan);
60  m_currentScan += increase;
62  emit addNextScans(increase);
63 }
64 
66  m_currentScan = 1;
68  emit gotoFirstScan();
69 }
70 
72  if (int(m_numberScans) > 1)
73  ui.scanProgressBar->setMaximum(int(m_numberScans));
74  else
75  ui.scanProgressBar->setMaximum(1);
76 
78  ui.nextScanButton->setEnabled(false);
79  ui.fastFwdScanButton->setEnabled(false);
80  ui.lastScanButton->setEnabled(false);
81 
82  } else{
83  ui.nextScanButton->setEnabled(true);
84  ui.fastFwdScanButton->setEnabled(true);
85  ui.lastScanButton->setEnabled(true);
86  }
87 
88  if (m_currentScan < 2){
89  ui.firstScanButton->setEnabled(false);
90  } else{
91  ui.firstScanButton->setEnabled(true);
92  }
93 
94  ui.scanProgressBar->setValue(m_currentScan);
95  // queue a redraw:
96  ui.scanProgressBar->update();
97 }
98 
100  m_numberScans = scans;
102 }
103 
105  m_currentScan = scan;
107 }
108 
109 void ViewerSettingsPanel::setResolution(double resolution){
110  m_resolution = resolution;
111  leafSizeChanged();
112 }
113 
115  emit treeDepthChanged(depth);
116  m_treeDepth = depth;
117  leafSizeChanged();
118 }
119 
121  double leafSize = m_resolution * pow(2.0, (int) (_TREE_MAX_DEPTH-m_treeDepth));
122  ui.leafSize->setText(QString::number(leafSize)+" m");
123 }
void setNumberOfScans(unsigned scans)
#define _TREE_MAX_DEPTH
void setResolution(double resolution)
void setTreeDepth(int depth)
void addNextScans(unsigned scans)
ViewerSettingsPanel(QWidget *parent=0)
void treeDepthChanged(int depth)
Ui::ViewerSettingsPanelClass ui
void setCurrentScan(unsigned scan)


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Wed Jun 5 2019 19:26:39