]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Debug of visualization of compsolids and sub-shapes
authormpv <mpv@opencascade.com>
Wed, 19 Aug 2015 08:26:46 +0000 (11:26 +0300)
committermpv <mpv@opencascade.com>
Wed, 19 Aug 2015 08:26:46 +0000 (11:26 +0300)
src/Model/Model_ResultCompSolid.cpp
src/ModelAPI/ModelAPI_Feature.cpp
src/PartSet/PartSet_Module.cpp

index 263c7c33bc8121d6bc4c8d0850fa4e741db3b49f..577bf7074a7578cb6d088f0b705b2f3910f7adb5 100755 (executable)
@@ -91,6 +91,7 @@ bool Model_ResultCompSolid::setDisabled(std::shared_ptr<ModelAPI_Result> theThis
   bool aChanged = ModelAPI_ResultBody::setDisabled(theThis, theFlag);
   if (aChanged) { // state is changed, so modifications are needed
     myBuilder->evolutionToSelection(theFlag);
+    updateSubs(shape()); // to set disabled/enabled 
   }
   return aChanged;
 }
@@ -109,7 +110,7 @@ void Model_ResultCompSolid::updateSubs(const std::shared_ptr<GeomAPI_Shape>& the
       std::shared_ptr<GeomAPI_Shape> aSolidShape(new GeomAPI_Shape);
       aSolidShape->setImpl(new TopoDS_Shape(aSolids.Current()));
       ResultBodyPtr aSub;
-      if (mySubs.size() >= aSubIndex) { // it is needed to create a new sub-result
+      if (mySubs.size() <= aSubIndex) { // it is needed to create a new sub-result
         aSub = anObjects->createBody(this->data(), aSubIndex);
         mySubs.push_back(aSub);
       } else { // just update shape of this result
@@ -124,7 +125,7 @@ void Model_ResultCompSolid::updateSubs(const std::shared_ptr<GeomAPI_Shape>& the
         aECreator->sendUpdated(aSub, EVENT_DISP);
         aECreator->sendUpdated(aSub, EVENT_UPD);
       }
-      aSub->setDisabled(aSub, false);
+      aSub->setDisabled(aSub, isDisabled());
     }
     // erase left, unused results
     while(mySubs.size() > aSubIndex) {
index 3d8e5d57f27d488e0159feae9392c3867ed51f79..11431a82ca785772950256a647ceac9ec1193aee 100644 (file)
@@ -79,6 +79,7 @@ void ModelAPI_Feature::eraseResultFromList(const std::shared_ptr<ModelAPI_Result
     ResultPtr aRes = *aResIter;
     if (aRes == theResult) {
       std::string aGroup = aRes->groupName();
+      aRes->setDisabled(aRes, true); // for complex results to disable all subs
       aRes->data()->erase();
       myResults.erase(aResIter);
 
index af416570fbdbd610607ceaf1f78f2ed3c765ce44..09fdef8f2b934e8ad79989ca97772c77b328222d 100644 (file)
 #include <QDebug>
 #endif
 
-//#define DEBUG_COMPOSOLID
+#define DEBUG_COMPOSOLID
 
 
 /*!Create and return new instance of XGUI_Module*/