]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Avoid of Fit all for 2d mode change
authornds <nds@opencascade.com>
Thu, 5 Dec 2013 10:27:54 +0000 (10:27 +0000)
committernds <nds@opencascade.com>
Thu, 5 Dec 2013 10:27:54 +0000 (10:27 +0000)
src/HYDROCurveCreator/OCCViewer_Utilities.cxx

index 425179f9c48acbb74eca1fb262958b44f275a45e..e89ce4516ff5c2e4a37be1870c0e221da6235e79 100644 (file)
@@ -3,10 +3,13 @@
 
 #include <OCCViewer_ViewFrame.h>
 #include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewPort3d.h>
 #include <SUIT_ViewManager.h>
 
 #include <QtxActionToolMgr.h>
 
+#include <V3d_View.hxx>
+
 #include <QAction>
 
 void OCCViewer_Utilities::setViewer2DMode( OCCViewer_Viewer* theViewer,
@@ -45,15 +48,18 @@ void OCCViewer_Utilities::setViewer2DMode( OCCViewer_Viewer* theViewer,
   }
 
   // change view position
-  switch ( theMode ) {
-    case OCCViewer_ViewWindow::XYPlane:
-      aView->onTopView();
-      break;
-    case OCCViewer_ViewWindow::XZPlane:
-      aView->onLeftView();
-      break;
-    case OCCViewer_ViewWindow::YZPlane:
-      aView->onFrontView();
-      break;
+  Handle(V3d_View) aView3d = aView->getViewPort()->getView();
+  if ( !aView3d.IsNull() ) {
+    switch ( theMode ) {
+      case OCCViewer_ViewWindow::XYPlane:
+        aView3d->SetProj (V3d_Zpos);
+        break;
+      case OCCViewer_ViewWindow::XZPlane:
+        aView3d->SetProj (V3d_Yneg);
+        break;
+      case OCCViewer_ViewWindow::YZPlane:
+        aView3d->SetProj (V3d_Xpos);
+        break;
+    }
   }
 }