1 ## Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 from salome.shaper import model
24 partSet = model.moduleDocument()
25 Part_1 = model.addPart(partSet)
26 Part_1_doc = Part_1.document()
27 Import_1 = model.addImport(Part_1_doc, "D:/rq_1.brep")
29 Import_1.setName("rq_1")
30 Import_1.result().setName("rq_1_1")
31 Import_2 = model.addImport(Part_1_doc, "D:/rq2_1.brep")
33 Import_2.setName("rq2_1")
34 Import_2.result().setName("rq2_1_1")
35 Import_3 = model.addImport(Part_1_doc, "D:/spine.brep")
37 Import_3.setName("spine")
38 Import_3.result().setName("spine_1")
39 Import_4 = model.addImport(Part_1_doc, "D:/v1.brep")
41 Import_4.setName("v1")
42 Import_4.result().setName("v1_1")
43 Import_5 = model.addImport(Part_1_doc, "D:/v2.brep")
45 Import_5.setName("v2")
46 Import_5.result().setName("v2_1")
47 Pipe_1 = model.addPipe(Part_1_doc, [model.selection("WIRE", "rq_1_1"), model.selection("WIRE", "rq2_1_1")], model.selection("WIRE", "spine_1"), [model.selection("VERTEX", "spine_1/Shape2"), model.selection("VERTEX", "spine_1/Shape3")])
51 from GeomAPI import GeomAPI_Shape
53 model.testNbResults(Pipe_1, 1)
54 model.testNbSubResults(Pipe_1, [0])
55 model.testNbSubShapes(Pipe_1, GeomAPI_Shape.SOLID, [0])
56 model.testNbSubShapes(Pipe_1, GeomAPI_Shape.FACE, [4])
57 model.testNbSubShapes(Pipe_1, GeomAPI_Shape.EDGE, [16])
58 model.testNbSubShapes(Pipe_1, GeomAPI_Shape.VERTEX, [32])
60 assert(model.checkPythonDump())