mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
New feature: Show lines between corresponding visual words (right-click on image view)
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@472 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -47,6 +47,9 @@ ImageView::ImageView(QWidget * parent) :
|
||||
_showFeatures = _menu->addAction(tr("Show features"));
|
||||
_showFeatures->setCheckable(true);
|
||||
_showFeatures->setChecked(true);
|
||||
_showLines = _menu->addAction(tr("Show lines"));
|
||||
_showLines->setCheckable(true);
|
||||
_showLines->setChecked(false);
|
||||
_saveImage = _menu->addAction(tr("Save picture..."));
|
||||
}
|
||||
|
||||
@@ -70,6 +73,11 @@ bool ImageView::isFeaturesShown()
|
||||
return _showFeatures->isChecked();
|
||||
}
|
||||
|
||||
bool ImageView::isLinesShown()
|
||||
{
|
||||
return _showLines->isChecked();
|
||||
}
|
||||
|
||||
void ImageView::contextMenuEvent(QContextMenuEvent * e)
|
||||
{
|
||||
QAction * action = _menu->exec(e->globalPos());
|
||||
@@ -90,7 +98,7 @@ void ImageView::contextMenuEvent(QContextMenuEvent * e)
|
||||
img.save(text);
|
||||
}
|
||||
}
|
||||
else if(action == _showFeatures || action == _showImage)
|
||||
else if(action == _showFeatures || action == _showImage || action == _showLines)
|
||||
{
|
||||
this->updateItemsShown();
|
||||
}
|
||||
@@ -105,6 +113,10 @@ void ImageView::updateItemsShown()
|
||||
{
|
||||
items.at(i)->setVisible(_showFeatures->isChecked());
|
||||
}
|
||||
else if( qgraphicsitem_cast<QGraphicsLineItem*>(items.at(i)))
|
||||
{
|
||||
items.at(i)->setVisible(_showLines->isChecked());
|
||||
}
|
||||
else if(qgraphicsitem_cast<QGraphicsPixmapItem*>(items.at(i)))
|
||||
{
|
||||
items.at(i)->setVisible(_showImage->isChecked());
|
||||
|
||||
Reference in New Issue
Block a user