From aa92486ff0439a368973f57ae1b3f3d4f3891eab Mon Sep 17 00:00:00 2001 From: matlabbe Date: Wed, 7 Oct 2015 16:54:36 -0400 Subject: [PATCH] DatabaseViewer: fixed clouds still shown in constraints view when unchecked --- guilib/src/DatabaseViewer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/guilib/src/DatabaseViewer.cpp b/guilib/src/DatabaseViewer.cpp index 52567428..98f5f68e 100644 --- a/guilib/src/DatabaseViewer.cpp +++ b/guilib/src/DatabaseViewer.cpp @@ -203,6 +203,8 @@ DatabaseViewer::DatabaseViewer(QWidget * parent) : connect(ui_->horizontalSlider_neighbors, SIGNAL(sliderMoved(int)), this, SLOT(sliderNeighborValueChanged(int))); connect(ui_->horizontalSlider_loops, SIGNAL(sliderMoved(int)), this, SLOT(sliderLoopValueChanged(int))); connect(ui_->checkBox_showOptimized, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintView())); + connect(ui_->checkBox_show3Dclouds, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintView())); + connect(ui_->checkBox_show2DScans, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintView())); connect(ui_->checkBox_show3DWords, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintView())); ui_->checkBox_showOptimized->setEnabled(false); @@ -2334,6 +2336,11 @@ void DatabaseViewer::updateConstraintView( ui_->constraintsViewer->addOrUpdateCloud("cloud1", cloudTo, Transform::getIdentity(), Qt::cyan); } } + else + { + ui_->constraintsViewer->removeCloud("cloud0"); + ui_->constraintsViewer->removeCloud("cloud1"); + } if(ui_->checkBox_show3DWords->isChecked()) { const Signature * sFrom = memory_->getSignature(link.from()); @@ -2398,6 +2405,11 @@ void DatabaseViewer::updateConstraintView( ui_->constraintsViewer->removeCloud("words1"); } } + else + { + ui_->constraintsViewer->removeCloud("words0"); + ui_->constraintsViewer->removeCloud("words1"); + } } else { @@ -2437,6 +2449,11 @@ void DatabaseViewer::updateConstraintView( ui_->constraintsViewer->removeCloud("scan1"); } } + else + { + ui_->constraintsViewer->removeCloud("scan0"); + ui_->constraintsViewer->removeCloud("scan1"); + } } else {