From 5e1cfe70db0966728aff50c2d2796bf13bb3614f Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 17 Feb 2009 07:15:34 +0000 Subject: [PATCH] Merge from BR_V5_DEV 16Feb09 --- Makefile.am | 33 +- NETGENPLUGIN_version.h.in | 36 +- adm_local/Makefile.am | 41 +- adm_local/unix/Makefile.am | 40 +- adm_local/unix/config_files/Makefile.am | 43 +- adm_local/unix/config_files/check_NETGEN.m4 | 29 +- .../unix/config_files/check_NETGENPLUGIN.m4 | 21 + adm_local/unix/make_common_starter.am | 68 ++- bin/Makefile.am | 53 +- build_configure | 27 +- clean_configure | 35 ++ configure.ac | 38 +- idl/Makefile.am | 57 +- idl/NETGENPlugin_Algorithm.idl | 102 +++- resources/Makefile.am | 34 +- resources/NETGENPlugin.xml | 45 +- resources/SalomeApp.xml | 32 ++ resources/mesh_tree_algo_netgen.png | Bin 0 -> 148 bytes src/GUI/Makefile.am | 19 +- src/GUI/NETGENPluginGUI.cxx | 48 +- src/GUI/NETGENPluginGUI.h | 36 ++ src/GUI/NETGENPluginGUI_HypothesisCreator.cxx | 242 +++++--- src/GUI/NETGENPluginGUI_HypothesisCreator.h | 80 ++- src/GUI/NETGENPluginGUI_SimpleCreator.cxx | 418 ++++++++++++++ src/GUI/NETGENPluginGUI_SimpleCreator.h | 78 +++ src/GUI/NETGENPlugin_images.po | 59 -- src/GUI/NETGENPlugin_images.ts | 73 +++ src/GUI/NETGENPlugin_msg_en.po | 84 --- src/GUI/NETGENPlugin_msg_en.ts | 137 +++++ src/Makefile.am | 42 +- src/NETGEN/Makefile.am | 19 +- src/NETGEN/netgen45ForSalome.patch | 301 +++++++--- src/NETGEN/netgen45lib64.patch | 6 +- src/NETGENPlugin/Makefile.am | 37 +- src/NETGENPlugin/NETGENPlugin_Defs.hxx | 32 +- src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx | 62 ++- src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx | 51 +- .../NETGENPlugin_Hypothesis_2D.cxx | 43 +- .../NETGENPlugin_Hypothesis_2D.hxx | 43 +- .../NETGENPlugin_Hypothesis_2D_i.cxx | 42 +- .../NETGENPlugin_Hypothesis_2D_i.hxx | 43 +- .../NETGENPlugin_Hypothesis_i.cxx | 42 +- .../NETGENPlugin_Hypothesis_i.hxx | 43 +- src/NETGENPlugin/NETGENPlugin_Mesher.cxx | 517 ++++++++++++++++-- src/NETGENPlugin/NETGENPlugin_Mesher.hxx | 66 ++- src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx | 65 +-- src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx | 47 +- src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx | 62 ++- src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx | 47 +- .../NETGENPlugin_NETGEN_2D3D_i.cxx | 43 +- .../NETGENPlugin_NETGEN_2D3D_i.hxx | 43 +- .../NETGENPlugin_NETGEN_2D_ONLY.cxx | 49 +- .../NETGENPlugin_NETGEN_2D_ONLY.hxx | 32 +- .../NETGENPlugin_NETGEN_2D_ONLY_i.cxx | 45 +- .../NETGENPlugin_NETGEN_2D_ONLY_i.hxx | 45 +- src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx | 43 +- src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx | 43 +- src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx | 171 ++++-- src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx | 32 +- src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx | 45 +- src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx | 45 +- .../NETGENPlugin_SimpleHypothesis_2D.cxx | 224 ++++++++ .../NETGENPlugin_SimpleHypothesis_2D.hxx | 106 ++++ .../NETGENPlugin_SimpleHypothesis_2D_i.cxx | 195 +++++++ .../NETGENPlugin_SimpleHypothesis_2D_i.hxx | 75 +++ .../NETGENPlugin_SimpleHypothesis_3D.cxx | 152 +++++ .../NETGENPlugin_SimpleHypothesis_3D.hxx | 68 +++ .../NETGENPlugin_SimpleHypothesis_3D_i.cxx | 135 +++++ .../NETGENPlugin_SimpleHypothesis_3D_i.hxx | 66 +++ src/NETGENPlugin/NETGENPlugin_i.cxx | 51 +- src/NETGENPlugin/NETGENPlugin_icons.po | 20 - 71 files changed, 4028 insertions(+), 1318 deletions(-) create mode 100755 clean_configure create mode 100644 resources/SalomeApp.xml create mode 100644 resources/mesh_tree_algo_netgen.png create mode 100755 src/GUI/NETGENPluginGUI.h create mode 100644 src/GUI/NETGENPluginGUI_SimpleCreator.cxx create mode 100644 src/GUI/NETGENPluginGUI_SimpleCreator.h delete mode 100755 src/GUI/NETGENPlugin_images.po create mode 100644 src/GUI/NETGENPlugin_images.ts delete mode 100755 src/GUI/NETGENPlugin_msg_en.po create mode 100644 src/GUI/NETGENPlugin_msg_en.ts create mode 100644 src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx create mode 100644 src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx create mode 100644 src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx create mode 100644 src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx create mode 100644 src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx create mode 100644 src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx create mode 100644 src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx create mode 100644 src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx delete mode 100644 src/NETGENPlugin/NETGENPlugin_icons.po diff --git a/Makefile.am b/Makefile.am index 00c1a60..893cd5c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,6 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or @@ -15,26 +17,41 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # -* Makefile *- -# # Author : Patrick GOLDBRONN (CEA) # Date : 28/06/2001 # Modified by : Alexander BORODIN (OCN) - autotools usage # - include $(top_srcdir)/adm_local/unix/make_common_starter.am +if NETGENPLUGIN_ENABLE_GUI + ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ + -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ + -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ + -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ + -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ + -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files +else !NETGENPLUGIN_ENABLE_GUI + ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ + -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ + -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ + -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ + -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files +endif + SUBDIRS = idl adm_local resources src bin DIST_SUBDIRS = idl adm_local resources src bin DISTCLEANFILES = a.out aclocal.m4 configure -salomeinclude_DATA=NETGENPLUGIN_version.h +salomeinclude_DATA = NETGENPLUGIN_version.h -EXTRA_DIST+= \ +EXTRA_DIST += \ build_configure \ - clean_configure \ - LICENCE + clean_configure + +dist-hook: + rm -rf `find $(distdir) -name CVS` diff --git a/NETGENPLUGIN_version.h.in b/NETGENPLUGIN_version.h.in index 349432e..8f1132a 100644 --- a/NETGENPLUGIN_version.h.in +++ b/NETGENPLUGIN_version.h.in @@ -1,26 +1,28 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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. +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE // -// 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 +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// See http://www.salome-platform.org/ +// 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 // // File : NETGENPLUGIN_version.h // Author : Vadim SANDLER // Module : SALOME - +// #if !defined(__NETGENPLUGIN_VERSION_H__) #define __NETGENPLUGIN_VERSION_H__ diff --git a/adm_local/Makefile.am b/adm_local/Makefile.am index 7ae83a6..f35273f 100644 --- a/adm_local/Makefile.am +++ b/adm_local/Makefile.am @@ -1,19 +1,24 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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 -# +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + SUBDIRS = unix diff --git a/adm_local/unix/Makefile.am b/adm_local/unix/Makefile.am index facd4e6..5f6d5f7 100644 --- a/adm_local/unix/Makefile.am +++ b/adm_local/unix/Makefile.am @@ -1,22 +1,24 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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 -# - +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 +# include $(top_srcdir)/adm_local/unix/make_common_starter.am SUBDIRS = config_files diff --git a/adm_local/unix/config_files/Makefile.am b/adm_local/unix/config_files/Makefile.am index 2277a68..ef7b6d6 100644 --- a/adm_local/unix/config_files/Makefile.am +++ b/adm_local/unix/config_files/Makefile.am @@ -1,23 +1,26 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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 -# +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 +# include $(top_srcdir)/adm_local/unix/make_common_starter.am -dist_admlocalm4_DATA= \ - check_NETGEN.m4 \ +dist_admlocalm4_DATA = \ + check_NETGEN.m4 \ check_NETGENPLUGIN.m4 diff --git a/adm_local/unix/config_files/check_NETGEN.m4 b/adm_local/unix/config_files/check_NETGEN.m4 index 97947eb..c33735f 100644 --- a/adm_local/unix/config_files/check_NETGEN.m4 +++ b/adm_local/unix/config_files/check_NETGEN.m4 @@ -1,3 +1,24 @@ +dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +dnl +dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +dnl AC_DEFUN([CHECK_NETGEN],[ AC_REQUIRE([AC_PROG_CXX])dnl @@ -83,8 +104,8 @@ if test "x$NETGEN_HOME" != "x"; then LDFLAGS_old="$LDFLAGS" LDFLAGS="-L. -lNETGEN $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS" - AC_TRY_COMPILE(#include -#include + AC_TRY_COMPILE(#include +#include namespace nglib { #include "nglib.h" } @@ -108,8 +129,8 @@ namespace nglib { AC_CACHE_VAL(salome_netgen_lib,[ AC_TRY_LINK( -#include -#include +#include +#include namespace nglib { #include "nglib.h" } diff --git a/adm_local/unix/config_files/check_NETGENPLUGIN.m4 b/adm_local/unix/config_files/check_NETGENPLUGIN.m4 index 23e916f..9ceac78 100644 --- a/adm_local/unix/config_files/check_NETGENPLUGIN.m4 +++ b/adm_local/unix/config_files/check_NETGENPLUGIN.m4 @@ -1,3 +1,24 @@ +dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +dnl +dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +dnl #------------------------------------------------------------ # Check availability of Salome NETGEN mesh plugin module # distribution diff --git a/adm_local/unix/make_common_starter.am b/adm_local/unix/make_common_starter.am index 5339413..36ad8c3 100644 --- a/adm_local/unix/make_common_starter.am +++ b/adm_local/unix/make_common_starter.am @@ -1,49 +1,83 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 # # ============================================================ # This file defines the common definitions used in several # Makefile. This file must be included, if needed, by the file # Makefile.am. # ============================================================ -# - # Standard directory for installation -salomeincludedir = $(includedir)/@PACKAGE@ -libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/@PACKAGE@ -bindir = $(prefix)/bin/@PACKAGE@ +# +salomeincludedir = $(includedir)/salome +libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome +bindir = $(prefix)/bin/salome salomescriptdir = $(bindir) +salomepythondir = $(pythondir)/salome +salomepyexecdir = $(pyexecdir)/salome # Directory for installing idl files -salomeidldir = $(prefix)/idl/@PACKAGE@ +salomeidldir = $(prefix)/idl/salome # Directory for installing resource files -salomeresdir = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@ +salomeresdir = $(prefix)/share/salome/resources/@MODULE_NAME@ # Directories for installing admin files -admlocaldir = $(prefix)/adm_local -admlocalunixdir = $(admlocaldir)/unix -admlocalm4dir = $(admlocaldir)/unix/config_files +admlocaldir = $(prefix)/adm_local +admlocalunixdir = $(admlocaldir)/unix +admlocalm4dir = $(admlocaldir)/unix/config_files # Shared modules installation directory -sharedpkgpythondir =$(pkgpythondir)/shared_modules +sharedpkgpythondir = $(salomepythondir)/shared_modules # Documentation directory -docdir = $(datadir)/doc/@PACKAGE@ +docdir = $(datadir)/doc/salome # common rules -# moc-files generation +# meta object implementation files generation (moc) %_moc.cxx: %.h $(MOC) $< -o $@ -# qm-files generation -%.qm: %.po - $(MSG2QM) $< $@ +# translation (*.qm) files generation (lrelease) +%.qm: %.ts + $(LRELEASE) $< -qm $@ -EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.po) +# resource files generation (qrcc) +qrc_%.cxx: %.qrc + $(QRCC) $< -o $@ -name $(*F) +# qt forms files generation (uic) +ui_%.h: %.ui + $(UIC) -o $@ $< + +# extra distributed files +EXTRA_DIST = $(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cxx=%.qrc) \ + $(UIC_FILES:ui_%.h=%.ui) $(nodist_salomeres_DATA:%.qm=%.ts) + +# customize clean operation mostlyclean-local: rm -f @builddir@/*_moc.cxx rm -f @builddir@/*.qm + rm -f @builddir@/ui_*.h + rm -f @builddir@/qrc_*.cxx # tests tests: unittest diff --git a/bin/Makefile.am b/bin/Makefile.am index 4fdbc53..88eceb7 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -1,36 +1,33 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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 *- +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE # +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 (CSSI) # Module : KERNEL # $Header$ # - include $(top_srcdir)/adm_local/unix/make_common_starter.am -# -# =============================================================== -# Files to be installed -# =============================================================== -# +# non-distributed files +nodist_salomescript_DATA = VERSION -# These files are data, module or lib files -nodist_salomescript_DATA= VERSION - -EXTRA_DIST+= VERSION.in +# distributed files +dist_salomescript_SCRIPTS = diff --git a/build_configure b/build_configure index c97ecba..4e3b7e4 100755 --- a/build_configure +++ b/build_configure @@ -1,16 +1,33 @@ #!/bin/bash - +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 # # Tool for updating list of .in file for the SALOME project # and regenerating configure script -# # Author : Marc Tajchman - CEA # Date : 10/10/2002 # 13/03/2007: Alexander BORODIN - OCN # Reorganization for usage of autotools # $Header$ # - ORIG_DIR=`pwd` CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` NETGENPLUGIN_WITH_GUI="yes" @@ -32,10 +49,10 @@ fi for option do case $option in - -with-ihm | --with-ihm) + -with-gui | --with-gui) NETGENPLUGIN_WITH_GUI="yes" break;; - -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no) + -without-gui | --without-gui | -with-gui=no | --with-gui=no) NETGENPLUGIN_WITH_GUI="no" break;; esac diff --git a/clean_configure b/clean_configure new file mode 100755 index 0000000..f57f7b3 --- /dev/null +++ b/clean_configure @@ -0,0 +1,35 @@ +#!/bin/sh +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 +# +rm -rf autom4te.cache aclocal.m4 configure make_config +find . -name "*~" -print -exec rm {} \; +find . -name "*.pyc" -print -exec rm {} \; +#exit +# ==================== ON SORT AVANT + +find bin -name Makefile.in | xargs rm -f +find doc -name Makefile.in | xargs rm -f +find idl -name Makefile.in | xargs rm -f +find resources -name Makefile.in | xargs rm -f +find salome_adm -name Makefile.in | xargs rm -f +find src -name Makefile.in | xargs rm -f +rm -f Makefile.in diff --git a/configure.ac b/configure.ac index 5c19daf..5855ffc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,23 +1,37 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 # # PLEASE DO NOT MODIFY configure.in FILE -# # ALL CHANGES WILL BE DISCARDED BY THE NEXT # build_configure COMMAND -# # CHANGES MUST BE MADE IN configure.in.base FILE -# -# # Author : Marc Tajchman (CEA) # Date : 28/06/2001 # Modified by : Patrick GOLDBRONN (CEA) # Modified by : Marc Tajchman (CEA) # 13/03/2007: Alexander BORODIN - OCN # Reorganization for usage of autotools -# # Created from configure.in.base # - -AC_INIT([Salome2 Project NETGENPLUGIN module], [4.1.1], [webmaster.salome@opencascade.com], [salome]) +AC_INIT([Salome2 Project NETGENPLUGIN module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeNETGENPLUGIN]) AC_CONFIG_AUX_DIR(salome_adm/unix/config_files) AC_CANONICAL_HOST AC_CANONICAL_TARGET @@ -223,19 +237,11 @@ AC_SUBST_FILE(CORBA) corba=make_$ORB CORBA=adm_local/unix/$corba -NETGENPLUGIN_WITH_GUI=no +NETGENPLUGIN_WITH_GUI=yes AM_CONDITIONAL(NETGENPLUGIN_ENABLE_GUI, [test "${NETGENPLUGIN_WITH_GUI}" = "yes"]) if test "${NETGENPLUGIN_WITH_GUI}" = "yes"; then - echo - echo --------------------------------------------- - echo testing MSG2QM - echo --------------------------------------------- - echo - - CHECK_MSG2QM - echo echo --------------------------------------------- echo testing openGL diff --git a/idl/Makefile.am b/idl/Makefile.am index fee15b3..c496875 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -1,48 +1,46 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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 -# - +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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 # # 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 # package and then is not manage here. # - include $(top_srcdir)/adm_local/unix/make_common_starter.am BASEIDL_FILES= NETGENPlugin_Algorithm.idl -EXTRA_DIST+= $(BASEIDL_FILES) - # This variable defines the files to be installed -salomeidl_DATA = $(BASEIDL_FILES) +dist_salomeidl_DATA = $(BASEIDL_FILES) # GUI idl common library lib_LTLIBRARIES = libSalomeIDLNETGENPLUGIN.la # Sources built from idl files -nodist_libSalomeIDLNETGENPLUGIN_la_SOURCES= NETGENPlugin_AlgorithmSK.cc +nodist_libSalomeIDLNETGENPLUGIN_la_SOURCES = NETGENPlugin_AlgorithmSK.cc # header files must be exported: other modules have to use this library -nodist_salomeinclude_HEADERS= $(BASEIDL_FILES:%.idl=%.hh) +nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh) -libSalomeIDLNETGENPLUGIN_la_CPPFLAGS =\ +libSalomeIDLNETGENPLUGIN_la_CPPFLAGS = \ $(KERNEL_CXXFLAGS) \ $(GEOM_CXXFLAGS) \ $(SMESH_CXXFLAGS) \ @@ -51,7 +49,6 @@ libSalomeIDLNETGENPLUGIN_la_CPPFLAGS =\ -I$(top_builddir)/salome_adm/unix \ -I$(top_builddir)/idl - libSalomeIDLNETGENPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0 libSalomeIDLNETGENPLUGIN_la_LIBADD = \ $(KERNEL_LDFLAGS) -lSalomeIDLKernel \ @@ -90,14 +87,14 @@ SUFFIXES = .idl .hh SK.cc $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%) - $(INSTALL) -d $(pkgpythondir) + $(INSTALL) -d $(DESTDIR)$(salomepythondir) ls $^ | while read file; do \ - $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(pkgpythondir) $$file ; \ + $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \ done # uninstall-local removes too much, but it works in distcheck uninstall-local: - rm -rf $(pkgpythondir)/* + rm -rf $(DESTDIR)$(salomepythondir)/* mostlyclean-local: -rm -f *.hh *.cc .depidl diff --git a/idl/NETGENPlugin_Algorithm.idl b/idl/NETGENPlugin_Algorithm.idl index 687419c..f968db2 100644 --- a/idl/NETGENPlugin_Algorithm.idl +++ b/idl/NETGENPlugin_Algorithm.idl @@ -1,31 +1,32 @@ -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE // +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // +// 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 // // File : NETGENPlugin_Algorithm.idl // Author : Julia DOROVSKIKH // $Header$ - +// #ifndef _SMESH_NETGENALGORITHM_IDL_ #define _SMESH_NETGENALGORITHM_IDL_ +#include "SALOME_Exception.idl" #include "SMESH_Hypothesis.idl" /*! @@ -99,6 +100,69 @@ module NETGENPlugin boolean GetQuadAllowed(); }; + /*! + * NETGENPlugin_Hypothesis: interface of "NETGEN 2D simple parameters" hypothesis + */ + interface NETGENPlugin_SimpleHypothesis_2D : SMESH::SMESH_Hypothesis + { + /*! + * Sets value + */ + void SetNumberOfSegments(in short nb) raises (SALOME::SALOME_Exception); + /*! + * Returns value. + * Can be zero in case if LocalLength() has been set + */ + short GetNumberOfSegments(); + + /*! + * Sets value + */ + void SetLocalLength(in double segmentLength); + /*! + * Returns value. + * Can be zero in case if NumberOfSegments() has been set + */ + double GetLocalLength(); + + /*! + * Sets to be dependent on 1D discretization + */ + void LengthFromEdges(); + /*! + * Sets value. + * Zero or negative value means same as LengthFromEdges(). + */ + void SetMaxElementArea(in double area); + /*! + * Returns value. + * Can be zero in case of LengthFromEdges() + */ + double GetMaxElementArea(); + }; + + /*! + * NETGENPlugin_SimpleHypothesis_3D: interface of "NETGEN 3D simple parameters" hypothesis + */ + interface NETGENPlugin_SimpleHypothesis_3D : NETGENPlugin_SimpleHypothesis_2D + { + /*! + * Sets to be dependent on 2D discretization + */ + void LengthFromFaces(); + /*! + * Sets value. + * Zero or negative value means same as LengthFromFaces(). + */ + void SetMaxElementVolume(in double volume); + + /*! + * Returns value + * Can be zero in case of LengthFromFaces() + */ + double GetMaxElementVolume(); + }; + }; #endif diff --git a/resources/Makefile.am b/resources/Makefile.am index df00b4d..d11fed6 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -1,4 +1,6 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or @@ -15,25 +17,29 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # -* Makefile *- -# # Author : Patrick GOLDBRONN (CEA) # Date : 28/06/2001 # Modified by : Alexander BORODIN (OCN) - autotools usage # $Header$ # - include $(top_srcdir)/adm_local/unix/make_common_starter.am -dist_salomeres_DATA = \ - mesh_algo_netgen_2d.png \ - mesh_algo_netgen_2d3d.png \ - mesh_hypo_netgen.png \ - mesh_hypo_netgen_2d.png \ - mesh_tree_algo_netgen_2d.png \ - mesh_tree_algo_netgen_2d3d.png \ - mesh_tree_hypo_netgen.png \ - mesh_tree_hypo_netgen_2d.png \ - NETGENPlugin.xml +dist_salomeres_DATA = \ + NETGENPlugin.xml \ + SalomeApp.xml + +if NETGENPLUGIN_ENABLE_GUI + dist_salomeres_DATA += \ + mesh_algo_netgen_2d.png \ + mesh_algo_netgen_2d3d.png \ + mesh_hypo_netgen.png \ + mesh_hypo_netgen_2d.png \ + mesh_tree_algo_netgen_2d.png \ + mesh_tree_algo_netgen_2d3d.png \ + mesh_tree_hypo_netgen.png \ + mesh_tree_hypo_netgen_2d.png \ + mesh_tree_algo_netgen.png +endif diff --git a/resources/NETGENPlugin.xml b/resources/NETGENPlugin.xml index 6135daa..248e1e1 100644 --- a/resources/NETGENPlugin.xml +++ b/resources/NETGENPlugin.xml @@ -1,5 +1,28 @@ + @@ -18,6 +41,14 @@ label-id="NETGEN 2D Parameters" icon-id="mesh_hypo_netgen_2d.png" dim="2"/> + + + dim="2" + support-submeshes="true" + /> + hypos="NETGEN_Parameters, NETGEN_SimpleParameters_3D" + dim="3" + support-submeshes="true" + /> + +
+ +
+
+ + +
+
diff --git a/resources/mesh_tree_algo_netgen.png b/resources/mesh_tree_algo_netgen.png new file mode 100644 index 0000000000000000000000000000000000000000..cb75b7e9d2c0c540feae86ebd25376f3cda5267d GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0y_Xipc%kcwN$DL>9Th$SfbOEWWb zhXuOXy!*jF<>)HG6`944Q+X2aSH;@+9bL>BJBKw=*le;R!|X(z7Lf#Fj>{`m7;a^= vSW8NYx@5atXJP7Cp{8_cWA>8p2Mi3y9?M94f1vRWXbpp>tDnm{r-UW|uA44F literal 0 HcmV?d00001 diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am index 6bedb75..a2f52dc 100644 --- a/src/GUI/Makefile.am +++ b/src/GUI/Makefile.am @@ -1,5 +1,7 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -15,14 +17,14 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # File : Makefile.in # Author : Michael Sazonov # Modified by : Alexander BORODIN (OCN) - autotools usage # Module : NETGENPLUGIN # $Header$ - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am # header files @@ -33,10 +35,15 @@ lib_LTLIBRARIES = libNETGENPluginGUI.la dist_libNETGENPluginGUI_la_SOURCES = \ NETGENPluginGUI.cxx \ - NETGENPluginGUI_HypothesisCreator.cxx + NETGENPluginGUI.h \ + NETGENPluginGUI_HypothesisCreator.h \ + NETGENPluginGUI_HypothesisCreator.cxx \ + NETGENPluginGUI_SimpleCreator.h \ + NETGENPluginGUI_SimpleCreator.cxx MOC_FILES = \ - NETGENPluginGUI_HypothesisCreator_moc.cxx + NETGENPluginGUI_HypothesisCreator_moc.cxx \ + NETGENPluginGUI_SimpleCreator_moc.cxx nodist_libNETGENPluginGUI_la_SOURCES= \ $(MOC_FILES) diff --git a/src/GUI/NETGENPluginGUI.cxx b/src/GUI/NETGENPluginGUI.cxx index 1b89921..d455547 100755 --- a/src/GUI/NETGENPluginGUI.cxx +++ b/src/GUI/NETGENPluginGUI.cxx @@ -1,32 +1,33 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin -// -// Copyright (C) 2003 CEA -// -// 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 -// -// -// // File : NETGENPluginGUI.cxx // Author : Michael Zorin // Module : NETGENPlugin // $Header: - //#include "SMESHGUI_Hypotheses.h" +// #include "NETGENPluginGUI_HypothesisCreator.h" +#include "NETGENPluginGUI_SimpleCreator.h" //============================================================================= /*! GetHypothesisCreator @@ -41,6 +42,9 @@ extern "C" SMESHGUI_GenericHypothesisCreator* aCreator = NULL; if( aHypType=="NETGEN_Parameters_2D" || aHypType=="NETGEN_Parameters" ) aCreator = new NETGENPluginGUI_HypothesisCreator( aHypType ); + else if ( aHypType=="NETGEN_SimpleParameters_2D" || + aHypType=="NETGEN_SimpleParameters_3D" ) + aCreator = new NETGENPluginGUI_SimpleCreator( aHypType ); return aCreator; } } diff --git a/src/GUI/NETGENPluginGUI.h b/src/GUI/NETGENPluginGUI.h new file mode 100755 index 0000000..ca882b4 --- /dev/null +++ b/src/GUI/NETGENPluginGUI.h @@ -0,0 +1,36 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin +// File : NETGENPluginGUI.h +// Author : Alexander A. BORODIN +// Module : NETGENPlugin +// $Header: +// +#ifdef WIN32 + #ifdef NETGENPLUGIN_GUI_EXPORTS + #define NETGENPLUGIN_GUI_EXPORT __declspec( dllexport ) + #else + #define NETGENPLUGIN_GUI_EXPORT __declspec( dllimport ) + #endif +#else + #define NETGENPLUGIN_GUI_EXPORT +#endif diff --git a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx index 5da2f11..fc9d196 100644 --- a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx @@ -1,51 +1,53 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin -// -// Copyright (C) 2003 CEA -// -// 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 -// -// -// // File : NETGENPluginGUI_HypothesisCreator.cxx // Author : Michael Zorin // Module : NETGENPlugin // $Header: - +// #include "NETGENPluginGUI_HypothesisCreator.h" #include #include +#include #include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) #include +#include #include -#include -#include +#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include enum Fineness { @@ -67,81 +69,103 @@ NETGENPluginGUI_HypothesisCreator::~NETGENPluginGUI_HypothesisCreator() { } -bool NETGENPluginGUI_HypothesisCreator::checkParams() const +bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg) const { NetgenHypothesisData data_old, data_new; readParamsFromHypo( data_old ); readParamsFromWidgets( data_new ); bool res = storeParamsToHypo( data_new ); storeParamsToHypo( data_old ); + + res = myMaxSize->isValid(msg,true) && res; + res = myGrowthRate->isValid(msg,true) && res; ; + res = myNbSegPerEdge->isValid(msg,true) && res; + res = myNbSegPerRadius->isValid(msg,true) && res; return res; } QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame() { - QFrame* fr = new QFrame( 0, "myframe" ); - QVBoxLayout* lay = new QVBoxLayout( fr, 5, 0 ); + QFrame* fr = new QFrame( 0 ); + fr->setObjectName( "myframe" ); + QVBoxLayout* lay = new QVBoxLayout( fr ); + lay->setMargin( 5 ); + lay->setSpacing( 0 ); - QGroupBox* GroupC1 = new QGroupBox( 2, Qt::Horizontal, fr, "GroupC1" ); + QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr ); lay->addWidget( GroupC1 ); - GroupC1->setTitle( tr( "SMESH_ARGUMENTS" ) ); - GroupC1->layout()->setSpacing( 6 ); - GroupC1->layout()->setMargin( 11 ); + QGridLayout* aGroupLayout = new QGridLayout( GroupC1 ); + aGroupLayout->setSpacing( 6 ); + aGroupLayout->setMargin( 11 ); + int row = 0; myName = 0; if( isCreation() ) { - new QLabel( tr( "SMESH_NAME" ), GroupC1 ); + aGroupLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), GroupC1 ), row, 0 ); myName = new QLineEdit( GroupC1 ); + aGroupLayout->addWidget( myName, row, 1 ); + row++; } - new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ); - myMaxSize = new QtxDblSpinBox( GroupC1 ); - myMaxSize->setPrecision( 7 ); - myMaxSize->setMinValue( 1e-07 ); - myMaxSize->setMaxValue( 1e+06 ); - myMaxSize->setLineStep( 10 ); + aGroupLayout->addWidget( new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ), row, 0 ); + myMaxSize = new SalomeApp_DoubleSpinBox( GroupC1 ); + myMaxSize->setDecimals( 7 ); + myMaxSize->setMinimum( 1e-07 ); + myMaxSize->setMaximum( 1e+06 ); + myMaxSize->setSingleStep( 10 ); + aGroupLayout->addWidget( myMaxSize, row, 1 ); + row++; mySecondOrder = new QCheckBox( tr( "NETGEN_SECOND_ORDER" ), GroupC1 ); - GroupC1->addSpace(0); + aGroupLayout->addWidget( mySecondOrder, row, 0 ); + row++; - new QLabel( tr( "NETGEN_FINENESS" ), GroupC1 ); - myFineness = new QtxComboBox( GroupC1 ); + aGroupLayout->addWidget( new QLabel( tr( "NETGEN_FINENESS" ), GroupC1 ), row, 0 ); + myFineness = new QComboBox( GroupC1 ); QStringList types; - types.append( QObject::tr( "NETGEN_VERYCOARSE" ) ); - types.append( QObject::tr( "NETGEN_COARSE" ) ); - types.append( QObject::tr( "NETGEN_MODERATE" ) ); - types.append( QObject::tr( "NETGEN_FINE" ) ); - types.append( QObject::tr( "NETGEN_VERYFINE" ) ); - types.append( QObject::tr( "NETGEN_CUSTOM" ) ); - myFineness->insertStringList( types ); + types << tr( "NETGEN_VERYCOARSE" ) << tr( "NETGEN_COARSE" ) << tr( "NETGEN_MODERATE" ) << + tr( "NETGEN_FINE" ) << tr( "NETGEN_VERYFINE" ) << tr( "NETGEN_CUSTOM" ); + myFineness->addItems( types ); + aGroupLayout->addWidget( myFineness, row, 1 ); + row++; - new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 ); - myGrowthRate = new QtxDblSpinBox( GroupC1 ); - myGrowthRate->setMinValue( 0.1 ); - myGrowthRate->setMaxValue( 10 ); - myGrowthRate->setLineStep( 0.1 ); + aGroupLayout->addWidget( new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 ), row, 0 ); + myGrowthRate = new SalomeApp_DoubleSpinBox( GroupC1 ); + myGrowthRate->setMinimum( 0.1 ); + myGrowthRate->setMaximum( 10 ); + myGrowthRate->setSingleStep( 0.1 ); + aGroupLayout->addWidget( myGrowthRate, row, 1 ); + row++; + + const double VALUE_MAX = 1.0e+6; + + aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 ), row, 0 ); + myNbSegPerEdge = new SalomeApp_DoubleSpinBox( GroupC1 ); + myNbSegPerEdge->setMinimum( 0.2 ); + myNbSegPerEdge->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5 + aGroupLayout->addWidget( myNbSegPerEdge, row, 1 ); + row++; - new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 ); - myNbSegPerEdge = new QtxDblSpinBox( GroupC1 ); - myNbSegPerEdge->setMinValue( 0.2 ); - myNbSegPerEdge->setMaxValue( 5.0 ); - - new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 ); - myNbSegPerRadius = new QtxDblSpinBox( GroupC1 ); - myNbSegPerRadius->setMinValue( 0.2 ); - myNbSegPerRadius->setMaxValue( 5.0 ); + aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 ), row, 0 ); + myNbSegPerRadius = new SalomeApp_DoubleSpinBox( GroupC1 ); + myNbSegPerRadius->setMinimum( 0.2 ); + myNbSegPerRadius->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5 + aGroupLayout->addWidget( myNbSegPerRadius, row, 1 ); + row++; if ( hypType()=="NETGEN_Parameters_2D" ) { myAllowQuadrangles = new QCheckBox( tr( "NETGEN_ALLOW_QUADRANGLES" ), GroupC1 ); - GroupC1->addSpace(0); + aGroupLayout->addWidget( myAllowQuadrangles, row, 0 ); myIs2D = true; + row++; } myOptimize = new QCheckBox( tr( "NETGEN_OPTIMIZE" ), GroupC1 ); - GroupC1->addSpace(0); + aGroupLayout->addWidget( myOptimize, row, 0 ); + row++; connect( myFineness, SIGNAL( activated( int ) ), this, SLOT( onFinenessChanged() ) ); @@ -155,18 +179,35 @@ void NETGENPluginGUI_HypothesisCreator::retrieveParams() const if( myName ) myName->setText( data.myName ); - myMaxSize->setValue( data.myMaxSize ); + if(data.myMaxSizeVar.isEmpty()) + myMaxSize->setValue( data.myMaxSize ); + else + myMaxSize->setText( data.myMaxSizeVar ); + mySecondOrder->setChecked( data.mySecondOrder ); myOptimize->setChecked( data.myOptimize ); - myFineness->setCurrentItem( data.myFineness ); - myGrowthRate->setValue( data.myGrowthRate ); - myNbSegPerEdge->setValue( data.myNbSegPerEdge ); - myNbSegPerRadius->setValue( data.myNbSegPerRadius ); + myFineness->setCurrentIndex( data.myFineness ); + + if(data.myGrowthRateVar.isEmpty()) + myGrowthRate->setValue( data.myGrowthRate ); + else + myGrowthRate->setText( data.myGrowthRateVar ); + + if(data.myNbSegPerEdgeVar.isEmpty()) + myNbSegPerEdge->setValue( data.myNbSegPerEdge ); + else + myNbSegPerEdge->setText( data.myNbSegPerEdgeVar ); + + if(data.myNbSegPerRadiusVar.isEmpty()) + myNbSegPerRadius->setValue( data.myNbSegPerRadius ); + else + myNbSegPerRadius->setText( data.myNbSegPerRadiusVar ); + if (myIs2D) myAllowQuadrangles->setChecked( data.myAllowQuadrangles ); // update widgets - bool isCustom = (myFineness->currentItem() == UserDefined); + bool isCustom = (myFineness->currentIndex() == UserDefined); myGrowthRate->setEnabled(isCustom); myNbSegPerEdge->setEnabled(isCustom); myNbSegPerRadius->setEnabled(isCustom); @@ -201,14 +242,20 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromHypo( NetgenHypothesisData HypothesisData* data = SMESH::GetHypothesisData( hypType() ); h_data.myName = isCreation() && data ? data->Label : ""; + SMESH::ListOfParameters_var aParameters = h->GetLastParameters(); + h_data.myMaxSize = h->GetMaxSize(); + h_data.myMaxSizeVar = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString(""); h_data.mySecondOrder = h->GetSecondOrder(); h_data.myOptimize = h->GetOptimize(); h_data.myFineness = (int) h->GetFineness(); h_data.myGrowthRate = h->GetGrowthRate(); + h_data.myGrowthRateVar = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString(""); h_data.myNbSegPerEdge = h->GetNbSegPerEdge(); + h_data.myNbSegPerEdgeVar = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString(""); h_data.myNbSegPerRadius = h->GetNbSegPerRadius(); + h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters[3].in()) : QString(""); if ( myIs2D ) { @@ -231,9 +278,10 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi try { if( isCreation() ) - SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.latin1() ); - + SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() ); + QStringList aVariablesList; h->SetMaxSize( h_data.myMaxSize ); + aVariablesList.append(h_data.myMaxSizeVar); h->SetSecondOrder( h_data.mySecondOrder ); h->SetOptimize( h_data.myOptimize ); int fineness = h_data.myFineness; @@ -244,6 +292,10 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi h->SetGrowthRate( h_data.myGrowthRate ); h->SetNbSegPerEdge( h_data.myNbSegPerEdge ); h->SetNbSegPerRadius( h_data.myNbSegPerRadius ); + + aVariablesList.append(h_data.myGrowthRateVar); + aVariablesList.append(h_data.myNbSegPerEdgeVar); + aVariablesList.append(h_data.myNbSegPerRadiusVar); } if ( myIs2D ) @@ -254,6 +306,15 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi if ( !h_2d->_is_nil() ) h_2d->SetQuadAllowed( h_data.myAllowQuadrangles ); } + + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + if( fineness==UserDefined ) + { + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + } + } catch(const SALOME::SALOME_Exception& ex) { @@ -267,12 +328,18 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD { h_data.myName = myName ? myName->text() : ""; h_data.myMaxSize = myMaxSize->value(); + h_data.myMaxSizeVar = myMaxSize->text(); h_data.mySecondOrder = mySecondOrder->isChecked(); h_data.myOptimize = myOptimize->isChecked(); - h_data.myFineness = myFineness->currentItem(); + h_data.myFineness = myFineness->currentIndex(); h_data.myGrowthRate = myGrowthRate->value(); h_data.myNbSegPerEdge = myNbSegPerEdge->value(); h_data.myNbSegPerRadius = myNbSegPerRadius->value(); + + h_data.myGrowthRateVar = myGrowthRate->text(); + h_data.myNbSegPerEdgeVar = myNbSegPerEdge->text(); + h_data.myNbSegPerRadiusVar = myNbSegPerRadius->text(); + if ( myIs2D ) h_data.myAllowQuadrangles = myAllowQuadrangles->isChecked(); @@ -282,7 +349,7 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD void NETGENPluginGUI_HypothesisCreator::onFinenessChanged() { - bool isCustom = (myFineness->currentItem() == UserDefined); + bool isCustom = (myFineness->currentIndex() == UserDefined); myGrowthRate->setEnabled(isCustom); myNbSegPerEdge->setEnabled(isCustom); @@ -292,7 +359,7 @@ void NETGENPluginGUI_HypothesisCreator::onFinenessChanged() { double aGrowthRate, aNbSegPerEdge, aNbSegPerRadius; - switch ( myFineness->currentItem() ) + switch ( myFineness->currentIndex() ) { case VeryCoarse: aGrowthRate = 0.7; @@ -330,16 +397,21 @@ void NETGENPluginGUI_HypothesisCreator::onFinenessChanged() QString NETGENPluginGUI_HypothesisCreator::caption() const { - return tr( QString( "NETGEN_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")) ); + return tr( QString( "NETGEN_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() ); } QPixmap NETGENPluginGUI_HypothesisCreator::icon() const { - QString hypIconName = tr( QString("ICON_DLG_NETGEN_PARAMETERS%1").arg(myIs2D?QString("_2D"):QString("")) ); + QString hypIconName = tr( QString("ICON_DLG_NETGEN_PARAMETERS%1").arg(myIs2D?QString("_2D"):QString("")).toLatin1().data() ); return SUIT_Session::session()->resourceMgr()->loadPixmap( "NETGENPlugin", hypIconName ); } QString NETGENPluginGUI_HypothesisCreator::type() const { - return tr( QString( "NETGEN_%1_HYPOTHESIS" ).arg(myIs2D?QString("2D"):QString("3D")) ); + return tr( QString( "NETGEN_%1_HYPOTHESIS" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() ); +} + +QString NETGENPluginGUI_HypothesisCreator::helpPage() const +{ + return "netgen_2d_3d_hypo_page.html"; } diff --git a/src/GUI/NETGENPluginGUI_HypothesisCreator.h b/src/GUI/NETGENPluginGUI_HypothesisCreator.h index 3cbd96a..a23739e 100644 --- a/src/GUI/NETGENPluginGUI_HypothesisCreator.h +++ b/src/GUI/NETGENPluginGUI_HypothesisCreator.h @@ -1,47 +1,39 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin GUI: GUI for plugged-in mesher NETGENPlugin -// -// Copyright (C) 2003 CEA -// -// 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 -// -// -// // File : NETGENPluginGUI_HypothesisCreator.h // Author : Michael Zorin // Module : NETGENPlugin // $Header: - +// #ifndef NETGENPLUGINGUI_HypothesisCreator_HeaderFile #define NETGENPLUGINGUI_HypothesisCreator_HeaderFile -#ifdef WIN32 - #ifdef NETGENPLUGIN_GUI_EXPORTS - #define NETGENPLUGIN_GUI_EXPORT __declspec( dllexport ) - #else - #define NETGENPLUGIN_GUI_EXPORT __declspec( dllimport ) - #endif -#else - #define NETGENPLUGIN_GUI_EXPORT -#endif +#include "NETGENPluginGUI.h" #include -class QtxDblSpinBox; -class QtxComboBox; +class SalomeApp_DoubleSpinBox; +class QComboBox; class QCheckBox; class QLineEdit; @@ -51,6 +43,7 @@ typedef struct int myFineness; bool mySecondOrder, myAllowQuadrangles, myOptimize; QString myName; + QString myMaxSizeVar, myGrowthRateVar, myNbSegPerEdgeVar, myNbSegPerRadiusVar; } NetgenHypothesisData; /*! @@ -64,7 +57,8 @@ public: NETGENPluginGUI_HypothesisCreator( const QString& ); virtual ~NETGENPluginGUI_HypothesisCreator(); - virtual bool checkParams() const; + virtual bool checkParams(QString& msg) const; + virtual QString helpPage() const; protected: virtual QFrame* buildFrame (); @@ -84,15 +78,15 @@ private: bool storeParamsToHypo( const NetgenHypothesisData& ) const; private: - QLineEdit* myName; - QtxDblSpinBox* myMaxSize; - QCheckBox* mySecondOrder; - QCheckBox* myOptimize; - QtxComboBox* myFineness; - QtxDblSpinBox* myGrowthRate; - QtxDblSpinBox* myNbSegPerEdge; - QtxDblSpinBox* myNbSegPerRadius; - QCheckBox* myAllowQuadrangles; + QLineEdit* myName; + SalomeApp_DoubleSpinBox* myMaxSize; + QCheckBox* mySecondOrder; + QCheckBox* myOptimize; + QComboBox* myFineness; + SalomeApp_DoubleSpinBox* myGrowthRate; + SalomeApp_DoubleSpinBox* myNbSegPerEdge; + SalomeApp_DoubleSpinBox* myNbSegPerRadius; + QCheckBox* myAllowQuadrangles; bool myIs2D; }; diff --git a/src/GUI/NETGENPluginGUI_SimpleCreator.cxx b/src/GUI/NETGENPluginGUI_SimpleCreator.cxx new file mode 100644 index 0000000..596a34d --- /dev/null +++ b/src/GUI/NETGENPluginGUI_SimpleCreator.cxx @@ -0,0 +1,418 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// File : NETGENPluginGUI_SimpleCreator.cxx +// Author : Open CASCADE S.A.S. +// SMESH includes +// +#include "NETGENPluginGUI_SimpleCreator.h" + +#include +#include +#include +#include + +// IDL includes +#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) + +#include +#include + +// SALOME GUI includes +#include +#include + +// Qt includes +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include + +#define SPACING 6 +#define MARGIN 11 + +using namespace NETGENPlugin; + +// copied from StdMeshersGUI_StdHypothesisCreator.cxx +const double VALUE_MAX = 1.0e+15, // COORD_MAX + VALUE_MAX_2 = VALUE_MAX * VALUE_MAX, + VALUE_MAX_3 = VALUE_MAX_2 * VALUE_MAX, + VALUE_SMALL = 1.0e-15, + VALUE_SMALL_2 = VALUE_SMALL * VALUE_SMALL, + VALUE_SMALL_3 = VALUE_SMALL_2 * VALUE_SMALL; + +NETGENPluginGUI_SimpleCreator::NETGENPluginGUI_SimpleCreator(const QString& theHypType) +: SMESHGUI_GenericHypothesisCreator( theHypType ), + myName(0), + myNbSeg(0), + myLength(0), + myNbSegRadioBut(0), + myLengthRadioBut(0), + myLenFromEdgesCheckBox(0), + myArea(0), + myLenFromFacesCheckBox(0), + myVolume(0) +{ +} + +NETGENPluginGUI_SimpleCreator::~NETGENPluginGUI_SimpleCreator() +{ +} + +bool NETGENPluginGUI_SimpleCreator::checkParams(QString& msg) const +{ + bool result = true; + result = myNbSeg->isValid(msg,true) && result; + result = myLength->isValid(msg,true) && result; + result = myArea->isValid(msg,true) && result; + if (myVolume) + result = myVolume->isValid(msg,true) && result; + + return result; +} + +QFrame* NETGENPluginGUI_SimpleCreator::buildFrame() +{ + QFrame* fr = new QFrame(); + + QVBoxLayout* lay = new QVBoxLayout( fr ); + lay->setMargin( 0 ); + lay->setSpacing( 0 ); + + QGroupBox* argGroup = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr ); + lay->addWidget( argGroup ); + + QGridLayout* argLay = new QGridLayout( argGroup ); + argLay->setSpacing( SPACING ); + argLay->setMargin( MARGIN ); + argLay->setColumnStretch( 0, 0 ); + argLay->setColumnStretch( 1, 1 ); + int argRow = 0; + + // Name + if( isCreation() ) { + myName = new QLineEdit( argGroup ); + argLay->addWidget( new QLabel( tr( "SMESH_NAME" ), argGroup ), argRow, 0 ); + argLay->addWidget( myName, argRow, 1 ); + argRow++; + } + + QGroupBox* dimGroup; + QGridLayout* dimLay; + int dimRow; + + // 1D params group + + dimGroup = new QGroupBox( tr( "NG_1D" ), argGroup ); + argLay->addWidget( dimGroup, argRow, 0, 1, 2 ); + argRow++; + + dimLay = new QGridLayout( dimGroup ); + dimLay->setSpacing( SPACING ); + dimLay->setMargin( MARGIN ); + dimLay->setColumnStretch( 0, 0 ); + dimLay->setColumnStretch( 1, 1 ); + dimRow = 0; + + // * number of segments + myNbSegRadioBut = new QRadioButton( tr( "SMESH_NB_SEGMENTS_HYPOTHESIS" ), dimGroup ); + myNbSeg = new SalomeApp_IntSpinBox( dimGroup ); + myNbSeg->setMinimum( 1 ); + myNbSeg->setMaximum( 9999 ); + myNbSeg->setValue( 1 ); + dimLay->addWidget( myNbSegRadioBut, dimRow, 0 ); + dimLay->addWidget( myNbSeg, dimRow, 1 ); + dimRow++; + + // * local length + myLengthRadioBut = new QRadioButton( tr( "SMESH_LOCAL_LENGTH_HYPOTHESIS" ), dimGroup ); + myLength = new SMESHGUI_SpinBox( dimGroup ); + myLength->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 0.1, 6 ); + myLength->setValue( 1. ); + dimLay->addWidget( myLengthRadioBut, dimRow, 0 ); + dimLay->addWidget( myLength, dimRow, 1 ); + dimRow++; + + // 2D params group + + dimGroup = new QGroupBox( tr( "NG_2D" ), argGroup ); + argLay->addWidget( dimGroup, argRow, 0, 1, 2 ); + argRow++; + + dimLay = new QGridLayout( dimGroup ); + dimLay->setSpacing( SPACING ); + dimLay->setMargin( MARGIN ); + dimLay->setColumnStretch( 0, 0 ); + dimLay->setColumnStretch( 1, 1 ); + dimRow = 0; + + // * Length from edges + myLenFromEdgesCheckBox = new QCheckBox( tr( "NG_LENGTH_FROM_EDGES" ), dimGroup ); + dimLay->addWidget( myLenFromEdgesCheckBox, dimRow, 0, 1, 2 ); + dimRow++; + + // * max area + dimLay->addWidget( new QLabel( tr( "SMESH_MAX_ELEMENT_AREA_HYPOTHESIS" ), dimGroup), dimRow, 0); + myArea = new SMESHGUI_SpinBox( dimGroup ); + myArea->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 0.1, 6 ); + myArea->setValue( 1. ); + dimLay->addWidget( myArea, dimRow, 1 ); + dimRow++; + + // 3D params group + if ( hypType()=="NETGEN_SimpleParameters_3D" ) + { + dimGroup = new QGroupBox( tr( "NG_3D" ), argGroup ); + argLay->addWidget( dimGroup, argRow, 0, 1, 2 ); + argRow++; + + dimLay = new QGridLayout( dimGroup ); + dimLay->setSpacing( SPACING ); + dimLay->setMargin( MARGIN ); + dimLay->setColumnStretch( 0, 0 ); + dimLay->setColumnStretch( 1, 1 ); + dimRow = 0; + + // * Length from faces + myLenFromFacesCheckBox = new QCheckBox( tr( "NG_LENGTH_FROM_FACES" ), dimGroup ); + dimLay->addWidget( myLenFromFacesCheckBox, dimRow, 0, 1, 2 ); + dimRow++; + + // * max volume + dimLay->addWidget(new QLabel( tr("SMESH_MAX_ELEMENT_VOLUME_HYPOTHESIS"), dimGroup), dimRow, 0); + myVolume = new SMESHGUI_SpinBox( dimGroup ); + myVolume->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 0.1, 6 ); + myVolume->setValue( 1. ); + dimLay->addWidget( myVolume, dimRow, 1 ); + dimRow++; + } + + connect( myNbSegRadioBut, SIGNAL( clicked(bool) ), this, SLOT( onValueChanged() )); + connect( myLengthRadioBut, SIGNAL( clicked(bool) ), this, SLOT( onValueChanged() )); + connect( myLenFromEdgesCheckBox, SIGNAL( stateChanged(int)), this, SLOT( onValueChanged() )); + if ( myLenFromFacesCheckBox ) + connect( myLenFromFacesCheckBox, SIGNAL( stateChanged(int)), this, SLOT( onValueChanged() )); + + return fr; +} + +void NETGENPluginGUI_SimpleCreator::retrieveParams() const +{ + if ( isCreation() ) + myName->setText( hypName() ); + + // set default real values + + NETGENPlugin_SimpleHypothesis_2D_var h = + NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis( hasInitParamsHypothesis() )); + + if ( double len = h->GetLocalLength() ) + myLength->setValue( len ); + if ( double area = h->GetMaxElementArea() ) + myArea->setValue( area ); + if ( myVolume ) { + NETGENPlugin_SimpleHypothesis_3D_var h3d = + NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis( hasInitParamsHypothesis()) ); + if ( double volume = (double) h3d->GetMaxElementVolume() ) + myVolume->setValue( volume ); + } + + h = NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() ); + + // set values of hypothesis + + SMESH::ListOfParameters_var aParameters = h->GetLastParameters(); + + // 1D + int nbSeg = (int) h->GetNumberOfSegments(); + myNbSegRadioBut->setChecked( nbSeg ); + myLengthRadioBut->setChecked( !nbSeg ); + QString aPrm; + if ( nbSeg ) { + myLength->setEnabled( false ); + myNbSeg->setEnabled( true ); + aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString(""); + if(aPrm.isEmpty()) + myNbSeg->setValue( nbSeg ); + else + myNbSeg->setText(aPrm); + } + else { + myNbSeg->setEnabled( false ); + myLength->setEnabled( true ); + aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString(""); + if(aPrm.isEmpty()) + myLength->setValue( h->GetLocalLength() ); + else + myLength->setText(aPrm); + } + + // 2D + if ( double area = h->GetMaxElementArea() ) { + myLenFromEdgesCheckBox->setChecked( false ); + myArea->setEnabled( true ); + aPrm = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString(""); + if(aPrm.isEmpty()) + myArea->setValue( area ); + else + myArea->setText( aPrm ); + } + else { + myLenFromEdgesCheckBox->setChecked( true ); + myArea->setEnabled( false ); + } + + // 3D + if ( myVolume ) { + NETGENPlugin_SimpleHypothesis_3D_var h = NETGENPlugin_SimpleHypothesis_3D::_narrow( hypothesis() ); + if ( double volume = (double) h->GetMaxElementVolume() ) { + myLenFromFacesCheckBox->setChecked( false ); + myVolume->setEnabled( true ); + aPrm = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString(""); + if(aPrm.isEmpty()) + myVolume->setValue( volume ); + else + myVolume->setText( aPrm ); + } + else { + myLenFromFacesCheckBox->setChecked( true ); + myVolume->setEnabled( false ); + } + } +} + +QString NETGENPluginGUI_SimpleCreator::storeParams() const +{ + QString valStr; + try + { + NETGENPlugin_SimpleHypothesis_2D_var h = + NETGENPlugin_SimpleHypothesis_2D::_narrow( hypothesis() ); + + if( isCreation() ) + SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().data() ); + + + + // 1D + QStringList aVariablesList; + if ( myNbSeg->isEnabled() ) { + h->SetNumberOfSegments( myNbSeg->value() ); + valStr += "nbSeg=" + myNbSeg->text(); + aVariablesList.append(myNbSeg->text()); + } + else { + h->SetLocalLength( myLength->value() ); + valStr += "len=" + myLength->text(); + aVariablesList.append(myLength->text()); + } + + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + + // 2D + if ( myArea->isEnabled() ) { + h->SetMaxElementArea( myArea->value() ); + valStr += "; area=" + myArea->text(); + aVariablesList.append(myArea->text()); + } + else { + h->LengthFromEdges(); + valStr += "; lenFromEdges"; + aVariablesList.append(QString()); + } + + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + + // 3D + if ( myVolume ) { + NETGENPlugin_SimpleHypothesis_3D_var h = + NETGENPlugin_SimpleHypothesis_3D::_narrow( hypothesis() ); + if ( myVolume->isEnabled() ) { + h->SetMaxElementVolume( myVolume->value() ); + valStr += "; vol=" + myVolume->text(); + aVariablesList.append( myVolume->text()); + } + else { + h->LengthFromFaces(); + valStr += "; lenFromFaces"; + aVariablesList.append(QString()); + } + h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList)); + } + } + catch(const SALOME::SALOME_Exception& ex) + { + SalomeApp_Tools::QtCatchCorbaException(ex); + } + + return valStr; +} + +void NETGENPluginGUI_SimpleCreator::onValueChanged() +{ + QObject* changed = sender(); + + if ( myNbSegRadioBut == changed ) + { + myLengthRadioBut->setChecked( !myNbSegRadioBut->isChecked() ); + } + else if ( myLengthRadioBut == changed ) + { + myNbSegRadioBut->setChecked( !myLengthRadioBut->isChecked() ); + } + else if ( myLenFromEdgesCheckBox == changed ) + { + myArea->setEnabled( !myLenFromEdgesCheckBox->isChecked() ); + } + else if ( myLenFromFacesCheckBox == changed ) + { + myVolume->setEnabled( !myLenFromFacesCheckBox->isChecked() ); + } + myLength->setEnabled( myLengthRadioBut->isChecked() ); + myNbSeg->setEnabled( myNbSegRadioBut->isChecked() ); +} + +QString NETGENPluginGUI_SimpleCreator::caption() const +{ + return tr( (hypType() + "_TITLE").toLatin1().data() ); +} + +QPixmap NETGENPluginGUI_SimpleCreator::icon() const +{ + QString hypIconName = tr( ("ICON_DLG_" + hypType()).toLatin1().data() ); + return SUIT_Session::session()->resourceMgr()->loadPixmap( "NETGENPlugin", hypIconName ); +} + +QString NETGENPluginGUI_SimpleCreator::type() const +{ + return tr( (hypType() + "_HYPOTHESIS").toLatin1().data() ); +} + +QString NETGENPluginGUI_SimpleCreator::helpPage() const +{ + return "netgen_2d_3d_hypo_page.html"; +} diff --git a/src/GUI/NETGENPluginGUI_SimpleCreator.h b/src/GUI/NETGENPluginGUI_SimpleCreator.h new file mode 100644 index 0000000..4b7bb88 --- /dev/null +++ b/src/GUI/NETGENPluginGUI_SimpleCreator.h @@ -0,0 +1,78 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// File : NETGENPluginGUI_SimpleCreator.h +// Author : Open CASCADE S.A.S. +// +#ifndef NETGENPluginGUI_SimpleCreator_H +#define NETGENPluginGUI_SimpleCreator_H + + +#include "NETGENPluginGUI.h" +// SMESH includes +#include + +class QCheckBox; +class QLineEdit; +class QRadioButton; +class SalomeApp_IntSpinBox; +class SMESHGUI_SpinBox; + +class NETGENPLUGIN_GUI_EXPORT NETGENPluginGUI_SimpleCreator : + public SMESHGUI_GenericHypothesisCreator +{ + Q_OBJECT + +public: + NETGENPluginGUI_SimpleCreator(const QString& theHypType); + virtual ~NETGENPluginGUI_SimpleCreator(); + + virtual bool checkParams(QString& msg) const; + virtual QString helpPage() const; + +protected: + virtual QFrame* buildFrame(); + virtual void retrieveParams() const; + virtual QString storeParams() const; + + virtual QString caption() const; + virtual QPixmap icon() const; + virtual QString type() const; + +protected slots: + void onValueChanged(); + +private: + QLineEdit * myName; + + SalomeApp_IntSpinBox* myNbSeg; + SMESHGUI_SpinBox* myLength; + QRadioButton* myNbSegRadioBut, *myLengthRadioBut; + + QCheckBox* myLenFromEdgesCheckBox; + SMESHGUI_SpinBox* myArea; + + QCheckBox* myLenFromFacesCheckBox; + SMESHGUI_SpinBox* myVolume; + +}; + +#endif // NETGENPluginGUI_SimpleCreator_H diff --git a/src/GUI/NETGENPlugin_images.po b/src/GUI/NETGENPlugin_images.po deleted file mode 100755 index 1d06b49..0000000 --- a/src/GUI/NETGENPlugin_images.po +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI -# -# 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 -# -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" -# would be translated to "Pub", not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -#----------------------------------------------------------- -# Hypothesis -#----------------------------------------------------------- - -msgid "ICON_DLG_NETGEN_PARAMETERS" -msgstr "mesh_hypo_netgen.png" - -msgid "ICON_DLG_NETGEN_PARAMETERS_2D" -msgstr "mesh_hypo_netgen_2d.png" - -#----------------------------------------------------------- -# ObjectBrowser -#----------------------------------------------------------- - -msgid "ICON_SMESH_TREE_ALGO_NETGEN_3D" -msgstr "mesh_tree_algo_tetra.png" - -msgid "ICON_SMESH_TREE_ALGO_NETGEN_2D" -msgstr "mesh_tree_algo_netgen_2d.png" - -msgid "ICON_SMESH_TREE_ALGO_NETGEN_2D3D" -msgstr "mesh_tree_algo_netgen_2d3d.png" - -msgid "ICON_SMESH_TREE_HYPO_NETGEN_Parameters" -msgstr "mesh_tree_hypo_netgen.png" - -msgid "ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D" -msgstr "mesh_tree_hypo_netgen_2d.png" diff --git a/src/GUI/NETGENPlugin_images.ts b/src/GUI/NETGENPlugin_images.ts new file mode 100644 index 0000000..92ae658 --- /dev/null +++ b/src/GUI/NETGENPlugin_images.ts @@ -0,0 +1,73 @@ + + + + + @default + + ICON_DLG_NETGEN_PARAMETERS + mesh_hypo_netgen.png + + + ICON_DLG_NETGEN_PARAMETERS_2D + mesh_hypo_netgen_2d.png + + + ICON_DLG_NETGEN_SimpleParameters_3D + mesh_hypo_netgen.png + + + ICON_DLG_NETGEN_SimpleParameters_2D + mesh_hypo_netgen_2d.png + + + ICON_SMESH_TREE_ALGO_NETGEN_2D + mesh_tree_algo_netgen_2d.png + + + ICON_SMESH_TREE_ALGO_NETGEN_2D3D + mesh_tree_algo_netgen_2d3d.png + + + ICON_SMESH_TREE_ALGO_NETGEN_3D + mesh_tree_algo_tetra.png + + + ICON_SMESH_TREE_HYPO_NETGEN_Parameters + mesh_tree_hypo_netgen.png + + + ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D + mesh_tree_hypo_netgen_2d.png + + + ICON_SMESH_TREE_HYPO_NETGEN_SimpleParameters_3D + mesh_tree_hypo_netgen.png + + + ICON_SMESH_TREE_HYPO_NETGEN_SimpleParameters_2D + mesh_tree_hypo_netgen_2d.png + + + diff --git a/src/GUI/NETGENPlugin_msg_en.po b/src/GUI/NETGENPlugin_msg_en.po deleted file mode 100755 index c60a745..0000000 --- a/src/GUI/NETGENPlugin_msg_en.po +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI -# -# 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 -# -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" -# would be translated to "Pub", not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:46:48 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -msgid "NETGEN_MAX_SIZE" -msgstr "Max. Size" - -msgid "NETGEN_SECOND_ORDER" -msgstr "Second Order" - -msgid "NETGEN_OPTIMIZE" -msgstr "Optimize" - -msgid "NETGEN_FINENESS" -msgstr "Fineness" - -msgid "NETGEN_VERYCOARSE" -msgstr "Very Coarse" - -msgid "NETGEN_COARSE" -msgstr "Coarse" - -msgid "NETGEN_MODERATE" -msgstr "Moderate" - -msgid "NETGEN_FINE" -msgstr "Fine" - -msgid "NETGEN_VERYFINE" -msgstr "Very Fine" - -msgid "NETGEN_CUSTOM" -msgstr "Custom" - -msgid "NETGEN_GROWTH_RATE" -msgstr "Growth Rate" - -msgid "NETGEN_SEG_PER_EDGE" -msgstr "Nb. Segs per Edge" - -msgid "NETGEN_SEG_PER_RADIUS" -msgstr "Nb. Segs per Radius" - -msgid "NETGEN_ALLOW_QUADRANGLES" -msgstr "Allow Quadrangles" - -msgid "NETGEN_2D_HYPOTHESIS" -msgstr "Netgen 2D" - -msgid "NETGEN_3D_HYPOTHESIS" -msgstr "Netgen 3D" - -msgid "NETGEN_2D_TITLE" -msgstr "Hypothesis Construction" - -msgid "NETGEN_3D_TITLE" -msgstr "Hypothesis Construction" diff --git a/src/GUI/NETGENPlugin_msg_en.ts b/src/GUI/NETGENPlugin_msg_en.ts new file mode 100644 index 0000000..42ef251 --- /dev/null +++ b/src/GUI/NETGENPlugin_msg_en.ts @@ -0,0 +1,137 @@ + + + + + @default + + NETGEN_2D_HYPOTHESIS + Netgen 2D + + + NETGEN_2D_TITLE + Hypothesis Construction + + + NETGEN_3D_HYPOTHESIS + Netgen 3D + + + NETGEN_3D_TITLE + Hypothesis Construction + + + NETGEN_SimpleParameters_3D_HYPOTHESIS + Netgen 3D simple parameters + + + NETGEN_SimpleParameters_3D_TITLE + Hypothesis Construction + + + NETGEN_SimpleParameters_2D_HYPOTHESIS + Netgen 2D simple parameters + + + NETGEN_SimpleParameters_2D_TITLE + Hypothesis Construction + + + NETGEN_ALLOW_QUADRANGLES + Allow Quadrangles + + + NETGEN_COARSE + Coarse + + + NETGEN_CUSTOM + Custom + + + NETGEN_FINE + Fine + + + NETGEN_FINENESS + Fineness + + + NETGEN_GROWTH_RATE + Growth Rate + + + NETGEN_MAX_SIZE + Max. Size + + + NETGEN_MODERATE + Moderate + + + NETGEN_OPTIMIZE + Optimize + + + NETGEN_SECOND_ORDER + Second Order + + + NETGEN_SEG_PER_EDGE + Nb. Segs per Edge + + + NETGEN_SEG_PER_RADIUS + Nb. Segs per Radius + + + NETGEN_VERYCOARSE + Very Coarse + + + NETGEN_VERYFINE + Very Fine + + + NG_1D + 1D + + + NG_2D + 2D + + + NG_3D + 3D + + + NG_LENGTH_FROM_EDGES + Length from edges + + + NG_LENGTH_FROM_FACES + Length from faces + + + diff --git a/src/Makefile.am b/src/Makefile.am index f4af73a..7251f43 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,36 +1,36 @@ -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# 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 +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE # +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # +# 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 # # File : Makefile.in # Author : Patrick GOLDBRONN (CEA) # Modified by : Alexander BORODIN (OCN) - autotools usage # Module : SMESH # $Header$ - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am -#SUBDIRS = NETGEN NETGENPlugin GUI - SUBDIRS = NETGEN NETGENPlugin if NETGENPLUGIN_ENABLE_GUI SUBDIRS += GUI endif + +DIST_SUBDIRS = NETGEN NETGENPlugin GUI diff --git a/src/NETGEN/Makefile.am b/src/NETGEN/Makefile.am index 98801dd..0ac0539 100644 --- a/src/NETGEN/Makefile.am +++ b/src/NETGEN/Makefile.am @@ -1,5 +1,7 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -15,17 +17,14 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # -* Makefile *- -# # Author : Edward AGAPOV (OCC) # Modified by : Alexander BORODIN (OCN) - autotools usage # Module : NETGENPLUGIN # Date : 10/01/2004 # -# - include $(top_srcdir)/adm_local/unix/make_common_starter.am # build .so of NETGEN itself @@ -69,9 +68,13 @@ $(LIB_OBJ_O): nodist_libNETGEN_la_SOURCES = - - libNETGEN_la_LDFLAGS = $(LIB_OBJ_O) \ $(CAS_LDPATH) -lTKernel -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKMesh -lTKSTL $(FCLIBS) $(STDLIB) libNETGEN_la_DEPENDENCIES = $(LIB_OBJ_O) + +EXTRA_DIST += \ + ReadMeForNgUsers \ + netgen43ForSalome.patch \ + netgen45ForSalome.patch \ + netgen45lib64.patch diff --git a/src/NETGEN/netgen45ForSalome.patch b/src/NETGEN/netgen45ForSalome.patch index 1560303..fac1fc0 100644 --- a/src/NETGEN/netgen45ForSalome.patch +++ b/src/NETGEN/netgen45ForSalome.patch @@ -1,6 +1,6 @@ -diff -Nru netgen-4.5_orig/libsrc/csg/meshsurf.cpp netgen-4.5_patch/libsrc/csg/meshsurf.cpp ---- netgen-4.5_orig/libsrc/csg/meshsurf.cpp 2006-02-14 10:54:35.000000000 +0300 -+++ netgen-4.5_patch/libsrc/csg/meshsurf.cpp 2006-10-25 16:05:59.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/csg/meshsurf.cpp netgen-4.5.new/libsrc/csg/meshsurf.cpp +--- netgen-4.5.old/libsrc/csg/meshsurf.cpp 2006-02-14 11:54:35.000000000 +0300 ++++ netgen-4.5.new/libsrc/csg/meshsurf.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -77,11 +77,12 @@ } @@ -15,9 +15,9 @@ diff -Nru netgen-4.5_orig/libsrc/csg/meshsurf.cpp netgen-4.5_patch/libsrc/csg/me } void MeshOptimize2dSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2, -diff -Nru netgen-4.5_orig/libsrc/csg/meshsurf.hpp netgen-4.5_patch/libsrc/csg/meshsurf.hpp ---- netgen-4.5_orig/libsrc/csg/meshsurf.hpp 2004-01-20 13:49:44.000000000 +0300 -+++ netgen-4.5_patch/libsrc/csg/meshsurf.hpp 2006-10-25 16:08:05.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/csg/meshsurf.hpp netgen-4.5.new/libsrc/csg/meshsurf.hpp +--- netgen-4.5.old/libsrc/csg/meshsurf.hpp 2004-01-20 14:49:44.000000000 +0300 ++++ netgen-4.5.new/libsrc/csg/meshsurf.hpp 2008-02-12 14:57:01.000000000 +0300 @@ -45,7 +45,7 @@ MeshOptimize2dSurfaces (const CSGeometry & ageometry); @@ -27,9 +27,9 @@ diff -Nru netgen-4.5_orig/libsrc/csg/meshsurf.hpp netgen-4.5_patch/libsrc/csg/me /// virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const; /// -diff -Nru netgen-4.5_orig/libsrc/interface/Makefile netgen-4.5_patch/libsrc/interface/Makefile ---- netgen-4.5_orig/libsrc/interface/Makefile 2005-08-09 18:14:59.000000000 +0400 -+++ netgen-4.5_patch/libsrc/interface/Makefile 2006-04-27 13:12:54.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/interface/Makefile netgen-4.5.new/libsrc/interface/Makefile +--- netgen-4.5.old/libsrc/interface/Makefile 2005-08-09 18:14:59.000000000 +0400 ++++ netgen-4.5.new/libsrc/interface/Makefile 2008-02-12 14:57:01.000000000 +0300 @@ -1,4 +1,5 @@ -src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp writegmsh.cpp writejcm.cpp readuser.cpp importsolution.cpp +#src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp writeelmer.cpp writegmsh.cpp writejcm.cpp readuser.cpp importsolution.cpp @@ -37,9 +37,9 @@ diff -Nru netgen-4.5_orig/libsrc/interface/Makefile netgen-4.5_patch/libsrc/inte # lib = nginterface libpath = libsrc/interface -diff -Nru netgen-4.5_orig/libsrc/interface/nglib.cpp netgen-4.5_patch/libsrc/interface/nglib.cpp ---- netgen-4.5_orig/libsrc/interface/nglib.cpp 2005-10-18 17:53:18.000000000 +0400 -+++ netgen-4.5_patch/libsrc/interface/nglib.cpp 2006-04-27 13:12:54.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/interface/nglib.cpp netgen-4.5.new/libsrc/interface/nglib.cpp +--- netgen-4.5.old/libsrc/interface/nglib.cpp 2005-10-18 17:53:18.000000000 +0400 ++++ netgen-4.5.new/libsrc/interface/nglib.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -56,7 +56,8 @@ void Ng_Exit () @@ -50,9 +50,9 @@ diff -Nru netgen-4.5_orig/libsrc/interface/nglib.cpp netgen-4.5_patch/libsrc/int } -diff -Nru netgen-4.5_orig/libsrc/makefile.inc netgen-4.5_patch/libsrc/makefile.inc ---- netgen-4.5_orig/libsrc/makefile.inc 2005-09-02 17:17:51.000000000 +0400 -+++ netgen-4.5_patch/libsrc/makefile.inc 2006-10-26 09:33:58.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/makefile.inc netgen-4.5.new/libsrc/makefile.inc +--- netgen-4.5.old/libsrc/makefile.inc 2005-09-02 17:17:51.000000000 +0400 ++++ netgen-4.5.new/libsrc/makefile.inc 2008-02-12 14:59:55.000000000 +0300 @@ -8,17 +8,14 @@ LIBSRC_DIR=$(CPP_DIR)/libsrc LIB_DIR=$(CPP_DIR)/lib/$(MACHINE) @@ -71,14 +71,14 @@ diff -Nru netgen-4.5_orig/libsrc/makefile.inc netgen-4.5_patch/libsrc/makefile.i include $(LIBSRC_DIR)/makefile.mach.$(MACHINE) # -CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) -+CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \ ++CPLUSPLUSFLAGS1 = -c -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \ + -DOCCGEOMETRY -DOCC52 -DHAVE_IOSTREAM -DHAVE_LIMITS_H # ARFLAGS = r # -diff -Nru netgen-4.5_orig/libsrc/makefile.mach.LINUX netgen-4.5_patch/libsrc/makefile.mach.LINUX ---- netgen-4.5_orig/libsrc/makefile.mach.LINUX 2004-10-11 23:49:26.000000000 +0400 -+++ netgen-4.5_patch/libsrc/makefile.mach.LINUX 2006-04-27 13:12:54.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/makefile.mach.LINUX netgen-4.5.new/libsrc/makefile.mach.LINUX +--- netgen-4.5.old/libsrc/makefile.mach.LINUX 2004-10-11 23:49:26.000000000 +0400 ++++ netgen-4.5.new/libsrc/makefile.mach.LINUX 2008-02-12 14:57:01.000000000 +0300 @@ -16,7 +16,7 @@ # CFLAGS2 = @@ -88,9 +88,29 @@ diff -Nru netgen-4.5_orig/libsrc/makefile.mach.LINUX netgen-4.5_patch/libsrc/mak -ftemplate-depth-99 -finline-limit=10000 \ -Wdisabled-optimization -funroll-loops -DnoNGSOLVE -diff -Nru netgen-4.5_orig/libsrc/meshing/improve2.cpp netgen-4.5_patch/libsrc/meshing/improve2.cpp ---- netgen-4.5_orig/libsrc/meshing/improve2.cpp 2006-01-11 18:08:19.000000000 +0300 -+++ netgen-4.5_patch/libsrc/meshing/improve2.cpp 2006-04-27 13:12:54.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/meshing/meshtype.cpp netgen-4.5.new/libsrc/meshing/meshtype.cpp +--- netgen-4.5.old/libsrc/meshing/meshtype.cpp 2006-02-10 13:11:08.000000000 +0300 ++++ netgen-4.5.new/libsrc/meshing/meshtype.cpp 2008-03-14 13:19:53.000000000 +0300 +@@ -1,4 +1,5 @@ + #include ++#include + + #include "meshing.hpp" + +@@ -774,7 +775,7 @@ + frob /= 2; + + double det = trans.Det(); +- if (det <= 0) ++ if (det <= DBL_MIN) + err += 1e12; + else + err += frob * frob / det; + + +diff -Naur netgen-4.5.old/libsrc/meshing/improve2.cpp netgen-4.5.new/libsrc/meshing/improve2.cpp +--- netgen-4.5.old/libsrc/meshing/improve2.cpp 2006-01-11 19:08:19.000000000 +0300 ++++ netgen-4.5.new/libsrc/meshing/improve2.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -4,7 +4,7 @@ #include @@ -100,9 +120,9 @@ diff -Nru netgen-4.5_orig/libsrc/meshing/improve2.cpp netgen-4.5_patch/libsrc/me #endif namespace netgen -diff -Nru netgen-4.5_orig/libsrc/meshing/improve2.hpp netgen-4.5_patch/libsrc/meshing/improve2.hpp ---- netgen-4.5_orig/libsrc/meshing/improve2.hpp 2004-10-12 23:22:55.000000000 +0400 -+++ netgen-4.5_patch/libsrc/meshing/improve2.hpp 2006-10-25 16:09:37.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/meshing/improve2.hpp netgen-4.5.new/libsrc/meshing/improve2.hpp +--- netgen-4.5.old/libsrc/meshing/improve2.hpp 2004-10-12 23:22:55.000000000 +0400 ++++ netgen-4.5.new/libsrc/meshing/improve2.hpp 2008-02-12 14:57:01.000000000 +0300 @@ -32,17 +32,16 @@ /// virtual void SelectSurfaceOfPoint (const Point3d & p, @@ -129,9 +149,9 @@ diff -Nru netgen-4.5_orig/libsrc/meshing/improve2.hpp netgen-4.5_patch/libsrc/me /// virtual void GetNormalVector(INDEX surfind, const Point3d & p, PointGeomInfo & gi, Vec3d & n) const; -diff -Nru netgen-4.5_orig/libsrc/meshing/smoothing2.cpp netgen-4.5_patch/libsrc/meshing/smoothing2.cpp ---- netgen-4.5_orig/libsrc/meshing/smoothing2.cpp 2006-01-11 18:08:20.000000000 +0300 -+++ netgen-4.5_patch/libsrc/meshing/smoothing2.cpp 2006-10-25 16:10:46.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/meshing/smoothing2.cpp netgen-4.5.new/libsrc/meshing/smoothing2.cpp +--- netgen-4.5.old/libsrc/meshing/smoothing2.cpp 2006-01-11 19:08:20.000000000 +0300 ++++ netgen-4.5.new/libsrc/meshing/smoothing2.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -300,7 +300,7 @@ double Opti2SurfaceMinFunction :: FuncGrad (const Vector & x, Vector & grad) const @@ -250,9 +270,9 @@ diff -Nru netgen-4.5_orig/libsrc/meshing/smoothing2.cpp netgen-4.5_patch/libsrc/ if (moveisok) { for (j = 0; j < locelements.Size(); j++) -diff -Nru netgen-4.5_orig/libsrc/occ/occconstruction.cpp netgen-4.5_patch/libsrc/occ/occconstruction.cpp ---- netgen-4.5_orig/libsrc/occ/occconstruction.cpp 2005-12-06 17:15:53.000000000 +0300 -+++ netgen-4.5_patch/libsrc/occ/occconstruction.cpp 2006-04-27 13:12:54.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/occ/occconstruction.cpp netgen-4.5.new/libsrc/occ/occconstruction.cpp +--- netgen-4.5.old/libsrc/occ/occconstruction.cpp 2005-12-06 18:15:53.000000000 +0300 ++++ netgen-4.5.new/libsrc/occ/occconstruction.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -28,8 +28,8 @@ #include #include @@ -264,9 +284,9 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occconstruction.cpp netgen-4.5_patch/libsrc #include #include namespace netgen -diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/occgenmesh.cpp ---- netgen-4.5_orig/libsrc/occ/occgenmesh.cpp 2006-02-07 12:12:48.000000000 +0300 -+++ netgen-4.5_patch/libsrc/occ/occgenmesh.cpp 2006-10-25 16:14:48.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/occ/occgenmesh.cpp netgen-4.5.new/libsrc/occ/occgenmesh.cpp +--- netgen-4.5.old/libsrc/occ/occgenmesh.cpp 2006-02-07 13:12:48.000000000 +0300 ++++ netgen-4.5.new/libsrc/occ/occgenmesh.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -28,7 +28,7 @@ return Point<3> (p.X(), p.Y(), p.Z()); } @@ -339,7 +359,37 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ { exists = 1; break; -@@ -276,8 +273,8 @@ +@@ -163,6 +160,7 @@ + { + TopoDS_Face face = TopoDS::Face(exp1.Current()); + int facenr = geom.fmap.FindIndex(face); ++ if ( facenr < 1 ) continue; + + if (face2solid[0][facenr-1] == 0) + face2solid[0][facenr-1] = solidnr; +@@ -184,6 +182,9 @@ + int facenr = 0; + int edgenr = 0; + ++ // EAP, IMP [SALOME platform 0013410]. ++ // take into account nb of already meshed edges ++ edgenr = mesh.GetNSeg(); + + (*testout) << "faces = " << geom.fmap.Extent() << endl; + int curr = 0; +@@ -232,6 +233,11 @@ + continue; + } + ++ // EAP, IMP [SALOME platform 0013410]. ++ // Do not divide already meshed edges ++ if ( geom.emap.FindIndex(edge) < 1 ) ++ continue; ++ + if (geom.vmap.FindIndex(TopExp::FirstVertex (edge)) == + geom.vmap.FindIndex(TopExp::LastVertex (edge))) + { +@@ -276,8 +282,8 @@ pnums.Last() = -1; for (PointIndex pi = 1; pi < first_ep; pi++) { @@ -350,7 +400,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ } } -@@ -287,7 +284,7 @@ +@@ -287,7 +293,7 @@ bool exists = 0; int j; for (j = first_ep; j <= mesh.GetNP(); j++) @@ -359,7 +409,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ { exists = 1; break; -@@ -394,7 +391,7 @@ +@@ -394,7 +400,7 @@ int i, j, k; int changed; @@ -368,7 +418,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ multithread.task = "Surface meshing"; geom.facemeshstatus = 0; -@@ -751,7 +748,7 @@ +@@ -751,7 +760,7 @@ multithread.task = savetask; } @@ -377,7 +427,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ { double hret; kappa *= mparam.curvaturesafety; -@@ -779,7 +776,7 @@ +@@ -779,7 +788,7 @@ double nq = n*q; Point<3> p = p0 + 0.5*n; @@ -386,7 +436,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ if (lambda >= 0 && lambda <= 1) { -@@ -799,55 +796,55 @@ +@@ -799,55 +808,55 @@ @@ -462,7 +512,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ //(*testout) << "curvature " << curvature << endl; -@@ -886,51 +883,47 @@ +@@ -886,51 +895,47 @@ pm1.SetX(0.5*(par0.X()+par2.X())); pm1.SetY(0.5*(par0.Y()+par2.Y())); pm2.SetX(0.5*(par1.X()+par0.X())); pm2.SetY(0.5*(par1.Y()+par0.Y())); @@ -529,7 +579,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl; */ } -@@ -970,7 +963,7 @@ +@@ -970,7 +975,7 @@ if (mparam.uselocalh) { @@ -538,7 +588,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ multithread.percent = 0; mesh->SetLocalH (bb.PMin(), bb.PMax(), mparam.grading); -@@ -1075,7 +1068,6 @@ +@@ -1075,7 +1080,6 @@ if (triangulation.IsNull()) continue; BRepAdaptor_Surface sf(face, Standard_True); @@ -546,7 +596,7 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ int ntriangles = triangulation -> NbTriangles(); for (int j = 1; j <= ntriangles; j++) -@@ -1096,7 +1088,7 @@ +@@ -1096,7 +1100,7 @@ maxside = max (maxside, p[1].Distance(p[2])); //cout << "\rFace " << i << " pos11 ntriangles " << ntriangles << " maxside " << maxside << flush; @@ -555,9 +605,9 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgenmesh.cpp netgen-4.5_patch/libsrc/occ/ //cout << "\rFace " << i << " pos12 ntriangles " << ntriangles << flush; } } -diff -Nru netgen-4.5_orig/libsrc/occ/occgeom.cpp netgen-4.5_patch/libsrc/occ/occgeom.cpp ---- netgen-4.5_orig/libsrc/occ/occgeom.cpp 2006-01-25 15:35:50.000000000 +0300 -+++ netgen-4.5_patch/libsrc/occ/occgeom.cpp 2006-10-25 16:15:24.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/occ/occgeom.cpp netgen-4.5.new/libsrc/occ/occgeom.cpp +--- netgen-4.5.old/libsrc/occ/occgeom.cpp 2006-01-25 16:35:50.000000000 +0300 ++++ netgen-4.5.new/libsrc/occ/occgeom.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -7,6 +7,8 @@ #include "ShapeAnalysis_ShapeContents.hxx" #include "ShapeAnalysis_CheckSmallFace.hxx" @@ -734,9 +784,9 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgeom.cpp netgen-4.5_patch/libsrc/occ/occ return true; } -diff -Nru netgen-4.5_orig/libsrc/occ/occgeom.hpp netgen-4.5_patch/libsrc/occ/occgeom.hpp ---- netgen-4.5_orig/libsrc/occ/occgeom.hpp 2006-01-25 15:35:50.000000000 +0300 -+++ netgen-4.5_patch/libsrc/occ/occgeom.hpp 2006-10-25 16:16:01.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/occ/occgeom.hpp netgen-4.5.new/libsrc/occ/occgeom.hpp +--- netgen-4.5.old/libsrc/occ/occgeom.hpp 2006-01-25 16:35:50.000000000 +0300 ++++ netgen-4.5.new/libsrc/occ/occgeom.hpp 2008-02-12 14:57:01.000000000 +0300 @@ -15,8 +15,6 @@ #include "Geom_Curve.hxx" #include "Geom2d_Curve.hxx" @@ -813,9 +863,9 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occgeom.hpp netgen-4.5_patch/libsrc/occ/occ OCCSurface GetSurface (int surfi) { cout << "OCCGeometry::GetSurface using PLANESPACE" << endl; -diff -Nru netgen-4.5_orig/libsrc/occ/occmeshsurf.cpp netgen-4.5_patch/libsrc/occ/occmeshsurf.cpp ---- netgen-4.5_orig/libsrc/occ/occmeshsurf.cpp 2006-01-25 15:36:26.000000000 +0300 -+++ netgen-4.5_patch/libsrc/occ/occmeshsurf.cpp 2006-10-25 16:16:26.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/occ/occmeshsurf.cpp netgen-4.5.new/libsrc/occ/occmeshsurf.cpp +--- netgen-4.5.old/libsrc/occ/occmeshsurf.cpp 2006-01-25 16:36:26.000000000 +0300 ++++ netgen-4.5.new/libsrc/occ/occmeshsurf.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -5,6 +5,8 @@ #include #include @@ -931,9 +981,9 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occmeshsurf.cpp netgen-4.5_patch/libsrc/occ -diff -Nru netgen-4.5_orig/libsrc/occ/occmeshsurf.hpp netgen-4.5_patch/libsrc/occ/occmeshsurf.hpp ---- netgen-4.5_orig/libsrc/occ/occmeshsurf.hpp 2005-06-09 18:51:10.000000000 +0400 -+++ netgen-4.5_patch/libsrc/occ/occmeshsurf.hpp 2006-10-25 16:17:22.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/occ/occmeshsurf.hpp netgen-4.5.new/libsrc/occ/occmeshsurf.hpp +--- netgen-4.5.old/libsrc/occ/occmeshsurf.hpp 2005-06-09 18:51:10.000000000 +0400 ++++ netgen-4.5.new/libsrc/occ/occmeshsurf.hpp 2008-02-12 14:57:01.000000000 +0300 @@ -151,7 +151,7 @@ MeshOptimize2dOCCSurfaces (const OCCGeometry & ageometry); @@ -953,9 +1003,9 @@ diff -Nru netgen-4.5_orig/libsrc/occ/occmeshsurf.hpp netgen-4.5_patch/libsrc/occ }; -diff -Nru netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.cpp netgen-4.5_patch/libsrc/stlgeom/meshstlsurface.cpp ---- netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.cpp 2006-01-11 18:08:20.000000000 +0300 -+++ netgen-4.5_patch/libsrc/stlgeom/meshstlsurface.cpp 2006-10-25 16:17:47.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/stlgeom/meshstlsurface.cpp netgen-4.5.new/libsrc/stlgeom/meshstlsurface.cpp +--- netgen-4.5.old/libsrc/stlgeom/meshstlsurface.cpp 2006-01-11 19:08:20.000000000 +0300 ++++ netgen-4.5.new/libsrc/stlgeom/meshstlsurface.cpp 2008-02-12 14:57:01.000000000 +0300 @@ -946,20 +946,23 @@ } @@ -1004,9 +1054,9 @@ diff -Nru netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.cpp netgen-4.5_patch/lib void MeshOptimizeSTLSurface :: GetNormalVector(INDEX surfind, const Point3d & p, Vec3d & n) const { n = geom.GetChartNormalVector(); -diff -Nru netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.hpp netgen-4.5_patch/libsrc/stlgeom/meshstlsurface.hpp ---- netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.hpp 2004-09-30 17:13:56.000000000 +0400 -+++ netgen-4.5_patch/libsrc/stlgeom/meshstlsurface.hpp 2006-10-25 16:17:59.000000000 +0400 +diff -Naur netgen-4.5.old/libsrc/stlgeom/meshstlsurface.hpp netgen-4.5.new/libsrc/stlgeom/meshstlsurface.hpp +--- netgen-4.5.old/libsrc/stlgeom/meshstlsurface.hpp 2004-09-30 17:13:56.000000000 +0400 ++++ netgen-4.5.new/libsrc/stlgeom/meshstlsurface.hpp 2008-02-12 14:57:01.000000000 +0300 @@ -79,12 +79,10 @@ virtual void SelectSurfaceOfPoint (const Point3d & p, const PointGeomInfo & gi); @@ -1021,9 +1071,9 @@ diff -Nru netgen-4.5_orig/libsrc/stlgeom/meshstlsurface.hpp netgen-4.5_patch/lib virtual void GetNormalVector(INDEX surfind, const Point3d & p, Vec3d & n) const; }; -diff -Nru netgen-4.5_orig/makeForSalome.sh netgen-4.5_patch/makeForSalome.sh ---- netgen-4.5_orig/makeForSalome.sh 1970-01-01 03:00:00.000000000 +0300 -+++ netgen-4.5_patch/makeForSalome.sh 2006-04-27 13:12:54.000000000 +0400 +diff -Naur netgen-4.5.old/makeForSalome.sh netgen-4.5.new/makeForSalome.sh +--- netgen-4.5.old/makeForSalome.sh 1970-01-01 03:00:00.000000000 +0300 ++++ netgen-4.5.new/makeForSalome.sh 2008-02-12 14:57:01.000000000 +0300 @@ -0,0 +1,31 @@ +#! /bin/sh +cp ngtcltk/ngnewdelete.* libsrc/interface/ @@ -1056,3 +1106,124 @@ diff -Nru netgen-4.5_orig/makeForSalome.sh netgen-4.5_patch/makeForSalome.sh + libsrc/occ/*.hpp libsrc/opti/*.hpp libsrc/include/mydefs.hpp \ + libsrc/stlgeom/*.hpp libsrc/include/mystdlib.h \ + install/include +diff -Naur netgen-4.5.old/libsrc/occ/Partition_Inter2d.cxx netgen-4.5.new/libsrc/occ/Partition_Inter2d.cxx +--- netgen-4.5.old/libsrc/occ/Partition_Inter2d.cxx 2005-06-09 18:51:10.000000000 +0400 ++++ netgen-4.5.new/libsrc/occ/Partition_Inter2d.cxx 2008-02-26 12:34:14.000000000 +0300 +@@ -29,10 +29,10 @@ + // $Header$ + + //using namespace std; +-#include "Partition_Inter2d.ixx" +- + #include "utilities.h" + ++#include "Partition_Inter2d.ixx" ++ + #include + #include + #include +diff -Naur netgen-4.5.old/libsrc/occ/Partition_Inter3d.cxx netgen-4.5.new/libsrc/occ/Partition_Inter3d.cxx +--- netgen-4.5.old/libsrc/occ/Partition_Inter3d.cxx 2005-06-09 18:51:10.000000000 +0400 ++++ netgen-4.5.new/libsrc/occ/Partition_Inter3d.cxx 2008-02-26 12:36:27.000000000 +0300 +@@ -29,13 +29,17 @@ + // $Header$ + + //using namespace std; ++ ++#include "utilities.h" ++ + #include "Partition_Inter2d.hxx" + #include "Partition_Inter3d.ixx" +-#include "utilities.h" + + #include + #include + #include ++//using namespace std; ++ + #include + #include + #include +diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop2d.cxx netgen-4.5.new/libsrc/occ/Partition_Loop2d.cxx +--- netgen-4.5.old/libsrc/occ/Partition_Loop2d.cxx 2005-06-09 18:51:10.000000000 +0400 ++++ netgen-4.5.new/libsrc/occ/Partition_Loop2d.cxx 2008-02-26 12:37:10.000000000 +0300 +@@ -12,9 +12,11 @@ + // $Header$ + + //using namespace std; +-#include "Partition_Loop2d.ixx" ++ + + #include "utilities.h" ++ ++#include "Partition_Loop2d.ixx" + #include + + #include +diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop3d.cxx netgen-4.5.new/libsrc/occ/Partition_Loop3d.cxx +--- netgen-4.5.old/libsrc/occ/Partition_Loop3d.cxx 2005-06-09 18:51:10.000000000 +0400 ++++ netgen-4.5.new/libsrc/occ/Partition_Loop3d.cxx 2008-02-26 12:39:32.000000000 +0300 +@@ -10,6 +10,11 @@ + // Module : GEOM + + //using namespace std; ++ ++ ++ ++#include "utilities.h" ++ + #include "Partition_Loop3d.ixx" + + #include +diff -Naur netgen-4.5.old/libsrc/occ/Partition_Loop.cxx netgen-4.5.new/libsrc/occ/Partition_Loop.cxx +--- netgen-4.5.old/libsrc/occ/Partition_Loop.cxx 2005-06-09 18:51:10.000000000 +0400 ++++ netgen-4.5.new/libsrc/occ/Partition_Loop.cxx 2008-02-26 12:40:41.000000000 +0300 +@@ -29,12 +29,14 @@ + // $Header$ + + //using namespace std; +-#include + +-#include "Partition_Loop.ixx" + + #include "utilities.h" + ++#include ++ ++#include "Partition_Loop.ixx" ++ + #include + #include + #include +diff -Naur netgen-4.5.old/libsrc/occ/Partition_Spliter.cxx netgen-4.5.new/libsrc/occ/Partition_Spliter.cxx +--- netgen-4.5.old/libsrc/occ/Partition_Spliter.cxx 2005-07-11 10:33:27.000000000 +0400 ++++ netgen-4.5.new/libsrc/occ/Partition_Spliter.cxx 2008-02-26 12:41:32.000000000 +0300 +@@ -29,14 +29,15 @@ + // $Header$ + + //using namespace std; ++ ++#include "utilities.h" ++ + #include "Partition_Inter2d.hxx" + #include "Partition_Inter3d.hxx" + #include "Partition_Loop2d.hxx" + #include "Partition_Loop3d.hxx" + #include "Partition_Spliter.ixx" + +-#include "utilities.h" +- + #include + #include + #include +diff -Naur netgen-4.5.old/libsrc/occ/utilities.h netgen-4.5.new/libsrc/occ/utilities.h +--- netgen-4.5.old/libsrc/occ/utilities.h 2005-02-11 14:35:43.000000000 +0300 ++++ netgen-4.5.new/libsrc/occ/utilities.h 2008-02-26 12:28:02.000000000 +0300 +@@ -33,6 +33,7 @@ + + #include + #include ++#include + #include + // #include "SALOME_Log.hxx" + diff --git a/src/NETGEN/netgen45lib64.patch b/src/NETGEN/netgen45lib64.patch index 1593971..6a29138 100755 --- a/src/NETGEN/netgen45lib64.patch +++ b/src/NETGEN/netgen45lib64.patch @@ -5,8 +5,8 @@ diff -ur netgen-4.5.old/libsrc/makefile.inc netgen-4.5.new/libsrc/makefile.inc # include $(LIBSRC_DIR)/makefile.mach.$(MACHINE) # --CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \ -+CPLUSPLUSFLAGS1 = -c -m64 -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \ +-CPLUSPLUSFLAGS1 = -c -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \ ++CPLUSPLUSFLAGS1 = -c -m64 -D_OCC64 -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \ -DOCCGEOMETRY -DOCC52 -DHAVE_IOSTREAM -DHAVE_LIMITS_H # ARFLAGS = r @@ -39,7 +39,7 @@ diff -ur netgen-4.5.old/Makefile netgen-4.5.new/Makefile #CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL -CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) -I./ngsolve/include -Ilibsrc/interface -DOPENGL -I$(METISINC) -+CPLUSPLUSFLAGS1 = -c -m64 -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) -I./ngsolve/include -Ilibsrc/interface -I$(METISINC) ++CPLUSPLUSFLAGS1 = -c -m64 -D_OCC64 -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) -I./ngsolve/include -Ilibsrc/interface -I$(METISINC) LINKFLAGS1 = -lGL -lGLU -lX11 -lXext -lXmu # diff --git a/src/NETGENPlugin/Makefile.am b/src/NETGENPlugin/Makefile.am index 7a10e1e..de09762 100644 --- a/src/NETGENPlugin/Makefile.am +++ b/src/NETGENPlugin/Makefile.am @@ -1,5 +1,7 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -15,21 +17,36 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # -* Makefile *- -# # Author : Edward AGAPOV (OCC) # Modified by : Alexander BORODIN (OCN) - autotools usage # Module : NETGENPLUGIN # Date : 10/01/2004 # -# - include $(top_srcdir)/adm_local/unix/make_common_starter.am -# header files -salomeinclude_HEADERS = +# header files +salomeinclude_HEADERS = \ + NETGENPlugin_NETGEN_3D.hxx \ + NETGENPlugin_NETGEN_3D_i.hxx \ + NETGENPlugin_NETGEN_2D.hxx \ + NETGENPlugin_NETGEN_2D_i.hxx \ + NETGENPlugin_NETGEN_2D3D.hxx \ + NETGENPlugin_NETGEN_2D3D_i.hxx \ + NETGENPlugin_NETGEN_2D_ONLY.hxx \ + NETGENPlugin_NETGEN_2D_ONLY_i.hxx \ + NETGENPlugin_Hypothesis.hxx \ + NETGENPlugin_Hypothesis_i.hxx \ + NETGENPlugin_Hypothesis_2D.hxx \ + NETGENPlugin_Hypothesis_2D_i.hxx \ + NETGENPlugin_SimpleHypothesis_2D.hxx \ + NETGENPlugin_SimpleHypothesis_3D.hxx \ + NETGENPlugin_SimpleHypothesis_2D_i.hxx \ + NETGENPlugin_SimpleHypothesis_3D_i.hxx \ + NETGENPlugin_Mesher.hxx \ + NETGENPlugin_Defs.hxx # Libraries targets lib_LTLIBRARIES = libNETGENEngine.la @@ -48,6 +65,10 @@ dist_libNETGENEngine_la_SOURCES = \ NETGENPlugin_Hypothesis_2D.cxx \ NETGENPlugin_Hypothesis_2D_i.cxx \ NETGENPlugin_Mesher.cxx \ + NETGENPlugin_SimpleHypothesis_2D.cxx \ + NETGENPlugin_SimpleHypothesis_3D.cxx \ + NETGENPlugin_SimpleHypothesis_2D_i.cxx \ + NETGENPlugin_SimpleHypothesis_3D_i.cxx \ NETGENPlugin_i.cxx libNETGENEngine_la_CPPFLAGS = \ diff --git a/src/NETGENPlugin/NETGENPlugin_Defs.hxx b/src/NETGENPlugin/NETGENPlugin_Defs.hxx index 5ed43a2..2eb36ac 100755 --- a/src/NETGENPlugin/NETGENPlugin_Defs.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Defs.hxx @@ -1,26 +1,28 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +// Copyright (C) 2007-2008 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// 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 +// 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. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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 // //============================================================================= // File : NETGENPlugin_Defs.hxx // Author : Alexander A. BORODIN - +// #ifndef _NETGENPlugin_DEFS_HXX_ #define _NETGENPlugin_DEFS_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx index bda2508..75100b5 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx @@ -1,31 +1,30 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Hypothesis.cxx // Author : Michael Sazonov (OCN) // Date : 28/03/2006 // Project : SALOME -// $Header$ -//============================================================================= - +// #include #include @@ -289,11 +288,26 @@ istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp) */ //================================================================================ bool NETGENPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* theMesh, - const TopoDS_Shape& theShape) + const TopoDS_Shape& theShape) { return false; } +//================================================================================ +/*! + * \brief Initialize my parameter values by default parameters. + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool NETGENPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts, + const SMESH_Mesh* /*theMesh*/) +{ + _nbSegPerEdge = dflts._nbSegments; + _maxSize = dflts._elemLength; + return _nbSegPerEdge && _maxSize > 0; +} + //============================================================================= /*! * diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx index f52504b..3654f86 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx @@ -1,31 +1,30 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Hypothesis.hxx // Author : Michael Sazonov (OCN) // Date : 27/03/2006 // Project : SALOME -// $Header$ -//============================================================================= - +// #ifndef _NETGENPlugin_Hypothesis_HXX_ #define _NETGENPlugin_Hypothesis_HXX_ @@ -102,6 +101,12 @@ public: */ virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + /*! + * \brief Initialize my parameter values by default parameters. + * \retval bool - true if parameter values have been successfully defined + */ + virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); + private: double _maxSize; double _growthRate; diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx index 0b157fc..eac7350 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx @@ -1,31 +1,32 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Hypothesis_2D.cxx // Author : Michael Sazonov (OCN) // Date : 28/03/2006 // Project : SALOME // $Header$ //============================================================================= - +// #include #include diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx index 5b6d1eb..07f1195 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx @@ -1,31 +1,32 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Hypothesis_2D.hxx // Author : Michael Sazonov (OCN) // Date : 27/03/2006 // Project : SALOME // $Header$ //============================================================================= - +// #ifndef _NETGENPlugin_Hypothesis_2D_HXX_ #define _NETGENPlugin_Hypothesis_2D_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx index baabaeb..cdb595c 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx @@ -1,30 +1,32 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Hypothesis_2D_i.cxx // Author : Michael Sazonov (OCN) // Date : 03/04/2006 // Project : SALOME // $Header$ //============================================================================= +// #include "NETGENPlugin_Hypothesis_2D_i.hxx" #include "SMESH_Gen.hxx" #include "SMESH_PythonDump.hxx" diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx index 44b8db2..1a94bc6 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx @@ -1,31 +1,32 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Hypothesis_2D_i.hxx // Author : Michael Sazonov (OCN) // Date : 03/04/2006 // Project : SALOME // $Header$ //============================================================================= - +// #ifndef _NETGENPlugin_Hypothesis_2D_i_HXX_ #define _NETGENPlugin_Hypothesis_2D_i_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx index 9836d2c..f13e9db 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx @@ -1,30 +1,32 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Hypothesis_i.cxx // Author : Michael Sazonov (OCN) // Date : 03/04/2006 // Project : SALOME // $Header$ //============================================================================= +// #include "NETGENPlugin_Hypothesis_i.hxx" #include "SMESH_Gen.hxx" #include "SMESH_PythonDump.hxx" diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx index 6651617..94ad126 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx @@ -1,31 +1,32 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Hypothesis_i.hxx // Author : Michael Sazonov (OCN) // Date : 03/04/2006 // Project : SALOME // $Header$ //============================================================================= - +// #ifndef _NETGENPlugin_Hypothesis_i_HXX_ #define _NETGENPlugin_Hypothesis_i_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index b1be861..0d86eca 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -1,38 +1,41 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Mesher.cxx // Author : Michael Sazonov (OCN) // Date : 31/03/2006 // Project : SALOME // $Header$ //============================================================================= - +// #include "NETGENPlugin_Mesher.hxx" #include "NETGENPlugin_Hypothesis_2D.hxx" +#include "NETGENPlugin_SimpleHypothesis_3D.hxx" #include #include #include #include +#include #include #include #include @@ -48,6 +51,8 @@ #include #include #include +#include +#include // Netgen include files namespace nglib { @@ -73,17 +78,28 @@ using namespace std; NETGENPlugin_Mesher::NETGENPlugin_Mesher (SMESH_Mesh* mesh, const TopoDS_Shape& aShape, const bool isVolume) - : _mesh (mesh), + : _mesh (mesh), _shape (aShape), _isVolume(isVolume), - _optimize(true) + _optimize(true), + _simpleHyp(NULL) +{ + defaultParameters(); +} + +//================================================================================ +/*! + * \brief Initialize global NETGEN parameters with default values + */ +//================================================================================ + +void NETGENPlugin_Mesher::defaultParameters() { #ifdef WNT netgen::MeshingParameters& mparams = netgen::GlobalMeshingParameters(); #else netgen::MeshingParameters& mparams = netgen::mparam; #endif - // Initialize global NETGEN parameters by default values: // maximal mesh edge size mparams.maxh = NETGENPlugin_Hypothesis::GetDefaultMaxSize(); // minimal number of segments per edge @@ -132,9 +148,23 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp) mparams.quad = static_cast (hyp)->GetQuadAllowed() ? 1 : 0; _optimize = hyp->GetOptimize(); + _simpleHyp = NULL; } } +//============================================================================= +/*! + * Pass simple parameters to NETGEN + */ +//============================================================================= + +void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_SimpleHypothesis_2D* hyp) +{ + _simpleHyp = hyp; + if ( _simpleHyp ) + defaultParameters(); +} + //============================================================================= /*! * Link - a pair of integer numbers @@ -164,15 +194,19 @@ Standard_Boolean IsEqual(const Link& aLink1, const Link& aLink2) */ //================================================================================ -void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo, - const TopoDS_Shape& shape) +void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo, + const TopoDS_Shape& shape, + SMESH_Mesh& mesh, + list< SMESH_subMesh* > * meshedSM) { - occgeo.shape = shape; - occgeo.changed = 1; - occgeo.BuildFMap(); - BRepTools::Clean (shape); - BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, 0.01, true); + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, 0.01, true); + } catch (Standard_Failure) { + } Bnd_Box bb; BRepBndLib::Add (shape, bb); double x1,y1,z1,x2,y2,z2; @@ -183,6 +217,280 @@ void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo, netgen::Point<3> p1 = netgen::Point<3> (x1,y1,z1); netgen::Point<3> p2 = netgen::Point<3> (x2,y2,z2); occgeo.boundingbox = netgen::Box<3> (p1,p2); + + occgeo.shape = shape; + occgeo.changed = 1; + //occgeo.BuildFMap(); + + // fill maps of shapes of occgeo with not yet meshed subshapes + + // get root submeshes + list< SMESH_subMesh* > rootSM; + if ( SMESH_subMesh* sm = mesh.GetSubMeshContaining( shape )) { + rootSM.push_back( sm ); + } + else { + for ( TopoDS_Iterator it( shape ); it.More(); it.Next() ) + rootSM.push_back( mesh.GetSubMesh( it.Value() )); + } + + // add subshapes of empty submeshes + list< SMESH_subMesh* >::iterator rootIt = rootSM.begin(), rootEnd = rootSM.end(); + for ( ; rootIt != rootEnd; ++rootIt ) { + SMESH_subMesh * root = *rootIt; + SMESH_subMeshIteratorPtr smIt = root->getDependsOnIterator(/*includeSelf=*/true, + /*complexShapeFirst=*/true); + // to find a right orientation of subshapes (PAL20462) + TopTools_IndexedMapOfShape subShapes; + TopExp::MapShapes(root->GetSubShape(), subShapes); + while ( smIt->more() ) { + SMESH_subMesh* sm = smIt->next(); + if ( sm->IsEmpty() ) { + TopoDS_Shape shape = sm->GetSubShape(); + if ( shape.ShapeType() != TopAbs_VERTEX ) + shape = subShapes( subShapes.FindIndex( shape ));// - shape->index->oriented shape + switch ( shape.ShapeType() ) { + case TopAbs_FACE : occgeo.fmap.Add( shape ); break; + case TopAbs_EDGE : occgeo.emap.Add( shape ); break; + case TopAbs_VERTEX: occgeo.vmap.Add( shape ); break; + case TopAbs_SOLID :occgeo.somap.Add( shape ); break; + default:; + } + } + // collect submeshes of meshed shapes + else if (meshedSM) { + meshedSM->push_back( sm ); + } + } + } + occgeo.facemeshstatus.SetSize (occgeo.fmap.Extent()); + occgeo.facemeshstatus = 0; + +} + +//================================================================================ +/*! + * \brief return id of netgen point corresponding to SMDS node + */ +//================================================================================ + +static int ngNodeId( const SMDS_MeshNode* node, + netgen::Mesh& ngMesh, + map< const SMDS_MeshNode*, int >& nodeNgIdMap) +{ + int newNgId = ngMesh.GetNP() + 1; + + pair< map< const SMDS_MeshNode*, int >::iterator, bool > it_isNew = + nodeNgIdMap.insert( make_pair( node, newNgId )); + + if ( it_isNew.second ) { + netgen::MeshPoint p( netgen::Point<3> (node->X(), node->Y(), node->Z()) ); + ngMesh.AddPoint( p ); + } + return it_isNew.first->second; +} + +//================================================================================ +/*! + * \brief fill ngMesh with nodes and elements of computed submeshes + */ +//================================================================================ + +bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom, + netgen::Mesh& ngMesh, + vector& nodeVec, + const list< SMESH_subMesh* > & meshedSM) +{ + map< const SMDS_MeshNode*, int > nodeNgIdMap; + + TopTools_MapOfShape visitedShapes; + + SMESH_MesherHelper helper (*_mesh); + + int faceID = occgeom.fmap.Extent(); + _faceDescriptors.clear(); + + list< SMESH_subMesh* >::const_iterator smIt, smEnd = meshedSM.end(); + for ( smIt = meshedSM.begin(); smIt != smEnd; ++smIt ) + { + SMESH_subMesh* sm = *smIt; + if ( !visitedShapes.Add( sm->GetSubShape() )) + continue; + + SMESHDS_SubMesh * smDS = sm->GetSubMeshDS(); + + switch ( sm->GetSubShape().ShapeType() ) + { + case TopAbs_EDGE: { // EDGE + // ---------------------- + const TopoDS_Edge& geomEdge = TopoDS::Edge( sm->GetSubShape() ); + + // Add ng segments for each not meshed face the edge bounds + TopTools_MapOfShape visitedAncestors; + const TopTools_ListOfShape& ancestors = _mesh->GetAncestors( geomEdge ); + TopTools_ListIteratorOfListOfShape ancestorIt ( ancestors ); + for ( ; ancestorIt.More(); ancestorIt.Next() ) + { + const TopoDS_Shape & ans = ancestorIt.Value(); + if ( ans.ShapeType() != TopAbs_FACE || !visitedAncestors.Add( ans )) + continue; + const TopoDS_Face& face = TopoDS::Face( ans ); + + int faceID = occgeom.fmap.FindIndex( face ); + if ( faceID < 1 ) + continue; // meshed face + + // find out orientation of geomEdge within face + bool isForwad = false; + for ( TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next() ) { + if ( geomEdge.IsSame( exp.Current() )) { + isForwad = ( exp.Current().Orientation() == geomEdge.Orientation() ); + break; + } + } + bool isQuad = smDS->GetElements()->next()->IsQuadratic(); + + // get all nodes from geomEdge + StdMeshers_FaceSide fSide( face, geomEdge, _mesh, isForwad, isQuad ); + const vector& points = fSide.GetUVPtStruct(); + int i, nbSeg = fSide.NbSegments(); + + double otherSeamParam = 0; + helper.SetSubShape( face ); + bool isSeam = helper.IsRealSeam( geomEdge ); + if ( isSeam ) + otherSeamParam = + helper.GetOtherParam( helper.GetPeriodicIndex() == 1 ? points[0].u : points[0].v ); + + // add segments + + int prevNgId = ngNodeId( points[0].node, ngMesh, nodeNgIdMap ); + + for ( i = 0; i < nbSeg; ++i ) + { + const UVPtStruct& p1 = points[ i ]; + const UVPtStruct& p2 = points[ i+1 ]; + + netgen::Segment seg; + // ng node ids + seg.p1 = prevNgId; + seg.p2 = prevNgId = ngNodeId( p2.node, ngMesh, nodeNgIdMap ); + // node param on curve + seg.epgeominfo[ 0 ].dist = p1.param; + seg.epgeominfo[ 1 ].dist = p2.param; + // uv on face + seg.epgeominfo[ 0 ].u = p1.u; + seg.epgeominfo[ 0 ].v = p1.v; + seg.epgeominfo[ 1 ].u = p2.u; + seg.epgeominfo[ 1 ].v = p2.v; + + //seg.epgeominfo[ iEnd ].edgenr = edgeID; // = geom.emap.FindIndex(edge); + seg.si = faceID; // = geom.fmap.FindIndex (face); + seg.edgenr = ngMesh.GetNSeg() + 1; // segment id + ngMesh.AddSegment (seg); + + if ( isSeam ) + { + if ( helper.GetPeriodicIndex() == 1 ) { + seg.epgeominfo[ 0 ].u = otherSeamParam; + seg.epgeominfo[ 1 ].u = otherSeamParam; + swap (seg.epgeominfo[0].v, seg.epgeominfo[1].v); + } else { + seg.epgeominfo[ 0 ].v = otherSeamParam; + seg.epgeominfo[ 1 ].v = otherSeamParam; + swap (seg.epgeominfo[0].u, seg.epgeominfo[1].u); + } + swap (seg.p1, seg.p2); + swap (seg.epgeominfo[0].dist, seg.epgeominfo[1].dist); + seg.edgenr = ngMesh.GetNSeg() + 1; // segment id + ngMesh.AddSegment (seg); + } + } + } // loop on geomEdge ancestors + + break; + } // case TopAbs_EDGE + + case TopAbs_FACE: { // FACE + // ---------------------- + const TopoDS_Face& geomFace = TopoDS::Face( sm->GetSubShape() ); + helper.SetSubShape( geomFace ); + + // find solids geomFace bounds + int solidID1 = 0, solidID2 = 0; + const TopTools_ListOfShape& ancestors = _mesh->GetAncestors( geomFace ); + TopTools_ListIteratorOfListOfShape ancestorIt ( ancestors ); + for ( ; ancestorIt.More(); ancestorIt.Next() ) + { + const TopoDS_Shape & solid = ancestorIt.Value(); + if ( solid.ShapeType() == TopAbs_SOLID ) { + int id = occgeom.somap.FindIndex ( solid ); + if ( solidID1 && id != solidID1 ) solidID2 = id; + else solidID1 = id; + } + } + faceID++; + _faceDescriptors[ faceID ].first = solidID1; + _faceDescriptors[ faceID ].second = solidID2; + + // add surface elements + SMDS_ElemIteratorPtr faces = smDS->GetElements(); + while ( faces->more() ) { + + const SMDS_MeshElement* f = faces->next(); + if ( f->NbNodes() % 3 != 0 ) { // not triangle + for ( ancestorIt.Initialize(ancestors); ancestorIt.More(); ancestorIt.Next() ) + if ( ancestorIt.Value().ShapeType() == TopAbs_SOLID ) { + sm = _mesh->GetSubMesh( ancestorIt.Value() ); + break; + } + SMESH_ComputeErrorPtr& smError = sm->GetComputeError(); + smError.reset( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"Not triangle submesh")); + smError->myBadElements.push_back( f ); + return false; + } + + netgen::Element2d tri(3); + tri.SetIndex ( faceID ); + + for ( int i = 0; i < 3; ++i ) { + const SMDS_MeshNode* node = f->GetNode( i ), * inFaceNode=0; + if ( helper.IsSeamShape( node->GetPosition()->GetShapeId() )) + if ( helper.IsSeamShape( f->GetNode( i+1 )->GetPosition()->GetShapeId() )) + inFaceNode = f->GetNode( i-1 ); + else + inFaceNode = f->GetNode( i+1 ); + + gp_XY uv = helper.GetNodeUV( geomFace, node, inFaceNode ); + tri.GeomInfoPi(i+1).u = uv.X(); + tri.GeomInfoPi(i+1).v = uv.Y(); + tri.PNum(i+1) = ngNodeId( node, ngMesh, nodeNgIdMap ); + } + + ngMesh.AddSurfaceElement (tri); + + } + break; + } // + + case TopAbs_VERTEX: { // VERTEX + // -------------------------- + SMDS_NodeIteratorPtr nodeIt = smDS->GetNodes(); + if ( nodeIt->more() ) + ngNodeId( nodeIt->next(), ngMesh, nodeNgIdMap ); + break; + } + default:; + } // switch + } // loop on submeshes + + // fill nodeVec + nodeVec.resize( ngMesh.GetNP() + 1 ); + map< const SMDS_MeshNode*, int >::iterator node_NgId, nodeNgIdEnd = nodeNgIdMap.end(); + for ( node_NgId = nodeNgIdMap.begin(); node_NgId != nodeNgIdEnd; ++node_NgId) + nodeVec[ node_NgId->second ] = (SMDS_MeshNode*) node_NgId->first; + + return true; } //============================================================================= @@ -214,31 +522,133 @@ bool NETGENPlugin_Mesher::Compute() // ------------------------- netgen::OCCGeometry occgeo; - PrepareOCCgeometry( occgeo, _shape ); + list< SMESH_subMesh* > meshedSM; + PrepareOCCgeometry( occgeo, _shape, *_mesh, &meshedSM ); // ------------------------- // Generate the mesh // ------------------------- netgen::Mesh *ngMesh = NULL; - // we start always with ANALYSE, - // but end depending on _optimize and _isVolume - int startWith = netgen::MESHCONST_ANALYSE; - int endWith = (_optimize - ? (_isVolume ? netgen::MESHCONST_OPTVOLUME : netgen::MESHCONST_OPTSURFACE) - : netgen::MESHCONST_MESHSURFACE); - char *optstr = 0; - int err = 0; SMESH_Comment comment; + int err = 0; + int nbInitNod = 0; + int nbInitSeg = 0; + int nbInitFac = 0; + // vector of nodes in which node index == netgen ID + vector< SMDS_MeshNode* > nodeVec; try { + // ---------------- + // compute 1D mesh + // ---------------- + // pass 1D simple parameters to NETGEN + if ( _simpleHyp ) { + if ( int nbSeg = _simpleHyp->GetNumberOfSegments() ) { + // nb of segments + mparams.segmentsperedge = nbSeg + 0.1; + mparams.maxh = occgeo.boundingbox.Diam(); + mparams.grading = 0; + } + else { + // segment length + mparams.segmentsperedge = 1; + mparams.maxh = _simpleHyp->GetLocalLength(); + } + } + // let netgen create ngMesh and calculate element size on not meshed shapes + char *optstr = 0; + int startWith = netgen::MESHCONST_ANALYSE; + int endWith = netgen::MESHCONST_ANALYSE; err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr); - if (err) comment << "Error in netgen::OCCGenerateMesh()"; - if (!err && !_optimize) + if (err) comment << "Error in netgen::OCCGenerateMesh() at MESHCONST_ANALYSE step"; + + // fill ngMesh with nodes and elements of computed submeshes + err = ! fillNgMesh(occgeo, *ngMesh, nodeVec, meshedSM); + nbInitNod = ngMesh->GetNP(); + nbInitSeg = ngMesh->GetNSeg(); + nbInitFac = ngMesh->GetNSE(); + + // compute mesh + if (!err) { - // we have got surface mesh only, so generate volume mesh - startWith = endWith = netgen::MESHCONST_MESHVOLUME; + startWith = endWith = netgen::MESHCONST_MESHEDGES; + err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr); + if (err) comment << "Error in netgen::OCCGenerateMesh() at 1D mesh generation"; + } + // --------------------- + // compute surface mesh + // --------------------- + if (!err) + { + // pass 2D simple parameters to NETGEN + if ( _simpleHyp ) { + if ( double area = _simpleHyp->GetMaxElementArea() ) { + // face area + mparams.maxh = sqrt(2. * area/sqrt(3.0)); + mparams.grading = 0.4; // moderate size growth + } + else { + // length from edges + double length = 0; + for ( TopExp_Explorer exp( _shape, TopAbs_EDGE ); exp.More(); exp.Next() ) + length += SMESH_Algo::EdgeLength( TopoDS::Edge( exp.Current() )); + if ( ngMesh->GetNSeg() ) + mparams.maxh = length / ngMesh->GetNSeg(); + else + mparams.maxh = 1000; + mparams.grading = 0.2; // slow size growth + } + mparams.maxh = min( mparams.maxh, occgeo.boundingbox.Diam()/2 ); + ngMesh->SetGlobalH (mparams.maxh); + netgen::Box<3> bb = occgeo.GetBoundingBox(); + bb.Increase (bb.Diam()/20); + ngMesh->SetLocalH (bb.PMin(), bb.PMax(), mparams.grading); + } + // let netgen compute 2D mesh + startWith = netgen::MESHCONST_MESHSURFACE; + endWith = _optimize ? netgen::MESHCONST_OPTSURFACE : netgen::MESHCONST_MESHSURFACE; + err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr); + if (err) comment << "Error in netgen::OCCGenerateMesh() at surface mesh generation"; + } + // --------------------- + // generate volume mesh + // --------------------- + if (!err && _isVolume) + { + // add ng face descriptors of meshed faces + std::map< int, std::pair >::iterator fId_soIds = _faceDescriptors.begin(); + for ( ; fId_soIds != _faceDescriptors.end(); ++fId_soIds ) { + int faceID = fId_soIds->first; + int solidID1 = fId_soIds->second.first; + int solidID2 = fId_soIds->second.second; + ngMesh->AddFaceDescriptor (netgen::FaceDescriptor(faceID, solidID1, solidID2, 0)); + } + // pass 3D simple parameters to NETGEN + const NETGENPlugin_SimpleHypothesis_3D* simple3d = + dynamic_cast< const NETGENPlugin_SimpleHypothesis_3D* > ( _simpleHyp ); + if ( simple3d ) { + if ( double vol = simple3d->GetMaxElementVolume() ) { + // max volume + mparams.maxh = pow( 72, 1/6. ) * pow( vol, 1/3. ); + mparams.maxh = min( mparams.maxh, occgeo.boundingbox.Diam()/2 ); + } + else { + // length from faces + mparams.maxh = ngMesh->AverageH(); + } +// netgen::ARRAY maxhdom; +// maxhdom.SetSize (occgeo.NrSolids()); +// maxhdom = mparams.maxh; +// ngMesh->SetMaxHDomain (maxhdom); + ngMesh->SetGlobalH (mparams.maxh); + mparams.grading = 0.4; + ngMesh->CalcLocalH(); + } + // let netgen compute 3D mesh + startWith = netgen::MESHCONST_MESHVOLUME; + endWith = _optimize ? netgen::MESHCONST_OPTVOLUME : netgen::MESHCONST_MESHVOLUME; err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr); if (err) comment << "Error in netgen::OCCGenerateMesh()"; } @@ -273,22 +683,21 @@ bool NETGENPlugin_Mesher::Compute() bool isOK = ( !err && (_isVolume ? (nbVol > 0) : (nbFac > 0)) ); if ( true /*isOK*/ ) // get whatever built { - // vector of nodes in which node index == netgen ID - vector< SMDS_MeshNode* > nodeVec ( nbNod + 1 ); // map of nodes assigned to submeshes NCollection_Map pindMap; // create and insert nodes into nodeVec + nodeVec.resize( nbNod + 1 ); int i; - for (i = 1; i <= nbNod /*&& isOK*/; ++i ) + for (i = nbInitNod+1; i <= nbNod /*&& isOK*/; ++i ) { const netgen::MeshPoint& ngPoint = ngMesh->Point(i); SMDS_MeshNode* node = NULL; bool newNodeOnVertex = false; TopoDS_Vertex aVert; - if (i <= occgeo.vmap.Extent()) + if (i-nbInitNod <= occgeo.vmap.Extent()) { // point on vertex - aVert = TopoDS::Vertex(occgeo.vmap(i)); + aVert = TopoDS::Vertex(occgeo.vmap(i-nbInitNod)); SMESHDS_SubMesh * submesh = meshDS->MeshElements(aVert); if (submesh) { @@ -322,7 +731,7 @@ bool NETGENPlugin_Mesher::Compute() // create mesh segments along geometric edges NCollection_Map linkMap; - for (i = 1; i <= nbSeg/* && isOK*/; ++i ) + for (i = nbInitSeg+1; i <= nbSeg/* && isOK*/; ++i ) { const netgen::Segment& seg = ngMesh->LineSegment(i); Link link(seg.p1, seg.p2); @@ -352,7 +761,7 @@ bool NETGENPlugin_Mesher::Compute() } else param = param2 * 0.5; - if (pindMap.Contains(pind)) + if (pind <= nbInitNod || pindMap.Contains(pind)) continue; if (!aEdge.IsNull()) { @@ -378,7 +787,7 @@ bool NETGENPlugin_Mesher::Compute() } // create mesh faces along geometric faces - for (i = 1; i <= nbFac/* && isOK*/; ++i ) + for (i = nbInitFac+1; i <= nbFac/* && isOK*/; ++i ) { const netgen::Element2d& elem = ngMesh->SurfaceElement(i); int aGeomFaceInd = elem.GetIndex(); @@ -391,7 +800,7 @@ bool NETGENPlugin_Mesher::Compute() int pind = elem.PNum(j); SMDS_MeshNode* node = nodeVec.at(pind); nodes.push_back(node); - if (pindMap.Contains(pind)) + if (pind <= nbInitNod || pindMap.Contains(pind)) continue; if (!aFace.IsNull()) { @@ -445,7 +854,7 @@ bool NETGENPlugin_Mesher::Compute() int pind = elem.PNum(j); SMDS_MeshNode* node = nodeVec.at(pind); nodes.push_back(node); - if (pindMap.Contains(pind)) + if (pind <= nbInitNod || pindMap.Contains(pind)) continue; if (!aSolid.IsNull()) { diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.hxx b/src/NETGENPlugin/NETGENPlugin_Mesher.hxx index 7795e6b..4cea643 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.hxx @@ -1,43 +1,47 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_Mesher.hxx // Author : Michael Sazonov (OCN) // Date : 31/03/2006 // Project : SALOME // $Header$ //============================================================================= - +// #ifndef _NETGENPlugin_Mesher_HXX_ #define _NETGENPlugin_Mesher_HXX_ #include "NETGENPlugin_Defs.hxx" #include "StdMeshers_FaceSide.hxx" +#include class SMESH_Mesh; class SMESHDS_Mesh; class TopoDS_Shape; class NETGENPlugin_Hypothesis; +class NETGENPlugin_SimpleHypothesis_2D; namespace netgen { class OCCGeometry; + class Mesh; } /*! @@ -53,19 +57,35 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher const bool isVolume); void SetParameters(const NETGENPlugin_Hypothesis* hyp); + void SetParameters(const NETGENPlugin_SimpleHypothesis_2D* hyp); bool Compute(); - static void PrepareOCCgeometry(netgen::OCCGeometry& occgeom, - const TopoDS_Shape& shape); + static void PrepareOCCgeometry(netgen::OCCGeometry& occgeom, + const TopoDS_Shape& shape, + SMESH_Mesh& mesh, + std::list< SMESH_subMesh* > * meshedSM=0); static void RemoveTmpFiles(); +protected: + + bool fillNgMesh(netgen::OCCGeometry& occgeom, + netgen::Mesh& ngMesh, + std::vector& nodeVec, + const std::list< SMESH_subMesh* > & meshedSM); + + void defaultParameters(); + + private: SMESH_Mesh* _mesh; const TopoDS_Shape& _shape; bool _isVolume; bool _optimize; + + const NETGENPlugin_SimpleHypothesis_2D * _simpleHyp; + std::map< int, std::pair > _faceDescriptors; }; #endif diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx index 719ec01..75bbc53 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx @@ -1,32 +1,35 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_NETGEN_2D.cxx // Author : Michael Sazonov (OCN) // Date : 20/03/2006 // Project : SALOME // $Header$ //============================================================================= +// #include "NETGENPlugin_NETGEN_2D.hxx" #include "NETGENPlugin_Hypothesis_2D.hxx" +#include "NETGENPlugin_SimpleHypothesis_2D.hxx" #include "NETGENPlugin_Mesher.hxx" #include @@ -53,9 +56,11 @@ NETGENPlugin_NETGEN_2D::NETGENPlugin_NETGEN_2D(int hypId, int studyId, _name = "NETGEN_2D"; _shapeType = (1 << TopAbs_FACE); // 1 bit /shape type _compatibleHypothesis.push_back("NETGEN_Parameters_2D"); + _compatibleHypothesis.push_back("NETGEN_SimpleParameters_2D"); _requireDescretBoundary = false; _onlyUnaryInput = false; _hypothesis = NULL; + _supportSubmeshes = true; } //============================================================================= @@ -82,9 +87,6 @@ bool NETGENPlugin_NETGEN_2D::CheckHypothesis { _hypothesis = NULL; - list::const_iterator itl; - const SMESHDS_Hypothesis* theHyp; - const list& hyps = GetUsedHypothesis(aMesh, aShape); int nbHyp = hyps.size(); if (!nbHyp) @@ -92,20 +94,20 @@ bool NETGENPlugin_NETGEN_2D::CheckHypothesis aStatus = SMESH_Hypothesis::HYP_OK; return true; // can work with no hypothesis } - - itl = hyps.begin(); - theHyp = (*itl); // use only the first hypothesis + // use only the first hypothesis + const SMESHDS_Hypothesis* theHyp = hyps.front(); string hypName = theHyp->GetName(); - - if (hypName == "NETGEN_Parameters_2D") + if ( find( _compatibleHypothesis.begin(), _compatibleHypothesis.end(), + hypName ) != _compatibleHypothesis.end() ) { - _hypothesis = static_cast (theHyp); - ASSERT(_hypothesis); + _hypothesis = theHyp; aStatus = SMESH_Hypothesis::HYP_OK; } else + { aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; + } return aStatus == SMESH_Hypothesis::HYP_OK; } @@ -123,6 +125,7 @@ bool NETGENPlugin_NETGEN_2D::Compute(SMESH_Mesh& aMesh, NETGENPlugin_Mesher mesher(&aMesh, aShape, false); // NETGENPlugin_Mesher mesher(meshDS, aShape, false); - mesher.SetParameters(_hypothesis); + mesher.SetParameters(dynamic_cast(_hypothesis)); + mesher.SetParameters(dynamic_cast(_hypothesis)); return mesher.Compute(); } diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx index 11ed70d..57b6ee4 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx @@ -1,31 +1,32 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_NETGEN_2D.hxx // Author : Michael Sazonov (OCN) // Date : 20/03/2006 // Project : SALOME // $Header$ //============================================================================= - +// #ifndef _NETGENPlugin_NETGEN_2D_HXX_ #define _NETGENPlugin_NETGEN_2D_HXX_ @@ -36,7 +37,7 @@ #include "StdMeshers_MaxElementVolume.hxx" #include "Utils_SALOME_Exception.hxx" -class NETGENPlugin_Hypothesis_2D; +//class NETGENPlugin_Hypothesis_2D; class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D: public SMESH_2D_Algo { @@ -52,7 +53,7 @@ public: const TopoDS_Shape& aShape); protected: - const NETGENPlugin_Hypothesis_2D* _hypothesis; + const SMESHDS_Hypothesis* _hypothesis; }; #endif diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx index 24bbe48..2bad447 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx @@ -1,32 +1,35 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_NETGEN_2D3D.cxx // Author : Michael Sazonov (OCN) // Date : 20/03/2006 // Project : SALOME // $Header$ //============================================================================= +// #include "NETGENPlugin_NETGEN_2D3D.hxx" #include "NETGENPlugin_Hypothesis.hxx" +#include "NETGENPlugin_SimpleHypothesis_2D.hxx" #include "NETGENPlugin_Mesher.hxx" #include @@ -53,9 +56,11 @@ NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D(int hypId, int studyId, _name = "NETGEN_2D3D"; _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type _compatibleHypothesis.push_back("NETGEN_Parameters"); + _compatibleHypothesis.push_back("NETGEN_SimpleParameters_3D"); _requireDescretBoundary = false; _onlyUnaryInput = false; _hypothesis = NULL; + _supportSubmeshes = true; } //============================================================================= @@ -84,9 +89,6 @@ bool NETGENPlugin_NETGEN_2D3D::CheckHypothesis _hypothesis = NULL; - list::const_iterator itl; - const SMESHDS_Hypothesis* theHyp; - const list& hyps = GetUsedHypothesis(aMesh, aShape); int nbHyp = hyps.size(); if (!nbHyp) @@ -95,19 +97,20 @@ bool NETGENPlugin_NETGEN_2D3D::CheckHypothesis return true; // can work with no hypothesis } - itl = hyps.begin(); - theHyp = (*itl); // use only the first hypothesis + const SMESHDS_Hypothesis* theHyp = hyps.front(); // use only the first hypothesis string hypName = theHyp->GetName(); - if (hypName == "NETGEN_Parameters") + if ( find( _compatibleHypothesis.begin(), _compatibleHypothesis.end(), + hypName ) != _compatibleHypothesis.end() ) { - _hypothesis = static_cast (theHyp); - ASSERT(_hypothesis); + _hypothesis = theHyp; aStatus = SMESH_Hypothesis::HYP_OK; } else + { aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; + } return aStatus == SMESH_Hypothesis::HYP_OK; } @@ -125,6 +128,7 @@ bool NETGENPlugin_NETGEN_2D3D::Compute(SMESH_Mesh& aMesh, NETGENPlugin_Mesher mesher(&aMesh, aShape, true); // NETGENPlugin_Mesher mesher(meshDS, aShape, true); - mesher.SetParameters(_hypothesis); + mesher.SetParameters(dynamic_cast(_hypothesis)); + mesher.SetParameters(dynamic_cast(_hypothesis)); return mesher.Compute(); } diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx index 9d086ad..2f490d7 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx @@ -1,31 +1,32 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : C++ implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_NETGEN_2D3D.hxx // Author : Michael Sazonov (OCN) // Date : 20/03/2006 // Project : SALOME // $Header$ //============================================================================= - +// #ifndef _NETGENPlugin_NETGEN_2D3D_HXX_ #define _NETGENPlugin_NETGEN_2D3D_HXX_ @@ -36,7 +37,7 @@ #include "StdMeshers_MaxElementVolume.hxx" #include "Utils_SALOME_Exception.hxx" -class NETGENPlugin_Hypothesis; +//class NETGENPlugin_Hypothesis; class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D: public SMESH_3D_Algo { @@ -52,7 +53,7 @@ public: const TopoDS_Shape& aShape); protected: - const NETGENPlugin_Hypothesis* _hypothesis; + const SMESHDS_Hypothesis* _hypothesis; }; #endif diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx index e0afd74..c15f825 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx @@ -1,29 +1,30 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : idl implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_NETGEN_2D3D_i.cxx // Author : Michael Sazonov (OCN) // Module : NETGENPlugin // $Header$ - +// #include "NETGENPlugin_NETGEN_2D3D_i.hxx" #include "SMESH_Gen.hxx" diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx index a6483d3..083deeb 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx @@ -1,29 +1,30 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : idl implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_NETGEN_2D3D_i.hxx // Author : Michael Sazonov (OCN) // Module : NETGENPlugin // $Header$ - +// #ifndef _NETGENPlugin_NETGEN_2D3D_I_HXX_ #define _NETGENPlugin_NETGEN_2D3D_I_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx index a474e03..fb48a06 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx @@ -1,27 +1,28 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +// Copyright (C) 2007-2008 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// 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 +// 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. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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 // // File : NETGENPlugin_NETGEN_2D_ONLY.cxx // Author : Edward AGAPOV (OCC) // Project : SALOME - - +// #include "NETGENPlugin_NETGEN_2D_ONLY.hxx" #include "NETGENPlugin_Mesher.hxx" @@ -114,11 +115,15 @@ bool NETGENPlugin_NETGEN_2D_ONLY::CheckHypothesis (SMESH_Mesh& aMesh, _hypLengthFromEdges = 0; _hypQuadranglePreference = 0; - aStatus = HYP_MISSING; - const list& hyps = GetUsedHypothesis(aMesh, aShape, false); - if (hyps.empty()) return false; // can't work with no hypothesis + if (hyps.empty()) + { + aStatus = HYP_OK; //SMESH_Hypothesis::HYP_MISSING; + return true; // (PAL13464) can work with no hypothesis, LengthFromEdges is default one + } + + aStatus = HYP_MISSING; list::const_iterator ith; for (ith = hyps.begin(); ith != hyps.end(); ++ith ) @@ -314,7 +319,9 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh, netgen::Mesh * ngMesh = new netgen::Mesh (); netgen::OCCGeometry occgeo; - NETGENPlugin_Mesher::PrepareOCCgeometry( occgeo, F ); + NETGENPlugin_Mesher::PrepareOCCgeometry( occgeo, F, aMesh ); + occgeo.fmap.Clear(); // face can be reversed, which is wrong in this case (issue 19978) + occgeo.fmap.Add( F ); vector< const SMDS_MeshNode* > nodeVec; problem = AddSegmentsToMesh( *ngMesh, occgeo, wires, helper, nodeVec ); @@ -328,7 +335,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh, // -------------------- double edgeLength = 0; - if (_hypLengthFromEdges) + if (_hypLengthFromEdges || !_hypLengthFromEdges && !_hypMaxElementArea) { int nbSegments = 0; for ( int iW = 0; iW < nbWires; ++iW ) diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx index f77a3d9..2be5858 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx @@ -1,26 +1,28 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +// Copyright (C) 2007-2008 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// 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 +// 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. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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 // // File : NETGENPlugin_NETGEN_2D_ONLY.hxx // Project : SALOME // Author : Edward AGAPOV (OCC) - +// #ifndef _NETGENPlugin_NETGEN_2D_ONLY_HXX_ #define _NETGENPlugin_NETGEN_2D_ONLY_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx index d5ae240..6dac129 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx @@ -1,30 +1,29 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// -// -// // File : NETGENPlugin_NETGEN_2D_ONLY_i.cxx // Author : Edward AGAPOV (OCC) // Module : SMESH - +// #include "NETGENPlugin_NETGEN_2D_ONLY_i.hxx" #include "SMESH_Gen.hxx" diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx index ad4f87d..125a5dc 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx @@ -1,30 +1,29 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// -// -// // File : NETGENPlugin_NETGEN_2D_ONLY_i.cxx // Author : Edward AGAPOV (OCC) // Module : SMESH - +// #ifndef _NETGENPlugin_NETGEN_2D_ONLY_I_HXX_ #define _NETGENPlugin_NETGEN_2D_ONLY_I_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx index 0ba4c91..3a113f6 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx @@ -1,29 +1,30 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : idl implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_NETGEN_2D_i.cxx // Author : Michael Sazonov (OCN) // Module : NETGENPlugin // $Header$ - +// #include "NETGENPlugin_NETGEN_2D_i.hxx" #include "SMESH_Gen.hxx" diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx index c574225..984f953 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx @@ -1,29 +1,30 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // NETGENPlugin : idl implementation -// -// Copyright (C) 2006 OPEN CASCADE, 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 -// -// // File : NETGENPlugin_NETGEN_2D_i.hxx // Author : Michael Sazonov (OCN) // Module : NETGENPlugin // $Header$ - +// #ifndef _NETGENPlugin_NETGEN_2D_I_HXX_ #define _NETGENPlugin_NETGEN_2D_I_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx index 66e3b95..0400de6 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx @@ -1,21 +1,23 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +// Copyright (C) 2007-2008 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// 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 +// 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. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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 // //============================================================================= // File : NETGENPlugin_NETGEN_3D.cxx @@ -23,9 +25,9 @@ // Created : lundi 27 Janvier 2003 // Author : Nadir BOUHAMOU (CEA) // Project : SALOME -// Copyright : CEA 2003 // $Header$ //============================================================================= +// #include "NETGENPlugin_NETGEN_3D.hxx" #include "NETGENPlugin_Mesher.hxx" @@ -38,6 +40,7 @@ #include "SMESH_Gen.hxx" #include "SMESH_Mesh.hxx" #include "SMESH_MesherHelper.hxx" +#include "StdMeshers_QuadToTriaAdaptor.hxx" #include #include @@ -80,6 +83,8 @@ NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, int studyId, _maxElementVolume = 0.; _hypMaxElementVolume = NULL; + + _requireShape = false; // can work without shape } //============================================================================= @@ -173,19 +178,29 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, list< const SMDS_MeshElement* > triangles; list< bool > isReversed; // orientation of triangles + TopAbs_ShapeEnum mainType = aMesh.GetShapeToMesh().ShapeType(); + bool checkReverse = ( mainType == TopAbs_COMPOUND || mainType == TopAbs_COMPSOLID ); + // for the degeneraged edge: ignore all but one node on it; // map storing ids of degen edges and vertices and their netgen id: map< int, int* > degenShapeIdToPtrNgId; map< int, int* >::iterator shId_ngId; list< int > degenNgIds; + StdMeshers_QuadToTriaAdaptor Adaptor; + Adaptor.Compute(aMesh,aShape); + for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next()) { const TopoDS_Shape& aShapeFace = exp.Current(); const SMESHDS_SubMesh * aSubMeshDSFace = meshDS->MeshElements( aShapeFace ); if ( aSubMeshDSFace ) { - bool isRev = SMESH_Algo::IsReversedSubMesh( TopoDS::Face(aShapeFace), meshDS ); + bool isRev = false; + if ( checkReverse && helper.NbAncestors(aShapeFace, aMesh, aShape.ShapeType()) > 1 ) + // IsReversedSubMesh() can work wrong on strongly curved faces, + // so we use it as less as possible + isRev = SMESH_Algo::IsReversedSubMesh( TopoDS::Face(aShapeFace), meshDS ); SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements(); while ( iteratorElem->more() ) // loop on elements on a face @@ -195,20 +210,43 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, if ( !elem ) return error( COMPERR_BAD_INPUT_MESH, "Null element encounters"); bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 )); - if ( !isTraingle ) - return error( COMPERR_BAD_INPUT_MESH, - SMESH_Comment("Not triangle element ")<GetID()); - // keep a triangle - triangles.push_back( elem ); - isReversed.push_back( isRev ); - // put elem nodes to nodeToNetgenID map - SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator(); - while ( triangleNodesIt->more() ) { - const SMDS_MeshNode * node = - static_cast(triangleNodesIt->next()); - if(myTool->IsMedium(node)) - continue; - nodeToNetgenID.insert( make_pair( node, invalid_ID )); + if ( !isTraingle ) { + //return error( COMPERR_BAD_INPUT_MESH, + // SMESH_Comment("Not triangle element ")<GetID()); + // using adaptor + std::list faces = Adaptor.GetTriangles(elem); + if(faces.size()==0) { + return error( COMPERR_BAD_INPUT_MESH, + SMESH_Comment("Not triangles in adaptor for element ")<GetID()); + } + std::list::iterator itf = faces.begin(); + for(; itf!=faces.end(); itf++ ) { + triangles.push_back( (*itf) ); + isReversed.push_back( isRev ); + // put triange's nodes to nodeToNetgenID map + SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator(); + while ( triangleNodesIt->more() ) { + const SMDS_MeshNode * node = + static_cast(triangleNodesIt->next()); + if(myTool->IsMedium(node)) + continue; + nodeToNetgenID.insert( make_pair( node, invalid_ID )); + } + } + } + else { + // keep a triangle + triangles.push_back( elem ); + isReversed.push_back( isRev ); + // put elem nodes to nodeToNetgenID map + SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator(); + while ( triangleNodesIt->more() ) { + const SMDS_MeshNode * node = + static_cast(triangleNodesIt->next()); + if(myTool->IsMedium(node)) + continue; + nodeToNetgenID.insert( make_pair( node, invalid_ID )); + } } #ifdef _DEBUG_ // check if a trainge is degenerated @@ -244,7 +282,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, int Netgen_NbOfNodes = 0; int Netgen_param2ndOrder = 0; double Netgen_paramFine = 1.; - double Netgen_paramSize = _maxElementVolume; + double Netgen_paramSize = pow( 72, 1/6. ) * pow( _maxElementVolume, 1/3. ); double Netgen_point[3]; int Netgen_triangle[3]; @@ -301,7 +339,9 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, (Netgen_triangle[0] != Netgen_triangle[1] && Netgen_triangle[0] != Netgen_triangle[2] && Netgen_triangle[2] != Netgen_triangle[1] )) + { Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle); + } } // ------------------------- @@ -413,30 +453,51 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, else if (MeshType == SMESH_MesherHelper::QUADRATIC) _quadraticMesh = true; - SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator(); + StdMeshers_QuadToTriaAdaptor Adaptor; + Adaptor.Compute(aMesh); - while(iteratorFace->more()) - { + SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator(); + while(iteratorFace->more()) { // check element const SMDS_MeshElement* elem = iteratorFace->next(); if ( !elem ) return error( COMPERR_BAD_INPUT_MESH, "Null element encounters"); bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 )); - if ( !isTraingle ) - return error( COMPERR_BAD_INPUT_MESH, - SMESH_Comment("Not triangle element ")<GetID()); - - // keep a triangle - triangles.push_back( elem ); - // put elem nodes to nodeToNetgenID map - SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator(); - while ( triangleNodesIt->more() ) { - const SMDS_MeshNode * node = - static_cast(triangleNodesIt->next()); - if(aHelper->IsMedium(node)) - continue; - - nodeToNetgenID.insert( make_pair( node, invalid_ID )); + if ( !isTraingle ) { + //return error( COMPERR_BAD_INPUT_MESH, + // SMESH_Comment("Not triangle element ")<GetID()); + // using adaptor + std::list faces = Adaptor.GetTriangles(elem); + if(faces.size()==0) { + return error( COMPERR_BAD_INPUT_MESH, + SMESH_Comment("Not triangles in adaptor for element ")<GetID()); + } + std::list::iterator itf = faces.begin(); + for(; itf!=faces.end(); itf++ ) { + triangles.push_back( (*itf) ); + // put triange's nodes to nodeToNetgenID map + SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator(); + while ( triangleNodesIt->more() ) { + const SMDS_MeshNode * node = + static_cast(triangleNodesIt->next()); + if(aHelper->IsMedium(node)) + continue; + nodeToNetgenID.insert( make_pair( node, invalid_ID )); + } + } + } + else { + // keep a triangle + triangles.push_back( elem ); + // put elem nodes to nodeToNetgenID map + SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator(); + while ( triangleNodesIt->more() ) { + const SMDS_MeshNode * node = + static_cast(triangleNodesIt->next()); + if(aHelper->IsMedium(node)) + continue; + nodeToNetgenID.insert( make_pair( node, invalid_ID )); + } } } @@ -447,7 +508,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, int Netgen_NbOfNodes = 0; int Netgen_param2ndOrder = 0; double Netgen_paramFine = 1.; - double Netgen_paramSize = _maxElementVolume; + double Netgen_paramSize = pow( 72, 1/6. ) * pow( _maxElementVolume, 1/3. ); double Netgen_point[3]; int Netgen_triangle[3]; @@ -548,8 +609,8 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, { Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point ); SMDS_MeshNode * node = aHelper->AddNode(Netgen_point[0], - Netgen_point[1], - Netgen_point[2]); + Netgen_point[1], + Netgen_point[2]); nodeVec.at(nodeIndex) = node; } @@ -558,9 +619,9 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, { Ng_GetVolumeElement(Netgen_mesh, elemIndex, Netgen_tetrahedron); aHelper->AddVolume (nodeVec.at( Netgen_tetrahedron[0] ), - nodeVec.at( Netgen_tetrahedron[1] ), - nodeVec.at( Netgen_tetrahedron[2] ), - nodeVec.at( Netgen_tetrahedron[3] )); + nodeVec.at( Netgen_tetrahedron[1] ), + nodeVec.at( Netgen_tetrahedron[2] ), + nodeVec.at( Netgen_tetrahedron[3] )); } } diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx index 1824689..97ab5bf 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx @@ -1,21 +1,23 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +// Copyright (C) 2007-2008 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// 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 +// 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. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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 // //============================================================================= // File : NETGENPlugin_NETGEN_3D.hxx @@ -25,7 +27,7 @@ // Project : SALOME // $Header$ //============================================================================= - +// #ifndef _NETGENPlugin_NETGEN_3D_HXX_ #define _NETGENPlugin_NETGEN_3D_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx index 53f1f4c..11b3473 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx @@ -1,32 +1,31 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// -// -// // File : NETGENPlugin_NETGEN_3D_i.cxx // Moved here from SMESH_NETGEN_3D_i.cxx // Author : Nadir Bouhamou CEA // Module : SMESH // $Header$ - +// #include "NETGENPlugin_NETGEN_3D_i.hxx" #include "SMESH_Gen.hxx" diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx index 9fac5f3..cbc660b 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx @@ -1,32 +1,31 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// -// -// // File : NETGENPlugin_NETGEN_3D_i.hxx // Moved here from SMESH_NETGEN_3D_i.hxx // Author : Nadir Bouhamou CEA // Module : SMESH // $Header$ - +// #ifndef _NETGENPlugin_NETGEN_3D_I_HXX_ #define _NETGENPlugin_NETGEN_3D_I_HXX_ diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx new file mode 100644 index 0000000..a54d2fb --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx @@ -0,0 +1,224 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin : C++ implementation +// File : NETGENPlugin_SimpleHypothesis_2D.cxx +// Author : Edward AGAPOV +// Project : SALOME +//============================================================================= +// +#include "NETGENPlugin_SimpleHypothesis_2D.hxx" +#include "NETGENPlugin_Hypothesis.hxx" + +#include +#include +#include + +#include + +#include + +using namespace std; + +//============================================================================= +/*! + * + */ +//============================================================================= +NETGENPlugin_SimpleHypothesis_2D::NETGENPlugin_SimpleHypothesis_2D (int hypId, + int studyId, + SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, studyId, gen), + _nbSegments ((int)NETGENPlugin_Hypothesis::GetDefaultNbSegPerEdge()), + _segmentLength(0), + _area (0.) +{ + _name = "NETGEN_SimpleParameters_2D"; + _param_algo_dim = 2; +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_2D::SetNumberOfSegments(int nb) throw (SALOME_Exception) +{ + if ( nb < 1 ) + throw SALOME_Exception("Number of segments must be positive"); + if (nb != _nbSegments) + { + _nbSegments = nb; + if ( _nbSegments ) _segmentLength = 0.; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_2D::SetLocalLength(double segmentLength) + throw (SALOME_Exception) +{ + if ( segmentLength < DBL_MIN ) + throw SALOME_Exception("segment length must be more than zero"); + if (segmentLength != _segmentLength) + { + _segmentLength = segmentLength; + if ( _segmentLength > DBL_MIN ) _nbSegments = 0; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_2D::LengthFromEdges() +{ + if (_area > DBL_MIN ) + { + _area = 0; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_2D::SetMaxElementArea(double area) +{ + if ( area < DBL_MIN ) + area = 0.; + if (_area != area) + { + _area = area; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= +ostream & NETGENPlugin_SimpleHypothesis_2D::SaveTo(ostream & save) +{ + save << _nbSegments << " " << _segmentLength << " " << _area; + + return save; +} + +//============================================================================= +/*! + * + */ +//============================================================================= +istream & NETGENPlugin_SimpleHypothesis_2D::LoadFrom(istream & load) +{ + bool isOK = true; + double val; + + isOK = (load >> val); + if (isOK) + _nbSegments = (int) val; + else + load.clear(ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _segmentLength = val; + else + load.clear(ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _area = val; + else + load.clear(ios::badbit | load.rdstate()); + + return load; +} + +//================================================================================ +/*! + * \brief Does nothing + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - always false + */ +//================================================================================ +bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByMesh(const SMESH_Mesh* theMesh, + const TopoDS_Shape& theShape) +{ + // Find out nb of segments. + int nbSeg = 0, nbEdges = 0; + TopExp_Explorer exp( theShape, TopAbs_EDGE ); + for ( ; exp.More(); exp.Next() ) { + SMESH_subMesh* sm = theMesh->GetSubMeshContaining( exp.Current() ); + if ( sm && !sm->IsEmpty() ) { + nbSeg += sm->GetSubMeshDS()->NbElements(); + nbEdges++; + } + } + if ( nbEdges ) + _nbSegments = nbSeg / nbEdges; + + // Find out max face area + _area = 0; + SMESH::Controls::Area areaControl; + SMESH::Controls::TSequenceOfXYZ nodesCoords; + const int nbFacesToCheck = 100; + for ( exp.Init( theShape, TopAbs_FACE ); exp.More(); exp.Next() ) { + SMESH_subMesh* sm = theMesh->GetSubMeshContaining( exp.Current() ); + if ( sm && !sm->IsEmpty() ) { + SMDS_ElemIteratorPtr fIt = sm->GetSubMeshDS()->GetElements(); + int nbCheckedFaces = 0; + while ( fIt->more() && nbCheckedFaces++ < nbFacesToCheck ) { + const SMDS_MeshElement* elem = fIt->next(); + areaControl.GetPoints( elem, nodesCoords ); + _area = max( _area, areaControl.GetValue( nodesCoords )); + } + } + } + return nbEdges; +} + +//================================================================================ +/*! + * \brief Initialize my parameter values by default parameters. + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByDefaults(const TDefaults& dflts, + const SMESH_Mesh* /*theMesh*/) +{ + _nbSegments = dflts._nbSegments; + _segmentLength = dflts._elemLength; + return _nbSegments && _segmentLength > 0; +} + diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx new file mode 100644 index 0000000..4ed9218 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx @@ -0,0 +1,106 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin : C++ implementation +// File : NETGENPlugin_SimpleHypothesis_2D.hxx +// Author : Edward AGAPOV +// Project : SALOME +//============================================================================= +// +#ifndef _NETGENPlugin_SimpleHypothesis_2D_HXX_ +#define _NETGENPlugin_SimpleHypothesis_2D_HXX_ + +#include "NETGENPlugin_Defs.hxx" + +#include "SMESH_Hypothesis.hxx" +#include "Utils_SALOME_Exception.hxx" + +// Simplified parameters of NETGEN +// + +using namespace std; + +class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D: public SMESH_Hypothesis +{ +public: + + NETGENPlugin_SimpleHypothesis_2D(int hypId, int studyId, SMESH_Gen * gen); + + /*! + * Sets value + */ + void SetNumberOfSegments(int nb) throw (SALOME_Exception); + /*! + * Returns value. + * Can be zero in case if LocalLength() has been set + */ + int GetNumberOfSegments() const { return _nbSegments; } + + /*! + * Sets value + */ + void SetLocalLength(double segmentLength) throw (SALOME_Exception); + /*! + * Returns value. + * Can be zero in case if NumberOfSegments() has been set + */ + double GetLocalLength() const { return _segmentLength; } + + /*! + * Sets to be dependent on 1D discretization + */ + void LengthFromEdges(); + + /*! + * Sets value. + * Zero or negative value means same as LengthFromEdges(). + */ + void SetMaxElementArea(double area); + /*! + * Returns value. + * Can be zero in case of LengthFromEdges() + */ + double GetMaxElementArea() const { return _area; } + + // Persistence + virtual ostream & SaveTo(ostream & save); + virtual istream & LoadFrom(istream & load); + + /*! + * \brief Set parameters by mesh + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if theShape is meshed + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + + /*! + * \brief Initialize my parameter values by default parameters. + * \retval bool - true if parameter values have been successfully defined + */ + virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); + +private: + int _nbSegments; + double _segmentLength, _area; +}; + +#endif diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx new file mode 100644 index 0000000..fac763e --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx @@ -0,0 +1,195 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin : C++ implementation +// File : NETGENPlugin_SimpleHypothesis_2D_i.cxx +// Author : Edward AGAPOV +// Project : SALOME +//============================================================================= +// +#include "NETGENPlugin_SimpleHypothesis_2D_i.hxx" +#include "NETGENPlugin_SimpleHypothesis_2D.hxx" + +#include +#include + +#include +#include + +using namespace std; + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_2D_i::NETGENPlugin_SimpleHypothesis_2D_i + * + * Constructor + */ +//============================================================================= +NETGENPlugin_SimpleHypothesis_2D_i:: +NETGENPlugin_SimpleHypothesis_2D_i (PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ) +{ + MESSAGE( "NETGENPlugin_SimpleHypothesis_2D_i::NETGENPlugin_SimpleHypothesis_2D_i" ); + myBaseImpl = new ::NETGENPlugin_SimpleHypothesis_2D (theGenImpl->GetANewId(), + theStudyId, + theGenImpl); +} + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i + * + * Destructor + */ +//============================================================================= +NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i() +{ + MESSAGE( "NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i" ); +} + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments(CORBA::Short nb) + throw ( SALOME::SALOME_Exception ) +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments"); + ASSERT(myBaseImpl); + try { + this->GetImpl()->SetNumberOfSegments(nb); + } + catch (SALOME_Exception& S_ex) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + SMESH::TPythonDump() << _this() << ".SetNumberOfSegments( " << nb << " )"; +} + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments() + */ +//============================================================================= +CORBA::Short NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments() +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetNumberOfSegments(); +} + +//================================================================================ +/*! + * LocalLength() + */ +//================================================================================ + +void NETGENPlugin_SimpleHypothesis_2D_i::SetLocalLength(CORBA::Double segmentLength) +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetLocalLength"); + ASSERT(myBaseImpl); + try { + this->GetImpl()->SetLocalLength(segmentLength); + } + catch (SALOME_Exception& S_ex) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + SMESH::TPythonDump() << _this() << ".SetLocalLength( " << segmentLength << " )"; +} + +//================================================================================ +/*! + * GetLocalLength() + */ +//================================================================================ + +CORBA::Double NETGENPlugin_SimpleHypothesis_2D_i::GetLocalLength() +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetLocalLength"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetLocalLength(); +} + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges() + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges() +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges"); + ASSERT(myBaseImpl); + this->GetImpl()->LengthFromEdges(); + SMESH::TPythonDump() << _this() << ".LengthFromEdges()"; +} + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea() + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea(CORBA::Double area) +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea"); + ASSERT(myBaseImpl); + this->GetImpl()->SetMaxElementArea(area); + SMESH::TPythonDump() << _this() << ".SetMaxElementArea( " << area << " )"; +} + + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea() + */ +//============================================================================= +CORBA::Double NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea() +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetMaxElementArea(); +} +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_2D_i::GetImpl + */ +//============================================================================= +::NETGENPlugin_SimpleHypothesis_2D* NETGENPlugin_SimpleHypothesis_2D_i::GetImpl() +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetImpl"); + return (::NETGENPlugin_SimpleHypothesis_2D*)myBaseImpl; +} + +//================================================================================ +/*! + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * + * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) + */ +//================================================================================ +CORBA::Boolean NETGENPlugin_SimpleHypothesis_2D_i::IsDimSupported( SMESH::Dimension type ) +{ + return type == SMESH::DIM_2D; +} diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx new file mode 100644 index 0000000..5426293 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx @@ -0,0 +1,75 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin : C++ implementation +// File : NETGENPlugin_SimpleHypothesis_2D_i.hxx +// Author : Edward AGAPOV +// Project : SALOME +//============================================================================= +// +#ifndef _NETGENPlugin_SimpleHypothesis_2D_i_HXX_ +#define _NETGENPlugin_SimpleHypothesis_2D_i_HXX_ + +#include "NETGENPlugin_Defs.hxx" + +#include +#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) + +#include "SMESH_Hypothesis_i.hxx" + +class SMESH_Gen; +class NETGENPlugin_SimpleHypothesis_2D; + +// Simplified NETGEN parameters (2D case) + +class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D_i: + public virtual POA_NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D, + public virtual SMESH_Hypothesis_i +{ + public: + // Constructor + NETGENPlugin_SimpleHypothesis_2D_i (PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl); + // Destructor + virtual ~NETGENPlugin_SimpleHypothesis_2D_i(); + + void SetNumberOfSegments(CORBA::Short nb) throw ( SALOME::SALOME_Exception ); + CORBA::Short GetNumberOfSegments(); + + void SetLocalLength(CORBA::Double segmentLength); + CORBA::Double GetLocalLength(); + + + void LengthFromEdges(); + + void SetMaxElementArea(CORBA::Double area); + CORBA::Double GetMaxElementArea(); + + + // Get implementation + ::NETGENPlugin_SimpleHypothesis_2D* GetImpl(); + + // Verify whether hypothesis supports given entity type + CORBA::Boolean IsDimSupported( SMESH::Dimension type ); +}; + +#endif diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx new file mode 100644 index 0000000..fd799b9 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx @@ -0,0 +1,152 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin : C++ implementation +// File : NETGENPlugin_SimpleHypothesis_3D.cxx +// Author : Edward AGAPOV +// Project : SALOME +//============================================================================= +// +#include "NETGENPlugin_SimpleHypothesis_3D.hxx" +#include "NETGENPlugin_Hypothesis.hxx" + +#include +#include +#include + +#include + +#include + +using namespace std; + +//============================================================================= +/*! + * + */ +//============================================================================= +NETGENPlugin_SimpleHypothesis_3D::NETGENPlugin_SimpleHypothesis_3D (int hypId, + int studyId, + SMESH_Gen * gen) + : NETGENPlugin_SimpleHypothesis_2D(hypId, studyId, gen), + _volume(0) +{ + _name = "NETGEN_SimpleParameters_3D"; + _param_algo_dim = 3; +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_3D::LengthFromFaces() +{ + if (_volume > DBL_MIN ) + { + _volume = 0; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_3D::SetMaxElementVolume(double value) +{ + if ( value < DBL_MIN ) + value = 0.; + if (_volume != value) + { + _volume = value; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= +ostream & NETGENPlugin_SimpleHypothesis_3D::SaveTo(ostream & save) +{ + NETGENPlugin_SimpleHypothesis_2D::SaveTo( save ); + save << " " << _volume; + + return save; +} + +//============================================================================= +/*! + * + */ +//============================================================================= +istream & NETGENPlugin_SimpleHypothesis_3D::LoadFrom(istream & load) +{ + NETGENPlugin_SimpleHypothesis_2D::LoadFrom(load); + + bool isOK = true; + double val; + + isOK = (load >> val); + if (isOK) + _volume = val; + else + load.clear(ios::badbit | load.rdstate()); + + return load; +} + +//================================================================================ +/*! + * \brief Does nothing + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - always false + */ +//================================================================================ +bool NETGENPlugin_SimpleHypothesis_3D::SetParametersByMesh(const SMESH_Mesh* theMesh, + const TopoDS_Shape& theShape) +{ + if ( NETGENPlugin_SimpleHypothesis_2D::SetParametersByMesh(theMesh, theShape) ) + { + // Find out max volume + _volume = 0; + SMESH::Controls::Volume volControl; + volControl.SetMesh( ((SMESH_Mesh*)theMesh)->GetMeshDS() ); + const int nbElemToCheck = 100; + for ( TopExp_Explorer exp( theShape, TopAbs_SOLID ); exp.More(); exp.Next() ) { + SMESH_subMesh* sm = theMesh->GetSubMeshContaining( exp.Current() ); + if ( sm && !sm->IsEmpty() ) { + SMDS_ElemIteratorPtr fIt = sm->GetSubMeshDS()->GetElements(); + int nbCheckedElems = 0; + while ( fIt->more() && nbCheckedElems++ < nbElemToCheck ) { + const SMDS_MeshElement* elem = fIt->next(); + _volume = max( _volume, volControl.GetValue( elem->GetID() )); + } + } + } + return int( _volume ); + } + return false; +} diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx new file mode 100644 index 0000000..7b7de4f --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx @@ -0,0 +1,68 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin : C++ implementation +// File : NETGENPlugin_SimpleHypothesis_3D.hxx +// Author : Edward AGAPOV +// Project : SALOME +//============================================================================= +// +#ifndef _NETGENPlugin_SimpleHypothesis_3D_HXX_ +#define _NETGENPlugin_SimpleHypothesis_3D_HXX_ + +#include "NETGENPlugin_Defs.hxx" +#include "NETGENPlugin_SimpleHypothesis_2D.hxx" + +#include + +// Simplified parameters of NETGEN +// + +using namespace std; + +class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_3D: public NETGENPlugin_SimpleHypothesis_2D +{ +public: + + NETGENPlugin_SimpleHypothesis_3D(int hypId, int studyId, SMESH_Gen * gen); + + void LengthFromFaces(); + + void SetMaxElementVolume(double value); + double GetMaxElementVolume() const { return _volume; } + + // Persistence + virtual ostream & SaveTo(ostream & save); + virtual istream & LoadFrom(istream & load); + + /*! + * \brief Set parameters by mesh + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if theShape is meshed + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + +private: + double _volume; +}; + +#endif diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx new file mode 100644 index 0000000..96b9aa8 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx @@ -0,0 +1,135 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin : C++ implementation +// File : NETGENPlugin_SimpleHypothesis_3D_i.cxx +// Author : Edward AGAPOV +// Project : SALOME +//============================================================================= +// +#include "NETGENPlugin_SimpleHypothesis_3D_i.hxx" +#include "NETGENPlugin_SimpleHypothesis_3D.hxx" + +#include +#include + +#include +#include + +using namespace std; + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_3D_i::NETGENPlugin_SimpleHypothesis_3D_i + * + * Constructor + */ +//============================================================================= +NETGENPlugin_SimpleHypothesis_3D_i:: +NETGENPlugin_SimpleHypothesis_3D_i (PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + NETGENPlugin_SimpleHypothesis_2D_i( thePOA,theStudyId,theGenImpl ) +{ + MESSAGE( "NETGENPlugin_SimpleHypothesis_3D_i::NETGENPlugin_SimpleHypothesis_3D_i" ); + if ( myBaseImpl ) + delete myBaseImpl; + myBaseImpl = new ::NETGENPlugin_SimpleHypothesis_3D (theGenImpl->GetANewId(), + theStudyId, + theGenImpl); +} + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i + * + * Destructor + */ +//============================================================================= +NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i() +{ + MESSAGE( "NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i" ); +} + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces() + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces() +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces"); + ASSERT(myBaseImpl); + this->GetImpl()->LengthFromFaces(); + SMESH::TPythonDump() << _this() << ".LengthFromFaces()"; +} + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume() + */ +//============================================================================= +void NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume(CORBA::Double value) +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume"); + ASSERT(myBaseImpl); + this->GetImpl()->SetMaxElementVolume(value); + SMESH::TPythonDump() << _this() << ".SetMaxElementVolume( " << value << " )"; +} + + +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume() + */ +//============================================================================= +CORBA::Double NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume() +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetMaxElementVolume(); +} +//============================================================================= +/*! + * NETGENPlugin_SimpleHypothesis_3D_i::GetImpl + */ +//============================================================================= +::NETGENPlugin_SimpleHypothesis_3D* NETGENPlugin_SimpleHypothesis_3D_i::GetImpl() +{ + MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::GetImpl"); + return (::NETGENPlugin_SimpleHypothesis_3D*)myBaseImpl; +} + +//================================================================================ +/*! + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * + * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) + */ +//================================================================================ +CORBA::Boolean NETGENPlugin_SimpleHypothesis_3D_i::IsDimSupported( SMESH::Dimension type ) +{ + return type == SMESH::DIM_3D; +} diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx new file mode 100644 index 0000000..6fd6688 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx @@ -0,0 +1,66 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// NETGENPlugin : C++ implementation +// File : NETGENPlugin_SimpleHypothesis_3D_i.hxx +// Author : Edward AGAPOV +// Project : SALOME +//============================================================================= +// +#ifndef _NETGENPlugin_SimpleHypothesis_3D_i_HXX_ +#define _NETGENPlugin_SimpleHypothesis_3D_i_HXX_ + +#include "NETGENPlugin_Defs.hxx" +#include "NETGENPlugin_SimpleHypothesis_2D_i.hxx" + +#include +#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) + +class SMESH_Gen; +class NETGENPlugin_SimpleHypothesis_3D; + +// Simplified NETGEN parameters (3D case) + +class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_3D_i: + public virtual POA_NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D, + public virtual NETGENPlugin_SimpleHypothesis_2D_i +{ + public: + // Constructor + NETGENPlugin_SimpleHypothesis_3D_i (PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl); + // Destructor + virtual ~NETGENPlugin_SimpleHypothesis_3D_i(); + + void LengthFromFaces(); + + void SetMaxElementVolume(CORBA::Double value); + CORBA::Double GetMaxElementVolume(); + + // Get implementation + ::NETGENPlugin_SimpleHypothesis_3D* GetImpl(); + + // Verify whether hypothesis supports given entity type + CORBA::Boolean IsDimSupported( SMESH::Dimension type ); +}; + +#endif diff --git a/src/NETGENPlugin/NETGENPlugin_i.cxx b/src/NETGENPlugin/NETGENPlugin_i.cxx index 2b27c98..78e77c1 100644 --- a/src/NETGENPlugin/NETGENPlugin_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_i.cxx @@ -1,31 +1,30 @@ +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// // SMESH NETGENPlugin : implementaion of SMESH idl descriptions -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 -// -// -// // File : NETGENPlugin.cxx // Author : Julia DOROVSKIKH // Module : SMESH // $Header$ - +// #include "utilities.h" #include "NETGENPlugin_NETGEN_3D_i.hxx" @@ -34,6 +33,8 @@ #include "NETGENPlugin_NETGEN_2D3D_i.hxx" #include "NETGENPlugin_Hypothesis_i.hxx" #include "NETGENPlugin_Hypothesis_2D_i.hxx" +#include "NETGENPlugin_SimpleHypothesis_2D_i.hxx" +#include "NETGENPlugin_SimpleHypothesis_3D_i.hxx" template class NETGENPlugin_Creator_i:public HypothesisCreator_i { @@ -72,6 +73,10 @@ extern "C" aCreator = new NETGENPlugin_Creator_i; else if (strcmp(aHypName, "NETGEN_Parameters_2D") == 0) aCreator = new NETGENPlugin_Creator_i; + else if (strcmp(aHypName, "NETGEN_SimpleParameters_2D") == 0) + aCreator = new NETGENPlugin_Creator_i; + else if (strcmp(aHypName, "NETGEN_SimpleParameters_3D") == 0) + aCreator = new NETGENPlugin_Creator_i; else ; return aCreator; diff --git a/src/NETGENPlugin/NETGENPlugin_icons.po b/src/NETGENPlugin/NETGENPlugin_icons.po deleted file mode 100644 index a3f6297..0000000 --- a/src/NETGENPlugin/NETGENPlugin_icons.po +++ /dev/null @@ -1,20 +0,0 @@ -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" -# would be translated to "Pub", not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -#----------------------------------------------------------- -# ObjectBrowser -#----------------------------------------------------------- - -#mesh_tree_algo_netgen -msgid "ICON_SMESH_TREE_ALGO_NETGEN_3D" -msgstr "mesh_tree_algo_tetra.png" -#msgstr "mesh_tree_algo_netgen.png"