From 9d30aa7eb95bebd4e194dec3efccb61b473a9903 Mon Sep 17 00:00:00 2001 From: mzn Date: Fri, 27 Oct 2006 11:16:02 +0000 Subject: [PATCH] Fix for bug IPAL13698(Error during execution "SMESH_mechanic_netgen.py" and "SMESH_fixation_netgen.py" scripts). --- src/SMESH_SWIG/smesh.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index cc8bc7b3f..504a26460 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -5,10 +5,21 @@ import salome import geompy -import StdMeshers + import SMESH from SMESH import * +import StdMeshers + +## import NETGENPlugin module if possible +noNETGENPlugin = 0 +try: + import NETGENPlugin +except ImportError: + noNETGENPlugin = 1 + pass + + ## Types of algo REGULAR = 1 PYTHON = 2 @@ -541,6 +552,8 @@ class Mesh_Triangle(Mesh_Algorithm): if algoType == MEFISTO: self.Create(mesh, geom, "MEFISTO_2D") elif algoType == NETGEN: + if noNETGENPlugin: + print "Warning: NETGENPlugin module has not been imported." self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so") self.algoType = algoType @@ -662,6 +675,8 @@ class Mesh_Tetrahedron(Mesh_Algorithm): import GHS3DPlugin self.Create(mesh, geom, "GHS3D_3D" , "libGHS3DEngine.so") elif algoType == FULL_NETGEN: + if noNETGENPlugin: + print "Warning: NETGENPlugin module has not been imported." self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so") self.algoType = algoType @@ -751,6 +766,9 @@ class Mesh_Netgen(Mesh_Algorithm): ## Private constructor. def __init__(self, mesh, is3D, geom=0): + if noNETGENPlugin: + print "Warning: NETGENPlugin module has not been imported." + self.is3D = is3D if is3D: self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so") -- 2.39.2