From adf1c2cc49502c366a2637adfcda9c1c71b11887 Mon Sep 17 00:00:00 2001 From: stv Date: Tue, 31 Mar 2015 13:06:33 +0300 Subject: [PATCH] Fit All after was added stream selection and displaying in embedded viewer. --- .../HYDROGUI_ProfileInterpolateOp.cxx | 22 ++++++++++++++++--- src/HYDROGUI/HYDROGUI_ViewerDlg.h | 8 +++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx b/src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx index 34fc43ce..4f328628 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileInterpolateOp.cxx @@ -42,8 +42,9 @@ #include #include -#include +#include #include +#include #include #include @@ -189,7 +190,7 @@ void HYDROGUI_ProfileInterpolateOp::updatePreview() { myPreview = new AIS_Shape( aShape ); myPreview->SetColor( Quantity_NOC_RED ); - aCtx->Display( myPreview, 0, -1, false ); + aCtx->Display( myPreview, 1, -1, false ); } } } @@ -354,7 +355,22 @@ void HYDROGUI_ProfileInterpolateOp::onRiverChanged( const QString& theRiver ) Handle(AIS_Shape) aPrs = new AIS_Shape( aProfile->GetShape3D() ); aPrs->SetOwner( aProfile ); aPrs->SetColor( Quantity_NOC_BLACK ); - aCtx->Display( aPrs, 0, 0, false ); + aCtx->Display( aPrs, 1, 0, false ); + } + } + OCCViewer_ViewManager* vm = aDlg->viewManager(); + if ( vm ) + { + QVector winList = vm->getViews(); + for ( QVector::iterator it = winList.begin(); it != winList.end(); ++it ) + { + OCCViewer_ViewWindow* occWin = ::qobject_cast( *it ); + if ( occWin ) + { + OCCViewer_ViewPort3d* vp = occWin->getViewPort(); + if ( vp ) + vp->fitAll(); + } } } } diff --git a/src/HYDROGUI/HYDROGUI_ViewerDlg.h b/src/HYDROGUI/HYDROGUI_ViewerDlg.h index b806c520..e41b60e7 100644 --- a/src/HYDROGUI/HYDROGUI_ViewerDlg.h +++ b/src/HYDROGUI/HYDROGUI_ViewerDlg.h @@ -46,14 +46,14 @@ public: Handle(AIS_InteractiveContext) getAISContext(); - virtual bool event( QEvent* ); - virtual bool eventFilter( QObject*, QEvent* ); - -protected: OCCViewer_Viewer* viewer() const; OCCViewer_ViewManager* viewManager() const; SUIT_SelectionMgr* selectionMgr() const; + virtual bool event( QEvent* ); + virtual bool eventFilter( QObject*, QEvent* ); + +protected: virtual Handle(AIS_Trihedron) trihedron(); protected slots: -- 2.39.2