#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultGroup.h>
#include <ModelAPI_ResultCompSolid.h>
#include <ModelAPI_Tools.h>
if (!aHide) { // check that this is not hidden result
ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
aHide = aRes && aRes->isConcealed();
+
+ // Hide the presentation with an empty shape. But isDisplayed state of the object should not
+ // be changed to the object becomes visible when the shape becomes not empty
+ if (!aHide && aRes.get())
+ aHide = !aRes->shape().get() || aRes->shape()->isNull();
}
#ifdef DEBUG_RESULT_COMPSOLID
ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
bool isConcealed = aRes && aRes->isConcealed();
aHide = aRes && aRes->isConcealed();
+ // Hide the presentation with an empty shape. But isDisplayed state of the object should not
+ // be changed to the object becomes visible when the shape becomes not empty
+ if (!aHide && aRes.get())
+ aHide = !aRes->shape().get() || aRes->shape()->isNull();
}
if (!aHide) {
// setDisplayed has to be called in order to synchronize internal state of the object
aDisplayed = aDisplayer->display(theObj, false);
if (aNb == 0)
theFirstVisualizedBody = true;
- } else
+ } else {
aDisplayed = aDisplayer->display(theObj, false);
-
+ if (aDisplayed) {
+ ResultPtr aGroup = std::dynamic_pointer_cast<ModelAPI_ResultGroup>(theObj);
+ if (aGroup.get() != NULL) {
+ std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aGroup);
+ theFirstVisualizedBody = aShapePtr.get() != NULL;
+ }
+ }
+ }
return aDisplayed;
}