+
+ // 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>(aObj);
+ if (aRes.get()) {
+ ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aRes);
+ if (aCompSolidRes.get()) {
+ qDebug(QString("COMPSOLID, numberOfSubs = %1").arg(aCompSolidRes->numberOfSubs()).toStdString().c_str());
+ }
+ if (ModelAPI_Tools::compSolidOwner(aRes))
+ qDebug("COMPSOLID sub-object");
+ }
+#endif
+ #ifdef DEBUG_FEATURE_REDISPLAY
+ QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
+ if (aFeature.get()) {
+ std::string aKind = aFeature->getKind();
+ if (aKind == DebugFeatureKind) {
+ qDebug(QString("visible=%1, hide=%2 : display= %2").arg(aDisplayer->isVisible(aObj))
+ .arg(aHide).arg(anObjInfo).toStdString().c_str());
+ }
+ }
+ #endif
+ if (aHide) {
+ //we should provide objects which are hidden in the viewer, e.g. sketch always should visualizes
+ // all sub-features, if some features are to be hidden, sould be proposed may be to removed #1223
+ //aHiddenObjects.push_back(aObj);
+ aRedisplayed = aDisplayer->erase(aObj, false) || aRedisplayed;
+ #ifdef DEBUG_FEATURE_REDISPLAY
+ // Redisplay the visible object or the object of the current operation
+ bool isVisibleObject = aDisplayer->isVisible(aObj);
+
+ QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
+ //qDebug(QString("visible=%1 : erase = %2").arg(isVisibleObject).arg(anObjInfo).toStdString().c_str());
+ #endif