From: Nabil Ghodbane Date: Sat, 8 Jan 2022 20:35:24 +0000 (+0100) Subject: spns #19079: add topo2volmesher - ongoing task: add it as a PARAVISADDONS plugin X-Git-Tag: V9_9_0~240 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0df090158caad9222b860e3bf769fedf71ce1606;p=tools%2Fsat_salome.git spns #19079: add topo2volmesher - ongoing task: add it as a PARAVISADDONS plugin --- diff --git a/products/env_scripts/topo2volmesh.py b/products/env_scripts/topo2volmesh.py new file mode 100644 index 0000000..b59c1e5 --- /dev/null +++ b/products/env_scripts/topo2volmesh.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os +import platform + +def set_env(env, prereq_dir, version): + env.set("TOPO2VOLMESH_ROOT_DIR",prereq_dir) + if not platform.system() == "Windows" : + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + +def set_nativ_env(env): + pass diff --git a/products/patches/smesh_spns-19079_topo2volmesh.patch b/products/patches/smesh_spns-19079_topo2volmesh.patch new file mode 100644 index 0000000..9e35534 --- /dev/null +++ b/products/patches/smesh_spns-19079_topo2volmesh.patch @@ -0,0 +1,849 @@ +diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt +index 2c8c207..e91875d 100644 +--- a/src/Tools/CMakeLists.txt ++++ b/src/Tools/CMakeLists.txt +@@ -26,6 +26,7 @@ ADD_SUBDIRECTORY(MacMesh) + IF(SALOME_BUILD_GUI) + ADD_SUBDIRECTORY(MGCleanerPlug) + ADD_SUBDIRECTORY(YamsPlug) ++ ADD_SUBDIRECTORY(Topo2VolMeshPlug) + # ADD_SUBDIRECTORY(ZCracksPlug) + ENDIF(SALOME_BUILD_GUI) + +diff --git a/src/Tools/Topo2VolMeshPlug/CMakeLists.txt b/src/Tools/Topo2VolMeshPlug/CMakeLists.txt +new file mode 100755 +index 0000000..c9ab7ca +--- /dev/null ++++ b/src/Tools/Topo2VolMeshPlug/CMakeLists.txt +@@ -0,0 +1,56 @@ ++# Copyright (C) 2013-2021 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, 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 ++# 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 ++# ++ ++IF(SALOME_BUILD_GUI) ++ INCLUDE(UsePyQt) ++ENDIF(SALOME_BUILD_GUI) ++ ++# --- scripts --- ++ ++# scripts / static ++SET(_plugin_SCRIPTS ++ Topo2VolMeshPluginDialog.py ++ Topo2VolMeshPlugin.py ++ Topo2VolMeshPlugin_plugin.py ++ Topo2VolMeshMonitor.py ++ README ++) ++ ++IF(SALOME_BUILD_GUI) ++ # uic files / to be processed by pyuic ++ SET(_pyuic_FILES ++ Topo2VolMeshPluginDialog.ui ++ Topo2VolMeshMonitor.ui ++ ) ++ # scripts / pyuic wrappings ++ PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic) ++ENDIF(SALOME_BUILD_GUI) ++ ++# --- rules --- ++ ++SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}) ++MESSAGE(VERBOSE "iNSTALLATION FOLDER ${SALOME_SMESH_INSTALL_PLUGINS}") ++IF(SALOME_BUILD_GUI) ++ SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS} TARGET_NAME _target_name_pyuic_py) ++ # add dependency of compiled py files on uic files in order ++ # to avoid races problems when compiling in parallel ++ ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic}) ++ # Install the CMake configuration files: ++ INSTALL(FILES "${PROJECT_SOURCE_DIR}/README" DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}") ++ENDIF(SALOME_BUILD_GUI) +diff --git a/src/Tools/Topo2VolMeshPlug/README b/src/Tools/Topo2VolMeshPlug/README +new file mode 100755 +index 0000000..073fdf3 +--- /dev/null ++++ b/src/Tools/Topo2VolMeshPlug/README +@@ -0,0 +1,109 @@ ++****************************** ++About SALOME HexaBlock plug-in ++****************************** ++ ++SALOME HexaBlock plug-in implements meshing of the CAD models created with ++the SALOME HexaBlock module. ++ ++SALOME HexaBlock plug-in is integrated into SALOME platform via the SALOME Mesh ++module. ++ ++For more information please visit the SALOME platform web site: ++ ++ ++ ++======= ++License ++======= ++ ++SALOME platform is distributed under the GNU Lesser General Public License. ++See COPYING file for more details. ++ ++Also, additional information can be found at SALOME platform web site: ++ ++ ++ ++============ ++Installation ++============ ++ ++-------------- ++Pre-requisites ++-------------- ++ ++SALOME platform relies on a set of third-party softwares; some of them are needed ++at build time only, while other ones are needed in runtime also. ++ ++For more information about the pre-requisites please visit SALOME platform web ++site: ++ ++* Check Release Notes and Software Requirements of the latest SALOME release at ++ ++ ++ ++* Pre-requisites page at SALOME web site: ++ ++ ++ ++Note: SALOME HexaBlock plug-in needs SALOME KERNEL, SALOME GUI, SALOME Geometry, ++SALOME Mesh and SALOME HexaBlock as pre-requisites. ++ ++------------------ ++Basic Installation ++------------------ ++ ++The build procedure of the SALOME platform is implemented with CMake. ++In order to build the plug-in you have to do the following actions: ++ ++1. Set up environment for pre-requisites (see "Pre-requisites" section above). ++ ++2. Create a build directory: ++ ++ % mkdir HEXABLOCKPLUGIN_BUILD ++ ++3. Configure the build procedure: ++ ++ % cd HEXABLOCKPLUGIN_BUILD ++ % cmake -DCMAKE_BUILD_TYPE= -DCMAKE_INSTALL_PREFIX= ++ ++ where ++ - is either Release or Debug (default: Release); ++ - is a destination folder to install SALOME HexaBlock ++ plug-in (default: /usr); ++ - is a path to the SALOME HexaBlock plug-in sources directory. ++ ++ Note: by default (if CMAKE_INSTALL_PREFIX option is not given), SALOME HexaBlock ++ plug-in will be configured for installation to the /usr directory that requires ++ root permissions to complete the installation. ++ ++4. Build and install: ++ ++ % make ++ % make install ++ ++ This will install SALOME HexaBlock plug-in to the ++ specified to cmake command on the previous step. ++ ++------------------- ++Custom installation ++------------------- ++ ++SALOME HexaBlock plug-in supports a set of advanced configuration options; ++for more details learn CMakeLists.txt file in the root source directory. ++ ++You can also use other options of cmake command to customize your installation. ++Learn more about available options by typing ++ ++ % cmake --help ++ ++============= ++Documentation ++============= ++ ++The directory doc contains additional documentation file of SALOME HexaBlock plug-in. ++ ++=============== ++Troubleshooting ++=============== ++ ++Please, send a mail to webmaster.salome@opencascade.com. +diff --git a/src/Tools/Topo2VolMeshPlug/Topo2VolMeshMonitor.py b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshMonitor.py +new file mode 100755 +index 0000000..455738b +--- /dev/null ++++ b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshMonitor.py +@@ -0,0 +1,97 @@ ++# -*- coding: utf-8 -*- ++# Copyright (C) 2013-2020 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, 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 ++# 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 ++# ++ ++import os ++import sys ++import string ++import types ++import tempfile ++import traceback ++import pprint as PP #pretty print ++ ++from qtsalome import * ++ ++# Import des panels ++ ++from Topo2VolMeshMonitor_ui import Ui_qdLogger ++ ++verbose = True ++ ++class Topo2VolMeshMonitor(Ui_qdLogger, QDialog): ++ def __init__(self, parent, txt): ++ QDialog.__init__(self,parent) ++ self.setupUi(self) ++ self.resize( QSize(1000,600).expandedTo(self.minimumSizeHint()) ) ++ self.qpbOK.clicked.connect( self.OnQpbOKClicked ) ++ # Button OK is disabled until computation is finished ++ self.qpbOK.setEnabled(False) ++ self.qpbSave.clicked.connect( self.OnQpbSaveClicked ) ++ self.qpbSave.setToolTip("Save trace in log file") ++ self.qpbOK.setToolTip("Close view") ++ self.myExecutable=QProcess(self) ++ self.myExecutable.readyReadStandardOutput.connect( self.readFromStdOut ) ++ self.myExecutable.readyReadStandardError.connect( self.readFromStdErr ) ++ self.myExecutable.finished.connect( self.computationFinished ) ++ self.myExecutable.errorOccurred.connect( self.computationOnError ) ++ if os.path.exists(self.parent().outputMesh): ++ os.remove(self.parent().outputMesh) ++ self.myExecutable.start(txt) ++ self.myExecutable.closeWriteChannel() ++ self.show() ++ ++ def OnQpbOKClicked(self): ++ self.close() ++ ++ def OnQpbSaveClicked(self): ++ outputDirectory=os.path.expanduser("~") ++ fn, mask = QFileDialog.getSaveFileName(None,"Save File",outputDirectory) ++ if not fn: ++ return ++ ulfile = os.path.abspath(str(fn)) ++ try: ++ f = open(fn, 'wb') ++ f.write(self.qtbLogWindow.toPlainText().encode("utf-8")) ++ f.close() ++ except IOError as why: ++ QMessageBox.critical(self, 'Save File', ++ 'The file %s could not be saved.
Reason: %s'%(str(fn), str(why))) ++ ++ def readFromStdErr(self): ++ a=self.myExecutable.readAllStandardError() ++ aa=a.data().decode(errors='ignore') ++ self.qtbLogWindow.append(aa) ++ ++ def readFromStdOut(self) : ++ a=self.myExecutable.readAllStandardOutput() ++ aa=a.data().decode(errors='ignore') ++ self.qtbLogWindow.append(aa) ++ ++ def computationFinished(self): ++ self.qpbOK.setEnabled(True) ++ if self.myExecutable.exitCode() == 0: ++ self.parent().saveOutputMesh() ++ else: ++ QMessageBox.critical(self, 'Computation failed', ++ 'The computation has failed.
Please, check the log message.') ++ ++ def computationOnError(self): ++ self.qpbOK.setEnabled(True) ++ QMessageBox.critical(self, 'Computation failed', ++ 'The computation has failed.
Please, check the log message.') +diff --git a/src/Tools/Topo2VolMeshPlug/Topo2VolMeshMonitor.ui b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshMonitor.ui +new file mode 100755 +index 0000000..ea6d196 +--- /dev/null ++++ b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshMonitor.ui +@@ -0,0 +1,38 @@ ++ ++ ++ qdLogger ++ ++ ++ ++ 0 ++ 0 ++ 469 ++ 489 ++ ++ ++ ++ Run Topo2VolMesh ++ ++ ++ ++ ++ ++ Save log ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Ok ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPlugin.py b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPlugin.py +new file mode 100755 +index 0000000..136cd63 +--- /dev/null ++++ b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPlugin.py +@@ -0,0 +1,36 @@ ++# -*- coding: utf-8 -*- ++# Copyright (C) 2013-2020 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, 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 ++# 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 ++# ++ ++# 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 ++ ++def Topo2VolMeshLct(context): ++ # get context study, salomeGui ++ study = context.study ++ sg = context.sg ++ ++ import os ++ import subprocess ++ import tempfile ++ from qtsalome import QFileDialog, QMessageBox ++ ++ import Topo2VolMeshPluginDialog ++ window = Topo2VolMeshPluginDialog.getInstance() ++ window.show() +diff --git a/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPluginDialog.py b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPluginDialog.py +new file mode 100755 +index 0000000..ac4a32c +--- /dev/null ++++ b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPluginDialog.py +@@ -0,0 +1,129 @@ ++# -*- coding: utf-8 -*- ++# Copyright (C) 2013-2020 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, 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 ++# 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 ++# ++ ++ ++import os, subprocess ++import random ++ ++# set seed ++from datetime import datetime ++random.seed(datetime.now()) ++ ++import platform ++import tempfile ++from Topo2VolMeshPluginDialog_ui import Ui_Topo2VolMeshMainFrame ++from Topo2VolMeshMonitor import Topo2VolMeshMonitor ++from qtsalome import * ++ ++verbose = True ++ ++class Topo2VolMeshPluginDialog(Ui_Topo2VolMeshMainFrame,QWidget): ++ """ ++ """ ++ def __init__(self): ++ QWidget.__init__(self) ++ self.setupUi(self) ++ self.qpbHelp.clicked.connect(self.OnQpbHelpClicked) ++ self.qpbCompute.clicked.connect(self.OnQpbComputeClicked) ++ self.qpbMeshFile.clicked.connect(self.OnQpbMeshFileClicked) ++ self.qpbMeshFile.setToolTip("hypothesis from Salome Object Browser") ++ self.qpbClose.clicked.connect(self.OnQpbCloseClicked) ++ self.resize(800, 500) ++ self.outputMesh = '' ++ ++ def OnQpbHelpClicked(self): ++ import SalomePyQt ++ sgPyQt = SalomePyQt.SalomePyQt() ++ try: ++ mydir=os.environ["SMESH_ROOT_DIR"] ++ except Exception: ++ QMessageBox.warning(self, "Help", "Help unavailable $SMESH_ROOT_DIR not found") ++ return ++ ++ myDoc=mydir + "/share/doc/salome/gui/SMESH/Topo2VolMeshPlugin/index.html" ++ sgPyQt.helpContext(myDoc,"") ++ ++ def OnQpbMeshFileClicked(self): ++ fd = QFileDialog(self, "select an existing Mesh file", self.qleMeshFile.text(), "Mesh-Files (*.xyz);;All Files (*)") ++ if fd.exec_(): ++ infile = fd.selectedFiles()[0] ++ self.qleMeshFile.setText(infile) ++ ++ def OnQpbComputeClicked(self): ++ if self.qleMeshFile.text() == '': ++ QMessageBox.critical(self, "Mesh", "select an input mesh") ++ return ++ inputMesh = self.qleMeshFile.text() ++ # retrieve x,y,z and depth parameters ++ xPoints = self.qsbXPoints.value() ++ yPoints = self.qsbYPoints.value() ++ zPoints = self.qsbZPoints.value() ++ depth = self.qsbDepth.value() ++ ++ shellCmd = "Top2Vol-Mesher.exe" ++ shellCmd+= " --xpoints " + str(xPoints) ++ shellCmd+= " --ypoints " + str(yPoints) ++ shellCmd+= " --zpoints " + str(zPoints) ++ shellCmd+= " --zdepth " + str(depth) ++ shellCmd+= " --in " + inputMesh ++ ++ if platform.system()=="Windows" : ++ SALOME_TMP_DIR = os.getenv("SALOME_TMP_DIR") ++ else: ++ SALOME_TMP_DIR = '/tmp' ++ n=random.random() ++ self.outputMesh= os.path.join(SALOME_TMP_DIR,'top2Vol_' + str(n) + '.mesh') ++ shellCmd+= " --out " + self.outputMesh ++ myMonitorView=Topo2VolMeshMonitor(self, shellCmd) ++ ++ def OnQpbCloseClicked(self): ++ self.close() ++ ++ def saveOutputMesh(self): ++ if not os.path.isfile(self.outputMesh): ++ QMessageBox.warning(self, "Compute", "Result file " + self.outputMesh + " not found") ++ return False ++ ++ import salome ++ import SMESH, SALOMEDS ++ from salome.smesh import smeshBuilder ++ smesh = smeshBuilder.New() ++ meshName=str(self.qleMeshFile.text()) ++ meshName=os.path.basename(os.path.splitext(meshName)[0])#.replace('-','_').replace(' ','') ++ meshName= 'Top2Vol_' + meshName ++ ++ (outputMesh, status) = smesh.CreateMeshesFromGMF(self.outputMesh) ++ smesh.SetName(outputMesh.GetMesh(), meshName) ++ if salome.sg.hasDesktop(): ++ salome.sg.updateObjBrowser() ++ return True ++ ++__instance = None ++ ++def getInstance(): ++ """ ++ This function returns a singleton instance of the plugin dialog. ++ It is mandatory in order to call show without a parent ... ++ """ ++ global __instance ++ if __instance is None: ++ __instance = Topo2VolMeshPluginDialog() ++ return __instance ++ +diff --git a/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPluginDialog.ui b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPluginDialog.ui +new file mode 100755 +index 0000000..9a9ea35 +--- /dev/null ++++ b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPluginDialog.ui +@@ -0,0 +1,268 @@ ++ ++ ++ Topo2VolMeshMainFrame ++ ++ ++ ++ 0 ++ 0 ++ 779 ++ 389 ++ ++ ++ ++ Tetra Mesh from cloud of x y points mesh generator ++ ++ ++ ++ ++ 10 ++ 10 ++ 761 ++ 120 ++ ++ ++ ++ ++ 10 ++ ++ ++ ++ Input Mesh ++ ++ ++ ++ ++ 10 ++ 50 ++ 190 ++ 31 ++ ++ ++ ++ ++ 10 ++ ++ ++ ++ Mesh File XY format ++ ++ ++ ++ 18 ++ 18 ++ ++ ++ ++ ++ ++ ++ 220 ++ 50 ++ 481 ++ 31 ++ ++ ++ ++ ++ 10 ++ ++ ++ ++ ++ ++ ++ ++ 10 ++ 150 ++ 761 ++ 201 ++ ++ ++ ++ Options ++ ++ ++ ++ ++ 40 ++ 30 ++ 62 ++ 22 ++ ++ ++ ++ 0 ++ ++ ++ 999999999 ++ ++ ++ 10 ++ ++ ++ ++ ++ ++ 120 ++ 30 ++ 551 ++ 20 ++ ++ ++ ++ Number of points in X direction ++ ++ ++ ++ ++ ++ 40 ++ 70 ++ 62 ++ 22 ++ ++ ++ ++ 0 ++ ++ ++ 999999999 ++ ++ ++ 10 ++ ++ ++ ++ ++ ++ 40 ++ 110 ++ 62 ++ 22 ++ ++ ++ ++ 0 ++ ++ ++ 999999999 ++ ++ ++ 10 ++ ++ ++ ++ ++ ++ 120 ++ 70 ++ 551 ++ 20 ++ ++ ++ ++ Number of points in Y direction ++ ++ ++ ++ ++ ++ 120 ++ 110 ++ 551 ++ 20 ++ ++ ++ ++ Number of points in Z direction ++ ++ ++ ++ ++ ++ 40 ++ 150 ++ 62 ++ 22 ++ ++ ++ ++ -999999999 ++ ++ ++ 999999999 ++ ++ ++ 0 ++ ++ ++ ++ ++ ++ 120 ++ 150 ++ 551 ++ 20 ++ ++ ++ ++ Depth in Z direction ++ ++ ++ ++ ++ ++ ++ 10 ++ 360 ++ 761 ++ 26 ++ ++ ++ ++ ++ ++ ++ Compute ++ ++ ++ ++ ++ ++ ++ Close ++ ++ ++ ++ ++ ++ ++ Qt::Horizontal ++ ++ ++ ++ 40 ++ 20 ++ ++ ++ ++ ++ ++ ++ ++ ++ 10 ++ ++ ++ ++ Help ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPlugin_plugin.py b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPlugin_plugin.py +new file mode 100755 +index 0000000..a17b00c +--- /dev/null ++++ b/src/Tools/Topo2VolMeshPlug/Topo2VolMeshPlugin_plugin.py +@@ -0,0 +1,37 @@ ++# -*- coding: utf-8 -*- ++# Copyright (C) 2013-2020 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, 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 ++# 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 ++# ++ ++# 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 ++ ++def Topo2VolMeshLct(context): ++ # get context study, salomeGui ++ study = context.study ++ sg = context.sg ++ ++ import os ++ import subprocess ++ import tempfile ++ from qtsalome import QFileDialog, QMessageBox ++ ++ import Topo2VolMeshPluginDialog ++ window = Topo2VolMeshPluginDialog.getDialog() ++ window.show() ++ +diff --git a/src/Tools/smesh_plugins.py b/src/Tools/smesh_plugins.py +index 7c72682..134965c 100644 +--- a/src/Tools/smesh_plugins.py ++++ b/src/Tools/smesh_plugins.py +@@ -91,3 +91,14 @@ except Exception as e: + #print 'probleme zcracks' + salome_pluginsmanager.logger.info('ERROR: Zcrack plug-in is unavailable: {}'.format(e)) + pass ++ ++# Topological to volumic mesh plugin ++try: ++ from Topo2VolMeshPlugin import Topo2VolMeshLct ++ salome_pluginsmanager.AddFunction('Run Topological Volumic mesher', ++ 'run topological volumic meshing', ++ Topo2VolMeshLct) ++except Exception as e: ++ #print 'probleme zcracks' ++ salome_pluginsmanager.logger.info('ERROR: topo2volmesh plug-in is unavailable: {}'.format(e)) ++ pass diff --git a/products/patches/topo2volmesh-0.0.1-00001.patch b/products/patches/topo2volmesh-0.0.1-00001.patch new file mode 100644 index 0000000..2af2c03 --- /dev/null +++ b/products/patches/topo2volmesh-0.0.1-00001.patch @@ -0,0 +1,74 @@ +diff -pruN Top2VolMesher_ref/CMakeLists.txt Topo2VolMesh/CMakeLists.txt +--- Topo2VolMesh_ref/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 ++++ Topo2VolMesh/CMakeLists.txt 2020-08-03 11:06:43.200739464 +0200 +@@ -0,0 +1,47 @@ ++# Copyright (C) 2012-2020 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, 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 ++# 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 ++# ++CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) ++if (NOT DEFINED CMAKE_BUILD_TYPE) ++ set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type") ++endif () ++PROJECT(Topo2VolMesh C CXX) ++ ++# Versioning ++# =========== ++# Project name, upper case ++STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) ++ ++SET(${PROJECT_NAME_UC}_MAJOR_VERSION 1) ++SET(${PROJECT_NAME_UC}_MINOR_VERSION 0) ++SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) ++SET(${PROJECT_NAME_UC}_VERSION ++ ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) ++SET(${PROJECT_NAME_UC}_VERSION_DEV 1) ++ ++# Sources ++# ======== ++if(WIN32) ++ set(WIN32 1) ++ add_definitions(-DWIN32) ++else(WIN32) ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") ++endif(WIN32) ++ ++ADD_SUBDIRECTORY(src) ++ +diff -pruN Topo2VolMesh_ref/src/CMakeLists.txt Topo2VolMesh/src/CMakeLists.txt +--- Topo2VolMesh_ref/src/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 ++++ Topo2VolMesh/src/CMakeLists.txt 2020-08-03 11:14:25.553942048 +0200 +@@ -0,0 +1,8 @@ ++add_executable (Top2Vol-Mesher Top2Vol-Mesher.cpp) ++IF(WIN32) ++ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/Top2Vol-Mesher.exe ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) ++ELSE(WIN32) ++ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/Top2Vol-Mesher ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin RENAME Top2Vol-Mesher.exe) ++ENDIF(WIN32) +diff -pruN Topo2VolMesh_ref/src/Top2Vol-Mesher.cpp Topo2VolMesh/src/Top2Vol-Mesher.cpp +--- Topo2VolMesh_ref/src/Top2Vol-Mesher.cpp 2020-03-04 10:51:22.000000000 +0100 ++++ Topo2VolMesh/src/Top2Vol-Mesher.cpp 2020-08-03 11:16:04.563854456 +0200 +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + using namespace std; + + diff --git a/products/topo2volmesh.pyconf b/products/topo2volmesh.pyconf new file mode 100644 index 0000000..10a44cf --- /dev/null +++ b/products/topo2volmesh.pyconf @@ -0,0 +1,34 @@ +default : +{ + name : "topo2volmesh" + build_source : "cmake" + compil_script : $name + $VARS.scriptExtension + get_source : "archive" + system_info : + { + rpm : [] + rpm_dev : [] + apt : [] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + patches : [] + depend : [] + build_depend : ["cmake"] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + single_install_dir : "yes" + } +} + +version_0_0_1: +{ + patches : ['topo2volmesh-0.0.1-00001.patch'] +}