From 37c19a108ecf411269171ce86194bbff9cab6eb9 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 15 Nov 2017 13:45:54 +0300 Subject: [PATCH] Task 2.1. Management of result names Apply "main_argument" mechanism to features, which have second object as a base. Create additional test case. --- src/FeaturesPlugin/extrusioncut_widget.xml | 3 +- src/FeaturesPlugin/extrusionfuse_widget.xml | 3 +- src/FeaturesPlugin/revolutioncut_widget.xml | 3 +- src/FeaturesPlugin/revolutionfuse_widget.xml | 3 +- .../Test/TestCustomName_ExtrusionCutFace.py | 41 +++++++++++++++++++ 5 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 src/ModelAPI/Test/TestCustomName_ExtrusionCutFace.py diff --git a/src/FeaturesPlugin/extrusioncut_widget.xml b/src/FeaturesPlugin/extrusioncut_widget.xml index 95f86e25a..b176ddc18 100755 --- a/src/FeaturesPlugin/extrusioncut_widget.xml +++ b/src/FeaturesPlugin/extrusioncut_widget.xml @@ -109,7 +109,8 @@ email : webmaster.salome@opencascade.com + concealment="true" + main_argument="true"> diff --git a/src/FeaturesPlugin/extrusionfuse_widget.xml b/src/FeaturesPlugin/extrusionfuse_widget.xml index 7cde0f50d..e65b6b4af 100644 --- a/src/FeaturesPlugin/extrusionfuse_widget.xml +++ b/src/FeaturesPlugin/extrusionfuse_widget.xml @@ -109,7 +109,8 @@ email : webmaster.salome@opencascade.com + concealment="true" + main_argument="true"> diff --git a/src/FeaturesPlugin/revolutioncut_widget.xml b/src/FeaturesPlugin/revolutioncut_widget.xml index 3b69da158..12f2f247f 100644 --- a/src/FeaturesPlugin/revolutioncut_widget.xml +++ b/src/FeaturesPlugin/revolutioncut_widget.xml @@ -109,7 +109,8 @@ email : webmaster.salome@opencascade.com + concealment="true" + main_argument="true"> diff --git a/src/FeaturesPlugin/revolutionfuse_widget.xml b/src/FeaturesPlugin/revolutionfuse_widget.xml index 26a02d72e..6d1bb8394 100644 --- a/src/FeaturesPlugin/revolutionfuse_widget.xml +++ b/src/FeaturesPlugin/revolutionfuse_widget.xml @@ -109,7 +109,8 @@ email : webmaster.salome@opencascade.com + concealment="true" + main_argument="true"> diff --git a/src/ModelAPI/Test/TestCustomName_ExtrusionCutFace.py b/src/ModelAPI/Test/TestCustomName_ExtrusionCutFace.py new file mode 100644 index 000000000..b20f90afb --- /dev/null +++ b/src/ModelAPI/Test/TestCustomName_ExtrusionCutFace.py @@ -0,0 +1,41 @@ +## Copyright (C) 2014-2017 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 +## + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Box_1.result().setName("box") +Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "box/Front")) +SketchCircle_1 = Sketch_1.addCircle(7, 6, 2) +model.do() +Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2")]) +Face_1.result().setName("circle") +ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "circle")], model.selection(), 0, 3, [model.selection("SOLID", "box")]) +model.do() + +assert(ExtrusionCut_1.result().name() == Box_1.result().name()), "ExtrusionCut name '{}' != '{}'".format(ExtrusionCut_1.result().name(), Box_1.result().name()) + +model.end() + +assert(model.checkPythonDump()) -- 2.39.2