From bb76c80f7e5115754ce5898c51d80cb8f2dfdfe4 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 21 Aug 2015 18:30:28 +0300 Subject: [PATCH] Compsolid - debug of visibility in the viewer. --- src/XGUI/XGUI_Displayer.cpp | 2 +- src/XGUI/XGUI_WorkshopListener.cpp | 36 +++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index cb2503f04..b20a2f246 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -989,6 +989,6 @@ std::string XGUI_Displayer::getResult2AISObjectMapInfo() const aContent.append(aPtrStr.str().c_str()); } - return QString("myResult2AISObjectMap: size = %1\n%2").arg(myResult2AISObjectMap.size()). + return QString("myResult2AISObjectMap: size = %1\n%2\n").arg(myResult2AISObjectMap.size()). arg(aContent.join("\n")).toStdString().c_str(); } diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index 685961c46..2e22c49ed 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -57,6 +57,7 @@ //#define DEBUG_FEATURE_CREATED //#define DEBUG_FEATURE_REDISPLAY +//#define DEBUG_RESULT_COMPSOLID XGUI_WorkshopListener::XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop) : myWorkshop(theWorkshop), @@ -241,6 +242,17 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr(aObj); aHide = aRes && aRes->isConcealed(); } +#ifdef DEBUG_RESULT_COMPSOLID + ResultPtr aRes = std::dynamic_pointer_cast(aObj); + if (aRes.get()) { + ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast(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 if (aHide) { aDisplayer->erase(aObj, false); #ifdef DEBUG_FEATURE_REDISPLAY @@ -248,7 +260,7 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptrisVisible(aObj); QString anObjInfo = ModuleBase_Tools::objectInfo((aObj)); - qDebug(QString("visible=%1 : erase = %2").arg(isVisibleObject).arg(anObjInfo).toStdString().c_str()); + //qDebug(QString("visible=%1 : erase = %2").arg(isVisibleObject).arg(anObjInfo).toStdString().c_str()); #endif } else { @@ -306,6 +318,18 @@ void XGUI_WorkshopListener::onFeatureCreatedMsg(const std::shared_ptr(anObject); + if (aRes.get()) { + ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast(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 // the validity of the data should be checked here in order to avoid display of the objects, // which were created, then deleted, but flush for the creation event happens after that // we should not display disabled objects @@ -429,6 +453,16 @@ void XGUI_WorkshopListener::addFeature(const std::shared_ptr(theObj); + if (aRes.get() && (ModelAPI_Tools::hasSubResults(aRes) || ModelAPI_Tools::compSolidOwner(aRes))) { + ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast(aRes); + if (aCompSolidRes.get()) { + qDebug("COMPSOLID: displayObject"); + } + } +#endif + XGUI_Workshop* aWorkshop = workshop(); // do not display the object if it has sub objects. They should be displayed separately. if (!aWorkshop->module()->canDisplayObject(theObj) || -- 2.39.2