Salome HOME
Fix for bug IPAL13698(Error during execution "SMESH_mechanic_netgen.py" and "SMESH_fi...
authormzn <mzn@opencascade.com>
Fri, 27 Oct 2006 11:16:02 +0000 (11:16 +0000)
committermzn <mzn@opencascade.com>
Fri, 27 Oct 2006 11:16:02 +0000 (11:16 +0000)
src/SMESH_SWIG/smesh.py

index cc8bc7b3fad1be6d83527de14f2583ff991e7a26..504a26460eac844a8122e3f57b0c68c134b3164d 100644 (file)
@@ -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")