From: dbv Date: Thu, 12 Jan 2017 12:14:56 +0000 (+0300) Subject: Issue #1976: Application crashes when loading python script X-Git-Tag: V_2.7.0~344^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e7cb7ff73c9db6f1672a7d84744b35685acabeb1;p=modules%2Fshaper.git Issue #1976: Application crashes when loading python script Removed obsolete code for storing compound sub-shapes on result sub-labels. --- diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index 2136750ba..38d349bd7 100755 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -206,43 +206,7 @@ void Model_BodyBuilder::storeModified(const std::shared_ptr& 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 aDoc = - std::dynamic_pointer_cast(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());