]> SALOME platform Git repositories - plugins/netgenplugin.git/blobdiff - src/NETGENPlugin/NETGENPluginBuilder.py
Salome HOME
Merge remote-tracking branch 'origin/V8_3_BR' into gdd/python3_dev
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPluginBuilder.py
index 11369c7331505ab4569080f286dc829de1c6121f..932500d85d1e9be3e4ea2c36a4625d40d71af566 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # 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.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -32,6 +32,8 @@ except ImportError:
     noNETGENPlugin = 1
     pass
 
+LIBRARY = "libNETGENEngine.so"
+
 #----------------------------
 # Mesh algo type identifiers
 #----------------------------
@@ -103,8 +105,8 @@ class NETGEN_Algorithm(Mesh_Algorithm):
     #              if it is @c 0 (default), the algorithm is assigned to the main shape
     def __init__(self, mesh, geom=0):
         Mesh_Algorithm.__init__(self)
-        if noNETGENPlugin: print "Warning: NETGENPlugin module unavailable"
-        self.Create(mesh, geom, self.algoType, "libNETGENEngine.so")
+        if noNETGENPlugin: print("Warning: NETGENPlugin module unavailable")
+        self.Create(mesh, geom, self.algoType, LIBRARY)
         self.params = None
         pass
 
@@ -163,10 +165,16 @@ class NETGEN_Algorithm(Mesh_Algorithm):
             self.mesh.RemoveHypothesis( self.params, self.geom )
             self.params = None
         if not self.params:
-            self.params = self.Hypothesis(hypType, [],"libNETGENEngine.so",UseExisting=0)
+            self.params = self.Hypothesis(hypType, [], LIBRARY, UseExisting=0)
 
         return self.params
 
+    ## Defines a file specifying size of elements at points and lines
+    #  @param file name of the file
+    def SetMeshSizeFile(self, file):
+        self.Parameters().SetMeshSizeFile(file)
+        pass
+
     pass # end of NETGEN_Algorithm class
 
 
@@ -218,6 +226,16 @@ class NETGEN_1D2D3D_Algorithm(NETGEN_Algorithm):
     def SetQuadAllowed(self, toAllow=True):
         if self.Parameters(): self.params.SetQuadAllowed(toAllow)
         pass
+    ## Sets @c UseSurfaceCurvature flag
+    #  @param toUse new value of the @c UseSurfaceCurvature parameter (@c True by default)
+    def SetUseSurfaceCurvature(self, toUse=True):
+        if self.Parameters(): self.params.SetUseSurfaceCurvature(toUse)
+        pass
+    ## Sets @c FuseEdges flag
+    #  @param toFuse new value of the @c FuseEdges parameter (@c False by default)
+    def SetFuseEdges(self, toFuse=False):
+        if self.Parameters(): self.params.SetFuseEdges(toFuse)
+        pass
 
     ## Sets number of segments overriding the value set by SetLocalLength()
     #  @param theVal new value of number of segments parameter
@@ -335,6 +353,12 @@ class NETGEN_2D_Only_Algorithm(NETGEN_Algorithm):
     def LengthFromEdges(self):
         hyp = self.Hypothesis("LengthFromEdges", UseExisting=1, CompareMethod=self.CompareEqualHyp)
         return hyp
+        
+    ## Sets @c UseSurfaceCurvature flag
+    #  @param toUse new value of the @c UseSurfaceCurvature parameter (@c True by default)
+    def SetUseSurfaceCurvature(self, toUse=True):
+        if self.Parameters(): self.params.SetUseSurfaceCurvature(toUse)
+        pass
 
     ## Sets @c QuadAllowed flag.
     #  @param toAllow new value of the @c QuadAllowed parameter (@c True by default)