Salome HOME
Update copyrights in the documentation.
[modules/smesh.git] / src / Tools / smesh_plugins.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2011-2016  EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 # Author : Guillaume Boulant (EDF)
21 #
22 import salome_pluginsmanager
23 import os
24
25 try:
26   from spadderPlugin import runSpadderPlugin
27   salome_pluginsmanager.AddFunction('PADDER mesher',
28                                     'Create a mesh with PADDER',
29                                     runSpadderPlugin)
30 except:
31   salome_pluginsmanager.logger.info('ERROR: PADDER mesher plug-in is unavailable')
32   pass
33
34 try:
35   from meshcut_plugin import MeshCut
36   salome_pluginsmanager.AddFunction('MeshCut',
37                                     'Cut a tetrahedron mesh by a plane',
38                                     MeshCut)
39
40 except:
41   salome_pluginsmanager.logger.info('ERROR: MeshCut plug-in is unavailable')
42   pass
43
44 try:
45   from yamsplug_plugin import YamsLct
46   salome_pluginsmanager.AddFunction('ReMesh with MGSurfOpt',
47                                     'Run Yams',
48                                     YamsLct)
49 except:
50   salome_pluginsmanager.logger.info('ERROR: MGSurfOpt plug-in is unavailable')
51   pass
52
53 try:
54   from MGCleanerplug_plugin import MGCleanerLct
55   salome_pluginsmanager.AddFunction('ReMesh with MGCleaner',
56                                     'Run MGCleaner',
57                                     MGCleanerLct)
58 except:
59   salome_pluginsmanager.logger.info('ERROR: MGCleaner plug-in is unavailable')
60   pass
61
62 try:
63   from blocFissure.ihm.fissureCoude_plugin import fissureCoudeDlg
64   salome_pluginsmanager.AddFunction('Meshed Pipe with a crack (blocFissure plugin)',
65                                     'Create a mesh with blocFissure tool',
66                                     fissureCoudeDlg)
67 except:
68   salome_pluginsmanager.logger.info('ERROR: Meshed Pipe with a crack plug-in is unavailable')
69   pass
70 try:
71   from blocFissure.ihm.fissureGenerale_plugin import fissureGeneraleDlg
72   salome_pluginsmanager.AddFunction('Add a crack in a mesh (blocFissure plugin)',
73                                     'Insert a crack in an hexahedral mesh with blocFissure tool',
74                                     fissureGeneraleDlg)
75 except:
76   salome_pluginsmanager.logger.info('ERROR: Meshed Pipe with a crack plug-in is unavailable')
77   pass
78
79 # ZCracks plugin requires the Zcracks tool
80 try:
81   zcracksHome=os.environ['ZCRACKSHOME']
82   if len(zcracksHome) > 1:
83     #print 'ZCRACKSHOME ', zcracksHome
84     from Zcracks.zcracks_plugin import ZcracksLct
85     salome_pluginsmanager.AddFunction('Run Zcrack',
86                                       'Run Zcrack',
87                                       ZcracksLct)
88 except:
89   #print 'probleme zcracks'
90   salome_pluginsmanager.logger.info('ERROR: Zcrack plug-in is unavailable')
91   pass