Salome HOME
Merge branch 'csgroup_IS2'
[modules/shaper.git] / src / CollectionPlugin / Test / TestGroupMove26.py
1 # Copyright (C) 2014-2021  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # Check that if particular result of group is concealed, other results are not concealed
21 # and don't treated like that by the move to the history algorithm
22
23 from salome.shaper import model
24 from ModelAPI import *
25
26 model.begin()
27 partSet = model.moduleDocument()
28 Part_1 = model.addPart(partSet)
29 Part_1_doc = Part_1.document()
30 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
31 SketchCircle_1 = Sketch_1.addCircle(10.07512315270936, 19.52832512315271, 5.646825151450413)
32 SketchCircle_2 = Sketch_1.addCircle(-17.04064039408868, -4.229064039408867, 10.0065552781921)
33 model.do()
34 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_2_2f"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")], model.selection(), 10, 0)
35 Group_1 = model.addGroup(Part_1_doc, "Solids", [model.selection("SOLID", "Extrusion_1_1")])
36 RemoveResults_1 = model.addRemoveResults(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2")])
37 model.do()
38 Part_1_doc.moveFeature(Group_1.feature(), RemoveResults_1.feature())
39 model.end()
40
41 aFactory = ModelAPI_Session.get().validators()
42 assert(aFactory.validate(Group_1.feature()))
43 selectionList = Group_1.feature().selectionList("group_list")
44 assert(selectionList.size() == 1)
45
46 assert(model.checkPythonDump())