]> SALOME platform Git repositories - modules/hexablock.git/commitdiff
Salome HOME
Modif Hexablock.py
authorabuhsing <abuhsing>
Mon, 9 Dec 2013 15:41:06 +0000 (15:41 +0000)
committerabuhsing <abuhsing>
Mon, 9 Dec 2013 15:41:06 +0000 (15:41 +0000)
src/HEXABLOCK_SWIG/hexablock.py

index 59ddbb14a5a3c9150cb3e04f0bde406a78b16774..c000f4b56610f7f2accb574d331ce35307f31c28 100644 (file)
@@ -2,12 +2,20 @@
 # HexaBlock : Module principal
 
 import hexablock_swig
-import salome
-import smesh
 
 import HEXABLOCKPlugin
 
-geompy    = smesh.geompy
+import salome
+salome.salome_init()
+
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+
+import SMESH
+from salome.smesh import smeshBuilder
+smesh = smeshBuilder.New(salome.myStudy)
+
 component = hexablock_swig.hex_instance ()
 
 # ======================================================== moduleName
@@ -113,15 +121,15 @@ def mesh (doc, name=None, dim=3, container="FactoryServer"):
 
     geompy.addToStudy(shape, name)
     comp_smesh = salome.lcc.FindOrLoadComponent(container, "SMESH")
-    comp_smesh.init_smesh(study, geompy.geom)
+    comp_smesh.init_smesh(study, geomBuilder.geom)
     meshexa = comp_smesh.Mesh(shape)
 
     so = "libHexaBlockPluginEngine.so"
 
-    algo = smesh.SMESH._objref_SMESH_Gen.CreateHypothesis(comp_smesh, "HEXABLOCK_3D", so)
+    algo = SMESH._objref_SMESH_Gen.CreateHypothesis(comp_smesh, "HEXABLOCK_3D", so)
     meshexa.mesh.AddHypothesis(shape, algo)
 
-    hypo = smesh.SMESH._objref_SMESH_Gen.CreateHypothesis(comp_smesh, "HEXABLOCK_Parameters", so)
+    hypo = SMESH._objref_SMESH_Gen.CreateHypothesis(comp_smesh, "HEXABLOCK_Parameters", so)
     meshexa.mesh.AddHypothesis(shape, hypo)
 
     ### hypo.SetDocument(doc.getXml())   ## Hexa6 TODO et a verifier