@@ -755,7 +755,7 @@ void MainWindow::setupMainLayout(bool vertical)
755755
756756std::map<int , Transform> MainWindow::currentVisiblePosesMap () const
757757{
758- return _ui->widget_mapVisibility ->getVisiblePoses ();
758+ return ! _ui->widget_mapVisibility ->isEmpty ()?_ui-> widget_mapVisibility -> getVisiblePoses ():_currentPosesMap ;
759759}
760760
761761void MainWindow::setCloudViewer (rtabmap::CloudViewer * cloudViewer)
@@ -2891,6 +2891,9 @@ void MainWindow::updateMapCloud(
28912891 _ui->widget_mapVisibility ->setMap (nodePoses, posesMask);
28922892 UDEBUG (" Updated map visibility with %ld poses" , nodePoses.size ());
28932893 }
2894+ else {
2895+ _ui->widget_mapVisibility ->clear ();
2896+ }
28942897
28952898 if (groundTruths.size () && _ui->actionAnchor_clouds_to_ground_truth ->isChecked ())
28962899 {
@@ -8043,7 +8046,7 @@ void MainWindow::exportClouds()
80438046 return ;
80448047 }
80458048
8046- std::map<int , Transform> poses = _ui->widget_mapVisibility ->getVisiblePoses ();
8049+ std::map<int , Transform> poses = ! _ui->widget_mapVisibility ->isEmpty ()?_ui-> widget_mapVisibility -> getVisiblePoses ():_currentPosesMap ;
80478050
80488051 // Use ground truth poses if current clouds are using them
80498052 if (_currentGTPosesMap.size () && _ui->actionAnchor_clouds_to_ground_truth ->isChecked ())
@@ -8080,7 +8083,7 @@ void MainWindow::viewClouds()
80808083 return ;
80818084 }
80828085
8083- std::map<int , Transform> poses = _ui->widget_mapVisibility ->getVisiblePoses ();
8086+ std::map<int , Transform> poses = ! _ui->widget_mapVisibility ->isEmpty ()?_ui-> widget_mapVisibility -> getVisiblePoses ():_currentPosesMap ;
80848087
80858088 // Use ground truth poses if current clouds are using them
80868089 if (_currentGTPosesMap.size () && _ui->actionAnchor_clouds_to_ground_truth ->isChecked ())
@@ -8156,7 +8159,7 @@ void MainWindow::exportImages()
81568159 QMessageBox::warning (this , tr (" Export images..." ), tr (" Cannot export images, the cache is empty!" ));
81578160 return ;
81588161 }
8159- std::map<int , Transform> poses = _ui->widget_mapVisibility ->getVisiblePoses ();
8162+ std::map<int , Transform> poses = ! _ui->widget_mapVisibility ->isEmpty ()?_ui-> widget_mapVisibility -> getVisiblePoses ():_currentPosesMap ;
81608163
81618164 if (poses.empty ())
81628165 {
@@ -8373,7 +8376,7 @@ void MainWindow::exportBundlerFormat()
83738376 return ;
83748377 }
83758378
8376- std::map<int , Transform> posesIn = _ui->widget_mapVisibility ->getVisiblePoses ();
8379+ std::map<int , Transform> posesIn = ! _ui->widget_mapVisibility ->isEmpty ()?_ui-> widget_mapVisibility -> getVisiblePoses ():_currentPosesMap ;
83778380
83788381 // Use ground truth poses if current clouds are using them
83798382 if (_currentGTPosesMap.size () && _ui->actionAnchor_clouds_to_ground_truth ->isChecked ())
0 commit comments