From: nds Date: Wed, 19 Aug 2015 07:35:36 +0000 (+0300) Subject: Compsolid visualization debug. X-Git-Tag: V_1.4.0_beta4~354 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=885f5880d7a9ad246f5ae3cd226cc8ebf4022053;p=modules%2Fshaper.git Compsolid visualization debug. --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index c4410ee75..af416570f 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -4,7 +4,6 @@ #include "PartSet_WidgetSketchLabel.h" #include "PartSet_Validators.h" #include "PartSet_Tools.h" -#include "ModuleBase_WidgetValidated.h" #include "PartSet_WidgetPoint2d.h" #include "PartSet_WidgetPoint2dDistance.h" #include "PartSet_WidgetShapeSelector.h" @@ -30,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -108,6 +109,7 @@ #include #endif +//#define DEBUG_COMPOSOLID /*!Create and return new instance of XGUI_Module*/ @@ -357,6 +359,13 @@ bool PartSet_Module::canCommitOperation() const bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const { +#ifdef DEBUG_COMPOSOLID + ResultCompSolidPtr aCompSolid = std::dynamic_pointer_cast + (theObject); + if (aCompSolid.get() && aCompSolid->numberOfSubs() > 0) + return false; +#endif + // the sketch manager put the restriction to the objects display return mySketchMgr->canDisplayObject(theObject); } diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index 27054bd3d..bc201061f 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,7 @@ #include #endif +//#define DEBUG_CANDISPLAY //#define DEBUG_FEATURE_CREATED //#define DEBUG_FEATURE_REDISPLAY @@ -239,21 +241,28 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr(aObj); aHide = aRes && aRes->isConcealed(); } - if (aHide) + if (aHide) { aDisplayer->erase(aObj, false); + #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 + } else { // Redisplay the visible object or the object of the current operation bool isVisibleObject = aDisplayer->isVisible(aObj); #ifdef DEBUG_FEATURE_REDISPLAY - QString anObjInfo = ModuleBase_Tools::objectInfo((aObj)); - qDebug(QString("visible=%1 : display= %2").arg(isVisibleObject).arg(anObjInfo).toStdString().c_str()); - - FeaturePtr aFeature = std::dynamic_pointer_cast(aObj); - if (aFeature.get()) { - std::string aKind = aFeature->getKind(); - if (aKind == "SketchMultiRotation") - bool aValue = true; - } + QString anObjInfo = ModuleBase_Tools::objectInfo((aObj)); + qDebug(QString("visible=%1 : display= %2").arg(isVisibleObject).arg(anObjInfo).toStdString().c_str()); + /*FeaturePtr aFeature = std::dynamic_pointer_cast(aObj); + if (aFeature.get()) { + std::string aKind = aFeature->getKind(); + if (aKind == "SketchMultiRotation") + bool aValue = true; + }*/ #endif if (isVisibleObject) { // redisplay visible object @@ -261,6 +270,12 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr + (aObj); + if (aCompSolid.get() && aCompSolid->numberOfSubs() > 0) { + aDisplayer->erase(aObj, false); + }*/ + aDisplayer->redisplay(aObj, false); // Deactivate object of current operation from selection aWorkshop->deactivateActiveObject(aObj, false); @@ -301,9 +316,15 @@ void XGUI_WorkshopListener::onFeatureCreatedMsg(const std::shared_ptrmodule()->canDisplayObject(anObject)*/) { + anObject->setDisplayed(true); + //isDisplayed = displayObject(anObject); +#else if (myWorkshop->module()->canDisplayObject(anObject)) { anObject->setDisplayed(true); - isDisplayed = displayObject(*aIt); + isDisplayed = displayObject(anObject); +#endif } else anObject->setDisplayed(false); }