Salome HOME
Merge from V6_main_20120808 08Aug12
[plugins/ghs3dprlplugin.git] / src / GHS3DPRLPlugin / GHS3DPRLPluginDC.py
diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py b/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py
new file mode 100644 (file)
index 0000000..b9bb2a3
--- /dev/null
@@ -0,0 +1,79 @@
+# Copyright (C) 2007-2012  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.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from smesh import Mesh_Algorithm, AssureGeomPublished
+
+# import GHS3DPRLPlugin module if possible
+noGHS3DPRLPlugin = 0
+try:
+    import GHS3DPRLPlugin
+except ImportError:
+    noGHS3DPRLPlugin = 1
+    pass
+
+# Optimization level of GHS3D
+# V3.1
+None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization = 0,1,2,3
+# V4.1 (partialy redefines V3.1). Issue 0020574
+None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization, Strong_Optimization = 0,1,2,3,4
+
+GHS3DPRL = "GHS3DPRL_3D"
+
+
+## Tetrahedron GHS3DPRL 3D algorithm
+#  It is created by calling Mesh.Tetrahedron( GHS3DPRL, geom=0 )
+#
+class GHS3DPRL_Algorithm(Mesh_Algorithm):
+
+    meshMethod = "Tetrahedron"
+    algoType   = GHS3DPRL
+
+    ## Private constructor.
+    def __init__(self, mesh, geom=0):
+        Mesh_Algorithm.__init__(self)
+        if none_optimization: print "Warning: GHS3DPRLPlugin module unavailable"
+        self.Create(mesh, geom, self.algoType, "libGHS3DPRLEngine.so")
+
+    ## Defines hypothesis having several parameters
+    #
+    def Parameters(self):
+        if not self.params:
+            self.params = self.Hypothesis("GHS3DPRL_Parameters", [],
+                                          "libGHS3DPRLEngine.so", UseExisting=0)
+        return self.params
+
+    ## To keep working files or remove them. Log file remains in case of errors anyway.
+    def SetKeepFiles(self, toKeep):
+        self.Parameters().SetKeepFiles(toKeep)
+    
+    ## Sets MED files name and path.
+    def SetMEDName(self, value):
+        self.Parameters().SetMEDName(value)
+
+    ## Sets the number of partition of the initial mesh
+    def SetNbPart(self, value):
+        self.Parameters().SetNbPart(value)
+
+    ## When big mesh, start tepal in background
+    def SetBackground(self, value):
+        self.Parameters().SetBackground(value)
+
+    ## To mesh "holes" in a solid or not. Default is to mesh.
+    def SetToMeshHoles(self, toMesh):
+        self.Parameters().SetToMeshHoles(toMesh)