From: prascle Date: Fri, 5 Apr 2013 09:15:06 +0000 (+0000) Subject: PR: adaptation to new geometry and mesh packaging (geomBuilder, smeshBuilder) X-Git-Tag: V7_2_0~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cfd3fe5289299191bd72022244f1f66dcd533776;p=plugins%2Fghs3dprlplugin.git PR: adaptation to new geometry and mesh packaging (geomBuilder, smeshBuilder) --- diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/Makefile.am b/doc/salome/gui/GHS3DPRLPLUGIN/Makefile.am index e6552f1..b6d0a75 100755 --- a/doc/salome/gui/GHS3DPRLPLUGIN/Makefile.am +++ b/doc/salome/gui/GHS3DPRLPLUGIN/Makefile.am @@ -27,10 +27,7 @@ DOC_PYTHONPATH=$(prefix)/bin/salome:$(SMESH_ROOT_DIR)/bin/salome:$(SMESH_ROOT_DI DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${MED_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome DOC_SMESH_MeshersList=GHS3DPRLPlugin -smesh.py: $(top_srcdir)/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py - @PYTHONPATH=$(DOC_PYTHONPATH):${PYTHONPATH} LD_LIBRARY_PATH=$(DOC_LD_LIBRARY_PATH):${LD_LIBRARY_PATH} SMESH_MeshersList=$(DOC_SMESH_MeshersList) $(PYTHON) $(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py -d -o $@ GHS3DPRLPlugin - -usr_docs: doxyfile_py doxyfile smesh.py +usr_docs: doxyfile_py doxyfile @$(DOXYGEN) doxyfile_py ; \ $(DOXYGEN) doxyfile diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile.in b/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile.in index 97f3775..f27489e 100755 --- a/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile.in +++ b/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile.in @@ -77,4 +77,9 @@ GENERATE_RTF = NO #rnv: 07.04.2011 Workaround for the doxygen 1.7.3: #because it wrongly defines location of the html files for search. TAGFILES = ghs3dprlpluginpy_doc.tag=../GHS3DPRLPLUGIN/ghs3dprlpluginpy_doc -SEARCHENGINE = YES \ No newline at end of file +SEARCHENGINE = YES + +#--------------------------------------------------------------------------- +#Custom commands +#--------------------------------------------------------------------------- +ALIASES += tui_script{1}="\include \1 Download this script" diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile_py.in b/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile_py.in index 9ad955e..841b2f5 100755 --- a/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile_py.in +++ b/doc/salome/gui/GHS3DPRLPLUGIN/doxyfile_py.in @@ -96,9 +96,9 @@ EXAMPLE_RECURSIVE = NO #--------------------------------------------------------------------------- #Input related options #--------------------------------------------------------------------------- -INPUT = @top_srcdir@/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py \ - smesh.py \ - @SMESH_ROOT_DIR@/bin/salome/smesh_algorithm.py +INPUT = @top_srcdir@/src/GHS3DPRLPlugin/GHS3DPRLPluginBuilder.py \ + @SMESH_ROOT_DIR@/lib/python@PYTHON_VERSION@/site-packages/salome/salome/smesh/smeshBuilder.py \ + @SMESH_ROOT_DIR@/lib/python@PYTHON_VERSION@/site-packages/salome/salome/smesh/smesh_algorithm.py FILE_PATTERNS = IMAGE_PATH = @srcdir@/images RECURSIVE = NO diff --git a/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprlplugin_python_interface.doc b/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprlplugin_python_interface.doc index 8ef266e..1f96f76 100644 --- a/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprlplugin_python_interface.doc +++ b/doc/salome/gui/GHS3DPRLPLUGIN/input/ghs3dprlplugin_python_interface.doc @@ -2,8 +2,8 @@ \page ghs3dprlplugin_python_interface_page Python Interface -Python package GHS3DPRLPluginDC defines several classes, destined for creation of the 3D meshes. +Python package GHS3DPRLPlugin defines several classes, destined for creation of the 3D meshes. -GHS3DPRL meshing plugin dynamically adds several methods to the smesh.Mesh class to create meshing algorithms. +GHS3DPRL meshing plugin dynamically adds several methods to the \ref SMESH_SWIG.smeshBuilder.Mesh "class Mesh" class to create meshing algorithms. */ diff --git a/idl/Makefile.am b/idl/Makefile.am index 135fc9f..0ab2ea2 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2013 CEA/DEN, EDF R&D +# Copyright (C) 2004-2013 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 @@ -17,10 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# --- -# File : Makefile.am -# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) -# --- # This Makefile is responsible of generating the client and server # implementation of IDL interfaces for both C++ and python usage. # The building process of the C++ files is in charge of each source @@ -39,33 +35,40 @@ dist_salomeidl_DATA = $(BASEIDL_FILES) lib_LTLIBRARIES = libSalomeIDLGHS3DPRLPLUGIN.la # Sources built from idl files -nodist_libSalomeIDLGHS3DPRLPLUGIN_la_SOURCES = GHS3DPRLPlugin_AlgorithmSK.cc +nodist_libSalomeIDLGHS3DPRLPLUGIN_la_SOURCES = \ + GHS3DPRLPlugin_AlgorithmSK.cc \ + GHS3DPRLPlugin_AlgorithmDynSK.cc +GHS3DPRLPlugin_AlgorithmDynSK.cc: GHS3DPRLPlugin_AlgorithmSK.cc # header files must be exported: other modules have to use this library nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh) libSalomeIDLGHS3DPRLPLUGIN_la_CPPFLAGS = \ + -I$(top_builddir)/idl \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ $(KERNEL_CXXFLAGS) \ $(GEOM_CXXFLAGS) \ - $(SMESH_CXXFLAGS) \ - @CORBA_CXXFLAGS@ \ - @CORBA_INCLUDES@ \ - -I$(top_builddir)/idl + $(MED_CXXFLAGS) \ + $(SMESH_CXXFLAGS) libSalomeIDLGHS3DPRLPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0 libSalomeIDLGHS3DPRLPLUGIN_la_LIBADD = \ $(KERNEL_LDFLAGS) -lSalomeIDLKernel \ - $(SMESH_LDFLAGS) -lSalomeIDLSMESH \ $(GEOM_LDFLAGS) -lSalomeIDLGEOM \ + $(MED_LDFLAGS) -lSalomeIDLMED \ + $(SMESH_LDFLAGS) -lSalomeIDLSMESH \ @CORBA_LIBS@ # These variables defines the building process of CORBA files OMNIORB_IDL = @OMNIORB_IDL@ OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@ -OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ \ +OMNIORB_IDLPYFLAGS = \ + @OMNIORB_IDLPYFLAGS@ \ -I$(top_builddir)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(GEOM_ROOT_DIR)/idl/salome \ + -I$(MED_ROOT_DIR)/idl/salome \ -I$(SMESH_ROOT_DIR)/idl/salome IDLCXXFLAGS = \ @@ -74,11 +77,13 @@ IDLCXXFLAGS = \ -I$(top_builddir)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(GEOM_ROOT_DIR)/idl/salome \ + -I$(MED_ROOT_DIR)/idl/salome \ -I$(SMESH_ROOT_DIR)/idl/salome IDLPYFLAGS = \ @IDLPYFLAGS@ \ -I$(KERNEL_ROOT_DIR)/idl/salome \ -I$(GEOM_ROOT_DIR)/idl/salome \ + -I$(MED_ROOT_DIR)/idl/salome \ -I$(SMESH_ROOT_DIR)/idl/salome # potential problem on parallel make on the following - multiple outputs @@ -116,7 +121,7 @@ mostlyclean-local: @for dep in $^ dummy; do \ if [ $$dep != "dummy" ]; then \ echo Building dependencies for $$dep; \ - $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \ + $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \ sed 's/\.o/\SK.cc/' >>$@; \ fi; \ done ; diff --git a/resources/GHS3DPRLPlugin.xml b/resources/GHS3DPRLPlugin.xml index d630a4a..c7e4816 100755 --- a/resources/GHS3DPRLPlugin.xml +++ b/resources/GHS3DPRLPlugin.xml @@ -43,7 +43,7 @@ input="TRIA,QUAD" dim="3"> - GHS3DPRL_3D=Tetrahedron(algo=smesh.GHS3DPRL) + GHS3DPRL_3D=Tetrahedron(algo=smeshBuilder.GHS3DPRL) GHS3DPRL_Parameters=Parameters() diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPluginBuilder.py b/src/GHS3DPRLPlugin/GHS3DPRLPluginBuilder.py new file mode 100644 index 0000000..85680ce --- /dev/null +++ b/src/GHS3DPRLPlugin/GHS3DPRLPluginBuilder.py @@ -0,0 +1,116 @@ +# Copyright (C) 2007-2013 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 +# + +## +# @package GHS3DPRLPluginBuilder +# Python API for the GHS3DPRL meshing plug-in module. + +from salome.smesh.smesh_algorithm import Mesh_Algorithm +from salome.smesh.smeshBuilder import 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 + +#---------------------------- +# Mesh algo type identifiers +#---------------------------- + +## Algorithm type: GHS3DPRL tetrahedron 3D algorithm, see GHS3DPRL_Algorithm +GHS3DPRL = "GHS3DPRL_3D" + +#---------------------------- +# Algorithms +#---------------------------- + +## Tetrahedron GHS3DPRL 3D algorithm +# +# It is created by calling smesh.Mesh.Tetrahedron( smesh.GHS3DPRL, geom=0 ) +class GHS3DPRL_Algorithm(Mesh_Algorithm): + + ## name of the dynamic method in smesh.Mesh class + # @internal + meshMethod = "Tetrahedron" + ## type of algorithm used with helper function in smesh.Mesh class + # @internal + algoType = GHS3DPRL + ## doc string of the method in smesh.Mesh class + # @internal + docHelper = "Creates tetrahedron 3D algorithm for volumes" + + ## Private constructor. + # @param mesh parent mesh object algorithm is assigned to + # @param geom geometry (shape/sub-shape) algorithm is assigned to; + # if it is @c 0 (default), the algorithm is assigned to the main shape + def __init__(self, mesh, geom=0): + Mesh_Algorithm.__init__(self) + if noGHS3DPRLPlugin: print "Warning: GHS3DPRLPlugin module unavailable" + self.Create(mesh, geom, self.algoType, "libGHS3DPRLEngine.so") + pass + + ## Defines hypothesis having several parameters + # @return hypothesis object + def Parameters(self): + if not self.params: + self.params = self.Hypothesis("GHS3DPRL_Parameters", [], + "libGHS3DPRLEngine.so", UseExisting=0) + pass + return self.params + + ## To keep working files or remove them. Log file remains in case of errors anyway. + # @param toKeep "keep working files" flag value + def SetKeepFiles(self, toKeep): + self.Parameters().SetKeepFiles(toKeep) + pass + + ## Sets MED files name and path. + # @param value MED file name + def SetMEDName(self, value): + self.Parameters().SetMEDName(value) + pass + + ## Sets the number of partition of the initial mesh + # @param value number of partition value + def SetNbPart(self, value): + self.Parameters().SetNbPart(value) + pass + + ## When big mesh, start tepal in background + # @param value "background mode" flag value + def SetBackground(self, value): + self.Parameters().SetBackground(value) + pass + + ## To mesh "holes" in a solid or not. Default is to mesh. + # @param toMesh "mesh holes" flag value + def SetToMeshHoles(self, toMesh): + self.Parameters().SetToMeshHoles(toMesh) + pass + + pass # end of GHS3DPRL_Algorithm class diff --git a/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py b/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py deleted file mode 100644 index e8a5bd7..0000000 --- a/src/GHS3DPRLPlugin/GHS3DPRLPluginDC.py +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (C) 2007-2013 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 -# - -## -# @package GHS3DPRLPluginDC -# Python API for the GHS3DPRL meshing plug-in module. - -from smesh_algorithm import Mesh_Algorithm -from smesh import 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 - -#---------------------------- -# Mesh algo type identifiers -#---------------------------- - -## Algorithm type: GHS3DPRL tetrahedron 3D algorithm, see GHS3DPRL_Algorithm -GHS3DPRL = "GHS3DPRL_3D" - -#---------------------------- -# Algorithms -#---------------------------- - -## Tetrahedron GHS3DPRL 3D algorithm -# -# It is created by calling smesh.Mesh.Tetrahedron( smesh.GHS3DPRL, geom=0 ) -class GHS3DPRL_Algorithm(Mesh_Algorithm): - - ## name of the dynamic method in smesh.Mesh class - # @internal - meshMethod = "Tetrahedron" - ## type of algorithm used with helper function in smesh.Mesh class - # @internal - algoType = GHS3DPRL - ## doc string of the method in smesh.Mesh class - # @internal - docHelper = "Creates tetrahedron 3D algorithm for volumes" - - ## Private constructor. - # @param mesh parent mesh object algorithm is assigned to - # @param geom geometry (shape/sub-shape) algorithm is assigned to; - # if it is @c 0 (default), the algorithm is assigned to the main shape - def __init__(self, mesh, geom=0): - Mesh_Algorithm.__init__(self) - if noGHS3DPRLPlugin: print "Warning: GHS3DPRLPlugin module unavailable" - self.Create(mesh, geom, self.algoType, "libGHS3DPRLEngine.so") - pass - - ## Defines hypothesis having several parameters - # @return hypothesis object - def Parameters(self): - if not self.params: - self.params = self.Hypothesis("GHS3DPRL_Parameters", [], - "libGHS3DPRLEngine.so", UseExisting=0) - pass - return self.params - - ## To keep working files or remove them. Log file remains in case of errors anyway. - # @param toKeep "keep working files" flag value - def SetKeepFiles(self, toKeep): - self.Parameters().SetKeepFiles(toKeep) - pass - - ## Sets MED files name and path. - # @param value MED file name - def SetMEDName(self, value): - self.Parameters().SetMEDName(value) - pass - - ## Sets the number of partition of the initial mesh - # @param value number of partition value - def SetNbPart(self, value): - self.Parameters().SetNbPart(value) - pass - - ## When big mesh, start tepal in background - # @param value "background mode" flag value - def SetBackground(self, value): - self.Parameters().SetBackground(value) - pass - - ## To mesh "holes" in a solid or not. Default is to mesh. - # @param toMesh "mesh holes" flag value - def SetToMeshHoles(self, toMesh): - self.Parameters().SetToMeshHoles(toMesh) - pass - - pass # end of GHS3DPRL_Algorithm class diff --git a/src/GHS3DPRLPlugin/Makefile.am b/src/GHS3DPRLPlugin/Makefile.am index c77f847..89ab43b 100644 --- a/src/GHS3DPRLPlugin/Makefile.am +++ b/src/GHS3DPRLPlugin/Makefile.am @@ -56,12 +56,16 @@ libGHS3DPRLEngine_la_CPPFLAGS = \ -I$(top_builddir)/idl libGHS3DPRLEngine_la_LDFLAGS = \ - ../../idl/libSalomeIDLGHS3DPRLPLUGIN.la \ - $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \ - $(KERNEL_LDFLAGS) -lSalomeGenericObj -lSALOMELocalTrace \ + ../../idl/libSalomeIDLGHS3DPRLPLUGIN.la \ + $(CAS_KERNEL) -lTKBRep -lTKG2d -lTKG3d -lTKTopAlgo -lTKGeomBase -lTKGeomAlgo -lTKCDF \ $(MED_LDFLAGS) -lSalomeIDLMED \ - $(CAS_LDFLAGS) -lTKBRep -lTKG3d -lTKTopAlgo\ - $(SMESH_LDFLAGS) -lSMDS -lSMESHDS -lTKG2d + $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lSMESHDS -lSMDS -lStdMeshers -lMeshDriverGMF \ + $(KERNEL_LDFLAGS) -lSalomeGenericObj -lSALOMELocalTrace -lSALOMEBasics -lSalomeNS -lOpUtil # Scripts to be installed. -dist_salomescript_DATA= GHS3DPRLPluginDC.py +#dist_salomescript_DATA= GHS3DPRLPluginDC.py +mypkgpythondir = $(salomepythondir)/salome/GHS3DPRLPlugin +mypkgpython_PYTHON = \ + __init__.py \ + GHS3DPRLPluginBuilder.py + diff --git a/src/GHS3DPRLPlugin/__init__.py b/src/GHS3DPRLPlugin/__init__.py new file mode 100644 index 0000000..72bdea5 --- /dev/null +++ b/src/GHS3DPRLPlugin/__init__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2007-2013 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 +# + +## +# @package GHS3DPluginBuilder +# Python API for the GHS3D meshing plug-in module. + diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 4821988..d69217c 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -59,11 +59,14 @@ libGHS3DPRLPluginGUI_la_CPPFLAGS = \ -I$(top_builddir)/idl libGHS3DPRLPluginGUI_la_LDFLAGS = \ + ../../idl/libSalomeIDLGHS3DPRLPLUGIN.la \ $(QT_LIBS) \ - ../GHS3DPRLPlugin/libGHS3DPRLEngine.la \ - ${SMESH_LDFLAGS} -lSMESH \ - $(CAS_KERNEL) \ - $(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp + $(KERNEL_LDFLAGS) -lSALOMELocalTrace \ + $(MED_LDFLAGS) -lSalomeIDLMED \ + $(GEOM_LDFLAGS) -lGEOM \ + $(SMESH_LDFLAGS) -lSMESH -lGeomSelectionTools -lStdMeshersGUI -lSMESHFiltersSelection \ + $(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp \ + $(CAS_KERNEL) # resources files nodist_salomeres_DATA = \