Salome HOME
PR: examples adaptation to geomBuilder
[modules/smesh.git] / src / SMESH_SWIG / SMESH_Partition1_tetra.py
index 30d93537abe6d701cb87c4381291275d59adfa53..ab7ddf27604fe8882d099f2c8ceacbaa2398442f 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 # -- Rayon de la bariere
 #
 import salome
-import geompy
-import smesh
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+smesh =  smeshBuilder.New(salome.myStudy)
+
 from math import sqrt
 
 
@@ -88,7 +95,7 @@ print "number of Edges  in alveole : ", len(subEdgeList)
 
 subshapes = geompy.SubShapeAll(alveole, geompy.ShapeType["SHAPE"])
 
-## there are 9 subshapes
+## there are 9 sub-shapes
 
 comp1 = geompy.MakeCompound( [ subshapes[0], subshapes[1] ] )
 comp2 = geompy.MakeCompound( [ subshapes[2], subshapes[3] ] )
@@ -119,8 +126,6 @@ print "number of Edges  in alveole : ", len(subEdgeList)
 status = geompy.CheckShape(alveole)
 print " check status ", status
 
-# ---- launch SMESH
-smesh.SetCurrentStudy(salome.myStudy)
 
 # ---- init a Mesh with the alveole
 shape_mesh = salome.IDToObject( idalveole )
@@ -155,7 +160,7 @@ print "-------------------------- MaxElementVolume"
 
 maxElementVolume = 0.5
 
-netgen3D = mesh.Tetrahedron(smesh.NETGEN)
+netgen3D = mesh.Tetrahedron(smeshBuilder.NETGEN)
 hypVolume = netgen3D.MaxElementVolume(maxElementVolume)
 print hypVolume.GetName()
 print hypVolume.GetId()