From 84a535df03fb037f21a056a1792c572d858d217c Mon Sep 17 00:00:00 2001 From: isn Date: Thu, 26 Oct 2017 12:15:13 +0300 Subject: [PATCH] refs #1339 --- src/HYDROGUI/HYDROGUI_CalculationOp.cxx | 12 ++++++++---- src/HYDROGUI/HYDROGUI_CalculationOp.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index 134c3bd0..4fefda30 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -477,7 +477,7 @@ void HYDROGUI_CalculationOp::onMoveZones( SUIT_DataObject* theRegionItem, ::qobject_cast( inputPanel() ); if ( aPanel ) aPanel->refreshZonesBrowser(); - createPreview( false ); + createPreview( false, false, false ); } } } @@ -1197,7 +1197,7 @@ bool HYDROGUI_CalculationOp::createRegion( const QList& theZon return aRetValue; } -void HYDROGUI_CalculationOp::createPreview( const bool theLandCoverMap ) +void HYDROGUI_CalculationOp::createPreview( const bool theLandCoverMap, bool fitAllFlag, bool onTopViewAndFit ) { LightApp_Application* anApp = module()->getApp(); HYDROData_SequenceOfObjects aSeq; @@ -1285,9 +1285,13 @@ void HYDROGUI_CalculationOp::createPreview( const bool theLandCoverMap ) QApplication::processEvents( QEventLoop::ExcludeUserInputEvents ); } - module()->update( UF_OCCViewer | UF_FitAll ); + int UpdateFlags = UF_OCCViewer; + if (fitAllFlag) + UpdateFlags |= UF_FitAll; + module()->update( UpdateFlags ); - if ( OCCViewer_ViewWindow* vw = (OCCViewer_ViewWindow*)myPreviewViewManager->getActiveView() ) + OCCViewer_ViewWindow* vw = (OCCViewer_ViewWindow*)myPreviewViewManager->getActiveView(); + if ( onTopViewAndFit && vw ) vw->onTopView(); } } diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.h b/src/HYDROGUI/HYDROGUI_CalculationOp.h index 90925647..90cf82d1 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.h +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.h @@ -130,7 +130,7 @@ protected slots: void onRegenerateColors(); private: - void createPreview( const bool theLandCoverMap); + void createPreview( const bool theLandCoverMap, bool fitAllFlag = true, bool onTopViewAndFit = true); void closePreview( bool theRemoveViewManager = true ); void setObjectVisibility( Handle(HYDROData_Entity) theEntity, const bool theIsVisible ); void setZonesVisible( bool theIsVisible ); -- 2.39.2