From c363fc5c3541669e07cf4d991cc1e94253147ac1 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 5 Dec 2013 10:27:54 +0000 Subject: [PATCH] Avoid of Fit all for 2d mode change --- src/HYDROCurveCreator/OCCViewer_Utilities.cxx | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) 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; + } } } -- 2.39.2