Salome HOME
Copyright update 2022
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / GHS3DPluginBuilder.py
index c1b710f6981b1c91326da3506abc61ad7255dee2..06f1a875a8afd1121dcddf1a1c3ce7a8945bd777 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2019  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2022  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -21,6 +21,7 @@
 # @package GHS3DPluginBuilder
 # Python API for the MG-Tetra meshing plug-in module.
 
+import omniORB
 from salome.smesh.smesh_algorithm import Mesh_Algorithm
 from salome.smesh.smeshBuilder import AssureGeomPublished
 
@@ -88,6 +89,30 @@ class GHS3D_Algorithm(Mesh_Algorithm):
             pass
         return self.params
 
+    ## Set lower boundary of mesh element size
+    #  Set it to zero to deactivate this option
+    def SetMinSize(self, theMinSize):
+        self.Parameters().SetMinSize(theMinSize)
+        return
+
+    ## Set upper boundary of mesh element size
+    #  Set it to zero to deactivate this option
+    def SetMaxSize(self, theMaxSize):
+        self.Parameters().SetMaxSize(theMaxSize)
+        return
+
+    ## Activate/deactivate volume proximity computation
+    #
+    def SetVolumeProximity(self, toUse ):
+        self.Parameters().SetVolumeProximity(toUse)
+        return
+
+    ## Set number of surface element layers to be generated due to volume proximity
+    #
+    def SetNbVolumeProximityLayers(self, nbLayers ):
+        self.Parameters().SetNbVolumeProximityLayers(nbLayers)
+        return
+
     ## To mesh "holes" in a solid or not. Default is to mesh.
     #  @param toMesh "mesh holes" flag value
     def SetToMeshHoles(self, toMesh):
@@ -264,15 +289,22 @@ class GHS3D_Algorithm(Mesh_Algorithm):
             pass
         pass
 
-    ## Sets command line option as text.
-    #  @param option command line option
-    def SetTextOption(self, option):
-        self.Parameters().SetAdvancedOption(option)
+    ## Set advanced option value
+    #  @param optionName option name
+    #  @param optionValue option value
+    def SetOptionValue(self, optionName, optionValue):
+        self.Parameters().SetOptionValue( optionName, optionValue )
         pass
     
     ## Sets command line option as text.
+    #  @param optionAndValue command line option in a form "option value"
+    def SetAdvancedOption(self, optionAndValue):
+        self.Parameters().SetAdvancedOption(optionAndValue)
+        pass
+    
+    ## OBSOLETE Sets command line option as text.
     #  @param option command line option
-    def SetAdvancedOption(self, option):
+    def SetTextOption(self, option):
         self.Parameters().SetAdvancedOption(option)
         pass
     
@@ -443,3 +475,17 @@ class GHS3D_Optimizer(GHS3D_Algorithm):
         pass
 
     pass # end of GHS3D_Optimizer class
+
+class hypoProxy(GHS3DPlugin._objref_GHS3DPlugin_Hypothesis):
+    """
+    Private class wrapping to provide backward compatibility with deprecated API.
+    """
+    def __init__(self, *args):
+        GHS3DPlugin._objref_GHS3DPlugin_Hypothesis.__init__(self, *args)
+    def __deepcopy__(self, memo=None):
+        new = self.__class__(self)
+        return new
+    def SetPrintLogInFile(self, value):
+        self.SetStandardOutputLog(not value)
+omniORB.registerObjref(GHS3DPlugin._objref_GHS3DPlugin_Hypothesis._NP_RepositoryId, hypoProxy)
+del hypoProxy