DatabaseViewer: fixed clouds still shown in constraints view when unchecked

This commit is contained in:
matlabbe
2015-10-07 16:54:36 -04:00
parent b8757f6e8b
commit aa92486ff0
+17
View File
@@ -203,6 +203,8 @@ DatabaseViewer::DatabaseViewer(QWidget * parent) :
connect(ui_->horizontalSlider_neighbors, SIGNAL(sliderMoved(int)), this, SLOT(sliderNeighborValueChanged(int))); connect(ui_->horizontalSlider_neighbors, SIGNAL(sliderMoved(int)), this, SLOT(sliderNeighborValueChanged(int)));
connect(ui_->horizontalSlider_loops, SIGNAL(sliderMoved(int)), this, SLOT(sliderLoopValueChanged(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_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())); connect(ui_->checkBox_show3DWords, SIGNAL(stateChanged(int)), this, SLOT(updateConstraintView()));
ui_->checkBox_showOptimized->setEnabled(false); ui_->checkBox_showOptimized->setEnabled(false);
@@ -2334,6 +2336,11 @@ void DatabaseViewer::updateConstraintView(
ui_->constraintsViewer->addOrUpdateCloud("cloud1", cloudTo, Transform::getIdentity(), Qt::cyan); ui_->constraintsViewer->addOrUpdateCloud("cloud1", cloudTo, Transform::getIdentity(), Qt::cyan);
} }
} }
else
{
ui_->constraintsViewer->removeCloud("cloud0");
ui_->constraintsViewer->removeCloud("cloud1");
}
if(ui_->checkBox_show3DWords->isChecked()) if(ui_->checkBox_show3DWords->isChecked())
{ {
const Signature * sFrom = memory_->getSignature(link.from()); const Signature * sFrom = memory_->getSignature(link.from());
@@ -2398,6 +2405,11 @@ void DatabaseViewer::updateConstraintView(
ui_->constraintsViewer->removeCloud("words1"); ui_->constraintsViewer->removeCloud("words1");
} }
} }
else
{
ui_->constraintsViewer->removeCloud("words0");
ui_->constraintsViewer->removeCloud("words1");
}
} }
else else
{ {
@@ -2437,6 +2449,11 @@ void DatabaseViewer::updateConstraintView(
ui_->constraintsViewer->removeCloud("scan1"); ui_->constraintsViewer->removeCloud("scan1");
} }
} }
else
{
ui_->constraintsViewer->removeCloud("scan0");
ui_->constraintsViewer->removeCloud("scan1");
}
} }
else else
{ {