From: nds Date: Tue, 1 Mar 2016 14:50:00 +0000 (+0300) Subject: Issue 1347: correction to fit all in the viewer the first visualized group result... X-Git-Tag: V_2.2.0~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c3c00a15849bc9113fabe42e42e3fc40bd878f79;p=modules%2Fshaper.git Issue 1347: correction to fit all in the viewer the first visualized group result(it was implemented for body results only) --- diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index 577e70da2..57025c6c7 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -575,9 +575,16 @@ bool XGUI_WorkshopListener::displayObject(ObjectPtr theObj, bool& theFirstVisual aDisplayed = aDisplayer->display(theObj, false); if (aNb == 0) theFirstVisualizedBody = true; - } else + } else { aDisplayed = aDisplayer->display(theObj, false); - + if (aDisplayed) { + ResultPtr aResult = std::dynamic_pointer_cast(theObj); + if (aResult.get() != NULL) { + std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); + theFirstVisualizedBody = aShapePtr.get() != NULL; + } + } + } return aDisplayed; }