mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
GraphViewer: added Show/Hide global path
This commit is contained in:
@@ -868,6 +868,7 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
|
|||||||
QAction * aShowHideOrigin;
|
QAction * aShowHideOrigin;
|
||||||
QAction * aShowHideReferential;
|
QAction * aShowHideReferential;
|
||||||
QAction * aShowHideLocalRadius;
|
QAction * aShowHideLocalRadius;
|
||||||
|
QAction * aClearGlobalPath;
|
||||||
if(_gridMap->isVisible())
|
if(_gridMap->isVisible())
|
||||||
{
|
{
|
||||||
aShowHideGridMap = menu.addAction(tr("Hide grid map"));
|
aShowHideGridMap = menu.addAction(tr("Hide grid map"));
|
||||||
@@ -900,6 +901,15 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
|
|||||||
{
|
{
|
||||||
aShowHideLocalRadius = menu.addAction(tr("Show local radius"));
|
aShowHideLocalRadius = menu.addAction(tr("Show local radius"));
|
||||||
}
|
}
|
||||||
|
if(_globalPathLinkItems.size() && _globalPathLinkItems.begin().value()->isVisible())
|
||||||
|
{
|
||||||
|
aClearGlobalPath = menu.addAction(tr("Hide global path"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aClearGlobalPath = menu.addAction(tr("Show global path"));
|
||||||
|
}
|
||||||
|
aClearGlobalPath->setEnabled(_globalPathLinkItems.size());
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
QAction * aRestoreDefaults = menu.addAction(tr("Restore defaults"));
|
QAction * aRestoreDefaults = menu.addAction(tr("Restore defaults"));
|
||||||
|
|
||||||
@@ -1097,6 +1107,13 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
|
|||||||
{
|
{
|
||||||
this->restoreDefaults();
|
this->restoreDefaults();
|
||||||
}
|
}
|
||||||
|
else if(r == aClearGlobalPath)
|
||||||
|
{
|
||||||
|
for(QMap<int, LinkItem*>::iterator iter=_globalPathLinkItems.begin(); iter!=_globalPathLinkItems.end(); ++iter)
|
||||||
|
{
|
||||||
|
iter.value()->setVisible(!iter.value()->isVisible());
|
||||||
|
}
|
||||||
|
}
|
||||||
if(r)
|
if(r)
|
||||||
{
|
{
|
||||||
emit configChanged();
|
emit configChanged();
|
||||||
|
|||||||
Reference in New Issue
Block a user