From e4d5282e6ffcc383267855e63847a60ade506049 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Fri, 7 Aug 2015 22:49:54 -0400 Subject: [PATCH] updated when "Export clouds/scans" actions are enabled --- guilib/src/MainWindow.cpp | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index b6274538..3503b663 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -1344,31 +1344,6 @@ void MainWindow::updateMapCloud( _currentLinksMap = constraints; _currentMapIds = mapIdsIn; _curentLabels = labels; - if(_currentPosesMap.size()) - { - if(!_ui->actionSave_point_cloud->isEnabled() && - _cachedSignatures.size() && - (!(--_cachedSignatures.end())->sensorData().depthOrRightCompressed().empty() || - !(--_cachedSignatures.end())->getWords3().empty())) - { - //enable save cloud action - _ui->actionSave_point_cloud->setEnabled(true); - _ui->actionView_high_res_point_cloud->setEnabled(true); - } - - if(!_ui->actionView_scans->isEnabled() && - _cachedSignatures.size() && - !(--_cachedSignatures.end())->sensorData().laserScanCompressed().empty()) - { - _ui->actionExport_2D_scans_ply_pcd->setEnabled(true); - _ui->actionExport_2D_Grid_map_bmp_png->setEnabled(true); - _ui->actionView_scans->setEnabled(true); - } - else if(_preferencesDialog->isGridMapFrom3DCloud() && _projectionLocalMaps.size()) - { - _ui->actionExport_2D_Grid_map_bmp_png->setEnabled(true); - } - } if(_state != kMonitoring && _state != kDetecting) { _ui->actionPost_processing->setEnabled(_cachedSignatures.size() >= 2 && _currentPosesMap.size() >= 2 && _currentLinksMap.size() >= 1); @@ -1517,6 +1492,13 @@ void MainWindow::updateMapCloud( ++i; } + // activate actions + _ui->actionSave_point_cloud->setEnabled(!_createdClouds.empty()); + _ui->actionView_high_res_point_cloud->setEnabled(!_createdClouds.empty()); + _ui->actionExport_2D_scans_ply_pcd->setEnabled(!_createdScans.empty()); + _ui->actionExport_2D_Grid_map_bmp_png->setEnabled(!_gridLocalMaps.empty() || !_projectionLocalMaps.empty()); + _ui->actionView_scans->setEnabled(!_createdScans.empty()); + //remove not used clouds for(QMap::iterator iter = viewerClouds.begin(); iter!=viewerClouds.end(); ++iter) {