]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1976: Application crashes when loading python script
authordbv <dbv@opencascade.com>
Thu, 12 Jan 2017 12:14:56 +0000 (15:14 +0300)
committerdbv <dbv@opencascade.com>
Thu, 12 Jan 2017 12:15:51 +0000 (15:15 +0300)
Removed obsolete code for storing compound sub-shapes on result sub-labels.

src/Model/Model_BodyBuilder.cpp

index 2136750ba1dd6d235c3b928bad970039fcdd434f..38d349bd7386b89dd822b2ab45ff9d03d22b4c22 100755 (executable)
@@ -206,43 +206,7 @@ void Model_BodyBuilder::storeModified(const std::shared_ptr<GeomAPI_Shape>& theO
     if (aShapeNew.IsNull())
       return;  // null shape inside
     aBuilder.Modify(aShapeOld, aShapeNew);
-    if (theDecomposeSolidsTag && aShapeNew.ShapeType() == TopAbs_COMPOUND) {
-      // make sub elements as subs
-
-      // register name if it is possible
-      TCollection_AsciiString aName;
-      if(!aBuilder.NamedShape()->IsEmpty()) {
-        Handle(TDataStd_Name) anAttr;
-        if(aBuilder.NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(),anAttr)) {
-          aName = TCollection_AsciiString(anAttr->Get()).ToCString();
-        }
-      }
-
-      TopoDS_Iterator aSubIter(aShapeNew);
-      for(int aTag = theDecomposeSolidsTag; aSubIter.More(); aSubIter.Next()) {
-        const TopoDS_Shape& aShape = aSubIter.Value();
-        Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aShape, aShapeLab);
-        if(!aNS.IsNull() && !aNS->IsEmpty()) {
-          // This shape is already in document, don't add it.
-          continue;
-        }
-        TNaming_Builder aSubBuilder(aShapeLab.FindChild(aTag++));
-        aSubBuilder.Generated(aSubIter.Value());
-        if(!aName.IsEmpty()) {
-          TCollection_AsciiString aShapeType = aShape.ShapeType() == TopAbs_EDGE ? "_Edge_" :
-                                               aShape.ShapeType() == TopAbs_FACE ? "_Face_" :
-                                               aShape.ShapeType() == TopAbs_SOLID ? "_Solid_" :
-                                               "_Shape_";
-          std::string aSolidName =
-            (aName + aShapeType + TCollection_AsciiString(aTag - theDecomposeSolidsTag))
-            .ToCString();
-          std::shared_ptr<Model_Document> aDoc =
-            std::dynamic_pointer_cast<Model_Document>(document());
-          aDoc->addNamingName(aSubBuilder.NamedShape()->Label(), aSolidName);
-          TDataStd_Name::Set(aSubBuilder.NamedShape()->Label(), aSolidName.c_str());
-        }
-      }
-    } else if(!aBuilder.NamedShape()->IsEmpty()) {
+    if(!aBuilder.NamedShape()->IsEmpty()) {
       Handle(TDataStd_Name) anAttr;
       if(aBuilder.NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(),anAttr)) {
         std::string aName (TCollection_AsciiString(anAttr->Get()).ToCString());