From: nds Date: Thu, 5 Dec 2013 10:27:54 +0000 (+0000) Subject: Avoid of Fit all for 2d mode change X-Git-Tag: BR_hydro_v_0_4~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c363fc5c3541669e07cf4d991cc1e94253147ac1;p=modules%2Fhydro.git Avoid of Fit all for 2d mode change --- diff --git a/src/HYDROCurveCreator/OCCViewer_Utilities.cxx b/src/HYDROCurveCreator/OCCViewer_Utilities.cxx index 425179f9..e89ce451 100644 --- a/src/HYDROCurveCreator/OCCViewer_Utilities.cxx +++ b/src/HYDROCurveCreator/OCCViewer_Utilities.cxx @@ -3,10 +3,13 @@ #include #include +#include #include #include +#include + #include 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; + } } }