Salome HOME
The external feature should be executed manually in order to return first result.
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 164253a..03b29dd
@@ -48,7 +48,6 @@
 #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*/
 extern "C" PARTSET_EXPORT ModuleBase_IModule* createModule(ModuleBase_IWorkshop* theWshop)
 {
@@ -361,13 +357,6 @@ bool PartSet_Module::canCommitOperation() const
 
 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);
 }
@@ -709,6 +698,14 @@ void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS)
   }
 }
 
+void PartSet_Module::onBeforeObjectErase(ObjectPtr theObject, AISObjectPtr theAIS)
+{
+  // it should be recomputed in order to disappear in the viewer if the corresponded object
+  // is erased
+  if (myCustomPrs->isActive())
+    myCustomPrs->customize(theObject);
+}
+
 void PartSet_Module::onViewTransformed(int theTrsfType)
 {
   // Set length of arrows constant in pixel size