]> Creatis software - clitk.git/blobdiff - vv/vvMainWindow.cxx
Added "Reset transformation to identity" in image right-click menu
[clitk.git] / vv / vvMainWindow.cxx
index d965069f7a356fc6778e65fa9d755bae6c0e55a5..882bc2b16d631c7cf68233f30ac3fe0c3640cf81 100644 (file)
@@ -160,6 +160,11 @@ vvMainWindow::vvMainWindow():vvMainWindowBase()
   connect(actionAdd_fusion_image,SIGNAL(triggered()),this,SLOT(SelectFusionImage()));
   contextActions.push_back(actionAdd_fusion_image);
 
+  contextMenu.addSeparator();
+  QAction* actionResetMatrix = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/identity.png")),
+                                                      tr("Reset transformation to identity"));
+  connect(actionResetMatrix, SIGNAL(triggered()), this,SLOT(ResetTransformationToIdentity()));
+
   // TRIAL DS
   /*
   QMenu * m = new QMenu(menubar);
@@ -1903,6 +1908,16 @@ void vvMainWindow::SelectFusionImage()
 }
 //------------------------------------------------------------------------------
 
+//------------------------------------------------------------------------------
+void vvMainWindow::ResetTransformationToIdentity()
+{
+  std::string actorType = DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString().toStdString();
+  int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+  mSlicerManagers[index]->ResetTransformationToIdentity(actorType);
+  ImageInfoChanged();
+}
+//------------------------------------------------------------------------------
+
 //------------------------------------------------------------------------------
 void vvMainWindow::AddFusionImage(int index, QString file)
 {