X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROCurveCreator%2FOCCViewer_Utilities.cxx;h=e89ce4516ff5c2e4a37be1870c0e221da6235e79;hb=c363fc5c3541669e07cf4d991cc1e94253147ac1;hp=c683c014814018e020ce852a8cfb0f1421c39dce;hpb=32fa2c8f9f80e7d33fdb7efeff53a1a12f54083f;p=modules%2Fhydro.git diff --git a/src/HYDROCurveCreator/OCCViewer_Utilities.cxx b/src/HYDROCurveCreator/OCCViewer_Utilities.cxx index c683c014..e89ce451 100644 --- a/src/HYDROCurveCreator/OCCViewer_Utilities.cxx +++ b/src/HYDROCurveCreator/OCCViewer_Utilities.cxx @@ -1,13 +1,15 @@ #include "OCCViewer_Utilities.h" -#include "OCCViewer_ViewWidget.h" #include #include +#include #include #include +#include + #include void OCCViewer_Utilities::setViewer2DMode( OCCViewer_Viewer* theViewer, @@ -46,56 +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; - } -} - -void OCCViewer_Utilities::setViewWidget2DMode( OCCViewer_ViewWidget* theViewWidget, - const OCCViewer_ViewWidget::Mode2dType& theMode ) -{ - if ( !theViewWidget ) - return; - - // set a view mode - theViewWidget->set2dMode( theMode ); - bool is2dMode = theMode != OCCViewer_ViewWindow::No2dMode; - - // enable/disable view actions - QList aNo2dActions; - aNo2dActions << OCCViewer_ViewWidget::RotationId - << OCCViewer_ViewWidget::FrontId - << OCCViewer_ViewWidget::BackId - << OCCViewer_ViewWidget::TopId - << OCCViewer_ViewWidget::BottomId - << OCCViewer_ViewWidget::LeftId - << OCCViewer_ViewWidget::RightId; - - QAction* anAction; - for ( int i = 0, aNb = aNo2dActions.size(); i < aNb; i++ ) { - anAction = theViewWidget->action( aNo2dActions[i] ); - if ( anAction ) - anAction->setVisible( !is2dMode ); - } - - // change view position - switch ( theMode ) { - case OCCViewer_ViewWindow::XYPlane: - theViewWidget->onTopView(); - break; - case OCCViewer_ViewWindow::XZPlane: - theViewWidget->onLeftView(); - break; - case OCCViewer_ViewWindow::YZPlane: - theViewWidget->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; + } } }