Salome HOME
Issue 1347: correction to fit all in the viewer the first visualized group result...
authornds <nds@opencascade.com>
Tue, 1 Mar 2016 14:50:00 +0000 (17:50 +0300)
committernds <nds@opencascade.com>
Tue, 1 Mar 2016 14:50:00 +0000 (17:50 +0300)
src/XGUI/XGUI_WorkshopListener.cpp

index 577e70da22a8dfa475cb69de9ffcacd2fbc5cbfc..57025c6c7d096b4a1ab60f11f6286728ea45d55b 100755 (executable)
@@ -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<ModelAPI_Result>(theObj);
+      if (aResult.get() != NULL) {
+        std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
+          theFirstVisualizedBody = aShapePtr.get() != NULL;
+      }
+    }
+  }
   return aDisplayed;
 }