Salome HOME
PR: reorganise smesh plugins and correct MeshCut when there are groups
authorprascle <prascle>
Fri, 23 Mar 2012 13:13:21 +0000 (13:13 +0000)
committerprascle <prascle>
Fri, 23 Mar 2012 13:13:21 +0000 (13:13 +0000)
src/Tools/Makefile.am
src/Tools/MeshCut/Makefile.am
src/Tools/MeshCut/MeshCut_DC.cxx
src/Tools/MeshCut/meshcut_plugin.py
src/Tools/padder/spadderpy/plugin/Makefile.am
src/Tools/padder/spadderpy/plugin/smesh_plugins.py [deleted file]
src/Tools/padder/spadderpy/plugin/spadderPlugin.py [new file with mode: 0644]
src/Tools/smesh_plugins.py [new file with mode: 0644]

index 96b92e3cf60bcf3fe50a9e94ea33391371f35e99..6ac95c5be425977468d222f954613fabfc647fe1 100644 (file)
@@ -26,3 +26,6 @@
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 SUBDIRS = MeshCut padder
+
+salomeplugins_PYTHON = \
+       smesh_plugins.py
index e191e4e01037d260c0643bc5bef2ff394517f7f4..496b3e11a803bd02202f98069ffc256e2adb0cbf 100644 (file)
@@ -42,12 +42,12 @@ MeshCut_CPPFLAGS =  $(MED3_INCLUDES)
 
 MeshCut_LDFLAGS =  $(MED3_LIBS) $(HDF5_LIBS)
 
-
+salomeplugins_PYTHON = \
+       meshcut_plugin.py
 
 UIPY_FILES =  MeshCutDialog.py
 
 if SMESH_ENABLE_GUI
-  dist_salomescript_SCRIPTS   = meshcut_plugin.py
   nodist_salomescript_SCRIPTS = $(UIPY_FILES)
 endif
 
index 8bb93713380c19af295425deff87cdc835472138..d957103db416b668bb648b5ff13d57278db433c9 100644 (file)
@@ -1104,11 +1104,13 @@ int main(int argc, char *argv[])
   //  cout << endl;
 
   // Groupes de mailles
-  MAILLAGE2->GM = MAILLAGE1->GM;
+  // MAILLAGE2->GM = MAILLAGE1->GM;
+  MAILLAGE2->GN.clear();
+  MAILLAGE2->GM.clear();
   MAILLAGE2->GM[str_id_GMplus] = GMplus;
   MAILLAGE2->GM[str_id_GMmoins] = GMmoins;
 
-  MAILLAGE2->GN = MAILLAGE1->GN;
+  // MAILLAGE2->GN = MAILLAGE1->GN;
 
   MAILLAGE2->eliminationMailles(TETRA4, cutTetras);
 
index e47e7e897d90450f00ba75b6a8dce5e48adc0329..600e09f1098789b2383f5b0da0b6fda7b66b41a6 100644 (file)
@@ -20,8 +20,6 @@
 # if you already have plugins defined in a salome_plugins.py file, add this file at the end.
 # if not, copy this file as ${HOME}/Plugins/smesh_plugins.py or ${APPLI}/Plugins/smesh_plugins.py
 
-import salome_pluginsmanager
-
 def MeshCut(context):
   # get context study, studyId, salomeGui
   study = context.study
@@ -31,6 +29,7 @@ def MeshCut(context):
   import os
   import subprocess
   import tempfile
+  from PyQt4 import QtCore
   from PyQt4 import QtGui
   from PyQt4.QtGui import QFileDialog
   from PyQt4.QtGui import QMessageBox
@@ -139,7 +138,3 @@ and T the tolerance.
       pass
     pass
   pass
-
-# register the function in the plugin manager
-salome_pluginsmanager.AddFunction('MeshCut', 'Cut a tetrahedron mesh by a plane', MeshCut)
-
index 543204a0f1535607466ec438f1dca74097eae35a..b09d6b9a60922beef6a4bd640d57ddd90bd91809 100644 (file)
@@ -6,7 +6,7 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 # plugins and created in the root installation directory.
 #
 salomeplugins_PYTHON = \
-       smesh_plugins.py
+       spadderPlugin.py
 
 #salomeplugins_DATA = \
 #      envPlugins.sh
diff --git a/src/Tools/padder/spadderpy/plugin/smesh_plugins.py b/src/Tools/padder/spadderpy/plugin/smesh_plugins.py
deleted file mode 100755 (executable)
index 9f79eab..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-#  Copyright (C) 2011 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
-#
-# -* Makefile *- 
-#
-# Author : Guillaume Boulant (EDF) 
-#
-import salome_pluginsmanager
-
-
-def runSpadderPlugin(context):
-    from salome.smesh.spadder.gui import plugindialog
-    from salome.kernel.uiexception import UiException
-    try:
-        dialog=plugindialog.getDialog()
-    except UiException, err:
-        from PyQt4.QtGui import QMessageBox
-        QMessageBox.critical(None,"An error occurs during PADDER configuration",
-                             err.getUIMessage())
-        return
-    
-    dialog.update()    
-    dialog.show()
-
-salome_pluginsmanager.AddFunction('PADDER mesher',
-                                  'Create a mesh with PADDER',
-                                  runSpadderPlugin)
-
diff --git a/src/Tools/padder/spadderpy/plugin/spadderPlugin.py b/src/Tools/padder/spadderpy/plugin/spadderPlugin.py
new file mode 100644 (file)
index 0000000..9e24c1b
--- /dev/null
@@ -0,0 +1,38 @@
+# -*- coding: iso-8859-1 -*-
+#  Copyright (C) 2011 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
+#
+# -* Makefile *- 
+#
+# Author : Guillaume Boulant (EDF) 
+#
+
+def runSpadderPlugin(context):
+    from salome.smesh.spadder.gui import plugindialog
+    from salome.kernel.uiexception import UiException
+    try:
+        dialog=plugindialog.getDialog()
+    except UiException, err:
+        from PyQt4.QtGui import QMessageBox
+        QMessageBox.critical(None,"An error occurs during PADDER configuration",
+                             err.getUIMessage())
+        return
+    
+    dialog.update()    
+    dialog.show()
+
diff --git a/src/Tools/smesh_plugins.py b/src/Tools/smesh_plugins.py
new file mode 100644 (file)
index 0000000..972ebd8
--- /dev/null
@@ -0,0 +1,35 @@
+# -*- coding: iso-8859-1 -*-
+#  Copyright (C) 2011 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
+#
+# -* Makefile *- 
+#
+# Author : Guillaume Boulant (EDF) 
+#
+import salome_pluginsmanager
+
+from spadderPlugin import runSpadderPlugin
+from meshcut_plugin import MeshCut
+
+salome_pluginsmanager.AddFunction('PADDER mesher',
+                                  'Create a mesh with PADDER',
+                                  runSpadderPlugin)
+
+salome_pluginsmanager.AddFunction('MeshCut',
+                                  'Cut a tetrahedron mesh by a plane',
+                                  MeshCut)