Skip to content

Commit

Permalink
GraphViewer: added Show/Hide global path
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed May 8, 2015
1 parent 7aaa469 commit aa8aeed
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions guilib/src/GraphViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
QAction * aShowHideOrigin;
QAction * aShowHideReferential;
QAction * aShowHideLocalRadius;
QAction * aClearGlobalPath;
if(_gridMap->isVisible())
{
aShowHideGridMap = menu.addAction(tr("Hide grid map"));
Expand Down Expand Up @@ -900,6 +901,15 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
{
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();
QAction * aRestoreDefaults = menu.addAction(tr("Restore defaults"));

Expand Down Expand Up @@ -1097,6 +1107,13 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
{
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)
{
emit configChanged();
Expand Down

0 comments on commit aa8aeed

Please sign in to comment.