// return name of reference result only if it has been renamed by the user,
// in other case compose a default name
- if (anObjRes->data()->hasUserDefinedName()) {
+ if (anObjRes->data()->hasUserDefinedName() ||
+ anObjRes->data()->name() != getDefaultName(anObjRes).first) {
std::wstringstream aName;
aName << anObjRes->data()->name();
std::map<ResultPtr, int>::iterator aFound = aNbRefToObject.find(anObjRes);
--- /dev/null
+# Copyright (C) 2020 CEA/DEN, EDF R&D
+#
+# 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
+#
+
+if __name__ == "__main__":
+ aPartFeature = locals()["Part_1"]
+ model.testNbResults(aPartFeature, 1)
+ model.testNbSubResults(aPartFeature, [0])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.SOLID, [2])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.FACE, [22])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.EDGE, [88])
+ model.testNbSubShapes(aPartFeature, GeomAPI_Shape.VERTEX, [176])
+ model.testResultsVolumes(aPartFeature, [55179.3113664])
+
+ assert(model.checkPythonDump(model.ModelHighAPI.CHECK_NAMING))
isOk = True
error = ""
- proc = subprocess.Popen(["runSalome.py", "--modules", "SHAPER,GEOM", "--gui", "--splash", "0", "--ns-port-log=" + portlogfile, "test_hdf.py", "args:" + hdffile + "," + testdatafile + "," + portlogfile + "," + testlogfile], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ proc = subprocess.Popen(["runSalome.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", "--ns-port-log=" + portlogfile, "test_hdf.py", "args:" + hdffile + "," + testdatafile + "," + portlogfile + "," + testlogfile], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
try:
proc.communicate(timeout = testTimeout)
except TimeoutExpired: