]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task 2.1. Management of result names
authorazv <azv@opencascade.com>
Wed, 15 Nov 2017 10:45:54 +0000 (13:45 +0300)
committerazv <azv@opencascade.com>
Wed, 15 Nov 2017 10:45:54 +0000 (13:45 +0300)
Apply "main_argument" mechanism to features, which have second object as a base.
Create additional test case.

src/FeaturesPlugin/extrusioncut_widget.xml
src/FeaturesPlugin/extrusionfuse_widget.xml
src/FeaturesPlugin/revolutioncut_widget.xml
src/FeaturesPlugin/revolutionfuse_widget.xml
src/ModelAPI/Test/TestCustomName_ExtrusionCutFace.py [new file with mode: 0644]

index 95f86e25a4e8ef46dd0e8a93e6f2837cb647a871..b176ddc1812e8050c855c02a8569abd097c22aca 100755 (executable)
@@ -109,7 +109,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
     tooltip="Objects to Cut"
     type_choice="Objects"
     use_choice="false"
-    concealment="true">
+    concealment="true"
+    main_argument="true">
     <validator id="GeomValidators_ShapeType" parameters="solid"/>
   </multi_selector>
   <validator id="GeomValidators_ZeroOffset" parameters="CreationMethod,BySizes,sketch_selection,to_size,from_size,to_object,to_offset,from_object,from_offset"/>
index 7cde0f50d7d0e858a827ef0da977963f88187b80..e65b6b4af990bcdcb52914206dae5522a2fd9ade 100644 (file)
@@ -109,7 +109,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
     tooltip="Objects to Fuse"
     type_choice="Objects"
     use_choice="false"
-    concealment="true">
+    concealment="true"
+    main_argument="true">
     <validator id="GeomValidators_ShapeType" parameters="solid"/>
   </multi_selector>
   <validator id="GeomValidators_ZeroOffset" parameters="CreationMethod,BySizes,sketch_selection,to_size,from_size,to_object,to_offset,from_object,from_offset"/>
index 3b69da1580585832afe16f4d2e5ff2764008cc1d..12f2f247f45e509048e9dd951573275a38668bfa 100644 (file)
@@ -109,7 +109,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
     tooltip="Objects to Cut"
     type_choice="Objects"
     use_choice="false"
-    concealment="true">
+    concealment="true"
+    main_argument="true">
     <validator id="GeomValidators_ShapeType" parameters="solid"/>
   </multi_selector>
   <validator id="GeomValidators_ZeroOffset" parameters="CreationMethod,ByAngles,sketch_selection,to_angle,from_angle,to_object,to_offset,from_object,from_offset"/>
index 26a02d72eae6f655a20970854e51ad498bd08340..6d1bb83945ef55b9e1a08688f8ea6173cb2ae147 100644 (file)
@@ -109,7 +109,8 @@ email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com
     tooltip="Objects to Fuse"
     type_choice="Objects"
     use_choice="false"
-    concealment="true">
+    concealment="true"
+    main_argument="true">
     <validator id="GeomValidators_ShapeType" parameters="solid"/>
   </multi_selector>
   <validator id="GeomValidators_ZeroOffset" parameters="CreationMethod,ByAngles,sketch_selection,to_angle,from_angle,to_object,to_offset,from_object,from_offset"/>
diff --git a/src/ModelAPI/Test/TestCustomName_ExtrusionCutFace.py b/src/ModelAPI/Test/TestCustomName_ExtrusionCutFace.py
new file mode 100644 (file)
index 0000000..b20f90a
--- /dev/null
@@ -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<mailto: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())