Salome HOME
23308: [EDF] Re-implement DISTENE meshing plugins to use libraries instead of executables
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / GHS3DPluginBuilder.py
index 08dfb09fcde67d91ac1b1791c03f96241bf280be..2d1a630a33ad7b2a4792f9e20987100e542c456e 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2016  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
 # 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
@@ -19,7 +19,7 @@
 
 ##
 # @package GHS3DPluginBuilder
-# Python API for the GHS3D meshing plug-in module.
+# Python API for the MG-Tetra meshing plug-in module.
 
 from salome.smesh.smesh_algorithm import Mesh_Algorithm
 from salome.smesh.smeshBuilder import AssureGeomPublished
@@ -32,7 +32,7 @@ except ImportError:
     noGHS3DPlugin = 1
     pass
 
-# Optimization level of GHS3D
+# Optimization level of MG-Tetra
 # V3.1
 None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization = 0,1,2,3
 # V4.1 (partialy redefines V3.1). Issue 0020574
@@ -42,12 +42,13 @@ None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optim
 # Mesh algo type identifiers
 #----------------------------
 
-## Algorithm type: GHS3D tetrahedron 3D algorithm, see GHS3D_Algorithm
-GHS3D = "GHS3D_3D"
+## Algorithm type: MG-Tetra tetrahedron 3D algorithm, see GHS3D_Algorithm
+MG_Tetra = "MG-Tetra"
+GHS3D = MG_Tetra
 
-## Tetrahedron GHS3D 3D algorithm
+## Tetrahedron MG-Tetra 3D algorithm
 #  
-#  It can be created by calling smeshBuilder.Mesh.Tetrahedron( smeshBuilder.GHS3D, geom=0 )
+#  It can be created by calling smeshBuilder.Mesh.Tetrahedron( smeshBuilder.MG_Tetra, geom=0 )
 class GHS3D_Algorithm(Mesh_Algorithm):
 
     ## name of the dynamic method in smeshBuilder.Mesh class
@@ -55,7 +56,7 @@ class GHS3D_Algorithm(Mesh_Algorithm):
     meshMethod = "Tetrahedron"
     ## type of algorithm used with helper function in smeshBuilder.Mesh class
     #  @internal
-    algoType   = GHS3D
+    algoType   = MG_Tetra
     ## doc string of the method in smeshBuilder.Mesh class
     #  @internal
     docHelper  = "Creates tetrahedron 3D algorithm for volumes"
@@ -75,7 +76,7 @@ class GHS3D_Algorithm(Mesh_Algorithm):
     #  @return hypothesis object
     def Parameters(self):
         if not self.params:
-            self.params = self.Hypothesis("GHS3D_Parameters", [],
+            self.params = self.Hypothesis("MG-Tetra Parameters", [],
                                           "libGHS3DEngine.so", UseExisting=0)
             pass
         return self.params
@@ -89,7 +90,7 @@ class GHS3D_Algorithm(Mesh_Algorithm):
     ## To make groups of volumes of different domains when mesh is generated from skin.
     #  Default is to make groups.
     # This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
-    #  @param toMesh "mesh holes" flag value
+    #  @param toMakeGroups "Make groups of domains" flag value
     def SetToMakeGroupsOfDomains(self, toMakeGroups):
         self.Parameters().SetToMakeGroupsOfDomains(toMakeGroups)
         pass
@@ -126,11 +127,27 @@ class GHS3D_Algorithm(Mesh_Algorithm):
         self.Parameters().SetWorkingDirectory(path)
         pass
 
-    ## To keep working files or remove them. Log file remains in case of errors anyway.
+    ## To keep working files or remove them.
     #  @param toKeep "keep working files" flag value
     def SetKeepFiles(self, toKeep):
         self.Parameters().SetKeepFiles(toKeep)
         pass
+    
+    ## Remove or not the log file (if any) in case of successful computation.
+    #  The log file remains in case of errors anyway. If 
+    #  the "keep working files" flag is set to true, this option
+    #  has no effect.
+    #  @param toRemove "remove log on success" flag value
+    def SetRemoveLogOnSuccess(self, toRemove):
+        self.Parameters().SetRemoveLogOnSuccess(toRemove)
+        pass
+    
+    ## Print the the log in a file. If set to false, the
+    # log is printed on the standard output
+    #  @param toPrintLogInFile "print log in a file" flag value
+    def SetPrintLogInFile(self, toPrintLogInFile):
+        self.Parameters().SetStandardOutputLog(not toPrintLogInFile)
+        pass
 
     ## Set verbosity level [0-10].
     #  @param level verbosity level
@@ -243,7 +260,13 @@ class GHS3D_Algorithm(Mesh_Algorithm):
     ## Sets command line option as text.
     #  @param option command line option
     def SetTextOption(self, option):
-        self.Parameters().SetTextOption(option)
+        self.Parameters().SetAdvancedOption(option)
+        pass
+    
+    ## Sets command line option as text.
+    #  @param option command line option
+    def SetAdvancedOption(self, option):
+        self.Parameters().SetAdvancedOption(option)
         pass
     
     pass # end of GHS3D_Algorithm class