Salome HOME
New item (FontItem), allowing to show information about font setting and to select...
[modules/gui.git] / src / SVTK / SVTK_InteractorStyle.cxx
index 2508794c34dfbdb2f40e9594994491fd89354785..c4d585b75ca7b939ea28343753b65f2309b4a16e 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "VTKViewer_CellRectPicker.h"
 #include "VTKViewer_Utilities.h"
-#include "VTKViewer_Trihedron.h"
 #include "VTKViewer_RectPicker.h"
 
 #include "SVTK_RenderWindowInteractor.h"
@@ -129,7 +128,6 @@ vtkStandardNewMacro(SVTK_InteractorStyle);
 SVTK_InteractorStyle
 ::SVTK_InteractorStyle() 
 {
-  myTrihedron = NULL;
   myViewWindow = NULL;
   this->MotionFactor = 10.0;
   this->State = VTK_INTERACTOR_STYLE_CAMERA_NONE;
@@ -185,6 +183,14 @@ SVTK_InteractorStyle
   Superclass::SetInteractor(theInteractor);
 }
 
+//----------------------------------------------------------------------------
+int
+SVTK_InteractorStyle
+::GetState()
+{
+  return State | ForcedState;
+}
+
 //----------------------------------------------------------------------------
 void 
 SVTK_InteractorStyle
@@ -203,14 +209,6 @@ SVTK_InteractorStyle
   myGUIWindow = theWindow;
 }
 
-//----------------------------------------------------------------------------
-void
-SVTK_InteractorStyle
-::setTriedron(VTKViewer_Trihedron* theTrihedron)
-{
-  myTrihedron = theTrihedron;
-}
-
 //----------------------------------------------------------------------------
 void
 SVTK_InteractorStyle
@@ -667,30 +665,6 @@ SVTK_InteractorStyle
 }
 
 
-//----------------------------------------------------------------------------
-void  
-SVTK_InteractorStyle
-::ViewFitAll() 
-{
-  int aTriedronWasVisible = false;
-  if(myTrihedron){
-    aTriedronWasVisible = myTrihedron->GetVisibility() == VTKViewer_Trihedron::eOn;
-    if(aTriedronWasVisible) myTrihedron->VisibilityOff();
-  }
-
-  if(myTrihedron->GetVisibleActorCount(CurrentRenderer)){
-    myTrihedron->VisibilityOff();
-    ::ResetCamera(CurrentRenderer);
-  }else{
-    myTrihedron->SetVisibility(VTKViewer_Trihedron::eOnlyLineOn);
-    ::ResetCamera(CurrentRenderer,true);
-  }
-  if(aTriedronWasVisible) myTrihedron->VisibilityOn();
-  else myTrihedron->VisibilityOff();
-  ::ResetCameraClippingRange(CurrentRenderer);
-}
-
-
 //----------------------------------------------------------------------------
 // starts Global Panning operation (e.g. through menu command)
 void
@@ -709,7 +683,7 @@ SVTK_InteractorStyle
   vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
   myScale = cam->GetParallelScale();
 
-  ViewFitAll();
+  if (myViewWindow) myViewWindow->onFitAll();
 
   if (myGUIWindow) myGUIWindow->update();
   
@@ -1280,6 +1254,12 @@ SVTK_InteractorStyle
 
   SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(aPicker->GetActor());
 
+  if (aSActor && myPreSelectionActor){
+    float aPos[3];
+    aSActor->GetPosition(aPos);
+    myPreSelectionActor->SetPosition(aPos);
+  }
+
   if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) {
     int aVtkId = picker->GetCellId();
     if ( aVtkId >= 0 ) {