#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"
#include <ModuleBase_IViewWindow.h>
#include <ModuleBase_IPropertyPanel.h>
#include <ModuleBase_WidgetEditor.h>
+#include <ModuleBase_WidgetValidated.h>
#include <ModuleBase_FilterFactory.h>
#include <ModuleBase_Tools.h>
#include <GeomValidators_ShapeType.h>
#include <ModelAPI_Session.h>
#include <ModelAPI_ShapeValidator.h>
#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultCompSolid.h>
#include <GeomDataAPI_Point2D.h>
#include <GeomDataAPI_Point.h>
#include <QDebug>
#endif
+//#define DEBUG_COMPOSOLID
/*!Create and return new instance of XGUI_Module*/
bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const
{
+#ifdef DEBUG_COMPOSOLID
+ ResultCompSolidPtr aCompSolid = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>
+ (theObject);
+ if (aCompSolid.get() && aCompSolid->numberOfSubs() > 0)
+ return false;
+#endif
+
// the sketch manager put the restriction to the objects display
return mySketchMgr->canDisplayObject(theObject);
}
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultCompSolid.h>
#include <Events_Loop.h>
#include <Events_Error.h>
#include <iostream>
#endif
+//#define DEBUG_CANDISPLAY
//#define DEBUG_FEATURE_CREATED
//#define DEBUG_FEATURE_REDISPLAY
ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(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<ModelAPI_Feature>(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<ModelAPI_Feature>(aObj);
+ if (aFeature.get()) {
+ std::string aKind = aFeature->getKind();
+ if (aKind == "SketchMultiRotation")
+ bool aValue = true;
+ }*/
#endif
if (isVisibleObject) { // redisplay visible object
// in order to avoid the check whether the object can be redisplayed, the exact method
// of redisplay is called. This modification is made in order to have the line is updated
// by creation of a horizontal constraint on the line by preselection
+ /*ResultCompSolidPtr aCompSolid = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>
+ (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);
if (!aHide) {
// setDisplayed has to be called in order to synchronize internal state of the object
// with list of displayed objects
+#ifdef DEBUG_CANDISPLAY
+ if (displayObject(anObject)/*myWorkshop->module()->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);
}