Skip to content

Commit

Permalink
Fixes #28: Can remove "blank" linear objects from the collection from…
Browse files Browse the repository at this point in the history
… the right-click context menu.
  • Loading branch information
matthewsholden committed May 15, 2014
1 parent 6f66194 commit f404e9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Binary file added Resources/Icons/LinearObjectRemoveBlank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Resources/qSlicerLinearObjectRegistrationModule.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<file>Icons/LinearObjectDown.png</file>
<file>Icons/LinearObjectDelete.png</file>
<file>Icons/LinearObjectRemoveBuffer.png</file>
<file>Icons/LinearObjectRemoveBlank.png</file>
<file>Icons/LinearObjectMerge.png</file>
</qresource>
</RCC>
10 changes: 9 additions & 1 deletion Widgets/qSlicerLinearObjectCollectionWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,16 @@ ::onCollectionTableContextMenu(const QPoint& position)
downAction->setIcon( QIcon( ":/Icons/LinearObjectDown.png" ) );
QAction* removeBufferAction = new QAction( "Remove position buffer", collectionMenu );
removeBufferAction->setIcon( QIcon( ":/Icons/LinearObjectRemoveBuffer.png" ) );
QAction* removeBlankAction = new QAction( "Remove blank linear object(s)", collectionMenu );
removeBlankAction->setIcon( QIcon( ":/Icons/LinearObjectRemoveBlank.png" ) );
QAction* mergeAction = new QAction( "Merge linear objects", collectionMenu );
mergeAction->setIcon( QIcon( ":/Icons/LinearObjectMerge.png" ) );

collectionMenu->addAction( deleteAction );
collectionMenu->addAction( upAction );
collectionMenu->addAction( downAction );
collectionMenu->addAction( removeBufferAction );
collectionMenu->addAction( removeBlankAction );
collectionMenu->addAction( mergeAction );

QAction* selectedAction = collectionMenu->exec( globalPosition );
Expand Down Expand Up @@ -442,12 +445,17 @@ ::onCollectionTableContextMenu(const QPoint& position)

if ( selectedAction == removeBufferAction )
{
if ( currentCollection->GetLinearObject( currentIndex ) != NULL )
if ( currentCollection->GetLinearObject( currentIndex ) != NULL )
{
currentCollection->GetLinearObject( currentIndex )->SetPositionBuffer( NULL );
}
}

if ( selectedAction == removeBlankAction )
{
currentCollection->ShuffleOutNull();
}

if ( selectedAction == mergeAction )
{
QItemSelectionModel* selectionModel = d->CollectionTableWidget->selectionModel();
Expand Down

0 comments on commit f404e9b

Please sign in to comment.