From dc9efa7dceb4fe9420be3640b0103dd599fbf164 Mon Sep 17 00:00:00 2001 From: abuhsing Date: Mon, 9 Dec 2013 15:41:06 +0000 Subject: [PATCH] Modif Hexablock.py --- src/HEXABLOCK_SWIG/hexablock.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/HEXABLOCK_SWIG/hexablock.py b/src/HEXABLOCK_SWIG/hexablock.py index 59ddbb1..c000f4b 100644 --- a/src/HEXABLOCK_SWIG/hexablock.py +++ b/src/HEXABLOCK_SWIG/hexablock.py @@ -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 -- 2.39.2