From: vsv Date: Tue, 5 Mar 2019 08:23:43 +0000 (+0300) Subject: Issue #2876: Fix synchronization of objects display on module activation X-Git-Tag: V9_3_0a2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5fea3f89cb0f16848b1217193c13fda0a596c754;p=modules%2Fshaper.git Issue #2876: Fix synchronization of objects display on module activation --- diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index 4b74af5ae..c0becb578 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -204,6 +204,7 @@ void SHAPERGUI::initialize(CAM_Application* theApp) aViewPort->installEventFilter(aViewer); Handle(V3d_View) aView = aViewPort->getView(); aViewer->SetScale(aView, aView->Camera()->Scale()); + onViewManagerAdded(aMgr); } } } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 2660cb93b..f1d5d4f36 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -2700,12 +2700,28 @@ void XGUI_Workshop::synchronizeGroupInViewer(const DocumentPtr& theDoc, ResultPtr aRes = std::dynamic_pointer_cast(aObj); if (aRes.get() && (!aRes->shape().get() || aRes->shape()->isNull())) continue; - myDisplayer->display(aObj, false); + ResultBodyPtr aResBody = std::dynamic_pointer_cast(aObj); + if (aResBody.get()) + synchronizeResultTree(aResBody, false); + else + myDisplayer->display(aObj, false); } } if (theUpdateViewer) myDisplayer->updateViewer(); } + +void XGUI_Workshop::synchronizeResultTree(const ResultBodyPtr& theRes, bool theUpdateViewer) +{ + if (theRes->numberOfSubs() > 0) + for (int i = 0; i < theRes->numberOfSubs(); i++) { + ResultBodyPtr aRes = theRes->subResult(i); + if (aRes.get()) + synchronizeResultTree(aRes, theUpdateViewer); + } + else + myDisplayer->display(theRes, theUpdateViewer); +} #endif //****************************************************** diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index ea1ecf094..01c75a373 100644 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -287,6 +288,8 @@ Q_OBJECT const std::string& theGroup, bool theUpdateViewer); + void synchronizeResultTree(const ResultBodyPtr& theRes, bool theUpdateViewer); + #endif /// Update the property panel content by the XML description of the operation and set the panel /// into the operation