Salome HOME
removing the call to the tetrahedron generator NETGEN, because I did not yet
[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 smeshgui = salome.ImportComponentGUI("SMESH")
39 smeshgui.Init(salome.myStudyId);
40
41 ShapeTypeCompSolid = 1
42 ShapeTypeSolid = 2
43 ShapeTypeShell = 3
44 ShapeTypeFace = 4
45 ShapeTypeWire = 5
46 ShapeTypeEdge = 6
47 ShapeTypeVertex = 7
48
49 # ---- define a box
50
51 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
52 idbox = geompy.addToStudy(box,"box")
53
54 # ---- add first face of box in study
55
56 subShapeList=geompy.SubShapeAll(box,ShapeTypeFace)
57 face=subShapeList[0]
58 name = geompy.SubShapeName( face._get_Name(), box._get_Name() )
59 print name
60 idface=geompy.addToStudyInFather(box,face,name)
61
62 # ---- add shell from box  in study
63
64 subShellList=geompy.SubShapeAll(box,ShapeTypeShell)
65 shell = subShellList[0]
66 name = geompy.SubShapeName( shell._get_Name(), box._get_Name() )
67 print name
68 idshell=geompy.addToStudyInFather(box,shell,name)
69
70 # ---- add first edge of face in study
71
72 edgeList = geompy.SubShapeAll(face,ShapeTypeEdge)
73 edge=edgeList[0];
74 name = geompy.SubShapeName( edge._get_Name(), face._get_Name() )
75 print name
76 idedge=geompy.addToStudyInFather(face,edge,name)
77
78 sg.updateObjBrowser(1);