]> Creatis software - clitk.git/blobdiff - vv/vvInteractorStyleNavigator.cxx
Debug RTStruct conversion with empty struc
[clitk.git] / vv / vvInteractorStyleNavigator.cxx
index 9d6aa104ba7324504eaca99b11397b37fd2658bf..f3fc53befc9cc1e1edeec2d9093b3044d18dd5c6 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to:
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+===========================================================================**/
 #include "vvInteractorStyleNavigator.h"
 
 #include "vtkAbstractPropPicker.h"
@@ -29,8 +29,6 @@
 #include <vtkRendererCollection.h>
 #include "clitkCommon.h"
 
-
-vtkCxxRevisionMacro(vvInteractorStyleNavigator, "DummyRevision");
 vtkStandardNewMacro(vvInteractorStyleNavigator);
 
 //----------------------------------------------------------------------------
@@ -90,14 +88,14 @@ void vvInteractorStyleNavigator::StartPick()
   if (this->State != VTKIS_NONE) {
     return;
   }
-  this->StartState(VTKIS_PICK);
+  this->StartState(VTKIS_PICK_NEW);
   this->InvokeEvent(vtkCommand::StartPickEvent, this);
 }
 
 //----------------------------------------------------------------------------
 void vvInteractorStyleNavigator::EndPick()
 {
-  if (this->State != VTKIS_PICK) {
+  if (this->State != VTKIS_PICK_NEW) {
     return;
   }
   this->InvokeEvent(vtkCommand::EndPickEvent, this);
@@ -117,7 +115,7 @@ void vvInteractorStyleNavigator::OnMouseMove()
     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
     break;
 
-  case VTKIS_PICK:
+  case VTKIS_PICK_NEW:
     this->FindPokedRenderer(x, y);
     this->Pick();
     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
@@ -153,7 +151,7 @@ void vvInteractorStyleNavigator::OnEnter()
   case VTKIS_WINDOW_LEVEL:
     break;
 
-  case VTKIS_PICK:
+  case VTKIS_PICK_NEW:
     break;
 
   case VTKIS_PAN:
@@ -178,7 +176,7 @@ void vvInteractorStyleNavigator::OnLeave()
   case VTKIS_WINDOW_LEVEL:
     break;
 
-  case VTKIS_PICK:
+  case VTKIS_PICK_NEW:
     break;
 
   case VTKIS_PAN:
@@ -249,7 +247,10 @@ void vvInteractorStyleNavigator::OnLeftButtonDown()
 
   // Redefine this button to handle pick
   this->GrabFocus(this->EventCallbackCommand);
-  if (!this->Interactor->GetShiftKey() && !this->Interactor->GetControlKey()) {
+  if (this->Interactor->GetShiftKey()) {
+    this->OnMiddleButtonDown();
+  }
+  else if (!this->Interactor->GetControlKey()) {
     this->StartPick();
   }
 
@@ -265,12 +266,15 @@ void vvInteractorStyleNavigator::OnLeftButtonUp()
 {
   //  DD("OnLeftButtonUp");
   switch (this->State) {
-  case VTKIS_PICK:
+  case VTKIS_PICK_NEW:
     this->EndPick();
     if ( this->Interactor ) {
       this->ReleaseFocus();
     }
     break;
+  case VTKIS_PAN:
+    this->OnMiddleButtonUp();
+    break;
   }
 
   // Call parent to handle all other states and perform additional work
@@ -356,7 +360,8 @@ void vvInteractorStyleNavigator::OnChar()
     //Do nothing, this is handled in vvSlicerManagerCommand
     break;
   default:
-    this->Superclass::OnChar();
+    //SR: we don't use the default vtk keys => removed to avoid conflicts
+    //this->Superclass::OnChar();
     break;
   }
 }
@@ -471,7 +476,9 @@ void vvInteractorStyleNavigator::Pan()
     this->CurrentRenderer->UpdateLightsGeometryToFollowCamera();
   }
 
-  rwi->Render();
+  this->InvokeEvent(vtkCommand::EndInteractionEvent, this);
+
+//  rwi->Render();
 }
 
 //----------------------------------------------------------------------------
@@ -556,6 +563,8 @@ void vvInteractorStyleNavigator::Dolly(double factor)
   }
   this->CurrentRenderer->ResetCameraClippingRange();
   //this->Interactor->Render();
+
+  this->InvokeEvent(vtkCommand::EndInteractionEvent, this);
 }