Save/view high-res point clouds depending on the visible clouds in Map view (only those checked in MapVisibility view)

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1437 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-06-23 20:43:08 +00:00
parent e9ae29f909
commit 7b0a34b150
13 changed files with 310 additions and 215 deletions

View File

@@ -57,7 +57,7 @@ void MapVisibilityWidget::updateCheckBoxes()
added = true;
}
checkboxes[i]->setText(QString("%1 (%2)").arg(iter->first).arg(iter->second.prettyPrint().c_str()));
checkboxes[i]->setChecked(true);
checkboxes[i]->setChecked(_mask.at(iter->first));
if(added)
{
connect(checkboxes[i], SIGNAL(stateChanged(int)), this, SLOT(signalVisibility()));
@@ -68,18 +68,34 @@ void MapVisibilityWidget::updateCheckBoxes()
}
}
void MapVisibilityWidget::setMap(const std::map<int, Transform> & poses)
void MapVisibilityWidget::setMap(const std::map<int, Transform> & poses, const std::map<int, bool> & mask)
{
UASSERT(poses.size() == mask.size());
_poses = poses;
_mask = mask;
if(this->isVisible())
{
updateCheckBoxes();
}
}
std::map<int, Transform> MapVisibilityWidget::getVisiblePoses() const
{
std::map<int, Transform> poses;
for(std::map<int, Transform>::const_iterator iter=_poses.begin(); iter!=_poses.end(); ++iter)
{
if(_mask.at(iter->first))
{
poses.insert(*iter);
}
}
return poses;
}
void MapVisibilityWidget::signalVisibility()
{
QCheckBox * check = qobject_cast<QCheckBox*>(sender());
_mask.at(check->text().split('(').first().toInt()) = check->isChecked();
emit visibilityChanged(check->text().split('(').first().toInt(), check->isChecked());
}