]> Creatis software - clitk.git/blobdiff - vv/vvSlicerManagerCommand.cxx
Fixed linked navigation with mouse wheel
[clitk.git] / vv / vvSlicerManagerCommand.cxx
index 5d252043bb0603c9f5f0f58419df63b9f0a3ff73..b7c2b4669fff27f2a2bd4888ecf501b09d88b4d1 100644 (file)
@@ -188,6 +188,14 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller,
           this->SM->Render();
           return;
         }
+        if (KeyPress == "x") {
+          for(int i=0; i<SM->NumberOfSlicers(); i++) {
+            SM->RemoveActor("overlay",0);
+            SM->SetColorMap(0);
+            SM->Render();
+          }
+          return;
+        }
         if (KeyPress == "u") {
           this->SM->Reload();
           this->SM->Render();
@@ -291,6 +299,10 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller,
         mStartSlicer = -1;
       }
 
+      if (event == vtkCommand::EndInteractionEvent) {
+        this->SM->UpdateLinkedNavigation(this->SM->GetSlicer(VisibleInWindow),true);
+        return;
+      }
     }
     if (VisibleInWindow > -1) {
       this->SM->Activated();
@@ -304,6 +316,7 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller,
       } else if (event == vtkCommand::MouseWheelForwardEvent && isi->GetInteractor()->GetControlKey()) {
         double factor = 2;
         this->Dolly(pow((double)1.1, factor),isi->GetInteractor());
+        Execute(caller, vtkCommand::EndInteractionEvent, NULL);
       } else if (event == vtkCommand::MouseWheelBackwardEvent && !isi->GetInteractor()->GetControlKey()) {
         this->SM->GetSlicer(VisibleInWindow)->SetSlice(this->SM->GetSlicer(VisibleInWindow)->GetSlice()-1);
         this->SM->UpdateSlice(VisibleInWindow);
@@ -311,6 +324,7 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller,
       } else if (event == vtkCommand::MouseWheelBackwardEvent && isi->GetInteractor()->GetControlKey()) {
         double factor = -2;
         this->Dolly(pow((double)1.1, factor),isi->GetInteractor());
+        Execute(caller, vtkCommand::EndInteractionEvent, NULL);
       }
       double xWorld=0;
       double yWorld=0;