Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/smesh.git] / src / SMESH_SWIG / SMESH_test0.py
1 #  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3
4 #  This library is free software; you can redistribute it and/or 
5 #  modify it under the terms of the GNU Lesser General Public 
6 #  License as published by the Free Software Foundation; either 
7 #  version 2.1 of the License. 
8
9 #  This library is distributed in the hope that it will be useful, 
10 #  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 #  Lesser General Public License for more details. 
13
14 #  You should have received a copy of the GNU Lesser General Public 
15 #  License along with this library; if not, write to the Free Software 
16 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17
18 #  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 #
20 #
21 #
22 #  File   : SMESH_test0.py
23 #  Module : SMESH
24
25 import SMESH
26 import smeshpy
27 import salome
28 from salome import sg
29 import math
30 #import SMESH_BasicHypothesis_idl
31
32 import geompy
33
34 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
35 myBuilder = salome.myStudy.NewBuilder()
36 from geompy import gg
37
38 ShapeTypeCompSolid = 1
39 ShapeTypeSolid = 2
40 ShapeTypeShell = 3
41 ShapeTypeFace = 4
42 ShapeTypeWire = 5
43 ShapeTypeEdge = 6
44 ShapeTypeVertex = 7
45
46 # ---- define a box
47
48 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
49 idbox = geompy.addToStudy(box,"box")
50
51 # ---- add first face of box in study
52
53 subShapeList=geompy.SubShapeAll(box,ShapeTypeFace)
54 face=subShapeList[0]
55 name = geompy.SubShapeName( face._get_Name(), box._get_Name() )
56 print name
57 idface=geompy.addToStudyInFather(box,face,name)
58
59 # ---- add shell from box  in study
60
61 subShellList=geompy.SubShapeAll(box,ShapeTypeShell)
62 shell = subShellList[0]
63 name = geompy.SubShapeName( shell._get_Name(), box._get_Name() )
64 print name
65 idshell=geompy.addToStudyInFather(box,shell,name)
66
67 # ---- add first edge of face in study
68
69 edgeList = geompy.SubShapeAll(face,ShapeTypeEdge)
70 edge=edgeList[0];
71 name = geompy.SubShapeName( edge._get_Name(), face._get_Name() )
72 print name
73 idedge=geompy.addToStudyInFather(face,edge,name)
74
75 sg.updateObjBrowser(1);