Salome HOME
SALOME PAL V1_4_1
[modules/smesh.git] / src / SMESH_I / SMESH_test.py
index a2bdc2da94fc3ef57ebb0cce03ef55e1fa67b672..e823f9028009d33f84f2fe5493373065a8710c23 100644 (file)
@@ -1,6 +1,32 @@
-# creer des geometries, en selectionner une
+#  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
+#
+#  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+# 
+#  This library is free software; you can redistribute it and/or 
+#  modify it under the terms of the GNU Lesser General Public 
+#  License as published by the Free Software Foundation; either 
+#  version 2.1 of the License. 
+# 
+#  This library is distributed in the hope that it will be useful, 
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+#  Lesser General Public License for more details. 
+# 
+#  You should have received a copy of the GNU Lesser General Public 
+#  License along with this library; if not, write to the Free Software 
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+# 
+#  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+#
+#
+#
+#  File   : SMESH_test.py
+#  Module : SMESH
 
 import SMESH
+import StdMeshers
+
 import smeshpy
 import salome
 from salome import sg
@@ -52,41 +78,41 @@ ide=geompy.addToStudyInFather(face,edge,name)
 
 # ---- launch SMESH, init a Mesh with the box
 gen=smeshpy.smeshpy()
-mesh=gen.Init(idb)
+mesh=gen.CreateMesh(idb)
 
 # ---- create Hypothesis
 
 print "-------------------------- create Hypothesis"
 print "-------------------------- LocalLength"
-hyp1=gen.CreateHypothesis("LocalLength")
+hyp1=gen.CreateHypothesis("LocalLength","libStdMeshersEngine.so")
 print hyp1.GetName()
 print hyp1.GetId()
-hypo1 = hyp1._narrow(SMESH.SMESH_LocalLength)
+hypo1 = hyp1._narrow(StdMeshers.StdMeshers_LocalLength)
 print hypo1.GetLength()
 hypo1.SetLength(100)
 print hypo1.GetLength()
 
 print "-------------------------- bidon"
-hyp3=gen.CreateHypothesis("bidon")
+hyp3=gen.CreateHypothesis("bidon","")
 
 print "-------------------------- NumberOfSegments"
-hyp3=gen.CreateHypothesis("NumberOfSegments")
-hypo3=hyp3._narrow(SMESH.SMESH_NumberOfSegments)
+hyp3=gen.CreateHypothesis("NumberOfSegments","libStdMeshersEngine.so")
+hypo3=hyp3._narrow(StdMeshers.StdMeshers_NumberOfSegments)
 hypo3.SetNumberOfSegments(7)
 print hypo3.GetName()
 print hypo3.GetNumberOfSegments()
 print hypo3.GetId()
 
 print "-------------------------- MaxElementArea"
-hyp4=gen.CreateHypothesis("MaxElementArea")
-hypo4=hyp4._narrow(SMESH.SMESH_MaxElementArea)
+hyp4=gen.CreateHypothesis("MaxElementArea","libStdMeshersEngine.so")
+hypo4=hyp4._narrow(StdMeshers.StdMeshers_MaxElementArea)
 hypo4.SetMaxElementArea(5000)
 print hypo4.GetName()
 print hypo4.GetMaxElementArea()
 print hypo4.GetId()
 
 print "-------------------------- Regular_1D"
-alg1=gen.CreateHypothesis("Regular_1D")
+alg1=gen.CreateHypothesis("Regular_1D","libStdMeshersEngine.so")
 print alg1.GetName()
 print alg1.GetId()
 algo1=alg1._narrow(SMESH.SMESH_Algo)
@@ -94,18 +120,18 @@ listHyp=algo1.GetCompatibleHypothesis()
 for hyp in listHyp:
     print hyp
     
-algo_1=alg1._narrow(SMESH.SMESH_Regular_1D)
+algo_1=alg1._narrow(StdMeshers.StdMeshers_Regular_1D)
 print algo_1.GetId()
 
 print "-------------------------- MEFISTO_2D"
-alg2=gen.CreateHypothesis("MEFISTO_2D")
+alg2=gen.CreateHypothesis("MEFISTO_2D","libStdMeshersEngine.so")
 print alg2.GetName()
 print alg2.GetId()
 algo2=alg2._narrow(SMESH.SMESH_Algo)
 listHyp=algo2.GetCompatibleHypothesis()
 for hyp in listHyp:
     print hyp
-algo_2=alg2._narrow(SMESH.SMESH_MEFISTO_2D)
+algo_2=alg2._narrow(StdMeshers.StdMeshers_MEFISTO_2D)
 print algo_2.GetId()
 
 # ---- add hypothesis to edge