From: Ekaterina Sukhareva Date: Wed, 24 Jan 2024 15:17:07 +0000 (+0000) Subject: Simple fix for 40160 [CEA] No name in SHAPER X-Git-Tag: V9_13_0a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Ftlpr%2F53%2Fhead;p=modules%2Fshaper.git Simple fix for 40160 [CEA] No name in SHAPER --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index af3133762..8ee38cbc8 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -833,8 +833,11 @@ std::wstring Model_AttributeSelection::namingName(const std::wstring& theDefault Selector_Selector aSelector(aSelLab, baseDocumentLab()); std::wstring aResult; - if (aCont->shape().get() && aSelector.restore(aCont->shape()->impl())) + if (aCont->shape().get()) + { + aSelector.restore(aCont->shape()->impl()); aResult = aSelector.name(this); + } if (aCenterType != NOT_CENTER) { aResult += centersMap()[aCenterType]; } diff --git a/test.hdfs/Test40160_NoName.hdf b/test.hdfs/Test40160_NoName.hdf new file mode 100644 index 000000000..7bdaebdc7 Binary files /dev/null and b/test.hdfs/Test40160_NoName.hdf differ diff --git a/test.hdfs/Test40160_NoName.py b/test.hdfs/Test40160_NoName.py new file mode 100644 index 000000000..d36901311 --- /dev/null +++ b/test.hdfs/Test40160_NoName.py @@ -0,0 +1,49 @@ +# Copyright (C) 2020-2024 CEA, EDF +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +from ModelAPI import * +from GeomDataAPI import * +from GeomAlgoAPI import * +from GeomAPI import * +import sys +import os + +if __name__ == "__main__": + session = ModelAPI.ModelAPI_Session.get() + aPartSet = session.moduleDocument() + + for aPartIndex in range(aPartSet.size("Parts")): + session.startOperation() + aPart = ModelAPI.modelAPI_ResultPart(ModelAPI.objectToResult(aPartSet.object("Parts", aPartIndex))) + aPart.activate() + session.finishOperation() + + session.startOperation() + session.setActiveDocument(aPartSet) + session.finishOperation() + + Part_1_doc = aPart.partDoc() + for aFeat in Part_1_doc.allFeatures(): + if aFeat.isInHistory(): + if(aFeat.data().name() == "Extrusion_1"): + aSelectionList = aFeat.selectionList("base") + for index in range(0, aSelectionList.size()): + attrSelection = aSelectionList.value(index) + shape = attrSelection.value() + name = attrSelection.namingName() + assert(name)