From: nds Date: Fri, 1 Apr 2016 09:12:27 +0000 (+0300) Subject: Issue #1382 Fit all done when I select elements X-Git-Tag: V_2.3.0~348 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b284840a8502ec4a74e8c93ec92cc16058745051;p=modules%2Fshaper.git Issue #1382 Fit all done when I select elements --- diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index 03aaf4fa1..5a4b943f7 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -570,20 +570,16 @@ bool XGUI_WorkshopListener::displayObject(ObjectPtr theObj, bool& theFirstVisual return aDisplayed; XGUI_Displayer* aDisplayer = aWorkshop->displayer(); - ResultBodyPtr aBody = std::dynamic_pointer_cast(theObj); - if (aBody.get() != NULL) { - int aNb = aDisplayer->objectsCount(); - aDisplayed = aDisplayer->display(theObj, false); - if (aNb == 0) - theFirstVisualizedBody = true; - } else { - aDisplayed = aDisplayer->display(theObj, false); - if (aDisplayed) { - ResultPtr aGroup = std::dynamic_pointer_cast(theObj); - if (aGroup.get() != NULL) { - std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aGroup); - theFirstVisualizedBody = aShapePtr.get() != NULL; - } + int aNb = aDisplayer->objectsCount(); + aDisplayed = aDisplayer->display(theObj, false); + + ResultPtr aResult = std::dynamic_pointer_cast(theObj); + if (aNb == 0 && aResult.get()) { + std::string aResultGroupName = aResult->groupName(); + if (aResultGroupName == ModelAPI_ResultBody::group() || + aResultGroupName == ModelAPI_ResultGroup::group()) { + std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); + theFirstVisualizedBody = aShapePtr.get() != NULL; } } return aDisplayed;