From: eap Date: Wed, 7 Mar 2012 15:50:52 +0000 (+0000) Subject: 0021308: Remove hard-coded dependency of the external mesh plugins from the SMESH... X-Git-Tag: V6_5_0a1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b2fff25365daa21e409cedd28ff3355bfd72044c;p=plugins%2Fghs3dprlplugin.git 0021308: Remove hard-coded dependency of the external mesh plugins from the SMESH module +# Scripts to be installed. +dist_salomescript_DATA= GHS3DPRLPluginDC.py --- diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py b/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py new file mode 100644 index 0000000..8228bde --- /dev/null +++ b/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py @@ -0,0 +1,83 @@ +# Copyright (C) 2007-2011 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. +# +# 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 ) +# +# @ingroup l3_algos_basic +class GHS3D_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) + + ## Defines hypothesis having several parameters + # + # @ingroup l3_hypos_ghs3dh + def Parameters(self, which=SOLE): + 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. + # @ingroup l3_hypos_ghs3dh + 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) diff --git a/src/GHS3DPRLPlugin/Makefile.am b/src/GHS3DPRLPlugin/Makefile.am index 64e49d4..b6a08af 100644 --- a/src/GHS3DPRLPlugin/Makefile.am +++ b/src/GHS3DPRLPlugin/Makefile.am @@ -58,3 +58,6 @@ libGHS3DPRLEngine_la_LDFLAGS = \ ../../idl/libSalomeIDLGHS3DPRLPLUGIN.la \ $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \ $(KERNEL_LDFLAGS) -lSalomeGenericObj + +# Scripts to be installed. +dist_salomescript_DATA= GHS3DPRLPluginDC.py