From: jfa Date: Fri, 7 Mar 2008 07:47:18 +0000 (+0000) Subject: Join modifications from BR_Dev_For_4_0 tag V4_1_1. X-Git-Tag: V4_1_2rc1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=40bc6ed7626de9ad8b941dc0b844ef9829c81842;p=plugins%2Fnetgenplugin.git Join modifications from BR_Dev_For_4_0 tag V4_1_1. --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..00c1a60 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,40 @@ +# 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. +# +# 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 : Patrick GOLDBRONN (CEA) +# Date : 28/06/2001 +# Modified by : Alexander BORODIN (OCN) - autotools usage +# + +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +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 + +EXTRA_DIST+= \ + build_configure \ + clean_configure \ + LICENCE diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 216b2a0..0000000 --- a/Makefile.in +++ /dev/null @@ -1,116 +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 -# -# -* Makefile *- -# -# Author : Patrick GOLDBRONN (CEA) -# Date : 28/06/2001 -# $Header$ -# - -# source path -top_srcdir=@top_srcdir@ -top_builddir=. -srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/bin:./bin/salome:@top_srcdir@/resources:./bin:@top_srcdir@/idl - - -@COMMENCE@ - -SUBDIRS = idl src adm_local - -RESOURCES_FILES = \ - NETGENPlugin.xml \ - mesh_hypo_netgen.png \ - mesh_hypo_netgen_2d.png \ - mesh_algo_netgen_2d3d.png \ - mesh_algo_netgen_2d.png \ - mesh_tree_hypo_netgen.png \ - mesh_tree_hypo_netgen_2d.png \ - mesh_tree_algo_netgen_2d3d.png \ - mesh_tree_algo_netgen_2d.png - -BIN_SCRIPT = VERSION - -# copy header files in common directory ------------ - -include_list = include/salome/SALOMEconfig.h \ - include/salome/NETGENPLUGIN_version.h - -ifneq ($(HAVE_SSTREAM),yes) - include_list += include/salome/sstream -endif - -inc: idl $(include_list) - -bin: bin/salome/VERSION - -bin/salome/VERSION : bin/VERSION - -$(RM) $@ - $(LN_S) ../../$< $@ - -include/salome/SALOMEconfig.h: salome_adm/unix/SALOMEconfig.ref - -$(RM) $@ - $(LN_S) ../../$< $@ - -# test if SALOMEconfig.h has changed (contents) -salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h - @if ! [ -a $@ ]; then \ - cp -p -f $< $@; \ - fi; \ - if ! cmp $< $@; then \ - cp -p -f $< $@; \ - fi; \ - -include/salome/sstream: salome_adm/unix/sstream - -$(RM) $@ - $(LN_S) ../../$< $@ - -include/salome/NETGENPLUGIN_version.h: NETGENPLUGIN_version.h - -$(RM) $@ - $(LN_S) ../../$< $@ - -install-include: $(include_list) - $(INSTALL) -d $(includedir) - @for f in X $(include_list); do \ - if test $$f != X; then \ - ($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1); \ - fi; \ - done - -# install script in $(bindir) : -install-bin: $(BIN_SCRIPT) - $(INSTALL) -d $(bindir) - if test $(BIN_SCRIPT)X != X; then \ - $(INSTALL_PROGRAM) $^ $(bindir); \ - fi - -# CLEAN -------------------- - -distclean: distclean-other - -distclean-other: - -$(RM) salome_adm/unix/*~ salome_adm/unix/*% salome_adm/unix/*.bak salome_adm/unix/*.new salome_adm/unix/*.old - -$(RM) salome_adm/unix/make_* - -$(RM) salome_adm/unix/depend salome_adm/unix/SALOMEconfig.h - -$(RM) config.cache config.log config.status - -@MODULE@ - -install: install-bin install-include diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/adm_local/Makefile.am b/adm_local/Makefile.am new file mode 100644 index 0000000..7ae83a6 --- /dev/null +++ b/adm_local/Makefile.am @@ -0,0 +1,19 @@ +# 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 +# +SUBDIRS = unix diff --git a/adm_local/Makefile.in b/adm_local/Makefile.in deleted file mode 100644 index 8e8c657..0000000 --- a/adm_local/Makefile.in +++ /dev/null @@ -1,60 +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 -# -# source path -top_srcdir=@top_srcdir@ -top_builddir=.. -srcdir=@srcdir@ -VPATH=.:$(srcdir)/adm_local - - -all: resources - -install: - cp -rf @top_srcdir@/adm_local @prefix@ - -bin: - -resources : - cp -rf @top_srcdir@/adm_local $(top_builddir) - -inc: - -lib: - -depend: - -depend_idl: - -install-end: - -install-include: - -install-bin: - -uninstall: - -uninstall-idl: - -distclean: - -clean: - -distclean-other: - diff --git a/adm_local/unix/Makefile.am b/adm_local/unix/Makefile.am new file mode 100644 index 0000000..facd4e6 --- /dev/null +++ b/adm_local/unix/Makefile.am @@ -0,0 +1,22 @@ +# 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 +# + +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 new file mode 100644 index 0000000..2277a68 --- /dev/null +++ b/adm_local/unix/config_files/Makefile.am @@ -0,0 +1,23 @@ +# 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 +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +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 new file mode 100644 index 0000000..97947eb --- /dev/null +++ b/adm_local/unix/config_files/check_NETGEN.m4 @@ -0,0 +1,145 @@ +AC_DEFUN([CHECK_NETGEN],[ + +AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_PROG_CXXCPP])dnl + +AC_CHECKING(for Netgen 4.5 and higher Libraries) + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +AC_ARG_WITH(netgen, + [ --with-netgen=DIR root directory path of NETGEN installation], + NETGEN_HOME=$withval,NETGEN_HOME="") + +NETGEN_INCLUDES="" +NETGEN_LIBS_DIR="" + +Netgen_ok=no + +if test "x$NETGEN_HOME" == "x" ; then + +# no --with-netgen option used + if test "x$NETGENHOME" != "x" ; then + + # NETGENHOME environment variable defined + NETGEN_HOME=$NETGENHOME + + fi +# +fi + +if test "x$NETGEN_HOME" != "x"; then + + echo + echo + echo ------------------------------------------------- + echo You are about to choose to use somehow the + echo Netgen Library to generate Tetrahedric mesh. + echo + echo WARNING + echo ---------------------------------------------------------- + echo ---------------------------------------------------------- + echo You are strongly advised to consult the file + echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly about + echo assumptions made on the installation of the Netgen + echo application and libraries. + echo Ask your system administrator for those details. + echo ---------------------------------------------------------- + echo ---------------------------------------------------------- + echo + echo + + + + NETGEN_INCLUDES="-I${NETGEN_HOME}/include" + + # check ${NETGEN_HOME}/lib/LINUX directory for libraries + if test -f ${NETGEN_HOME}/lib/LINUX/libcsg.a ; then + NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX" + else + # check ${NETGEN_HOME}/lib/LINUX64 directory for libraries + if test -f ${NETGEN_HOME}/lib/LINUX64/libcsg.a ; then + NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX64" + else + NETGEN_LIBS_DIR="${NETGEN_HOME}/lib" + fi + fi + + echo "NETGEN_LIBS_DIR = $NETGEN_LIBS_DIR" + + CPPFLAGS_old="$CPPFLAGS" + CXXFLAGS_old="$CXXFLAGS" + CPPFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CPPFLAGS" + CXXFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CXXFLAGS" + + AC_MSG_CHECKING(for Netgen header file) + + AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no) + if test "x$Netgen_ok" == "xyes"; then + + AC_MSG_CHECKING(for Netgen libraries) + + LDFLAGS_old="$LDFLAGS" + LDFLAGS="-L. -lNETGEN $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS" + + AC_TRY_COMPILE(#include +#include +namespace nglib { +#include "nglib.h" +} +#define OCCGEOMETRY +#include +,nglib::Ng_Init(); + netgen::OCCGeometry occgeo; + nglib::Ng_Exit();,Netgen_ok=yes;ar x "$NETGEN_LIBS_DIR/libnginterface.a"; + ar x "$NETGEN_LIBS_DIR/libocc.a"; + ar x "$NETGEN_LIBS_DIR/libcsg.a"; + ar x "$NETGEN_LIBS_DIR/libgprim.a"; + ar x "$NETGEN_LIBS_DIR/libmesh.a"; + ar x "$NETGEN_LIBS_DIR/libopti.a"; + ar x "$NETGEN_LIBS_DIR/libgen.a"; + ar x "$NETGEN_LIBS_DIR/libla.a"; + ar x "$NETGEN_LIBS_DIR/libstlgeom.a"; + ar x "$NETGEN_LIBS_DIR/libgeom2d.a"; + $CXX -shared linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o -o libNETGEN.so; + rm -rf linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o, + Netgen_ok=no) + + AC_CACHE_VAL(salome_netgen_lib,[ + AC_TRY_LINK( +#include +#include +namespace nglib { +#include "nglib.h" +} +#define OCCGEOMETRY +#include +,nglib::Ng_Init(); + netgen::OCCGeometry occgeo; + nglib::Ng_Exit();, + eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so) + ]) + Netgen_ok="$salome_netgen_lib" + + + LDFLAGS="$LDFLAGS_old" + fi + + CPPFLAGS="$CPPFLAGS_old" + CXXFLAGS="$CXXFLAGS_old" + + if test "x$Netgen_ok" == xno ; then + AC_MSG_RESULT(no) + AC_MSG_WARN(Netgen libraries not found or not properly installed) + else + AC_MSG_RESULT(yes) + fi +fi + +AC_SUBST(NETGEN_INCLUDES) +AC_SUBST(NETGEN_LIBS_DIR) + +AC_LANG_RESTORE + +])dnl diff --git a/adm_local/unix/config_files/check_NETGENPLUGIN.m4 b/adm_local/unix/config_files/check_NETGENPLUGIN.m4 index 1838cde..23e916f 100644 --- a/adm_local/unix/config_files/check_NETGENPLUGIN.m4 +++ b/adm_local/unix/config_files/check_NETGENPLUGIN.m4 @@ -1,132 +1,53 @@ -AC_DEFUN([CHECK_NETGEN],[ +#------------------------------------------------------------ +# Check availability of Salome NETGEN mesh plugin module +# distribution +#------------------------------------------------------------ -AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_PROG_CXXCPP])dnl +AC_DEFUN([CHECK_NETGENPLUGIN],[ -AC_CHECKING(for Netgen 4.5 and higher Libraries) +AC_CHECKING(for NETGEN mesh plugin) -AC_LANG_SAVE -AC_LANG_CPLUSPLUS +NGplugin_ok=no -AC_ARG_WITH(netgen, - [ --with-netgen=DIR root directory path of NETGEN installation], - NETGEN_HOME=$withval,NETGEN_HOME="") +NETGENPLUGIN_LDLAGS="" +NETGENPLUGIN_CXXFLAGS="" -NETGEN_INCLUDES="" -NETGEN_LIBS_DIR="" +AC_ARG_WITH(netgenplugin, + [ --with-netgenplugin=DIR root directory path of NETGEN mesh plugin installation ], + NETGENPLUGIN_DIR="$withval",NETGENPLUGIN_DIR="") -Netgen_ok=no +if test "x$NETGENPLUGIN_DIR" == "x" ; then -if test "x$NETGEN_HOME" == "x" ; then +# no --with-netgenplugin-dir option used -# no --with-netgen option used - if test "x$NETGENHOME" != "x" ; then + if test "x$NETGENPLUGIN_ROOT_DIR" != "x" ; then - # NETGENHOME environment variable defined - NETGEN_HOME=$NETGENHOME + # NETGENPLUGIN_ROOT_DIR environment variable defined + NETGENPLUGIN_DIR=$NETGENPLUGIN_ROOT_DIR fi # fi -if test "x$NETGEN_HOME" != "x"; then - - echo - echo - echo ------------------------------------------------- - echo You are about to choose to use somehow the - echo Netgen Library to generate Tetrahedric mesh. - echo - echo WARNING - echo ---------------------------------------------------------- - echo ---------------------------------------------------------- - echo You are strongly advised to consult the file - echo NETGENPLUGIN_SRC/src/ReadMeForNgUsers, particularly about - echo assumptions made on the installation of the Netgen - echo application and libraries. - echo Ask your system administrator for those details. - echo ---------------------------------------------------------- - echo ---------------------------------------------------------- - echo - echo - - - - NETGEN_INCLUDES="-I$NETGEN_HOME/include" - NETGEN_LIBS_DIR="$NETGEN_HOME/lib/LINUX" - - CPPFLAGS_old="$CPPFLAGS" - CXXFLAGS_old="$CXXFLAGS" - CPPFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CPPFLAGS" - CXXFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CXXFLAGS" - - AC_MSG_CHECKING(for Netgen header file) - - AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no) - if test "x$Netgen_ok" == "xyes"; then - - AC_MSG_CHECKING(for Netgen libraries) - - LDFLAGS_old="$LDFLAGS" - LDFLAGS="-L. -lNETGEN $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS" - - AC_TRY_COMPILE(#include -#include -namespace nglib { -#include "nglib.h" -} -#define OCCGEOMETRY -#include -,nglib::Ng_Init(); - netgen::OCCGeometry occgeo; - nglib::Ng_Exit();,Netgen_ok=yes;ar x "$NETGEN_LIBS_DIR/libnginterface.a"; - ar x "$NETGEN_LIBS_DIR/libocc.a"; - ar x "$NETGEN_LIBS_DIR/libcsg.a"; - ar x "$NETGEN_LIBS_DIR/libgprim.a"; - ar x "$NETGEN_LIBS_DIR/libmesh.a"; - ar x "$NETGEN_LIBS_DIR/libopti.a"; - ar x "$NETGEN_LIBS_DIR/libgen.a"; - ar x "$NETGEN_LIBS_DIR/libla.a"; - ar x "$NETGEN_LIBS_DIR/libstlgeom.a"; - ar x "$NETGEN_LIBS_DIR/libgeom2d.a"; - $CXX -shared linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o -o libNETGEN.so; - rm -rf linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o, - Netgen_ok=no) - - AC_CACHE_VAL(salome_netgen_lib,[ - AC_TRY_LINK( -#include -#include -namespace nglib { -#include "nglib.h" -} -#define OCCGEOMETRY -#include -,nglib::Ng_Init(); - netgen::OCCGeometry occgeo; - nglib::Ng_Exit();, - eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so) - ]) - Netgen_ok="$salome_netgen_lib" - - - LDFLAGS="$LDFLAGS_old" - fi - - CPPFLAGS="$CPPFLAGS_old" - CXXFLAGS="$CXXFLAGS_old" - - if test "x$Netgen_ok" == xno ; then - AC_MSG_RESULT(no) - AC_MSG_WARN(Netgen libraries not found or not properly installed) - else - AC_MSG_RESULT(yes) - fi -fi +if test -f ${NETGENPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome/libNETGENEngine.so ; then + NGplugin_ok=yes + AC_MSG_RESULT(Using NETGEN mesh plugin distribution in ${NETGENPLUGIN_DIR}) + + if test "x$NETGENPLUGIN_ROOT_DIR" == "x" ; then + NETGENPLUGIN_ROOT_DIR=${NETGENPLUGIN_DIR} + fi + AC_SUBST(NETGENPLUGIN_ROOT_DIR) -AC_SUBST(NETGEN_INCLUDES) -AC_SUBST(NETGEN_LIBS_DIR) + NETGENPLUGIN_LDFLAGS=-L${NETGENPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome + NETGENPLUGIN_CXXFLAGS=-I${NETGENPLUGIN_DIR}/include/salome -AC_LANG_RESTORE + AC_SUBST(NETGENPLUGIN_LDFLAGS) + AC_SUBST(NETGENPLUGIN_CXXFLAGS) + +else + AC_MSG_WARN("Cannot find compiled NETGEN mesh plugin distribution") +fi +AC_MSG_RESULT(for NETGEN mesh plugin: $NGplugin_ok) + ])dnl diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in deleted file mode 100644 index 19336a2..0000000 --- a/adm_local/unix/make_commence.in +++ /dev/null @@ -1,288 +0,0 @@ -# common directories to put headerfiles -inc_builddir=$(top_builddir)/include/salome - -@SET_MAKE@ -SHELL=/bin/sh - -# header missing - -HAVE_SSTREAM=@HAVE_SSTREAM@ - - -LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker $(top_builddir)/lib/salome -# add libstdc++ to link c++ library with libtool ! -LDFLAGS+= -lstdc++ - -CP=@CP@ - -# CPP - -CPP=@CPP@ -CXXCPP=@CXXCPP@ -CPPFLAGS=@CPPFLAGS@ -I$(inc_builddir) -I$(srcdir) -I. - -# C - -CC = @CC@ -CFLAGS = @CFLAGS@ -C_DEPEND_FLAG = @C_DEPEND_FLAG@ - -# C++ - -CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ -CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@ - -# BOOST Library - -BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ - -# JAVA - -JAVA_INCLUDES = @JAVA_INCLUDES@ -JAVA_LIBS = @JAVA_LIBS@ -JAVA_LDPATH = @JAVA_LDPATH@ - -# PYTHON - -PYTHON = @PYTHON@ -PYTHONHOME = @PYTHONHOME@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_VERSION = @PYTHON_VERSION@ -PYTHON_SITE = @PYTHON_SITE@ -PYTHON_SITE_INSTALL = @PYTHON_SITE_INSTALL@ - -# QT - -QT_ROOT = @QT_ROOT@ -QT_INCLUDES = @QT_INCLUDES@ -QT_MT_INCLUDES = @QT_INCLUDES@ -DQT_THREAD_SUPPORT -QT_LIBS = @QT_LIBS@ -QT_MT_LIBS = @QT_MT_LIBS@ - -MOC = @MOC@ -UIC = @UIC@ -MSG2QM = @MSG2QM@ - -#QWT - -QWT_INCLUDES=@QWT_INCLUDES@ -QWT_LIBS=@QWT_LIBS@ - -# SIP -SIP = @SIP@ -SIP_INCLUDES = @SIP_INCLUDES@ -SIP_LIBS = @SIP_LIBS@ - -# PYQT -PYQT_SIPS = @PYQT_SIPS@ -PYQT_LIBS = @PYQT_LIBS@ - -# openGL -OGL_INCLUDES=@OGL_INCLUDES@ -OGL_LIBS=@OGL_LIBS@ - -# VTK -VTK_INCLUDES=@VTK_INCLUDES@ -VTK_LIBS=@VTK_LIBS@ - -# HDF5 - -HDF5_INCLUDES=@HDF5_INCLUDES@ -HDF5_LIBS=@HDF5_LIBS@ -HDF5_MT_LIBS=@HDF5_MT_LIBS@ - -# OpenCasCade - -OCC_INCLUDES=@CAS_CPPFLAGS@ -OCC_CXXFLAGS=@CAS_CXXFLAGS@ - -OCC_KERNEL_LIBS=@CAS_KERNEL@ -OCC_OCAF_LIBS=@CAS_OCAF@ -OCC_VIEWER_LIBS=@CAS_VIEWER@ -OCC_MODELER_LIBS=@CAS_MODELER@ -OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@ -OCC_LIBS=@CAS_LDFLAGS@ -OCC_LDPATH=@CAS_LDPATH@ - -# MPICH - -MPICH_INCLUDES=@MPICH_INCLUDES@ -MPICH_LIBS=@MPICH_LIBS@ - -# Swig C++ Python - -SWIG = @SWIG@ -SWIG_FLAGS = @SWIG_FLAGS@ -I$(inc_builddir) -I$(srcdir) -I. - -# OMNIORB - -OMNIORB_ROOT = @OMNIORB_ROOT@ -OMNIORB_INCLUDES = @OMNIORB_INCLUDES@ -OMNIORB_LIBS = @OMNIORB_LIBS@ -OMNIORB_CXXFLAGS = @OMNIORB_CXXFLAGS@ - -OMNIORB_IDL = @OMNIORB_IDL@ -OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@ -OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome \ - -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome\ - -I$(SMESH_ROOT_DIR)/idl/salome - -OMNIORB_IDL_CLN_H = @OMNIORB_IDL_CLN_H@ -OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@ -OMNIORB_IDL_CLN_OBJ = @OMNIORB_IDL_CLN_OBJ@ - -OMNIORB_IDL_SRV_H = @OMNIORB_IDL_SRV_H@ -OMNIORB_IDL_SRV_CXX = @OMNIORB_IDL_SRV_CXX@ -OMNIORB_IDL_SRV_OBJ = @OMNIORB_IDL_SRV_OBJ@ - -# Default ORB - -CORBA_ROOT = @CORBA_ROOT@ -CORBA_INCLUDES = @CORBA_INCLUDES@ -CORBA_LIBS = @CORBA_LIBS@ -CORBA_CXXFLAGS = @CORBA_CXXFLAGS@ - -IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome \ - -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome\ - -I$(SMESH_ROOT_DIR)/idl/salome -IDLPYFLAGS = @IDLPYFLAGS@ - -IDL = @IDL@ - -IDL_CLN_H = @IDL_CLN_H@ -IDL_CLN_CXX = @IDL_CLN_CXX@ -IDL_CLN_OBJ = @IDL_CLN_OBJ@ - -IDL_SRV_H = @IDL_SRV_H@ -IDL_SRV_CXX = @IDL_SRV_CXX@ -IDL_SRV_OBJ = @IDL_SRV_OBJ@ - -CPPFLAGS+= $(CORBA_INCLUDES) -CXXFLAGS+= $(CORBA_CXXFLAGS) - -# SALOME - -SALOME_INCLUDES = \ - -I$(KERNEL_ROOT_DIR)/include/salome \ - -I$(GEOM_ROOT_DIR)/include/salome \ - -I$(SMESH_ROOT_DIR)/include/salome - -CPPFLAGS += -DSOLIDGEOM -DLINUX $(OCC_INCLUDES) $(SALOME_INCLUDES) $(BOOST_CPPFLAGS) -CXXFLAGS += -DSOLIDGEOM -DLINUX $(OCC_CXXFLAGS) $(SALOME_INCLUDES) - -LDFLAGS += -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -L${KERNEL_ROOT_DIR}/lib/salome -L${SMESH_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -lSalomeGenericObj - -# add corba libs when link salome application ! -#LDFLAGS+= $(CORBA_LIBS) -LIBS+=$(CORBA_LIBS) - -## Shared libraries -LT_STATIC_EXEC=@LT_STATIC_EXEC@ -DYNAMIC_DIRS=@DYNAMIC_DIRS@ -LT_LIB=libtool -LT=$(top_builddir)/libtool -LT_COMPILE=$(LT) --mode=compile $(CC) -LT_LINK_LIB=$(LT_LIB) --mode=link $(CC) -rpath $(libdir) -LT_LINK_EXE=$(LT) --mode=link $(CC) $(LT_STATIC_EXEC) -dlopen self -rpath $(bindir) $(DYNAMIC_DIRS) -LT_RUN=$(LT) --mode=execute -LT_INSTALL_PROG=$(LT) --mode=install $(INSTALL_PROGRAM) -LT_INSTALL_LIB=$(LT) --mode=install $(INSTALL_DATA) -LT_UNINSTALL=$(LT) --mode=uninstall $(RM) - -INSTALL=@INSTALL@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -INSTALL_DATA=@INSTALL_DATA@ - -# create a symbolic link (or a copie ?) -LN_S=@LN_S@ - -## Installation points -prefix=@prefix@ -exec_prefix=@exec_prefix@ -bindir=@bindir@/salome -libdir=@libdir@/salome -# warning : if user give this path in configure we could have salome/salome :-( -includedir=@includedir@/salome -datadir=@datadir@/salome -idldir=$(prefix)/idl/salome -sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules - -docdir=${prefix}/doc/salome - -# -# begin of package rules -# - -.PHONY: all lib bin inc resources docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean - -.SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm - -all: - $(MAKE) inc - $(MAKE) depend_idl - $(MAKE) depend - $(MAKE) lib - $(MAKE) bin - $(MAKE) resources - -# -# add target to build administrative files -# - -Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in - cd $(top_builddir) ; ./config.status - -LOCAL_MAKE = make_commence make_omniorb - -KERNEL_MAKE = make_module make_conclude depend SALOMEconfig.h F77config.h sstream envScript - -$(top_builddir)/config.status: $(top_srcdir)/configure \ - $(LOCAL_MAKE:%=$(top_srcdir)/adm_local/unix/%.in) \ - $(KERNEL_MAKE:%=$(KERNEL_ROOT_DIR)/salome_adm/unix/%.in) - cd $(top_builddir) ; ./config.status --recheck - -# VPATH contain $(srcdir), so make configure is good in top_srcdir and we must add target configure otherwise :-) -ifneq ($(top_srcdir),$(srcdir)) -configure: $(top_srcdir)/configure -endif - -$(top_srcdir)/configure: $(top_srcdir)/configure.in $(top_srcdir)/aclocal.m4 - cd $(top_srcdir) ; autoconf - -$(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base - cd $(top_srcdir) && ./build_configure - - -ACLOCAL_KERNEL = \ -ac_cxx_bool.m4 check_corba.m4 \ -ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \ -ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ -ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \ -ac_cxx_partial_specialization.m4 python.m4 \ -ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \ -ac_cc_warnings.m4 check_swig.m4 check_boost.m4 - -#ifeq (@WITHNETGEN@,yes) -# ACLOCAL_SRC += check_Netgen.m4 -#endif - -ACLOCAL_GUI = \ -check_vtk.m4 check_opengl.m4 check_qt.m4 \ -check_GUI.m4 check_corba_in_GUI.m4 - -ACLOCAL_GEOM = check_GEOM.m4 - -ACLOCAL_SMESH = check_SMESH.m4 - -$(top_srcdir)/aclocal.m4: $(ACLOCAL_KERNEL%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \ - $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \ - $(ACLOCAL_GEOM:%=@GEOM_ROOT_DIR@/adm_local/unix/config_files/%) \ - $(ACLOCAL_SMESH:%=@SMESH_ROOT_DIR@/adm_local/unix/config_files/%) - cd $(top_srcdir) ; aclocal -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 @GEOM_ROOT_DIR@/adm_local/unix/config_files \ - -I @SMESH_ROOT_DIR@/adm_local/unix/config_files - diff --git a/adm_local/unix/make_common_starter.am b/adm_local/unix/make_common_starter.am new file mode 100644 index 0000000..5339413 --- /dev/null +++ b/adm_local/unix/make_common_starter.am @@ -0,0 +1,54 @@ +# +# ============================================================ +# 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@ +salomescriptdir = $(bindir) + +# Directory for installing idl files +salomeidldir = $(prefix)/idl/@PACKAGE@ + +# Directory for installing resource files +salomeresdir = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@ + +# Directories for installing admin files +admlocaldir = $(prefix)/adm_local +admlocalunixdir = $(admlocaldir)/unix +admlocalm4dir = $(admlocaldir)/unix/config_files + +# Shared modules installation directory +sharedpkgpythondir =$(pkgpythondir)/shared_modules + +# Documentation directory +docdir = $(datadir)/doc/@PACKAGE@ + +# common rules + +# moc-files generation +%_moc.cxx: %.h + $(MOC) $< -o $@ + +# qm-files generation +%.qm: %.po + $(MSG2QM) $< $@ + +EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.po) + +mostlyclean-local: + rm -f @builddir@/*_moc.cxx + rm -f @builddir@/*.qm + +# tests +tests: unittest + +unittest: $(UNIT_TEST_PROG) + @if test "x$(UNIT_TEST_PROG)" != "x"; then \ + $(UNIT_TEST_PROG); \ + fi; diff --git a/adm_local/unix/make_omniorb.in b/adm_local/unix/make_omniorb.in deleted file mode 100644 index cf6fd63..0000000 --- a/adm_local/unix/make_omniorb.in +++ /dev/null @@ -1,62 +0,0 @@ -#======================================================================= -# Begin specific part to omniorb -# (include from file adm/unix/make_omniorb generated by -# adm/unix/make_omniorb.in) -#======================================================================= -# -* Makefile *- -# -# Author : Patrick GOLDBRONN (CEA) -# Date : 29/06/2001 -# $Header$ -# - -# Client and server object are the same with omniorb -# There are one header file and one source file generate - -#IDLOBJ=$(IDLSRC:%.idl=%$(IDL_CLN_OBJ)) - -# dependancies between idl and it's generated files -%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${KERNEL_ROOT_DIR}/idl/salome/%.idl - $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${GEOM_ROOT_DIR}/idl/salome/%.idl - $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -#%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${MED_ROOT_DIR}/idl/salome/%.idl -# $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${SMESH_ROOT_DIR}/idl/salome/%.idl - $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${top_builddir}/idl/salome/%.idl - $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -# dependncies between idl files -depend_idl: .depidl - -# we use cpp to generate dependencies between idl files. -# we change cpp output to keep only idl file and transform it to get a suitable rule -.depidl: $(IDL_FILES) - @touch $@ - @for dep in $? dummy; do \ - if [ $$dep != "dummy" ]; then \ - echo Building dependencies for $$dep; \ - basedep=`basename $$dep .idl`; \ - header="$$basedep"$(IDL_CLN_H); \ - sed '\%^'"$$header"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \ - $(CPP) $(C_DEPEND_FLAG) -I$(srcdir) $$dep 2>/dev/null | \ - sed `echo "s%$$basedep\\.idl%$$header:%g"` | \ - sed 's% $(srcdir)/% %g' | \ - sed 's% $(top_srcdir)/% %g' | \ - sed 's% $(top_builddir)/% %g' | \ - sed 's%^.*:\.o: *%%' | sed 's%^ *\\ *%%'| sed 's%^ *\(.*\):%\1:%' | \ - sed 's/\.idl/$(IDL_CLN_H)/' >>$@; \ - echo '' >>$@; \ - fi; \ - done ; - --include .depidl - -#======================================================================= -# End specific part to omniorb -#======================================================================= diff --git a/bin/Makefile.am b/bin/Makefile.am new file mode 100644 index 0000000..4fdbc53 --- /dev/null +++ b/bin/Makefile.am @@ -0,0 +1,36 @@ +# 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 *- +# +# Author : Guillaume Boulant (CSSI) +# Module : KERNEL +# $Header$ +# + +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# +# =============================================================== +# Files to be installed +# =============================================================== +# + +# These files are data, module or lib files +nodist_salomescript_DATA= VERSION + +EXTRA_DIST+= VERSION.in diff --git a/build_configure b/build_configure index cf7d322..c97ecba 100755 --- a/build_configure +++ b/build_configure @@ -6,11 +6,14 @@ # # 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" ######################################################################## # Test if the KERNEL_ROOT_DIR is set correctly @@ -26,12 +29,26 @@ fi # echo "failed : KERNEL_SRC variable is not correct !" # exit #fi +for option +do + case $option in + -with-ihm | --with-ihm) + NETGENPLUGIN_WITH_GUI="yes" + break;; + -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no) + NETGENPLUGIN_WITH_GUI="no" + break;; + esac +done + ######################################################################## # Test if the GUI_ROOT_DIR is set correctly -if test ! -d "${GUI_ROOT_DIR}"; then - echo "failed : GUI_ROOT_DIR variable is not correct !" - exit +if test ${NETGENPLUGIN_WITH_GUI} = yes; then + if test ! -d "${GUI_ROOT_DIR}"; then + echo "failed : GUI_ROOT_DIR variable is not correct !" + exit + fi fi ######################################################################## @@ -58,195 +75,93 @@ if test ! -d "${SMESH_ROOT_DIR}"; then exit fi -######################################################################## -# find_in - utility function -# -# usage : -# find_in directory filename -# -# Finds files following the *.in pattern, recursively in the -# directory (first argument). -# Results are appended into the file (second argument) -# -# Difference from the standard unix find is that files are tested -# before directories -# - -find_in() -{ - local i - local f=$2 - -# if the first argument is not a directory, returns - - if [ ! -d "$1" ] ; then - return - fi - -# dont look in the CVS directories - - case $1 in - */CVS) return ;; - */adm_local/*) return ;; - *) ;; - esac - -# for each regular file contained in the directory -# test if it's a .in file - - for i in "$1"/* - do - if [ -f "$i" ] ; then - case $i in - *.in) echo " "$i" \\" >> $f;; - *) ;; - esac - fi - done - -# for each subdirectory of the first argument, proceeds recursively - - for i in "$1"/* - do - if [ -d "$i" ] ; then - find_in "$i" "$f" - fi - done -} - - -####################################################################### -# Generate list of .in files (Makefile.in, config.h.in, etc) -# appending it in file configure.in - cd ${CONF_DIR} ABS_CONF_DIR=`pwd` -# -# Common part of the configure.in file -# -chmod u+w configure.in.base -if ! \cp -f configure.in.base configure.in_tmp1 -then - echo - echo "error : can't create files in" ${CONF_DIR} - echo "aborting ..." - chmod u-w configure.in.base - exit -fi -chmod u-w configure.in.base - -if [ -e "${CONF_DIR}/salome_adm" ] ; then - \rm -f ${CONF_DIR}/salome_adm -fi - -# make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files -echo "" >> configure.in_tmp1 -echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1 - -echo "" >> configure.in_tmp1 -echo "AC_OUTPUT([ \\" >> configure.in_tmp1 - -# -# List of .in files in the adm/unix directory -# These files MUST be on top of AC_OUTPUT list so we -# put them "manually" -# - -echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1 -echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1 -echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1 -echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_omniorb:${ABS_CONF_DIR}/adm_local/unix/make_omniorb.in \\" >> configure.in_tmp1 -echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_commence:${ABS_CONF_DIR}/adm_local/unix/make_commence.in \\" >> configure.in_tmp1 -echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1 -echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1 - -\rm -f configure.in_tmp2 configure.in_tmp3 -touch configure.in_tmp2 -find_in . configure.in_tmp2 -sed -e '/^...salome_adm/d' configure.in_tmp2 > configure.in_tmp3 -sed -e '/^...adm_local.unix.make_omniorb/d' configure.in_tmp3 configure.in_tmp2 -sed -e '/^...adm_local.unix.make_commence/d' configure.in_tmp2 > configure.in_tmp3 -sed -e '/configure.in/d' configure.in_tmp3 > configure.in_tmp2 -sed -e 's/.in / /' configure.in_tmp2 >> configure.in_tmp1 -#sed '/^.salome_adm/d' configure.in_tmp2 > configure.in_tmp3 -#sed '/configure.in/d' configure.in_tmp3 > configure.in_tmp2 -#sed 's/.in / /' configure.in_tmp2 >> configure.in_tmp1 - -echo "])" >> configure.in_tmp1 - -# delete the link created for AC_OUTPUT -echo "" >> configure.in_tmp1 -#echo 'rm -f ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1 -\mv configure.in_tmp1 configure.in_new -\rm -f configure.in_tmp2 configure.in_tmp3 - - -######################################################################## -# Create new (or replace old) configure.in file -# Print a message if the file is write protected -# - -echo -if test ! -f configure.in -then - echo -n "Creating new file 'configure.in' ... " - if \mv configure.in_new configure.in >& /dev/null - then - echo "done" - else - echo "error, check your file permissions" - fi -else - echo -n "Updating 'configure.in' file ... " - if ! \cp configure.in configure.in_old >& /dev/null - then - echo - echo - echo "Can't backup previous configure.in" - echo -n "Continue (you will not be able to revert) - (Y/N) ? " - read R - case "x$R" in - xn*) exit;; - xN*) exit;; - esac - echo - echo -n " " - fi - if \cp configure.in_new configure.in >& /dev/null - then - echo "done" - else - echo - echo "error, can't update previous configure.in" - fi -fi - -######################################################################## -# Use autoconf to rebuild the configure script -# - -if test -f configure -then - echo -n "Updating 'configure' script ... " -else - echo -n "Creating 'configure' script ... " -fi - -aclocal -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 -if autoconf -then - echo "done" +####################################################################### +# Update configure.ac script: to set NETGENPLUGIN_WITH_GUI variable +sed -e s/NETGENPLUGIN_WITH_GUI=[a-z]*/NETGENPLUGIN_WITH_GUI=${NETGENPLUGIN_WITH_GUI}/g configure.ac > configure.tmp +mv -f configure.tmp configure.ac + +mkdir -p salome_adm/unix/config_files +#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files +#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix + +cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix + +#cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files +#cp -f ${MED_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files +#cp -f ${GEOM_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files +#cp -f ${SMESH_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files + +# remove KERNEL deprecated configure files +#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \ +# check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \ +# check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing +# do +# rm -f salome_adm/unix/config_files/${deprecated} +# done + + +# ____________________________________________________________________ +# aclocal creates the aclocal.m4 file from the standard macro and the +# custom macro embedded in the directory salome_adm/unix/config_files +# and KERNEL config_files directory. +# output: +# aclocal.m4 +# autom4te.cache (directory) +echo "====================================================== aclocal" + +if test ${NETGENPLUGIN_WITH_GUI} = yes; then + aclocal -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 || exit 1 else - echo "failed (check file permissions and/or user quotas ...)" + aclocal -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 || exit 1 fi -cd ${ORIG_DIR} - -echo +# ____________________________________________________________________ +# libtoolize creates some configuration files (ltmain.sh, +# config.guess and config.sub). It only depends on the libtool +# version. The files are created in the directory specified with the +# AC_CONFIG_AUX_DIR() tag (see configure.ac). +# output: +# salome_adm/unix/config_files/config.guess +# salome_adm/unix/config_files/config.sub +# salome_adm/unix/config_files/ltmain.sh +#echo "====================================================== libtoolize" + +libtoolize --force --copy --automake || exit 1 + +# ____________________________________________________________________ +# autoconf creates the configure script from the file configure.ac (or +# configure.in if configure.ac doesn't exist) +# output: +# configure +echo "====================================================== autoconf" + +autoconf + +# ____________________________________________________________________ +# automake creates some scripts used in building process +# (install-sh, missing, ...). It only depends on the automake +# version. The files are created in the directory specified with the +# AC_CONFIG_AUX_DIR() tag (see configure.ac). This step also +# creates the Makefile.in files from the Makefile.am files. +# output: +# salome_adm/unix/config_files/compile +# salome_adm/unix/config_files/depcomp +# salome_adm/unix/config_files/install-sh +# salome_adm/unix/config_files/missing +# salome_adm/unix/config_files/py-compile +# Makefile.in (from Makefile.am) +echo "====================================================== automake" + +automake --copy --gnu --add-missing diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..5c19daf --- /dev/null +++ b/configure.ac @@ -0,0 +1,416 @@ +# +# 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_CONFIG_AUX_DIR(salome_adm/unix/config_files) +AC_CANONICAL_HOST +AC_CANONICAL_TARGET +AM_INIT_AUTOMAKE + +XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'` +AC_SUBST(XVERSION) + +# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) +MODULE_NAME=netgenplugin +AC_SUBST(MODULE_NAME) + +dnl +dnl Initialize source and build root directories +dnl + +ROOT_BUILDDIR=`pwd` +ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` +cd $ROOT_SRCDIR +ROOT_SRCDIR=`pwd` +cd $ROOT_BUILDDIR + +AC_SUBST(ROOT_SRCDIR) +AC_SUBST(ROOT_BUILDDIR) + +echo +echo Source root directory : $ROOT_SRCDIR +echo Build root directory : $ROOT_BUILDDIR +echo +echo + +if test -z "$AR"; then + AC_CHECK_PROGS(AR,ar xar,:,$PATH) +fi +AC_SUBST(AR) + +dnl Export the AR macro so that it will be placed in the libtool file +dnl correctly. +export AR + +echo +echo --------------------------------------------- +echo testing make +echo --------------------------------------------- +echo + +AC_PROG_MAKE_SET +AC_PROG_INSTALL +dnl +dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques ! + +AC_ENABLE_DEBUG(yes) +AC_DISABLE_PRODUCTION + +echo --------------------------------------------- +echo testing libtool +echo --------------------------------------------- + +dnl first, we set static to no! +dnl if we want it, use --enable-static +AC_ENABLE_STATIC(no) + +AC_LIBTOOL_DLOPEN +AC_PROG_LIBTOOL + +dnl Fix up the INSTALL macro if it s a relative path. We want the +dnl full-path to the binary instead. +case "$INSTALL" in + *install-sh*) + INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh + ;; +esac + +echo +echo --------------------------------------------- +echo testing C/C++ +echo --------------------------------------------- +echo + +cc_ok=no +dnl inutil car libtool +dnl AC_PROG_CC +AC_PROG_CXX +AC_DEPEND_FLAG +# AC_CC_WARNINGS([ansi]) +cc_ok=yes + +echo +echo --------------------------------------------- +echo testing Fortran +echo --------------------------------------------- +echo + +fortran_ok=no +AC_PROG_F77 +AC_F77_LIBRARY_LDFLAGS +AC_PROG_FC +AC_FC_LIBRARY_LDFLAGS +if test "X$FC" != "X" ; then + fortran_ok=yes +fi + +dnl Library libdl : +AC_CHECK_LIB(dl,dlopen) + +dnl add library libm : +AC_CHECK_LIB(m,ceil) + +dnl +dnl Well we use sstream which is not in gcc pre-2.95.3 +dnl We must test if it exists. If not, add it in include ! +dnl + +AC_CXX_HAVE_SSTREAM + +echo +echo --------------------------------------------- +echo BOOST Library +echo --------------------------------------------- +echo + +CHECK_BOOST + +dnl +dnl --------------------------------------------- +dnl testing MPICH +dnl --------------------------------------------- +dnl + +CHECK_MPICH + +echo +echo --------------------------------------------- +echo testing LEX \& YACC +echo --------------------------------------------- +echo + +lex_yacc_ok=no +AC_PROG_YACC +AC_PROG_LEX +lex_yacc_ok=yes + +echo +echo --------------------------------------------- +echo testing python +echo --------------------------------------------- +echo + +CHECK_PYTHON + +AM_PATH_PYTHON(2.3) + +dnl echo +dnl echo --------------------------------------------- +dnl echo testing java +dnl echo --------------------------------------------- +dnl echo + +dnl CHECK_JAVA + +echo +echo --------------------------------------------- +echo testing swig +echo --------------------------------------------- +echo + +CHECK_SWIG + +echo +echo --------------------------------------------- +echo testing threads +echo --------------------------------------------- +echo + +ENABLE_PTHREADS + +echo +echo --------------------------------------------- +echo testing omniORB +echo --------------------------------------------- +echo + +CHECK_OMNIORB + +dnl echo +dnl echo --------------------------------------------- +dnl echo testing mico +dnl echo --------------------------------------------- +dnl echo + +dnl CHECK_MICO + +echo +echo --------------------------------------------- +echo default ORB : omniORB +echo --------------------------------------------- +echo + +DEFAULT_ORB=omniORB +CHECK_CORBA + +AC_SUBST_FILE(CORBA) +corba=make_$ORB +CORBA=adm_local/unix/$corba + +NETGENPLUGIN_WITH_GUI=no + +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 + echo --------------------------------------------- + echo + + CHECK_OPENGL + + echo + echo --------------------------------------------- + echo testing QT + echo --------------------------------------------- + echo + + CHECK_QT + + echo + echo --------------------------------------------- + echo testing VTK + echo --------------------------------------------- + echo + + CHECK_VTK + + echo + echo --------------------------------------------- + echo Testing GUI + echo --------------------------------------------- + echo + + CHECK_SALOME_GUI + + echo + echo --------------------------------------------- + echo Testing full GUI + echo --------------------------------------------- + echo + + CHECK_CORBA_IN_GUI + if test "x${CORBA_IN_GUI}" != "xyes"; then + echo "failed : For configure NETGENPLUGIN module necessary full GUI !" + exit + fi +fi + +echo +echo --------------------------------------------- +echo testing HDF5 +echo --------------------------------------------- +echo + +CHECK_HDF5 + +echo +echo --------------------------------------------- +echo Testing OpenCascade +echo --------------------------------------------- +echo + +CHECK_CAS + +echo +echo --------------------------------------------- +echo Testing html generators +echo --------------------------------------------- +echo + +CHECK_HTML_GENERATORS + +echo +echo --------------------------------------------- +echo Testing Kernel +echo --------------------------------------------- +echo + +CHECK_KERNEL + +echo +echo --------------------------------------------- +echo Testing Geom +echo --------------------------------------------- +echo + +CHECK_GEOM + + echo + echo --------------------------------------------- + echo Testing Med + echo --------------------------------------------- + echo + +CHECK_MED + +echo +echo --------------------------------------------- +echo Testing Netgen +echo --------------------------------------------- +echo + +CHECK_NETGEN + +echo +echo --------------------------------------------- +echo Testing SMesh +echo --------------------------------------------- +echo + +CHECK_SMESH + +echo +echo --------------------------------------------- +echo Summary +echo --------------------------------------------- +echo + +#AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"]) + +echo Configure +if test "${NETGENPLUGIN_WITH_GUI}" = "yes"; then +variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Netgen_ok" +fi +if test "${NETGENPLUGIN_WITH_GUI}" = "no"; then +variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Netgen_ok" +fi + +for var in $variables +do + printf " %10s : " `echo \$var | sed -e "s,_ok,,"` + eval echo \$$var +done + +echo +echo "Default ORB : $DEFAULT_ORB" +echo + +dnl We don t need to say when we re entering directories if we re using +dnl GNU make becuase make does it for us. +if test "X$GMAKE" = "Xyes"; then + AC_SUBST(SETX) SETX=":" +else + AC_SUBST(SETX) SETX="set -x" +fi + +dnl copy shells and utilities contained in the bin directory +dnl excluding .in files (treated in AC-OUTPUT below) and CVS +dnl directory + +echo +echo --------------------------------------------- +echo generating Makefiles and configure files +echo --------------------------------------------- +echo + +#AC_OUTPUT_COMMANDS([ \ +# chmod +x ./bin/*; \ +# chmod +x ./bin/salome/*; +#]) + +# This list is initiated using autoscan and must be updated manually +# when adding a new file .in to manage. When you execute +# autoscan, the Makefile list is generated in the output file configure.scan. +# This could be helpfull to update de configuration. +AC_OUTPUT([ \ + ./salome_adm/unix/SALOMEconfig.h \ + ./adm_local/Makefile \ + ./adm_local/unix/Makefile \ + ./adm_local/unix/config_files/Makefile \ + ./bin/VERSION \ + ./bin/Makefile \ + ./NETGENPLUGIN_version.h \ + ./src/Makefile \ + ./src/GUI/Makefile \ + ./src/NETGEN/Makefile \ + ./src/NETGENPlugin/Makefile \ + ./resources/Makefile \ + ./idl/Makefile \ + Makefile \ +]) diff --git a/configure.in.base b/configure.in.base deleted file mode 100644 index 42a557a..0000000 --- a/configure.in.base +++ /dev/null @@ -1,429 +0,0 @@ -# -# 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) -# -# Created from configure.in.base -# - -AC_INIT(src) -AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files) -AC_CANONICAL_HOST - -PACKAGE=salome -AC_SUBST(PACKAGE) - -VERSION=3.2.0 -XVERSION=0x030200 -AC_SUBST(VERSION) -AC_SUBST(XVERSION) - -dnl -dnl Initialize source and build root directories -dnl - -ROOT_BUILDDIR=`pwd` -ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` -cd $ROOT_SRCDIR -ROOT_SRCDIR=`pwd` -cd $ROOT_BUILDDIR - -AC_SUBST(ROOT_SRCDIR) -AC_SUBST(ROOT_BUILDDIR) - -echo -echo Source root directory : $ROOT_SRCDIR -echo Build root directory : $ROOT_BUILDDIR -echo -echo - -if test -z "$AR"; then - AC_CHECK_PROGS(AR,ar xar,:,$PATH) -fi -AC_SUBST(AR) - -dnl Export the AR macro so that it will be placed in the libtool file -dnl correctly. -export AR - -echo -echo --------------------------------------------- -echo testing make -echo --------------------------------------------- -echo - -AC_PROG_MAKE_SET -AC_PROG_INSTALL -dnl -dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques ! - -AC_ENABLE_DEBUG(yes) -AC_DISABLE_PRODUCTION - -echo --------------------------------------------- -echo testing libtool -echo --------------------------------------------- - -dnl first, we set static to no! -dnl if we want it, use --enable-static -AC_ENABLE_STATIC(no) - -AC_LIBTOOL_DLOPEN -AC_PROG_LIBTOOL - -dnl Fix up the INSTALL macro if it s a relative path. We want the -dnl full-path to the binary instead. -case "$INSTALL" in - *install-sh*) - INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh - ;; -esac - -echo -echo --------------------------------------------- -echo testing C/C++ -echo --------------------------------------------- -echo - -cc_ok=no -dnl inutil car libtool -dnl AC_PROG_CC -AC_PROG_CXX -AC_DEPEND_FLAG -# AC_CC_WARNINGS([ansi]) -cc_ok=yes - -dnl Library libdl : -AC_CHECK_LIB(dl,dlopen) - -dnl add library libm : -AC_CHECK_LIB(m,ceil) - -dnl -dnl Well we use sstream which is not in gcc pre-2.95.3 -dnl We must test if it exists. If not, add it in include ! -dnl - -AC_CXX_HAVE_SSTREAM - -echo -echo --------------------------------------------- -echo BOOST Library -echo --------------------------------------------- -echo - -CHECK_BOOST - -dnl -dnl --------------------------------------------- -dnl testing MPICH -dnl --------------------------------------------- -dnl - -CHECK_MPICH - -echo -echo --------------------------------------------- -echo testing LEX \& YACC -echo --------------------------------------------- -echo - -lex_yacc_ok=no -AC_PROG_YACC -AC_PROG_LEX -lex_yacc_ok=yes - -echo -echo --------------------------------------------- -echo testing python -echo --------------------------------------------- -echo - -CHECK_PYTHON - -dnl echo -dnl echo --------------------------------------------- -dnl echo testing java -dnl echo --------------------------------------------- -dnl echo - -dnl CHECK_JAVA - -echo -echo --------------------------------------------- -echo testing swig -echo --------------------------------------------- -echo - -CHECK_SWIG - -echo -echo --------------------------------------------- -echo testing threads -echo --------------------------------------------- -echo - -ENABLE_PTHREADS - -echo -echo --------------------------------------------- -echo testing omniORB -echo --------------------------------------------- -echo - -CHECK_OMNIORB - -dnl echo -dnl echo --------------------------------------------- -dnl echo testing mico -dnl echo --------------------------------------------- -dnl echo - -dnl CHECK_MICO - -echo -echo --------------------------------------------- -echo default ORB : omniORB -echo --------------------------------------------- -echo - -DEFAULT_ORB=omniORB -CHECK_CORBA - -AC_SUBST_FILE(CORBA) -corba=make_$ORB -CORBA=adm_local/unix/$corba - -echo -echo --------------------------------------------- -echo testing openGL -echo --------------------------------------------- -echo - -CHECK_OPENGL - -echo -echo --------------------------------------------- -echo testing QT -echo --------------------------------------------- -echo - -CHECK_QT - -echo -echo --------------------------------------------- -echo testing MSG2QM -echo --------------------------------------------- -echo - -CHECK_MSG2QM - -echo -echo --------------------------------------------- -echo testing VTK -echo --------------------------------------------- -echo - -CHECK_VTK - -echo -echo --------------------------------------------- -echo testing HDF5 -echo --------------------------------------------- -echo - -CHECK_HDF5 - -echo -echo --------------------------------------------- -echo Testing OpenCascade -echo --------------------------------------------- -echo - -CHECK_CAS - -echo -echo --------------------------------------------- -echo Testing html generators -echo --------------------------------------------- -echo - -CHECK_HTML_GENERATORS - -echo -echo --------------------------------------------- -echo Testing GUI -echo --------------------------------------------- -echo - -CHECK_SALOME_GUI - -echo -echo --------------------------------------------- -echo Testing full GUI -echo --------------------------------------------- -echo - -CHECK_CORBA_IN_GUI -if test "x${CORBA_IN_GUI}" != "xyes"; then - echo "failed : For configure NETGENPLUGIN module necessary full GUI !" - exit -fi - -echo -echo --------------------------------------------- -echo Testing Kernel -echo --------------------------------------------- -echo - -CHECK_KERNEL - -echo -echo --------------------------------------------- -echo Testing Geom -echo --------------------------------------------- -echo - -CHECK_GEOM - -# echo -# echo --------------------------------------------- -# echo Testing Med -# echo --------------------------------------------- -# echo -# -# CHECK_MED - -echo -echo --------------------------------------------- -echo Testing Netgen -echo --------------------------------------------- -echo - -CHECK_NETGEN - -echo -echo --------------------------------------------- -echo Testing SMesh -echo --------------------------------------------- -echo - -CHECK_SMESH - -echo -echo --------------------------------------------- -echo Summary -echo --------------------------------------------- -echo - -echo Configure -variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Netgen_ok" - -for var in $variables -do - printf " %10s : " `echo \$var | sed -e "s,_ok,,"` - eval echo \$$var -done - -echo -echo "Default ORB : $DEFAULT_ORB" -echo - -dnl generals files which could be included in every makefile - -AC_SUBST_FILE(COMMENCE) COMMENCE=adm_local/unix/make_commence -AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude -AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module - -dnl les dependences -AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend - -dnl We don t need to say when we re entering directories if we re using -dnl GNU make becuase make does it for us. -if test "X$GMAKE" = "Xyes"; then - AC_SUBST(SETX) SETX=":" -else - AC_SUBST(SETX) SETX="set -x" -fi - -# make other build directories -for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl -do -# if test ! -d $rep ; then -# eval mkdir $rep -# fi - $INSTALL -d $rep -done - -echo -echo --------------------------------------------- -echo copying resource files, shell scripts, and -echo xml files -echo --------------------------------------------- -echo - - -dnl copy resources directories - -#for i in `find $ROOT_SRCDIR -name 'resources' -print` -#do -# local_res=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"` -# local_res_dir=`echo $local_res | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` -# mkdir -p $local_res_dir -# cd $local_res_dir -# ln -fs $i -# echo $local_res -# cd $ROOT_BUILDDIR -#done - -dnl copy shells and utilities contained in the bin directory -dnl excluding .in files (treated in AC-OUTPUT below) and CVS -dnl directory - -#mkdir -p bin/salome -#cd bin/salome -#for i in $ROOT_SRCDIR/bin/* -#do -# local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"` -# case "$local_bin" in -# *.in | *~) ;; -# ./bin/CVS | ./bin/salome) ;; -# *) /usr/bin/install -C $i .; echo $local_bin ;; -# esac -#done -#cd $ROOT_BUILDDIR - -AC_SUBST_FILE(ENVSCRIPT) ENVSCRIPT=salome_adm/unix/envScript - -dnl copy xml files to the build tree (lib directory) -dnl pourquoi ???? - -#cd lib -#for i in `find $ROOT_SRCDIR -name "*.xml" -print` -#do -# ln -fs $i -# echo `echo $i | sed -e "s,$ROOT_SRCDIR,.,"` -#done -#cd $ROOT_BUILDDIR - - -echo -echo --------------------------------------------- -echo generating Makefiles and configure files -echo --------------------------------------------- -echo - -#AC_OUTPUT_COMMANDS([ \ -# chmod +x ./bin/* \ -#]) - -## do not delete this line diff --git a/idl/Makefile.am b/idl/Makefile.am new file mode 100644 index 0000000..fee15b3 --- /dev/null +++ b/idl/Makefile.am @@ -0,0 +1,119 @@ +# 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 +# + +# +# 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) + +# GUI idl common library +lib_LTLIBRARIES = libSalomeIDLNETGENPLUGIN.la + +# Sources built from idl files +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) + +libSalomeIDLNETGENPLUGIN_la_CPPFLAGS =\ + $(KERNEL_CXXFLAGS) \ + $(GEOM_CXXFLAGS) \ + $(SMESH_CXXFLAGS) \ + @CORBA_CXXFLAGS@ \ + @CORBA_INCLUDES@ \ + -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 \ + $(SMESH_LDFLAGS) -lSalomeIDLSMESH \ + $(GEOM_LDFLAGS) -lSalomeIDLGEOM \ + @CORBA_LIBS@ + +# These variables defines the building process of CORBA files +OMNIORB_IDL = @OMNIORB_IDL@ +OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@ +OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ \ + -I$(top_builddir)/idl/salome \ + -I$(KERNEL_ROOT_DIR)/idl/salome \ + -I$(GEOM_ROOT_DIR)/idl/salome \ + -I$(SMESH_ROOT_DIR)/idl/salome + +IDLCXXFLAGS = \ + -bcxx \ + @IDLCXXFLAGS@ \ + -I$(top_builddir)/idl/salome \ + -I$(KERNEL_ROOT_DIR)/idl/salome \ + -I$(GEOM_ROOT_DIR)/idl/salome \ + -I$(SMESH_ROOT_DIR)/idl/salome \ + -I$(top_builddir)/salome_adm/unix +IDLPYFLAGS = \ + @IDLPYFLAGS@ \ + -I$(KERNEL_ROOT_DIR)/idl/salome \ + -I$(GEOM_ROOT_DIR)/idl/salome \ + -I$(SMESH_ROOT_DIR)/idl/salome + +# potential problem on parallel make on the following - multiple outputs +SUFFIXES = .idl .hh SK.cc +.idlSK.cc: + $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< +.idl.hh: + $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< + +install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%) + $(INSTALL) -d $(pkgpythondir) + ls $^ | while read file; do \ + $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(pkgpythondir) $$file ; \ + done + +# uninstall-local removes too much, but it works in distcheck +uninstall-local: + rm -rf $(pkgpythondir)/* + +mostlyclean-local: + -rm -f *.hh *.cc .depidl + +# we use cpp to generate dependencies between idl files. +# option x c tells the preprocessor to consider idl as a c file. +# if an idl is modified, all idl dependencies are rebuilt + +.depidl: $(BASEIDL_FILES) + @echo "" > $@ + @for dep in $^ dummy; do \ + if [ $$dep != "dummy" ]; then \ + echo Building dependencies for $$dep; \ + $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome -I$(top_builddir)/salome_adm/unix $$dep 2>/dev/null | \ + sed 's/\.o/\SK.cc/' >>$@; \ + fi; \ + done ; + +-include .depidl diff --git a/idl/Makefile.in b/idl/Makefile.in deleted file mode 100644 index 980cd86..0000000 --- a/idl/Makefile.in +++ /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 -# -# -# generate dependencies for idl file : -# - -# source path -top_srcdir=@top_srcdir@ -top_builddir=.. -srcdir=@srcdir@ -VPATH=.:${KERNEL_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome :${SMESH_ROOT_DIR}/idl/salome -#:${MED_ROOT_DIR}/idl/salome - -@COMMENCE@ - -IDL_FILES = NETGENPlugin_Algorithm.idl - - -# copy all idl file in $(top_builddir)/idl -inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%) - -$(top_builddir)/idl/salome: - $(INSTALL) -d $@ - -$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%) - cp -f $^ $(top_builddir)/idl/salome - - -# python wrap -lib: pyidl - -PYTHON_BUILD_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/@PACKAGE@ - -pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py) - -$(PYTHON_BUILD_SITE): - $(INSTALL) -d $@ - -$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl - $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $< - - -# install python client (generated from idl file) -install: $(IDL_FILES:%=$(top_builddir)/idl/salome/%) - $(INSTALL) -d $(idldir) $(PYTHON_SITE_INSTALL) - $(INSTALL_DATA) $^ $(idldir) - @for file in $^ dummy; do \ - if [ $$file != "dummy" ]; then \ - $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_SITE_INSTALL) $$file ; \ - fi ; \ - done ; - -uninstall: - -$(RM) $(IDL_FILES:%=$(idldir)/%) - -$(RM) $(IDL_FILES:%.idl=$(PYTHON_SITE_INSTALL)/%_idl.py) - -# clean -cleandep: - -$(RM) .dep* - -clean: cleandep - -$(RM) $(top_builddir)/idl/salome/*.idl - -$(RM) $(PYTHON_BUILD_SITE)/*.py - -distclean: clean - -$(RM) Makefile - diff --git a/idl/NETGENPlugin_Algorithm.idl b/idl/NETGENPlugin_Algorithm.idl index ffee6c4..687419c 100644 --- a/idl/NETGENPlugin_Algorithm.idl +++ b/idl/NETGENPlugin_Algorithm.idl @@ -41,19 +41,28 @@ module NETGENPlugin }; /*! - * NETGENPlugin_NETGEN_2D: interface of "1D-2D (Netgen)" algorithm + * NETGENPlugin_NETGEN_2D: interface of "Netgen 1D-2D" algorithm */ interface NETGENPlugin_NETGEN_2D : SMESH::SMESH_2D_Algo { }; /*! - * NETGENPlugin_NETGEN_2D3D: interface of "1D-2D-3D (Netgen)" algorithm + * NETGENPlugin_NETGEN_2D3D: interface of "Netgen 1D-2D-3D" algorithm */ interface NETGENPlugin_NETGEN_2D3D : SMESH::SMESH_3D_Algo { }; + /*! + * NETGENPlugin_NETGEN_2D_ONLY: interface of "Netgen 2D" algorithm, + * generating 2D elements on a geometrical face taking + * into account pre-existing nodes on face boundaries + */ + interface NETGENPlugin_NETGEN_2D_ONLY : SMESH::SMESH_2D_Algo + { + }; + /*! * NETGENPlugin_Hypothesis: interface of "NETGEN parameters" hypothesis */ diff --git a/resources/Makefile.am b/resources/Makefile.am new file mode 100644 index 0000000..df00b4d --- /dev/null +++ b/resources/Makefile.am @@ -0,0 +1,39 @@ +# 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. +# +# 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 : 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 diff --git a/resources/NETGENPlugin.xml b/resources/NETGENPlugin.xml index df4e14d..6135daa 100644 --- a/resources/NETGENPlugin.xml +++ b/resources/NETGENPlugin.xml @@ -7,8 +7,8 @@ + server-lib="NETGENEngine" + gui-lib="NETGENPluginGUI"> + diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am new file mode 100644 index 0000000..6bedb75 --- /dev/null +++ b/src/GUI/Makefile.am @@ -0,0 +1,71 @@ +# 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 +# +# 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 +salomeinclude_HEADERS = + +# Libraries targets +lib_LTLIBRARIES = libNETGENPluginGUI.la + +dist_libNETGENPluginGUI_la_SOURCES = \ + NETGENPluginGUI.cxx \ + NETGENPluginGUI_HypothesisCreator.cxx + +MOC_FILES = \ + NETGENPluginGUI_HypothesisCreator_moc.cxx + +nodist_libNETGENPluginGUI_la_SOURCES= \ + $(MOC_FILES) + +# additionnal information to compil and link file + +libNETGENPluginGUI_la_CPPFLAGS = \ + $(QT_INCLUDES) \ + $(CAS_CPPFLAGS) \ + $(PYTHON_INCLUDES) \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(GEOM_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(SMESH_CXXFLAGS) \ + $(BOOST_CPPFLAGS) \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ + -I$(srcdir)/../NETGENPlugin \ + -I$(top_builddir)/idl \ + -I$(top_builddir)/salome_adm/unix + +libNETGENPluginGUI_la_LDFLAGS = \ + ../NETGENPlugin/libNETGENEngine.la \ + ${SMESH_LDFLAGS} -lSMESH \ + $(CAS_KERNEL) + +# resources files +nodist_salomeres_DATA= \ + NETGENPlugin_images.qm \ + NETGENPlugin_msg_en.qm + diff --git a/src/GUI/Makefile.in b/src/GUI/Makefile.in deleted file mode 100644 index d12da02..0000000 --- a/src/GUI/Makefile.in +++ /dev/null @@ -1,74 +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 -# -# File : Makefile.in -# Author : Michael Sazonov -# Module : NETGENPLUGIN -# $Header$ - -top_srcdir=@top_srcdir@ -top_builddir=../.. -srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:${KERNEL_ROOT_DIR}/idl/salome:${GUI_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome:${SMESH_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome - -@COMMENCE@ - -# .po files to transform in .qm -PO_FILES = \ - NETGENPlugin_images.po \ - NETGENPlugin_msg_en.po - -# Libraries targets -LIB = libNETGENPluginGUI.la - -LIB_SRC = \ - NETGENPluginGUI.cxx \ - NETGENPluginGUI_HypothesisCreator.cxx - -LIB_MOC = \ - NETGENPluginGUI_HypothesisCreator.h - -LIB_CLIENT_IDL = \ - SALOME_Exception.idl \ - SALOME_GenericObj.idl \ - SALOME_Component.idl \ - SALOME_Comm.idl \ - GEOM_Gen.idl \ - MED.idl \ - SMESH_Gen.idl \ - SMESH_Mesh.idl \ - SMESH_Group.idl \ - NETGENPlugin_Algorithm.idl - -LIB_SERVER_IDL = - -# additionnal information to compil and link file - -CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome -I${SMESH_ROOT_DIR}/include/salome \ - $(BOOST_CPPFLAGS) -CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome -I${SMESH_ROOT_DIR}/include/salome - -LDFLAGS += -lSMESH $(OCC_KERNEL_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome \ - -L${GUI_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome \ - -L${SMESH_ROOT_DIR}/lib/salome - -@CONCLUDE@ diff --git a/src/GUI/NETGENPluginGUI.cxx b/src/GUI/NETGENPluginGUI.cxx index 47fd3c0..1b89921 100755 --- a/src/GUI/NETGENPluginGUI.cxx +++ b/src/GUI/NETGENPluginGUI.cxx @@ -35,6 +35,7 @@ //============================================================================= extern "C" { + NETGENPLUGIN_GUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType ) { SMESHGUI_GenericHypothesisCreator* aCreator = NULL; diff --git a/src/GUI/NETGENPluginGUI_HypothesisCreator.h b/src/GUI/NETGENPluginGUI_HypothesisCreator.h index c86b99f..3cbd96a 100644 --- a/src/GUI/NETGENPluginGUI_HypothesisCreator.h +++ b/src/GUI/NETGENPluginGUI_HypothesisCreator.h @@ -28,6 +28,16 @@ #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 class QtxDblSpinBox; @@ -46,7 +56,7 @@ typedef struct /*! * \brief Class for creation of NETGEN2D and NETGEN3D hypotheses */ -class NETGENPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator +class NETGENPLUGIN_GUI_EXPORT NETGENPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator { Q_OBJECT diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..f4af73a --- /dev/null +++ b/src/Makefile.am @@ -0,0 +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 +# +# +# +# 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 diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index e171c7a..0000000 --- a/src/Makefile.in +++ /dev/null @@ -1,36 +0,0 @@ -# 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 : Makefile.in -# Author : Patrick GOLDBRONN (CEA) -# Module : SMESH -# $Header$ - -top_srcdir=@top_srcdir@ -top_builddir=.. -srcdir=@srcdir@ -VPATH=.:@srcdir@ - -@COMMENCE@ - -SUBDIRS = NETGEN NETGENPlugin GUI - -@MODULE@ diff --git a/src/NETGEN/Makefile.am b/src/NETGEN/Makefile.am new file mode 100644 index 0000000..98801dd --- /dev/null +++ b/src/NETGEN/Makefile.am @@ -0,0 +1,77 @@ +# 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 +# +# -* 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 + +lib_LTLIBRARIES = libNETGEN.la + +LIB_OBJ_O = \ + linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o \ + improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o \ + netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o \ + secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o \ + meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o \ + meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o \ + ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o \ + polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o \ + meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o \ + specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o \ + triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o \ + stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o \ + array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o \ + hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o \ + Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o + +NETGEN_LIBS_DIR=@NETGEN_LIBS_DIR@ + +$(LIB_OBJ_O): + ar x $(NETGEN_LIBS_DIR)/libnginterface.a + ar x $(NETGEN_LIBS_DIR)/libocc.a + ar x $(NETGEN_LIBS_DIR)/libcsg.a + ar x $(NETGEN_LIBS_DIR)/libgprim.a + ar x $(NETGEN_LIBS_DIR)/libmesh.a + ar x $(NETGEN_LIBS_DIR)/libopti.a + ar x $(NETGEN_LIBS_DIR)/libgen.a + ar x $(NETGEN_LIBS_DIR)/libla.a + ar x $(NETGEN_LIBS_DIR)/libstlgeom.a + ar x $(NETGEN_LIBS_DIR)/libgeom2d.a + rm -rf csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o + +#LIB_OBJ_LO = $(LIB_OBJ_O:%.o=%.lo) +#%.lo: %.o; @ln -s $< $@ + +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) diff --git a/src/NETGEN/Makefile.in b/src/NETGEN/Makefile.in deleted file mode 100644 index 4ca3df1..0000000 --- a/src/NETGEN/Makefile.in +++ /dev/null @@ -1,88 +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 -# -# -* Makefile *- -# -# Author : Edward AGAPOV (OCC) -# Module : NETGENPLUGIN -# Date : 10/01/2004 -# -# - -top_srcdir=@top_srcdir@ -top_builddir=../.. -srcdir=@srcdir@ -VPATH= - -# build .so of NETGEN itself - -@COMMENCE@ - -LIB = libNETGEN.la - -@CONCLUDE@ - -LIB_OBJ_O = \ - linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o \ - improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o \ - netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o \ - secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o \ - meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o \ - meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o \ - ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o \ - polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o \ - meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o \ - specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o \ - triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o \ - stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o \ - array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o \ - hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o \ - Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o - -NETGEN_LIBS_DIR=@NETGEN_LIBS_DIR@ - -$(LIB_OBJ_O): - ar x $(NETGEN_LIBS_DIR)/libnginterface.a - ar x $(NETGEN_LIBS_DIR)/libocc.a - ar x $(NETGEN_LIBS_DIR)/libcsg.a - ar x $(NETGEN_LIBS_DIR)/libgprim.a - ar x $(NETGEN_LIBS_DIR)/libmesh.a - ar x $(NETGEN_LIBS_DIR)/libopti.a - ar x $(NETGEN_LIBS_DIR)/libgen.a - ar x $(NETGEN_LIBS_DIR)/libla.a - ar x $(NETGEN_LIBS_DIR)/libstlgeom.a - ar x $(NETGEN_LIBS_DIR)/libgeom2d.a - rm -rf csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o - -LIB_OBJ_LO = $(LIB_OBJ_O:%.o=%.lo) - -%.lo: %.o; @ln -s $< $@ - -$(LIB): $(LIB_OBJ_O) $(LIB_OBJ_LO) -LIB_OBJ = $(LIB_OBJ_LO) - -ifeq ($(F77),gfortran) -LDFLAGS += -lgfortran -else -LDFLAGS += -lg2c -endif - -LDFLAGS += $(OCC_LDPATH) -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES - -MOSTLYCLEAN += $(LIB_OBJ_O) diff --git a/src/NETGEN/ReadMeForNgUsers b/src/NETGEN/ReadMeForNgUsers index 4abb2b1..0b7cb28 100644 --- a/src/NETGEN/ReadMeForNgUsers +++ b/src/NETGEN/ReadMeForNgUsers @@ -1,23 +1,40 @@ The Netgen 4.5 from the web location : http://www.hpfem.jku.at/netgen/ (CVS access) is used in the SMESH Module of Salome3 distribution. -How to build Netgen for Salome +1. How to build Netgen for Salome ------------------------------ -Patch the netgen 4.5 distribution: +1.1. Download Netgen 4.5 from the NETGEN home site (see above). + +1.2. Unpack the downloaded Netgen 4.5 archive + (hereafter we assume that this is netgen45 directory) + +1.3. Patch the netgen 4.5 distribution for SALOME: $ cd netgen45 $ patch -p1 < patch_directory/netgen45ForSalome.patch -Then run makeForSalome.sh (it will be created by the patch): +1.4. For 64-bit platform you also need to apply another patch: + +$ cd netgen45 +$ patch -p1 < patch_directory/netgen45lib64.patch + +1.5. Set CASROOT environment variable to OCCT installation path, + since Netgen 4.5 requires Open CASCADE Technology: + +$ setenv CASROOT + +1.6. Compile and install netgen 4.5. To do this, simply run + makeForSalome.sh script (it is created from the patch): + $ sh makeForSalome.sh -Additional information for maintainers +2. Additional information for maintainers -------------------------------------- -The file check_NETGENPLUGIN.m4 assumes -that Netgen is installed in the directory as follow: +The file check_NETGEN.m4 assumes that Netgen is installed in +the directory as follow: prompt> ls @@ -50,17 +67,16 @@ edgeflw.hpp hpref_pyramid.hpp msghandler.hpp sparsmat.hpp prompt> ls /lib -LINUX/ - -prompt> ls /lib/LINUX - libcsg.a libgeom2d.a libla.a libnginterface.a libopti.a libgen.a libgprim.a libmesh.a libocc.a libstlgeom.a +The library files can be also installed in the LINUX or LINUX64 +subfolder of the lib directory. + All the libraries *.a should be compiled without the option -DOPENGL. netgen45 is assumed to be the directory downloaded from the above web location archive of Netgen. The library -/lib/LINUX/libnginterface.a should contain the objects +/lib/libnginterface.a should contain the objects nglib.o (from netgen45/libsrc/interface/nglib.cpp) and ngnewdelete.o (from netgen45/ngtcltk/ngnewdelete.cpp). @@ -72,7 +88,7 @@ nglib.o and ngnewdelete.o to the library libnginterface.a and recompile the libraries only. All this job is done by applying the patch and running the script makeForSalome.sh. -Th suggested patch alters some Netgen sources to compile them. +The suggested patch alters some Netgen sources to compile them. Michael SAZONOV m-sazonov@opencascade.com diff --git a/src/NETGEN/netgen43ForSalome.patch b/src/NETGEN/netgen43ForSalome.patch new file mode 100644 index 0000000..5e08d88 --- /dev/null +++ b/src/NETGEN/netgen43ForSalome.patch @@ -0,0 +1,221 @@ +diff -N -r -u netgen43/libsrc/include/spline2d.hpp /tmp/netgen43/libsrc/include/spline2d.hpp +--- netgen43/libsrc/include/spline2d.hpp 1970-01-01 01:00:00.000000000 +0100 ++++ /tmp/netgen43/libsrc/include/spline2d.hpp 2003-12-10 16:28:12.000000000 +0100 +@@ -0,0 +1 @@ ++#include "../geom2d/spline2d.hpp" +diff -N -r -u netgen43/libsrc/include/splinegeometry2.hpp /tmp/netgen43/libsrc/include/splinegeometry2.hpp +--- netgen43/libsrc/include/splinegeometry2.hpp 1970-01-01 01:00:00.000000000 +0100 ++++ /tmp/netgen43/libsrc/include/splinegeometry2.hpp 2003-12-10 16:28:23.000000000 +0100 +@@ -0,0 +1 @@ ++#include "../geom2d/splinegeometry2.hpp" +diff -N -r -u netgen43/libsrc/interface/Makefile /tmp/netgen43/libsrc/interface/Makefile +--- netgen43/libsrc/interface/Makefile 2003-05-07 16:01:43.000000000 +0200 ++++ /tmp/netgen43/libsrc/interface/Makefile 2003-12-10 15:59:47.000000000 +0100 +@@ -1,4 +1,4 @@ +-src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp readuser.cpp importsolution.cpp ++src = writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp readuser.cpp importsolution.cpp nglib.cpp ngnewdelete.cpp + # + lib = nginterface + libpath = libsrc/interface +diff -N -r -u netgen43/libsrc/interface/nglib.cpp /tmp/netgen43/libsrc/interface/nglib.cpp +--- netgen43/libsrc/interface/nglib.cpp 2003-05-07 16:01:43.000000000 +0200 ++++ /tmp/netgen43/libsrc/interface/nglib.cpp 2003-12-10 16:32:54.000000000 +0100 +@@ -23,6 +23,20 @@ + + #include "nglib.h" + ++namespace netgen ++{ ++ char geomfilename [100]; ++ ++ //Destination for messages, errors, ... ++ void Ng_PrintDest(const char * s) ++ { ++ (*mycout) << s << flush; ++ } ++ ++#include ++#include ++} ++ + using namespace netgen; + + // constants and types: +@@ -171,8 +185,6 @@ + // CSG Geometry + + // FlexLexer * lexer; +-char geomfilename [100]; +- + + // 2D Meshing Functions: + +@@ -362,7 +374,18 @@ + cout << "e(" << readedges.Get(i) << "," << readedges.Get(i+1) << ")" << endl; + } + */ +- geo->AddEdges(readedges); ++ ++ ARRAY< Point<3> > readedges1; ++ ++ for (i = 1; i <= readedges.Size(); i++) ++ { ++ Point3d readedgesData = readedges.Get(i); ++ Point <3> readedges1Data = Point<3>(readedgesData.X(),readedgesData.Y(),readedgesData.Z()); ++ ++ readedges1.Append(readedges1Data); ++ } ++ ++ geo->AddEdges(readedges1); + } + + if (geo->GetStatus() == STLTopology::STL_GOOD || geo->GetStatus() == STLTopology::STL_WARNING) return NG_OK; +@@ -472,7 +495,14 @@ + n = Vec3d(nv[0],nv[1],nv[2]); + } + +- readtrias.Append(STLReadTriangle(apts,n)); ++ Point<3> apts1[3]; ++ apts1[0] = Point<3>(p1[0],p1[1],p1[2]); ++ apts1[1] = Point<3>(p2[0],p2[1],p2[2]); ++ apts1[2] = Point<3>(p3[0],p3[1],p3[2]); ++ ++ Vec<3> n1 = Vec<3>(n.X(),n.Y(),n.Z()); ++ ++ readtrias.Append(STLReadTriangle(apts1,n1)); + } + + // add (optional) edges: +@@ -487,30 +517,29 @@ + + // compatibility functions: + +-void MyError (const char * ch) ++void netgen::MyError (const char * ch) + { + cerr << ch; + } + +-//Destination for messages, errors, ... +-void Ng_PrintDest(const char * s) +-{ +- (*mycout) << s << flush; +-} +- +- +-double GetTime () ++double netgen::GetTime () + { + return 0; + } + +-void ResetTime () ++void netgen::ResetTime () + { + ; + } + +-void MyBeep (int i) ++void netgen::MyBeep (int i) + { + ; + } + ++void MeshFromSpline2D (SplineGeometry2d & geometry, ++ Mesh *& mesh, ++ MeshingParameters & mp) ++{ ++ MeshFromSpline2D (geometry, mesh, mp); ++} +diff -N -r -u netgen43/libsrc/makefile.mach.LINUX /tmp/netgen43/libsrc/makefile.mach.LINUX +--- netgen43/libsrc/makefile.mach.LINUX 2003-05-07 16:01:43.000000000 +0200 ++++ /tmp/netgen43/libsrc/makefile.mach.LINUX 2003-12-10 15:12:18.000000000 +0100 +@@ -14,7 +14,8 @@ + # + CFLAGS2 = + # pg stands for profiling - also in linkflags2 +-CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX -DOPENGL ++#CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX -DOPENGL ++CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX + # -fomit-frame-pointer + # -ffast-math + # +diff -N -r -u netgen43/libsrc/meshing/improve2.cpp /tmp/netgen43/libsrc/meshing/improve2.cpp +--- netgen43/libsrc/meshing/improve2.cpp 2003-05-07 16:01:43.000000000 +0200 ++++ /tmp/netgen43/libsrc/meshing/improve2.cpp 2003-12-10 15:42:00.000000000 +0100 +@@ -3,7 +3,7 @@ + #include "meshing.hpp" + #include + +-#include ++/*#include */ + + + namespace netgen +diff -N -r -u netgen43/libsrc/meshing/meshing2.cpp /tmp/netgen43/libsrc/meshing/meshing2.cpp +--- netgen43/libsrc/meshing/meshing2.cpp 2003-05-07 16:01:43.000000000 +0200 ++++ /tmp/netgen43/libsrc/meshing/meshing2.cpp 2003-12-10 15:34:35.000000000 +0100 +@@ -1785,7 +1785,7 @@ + + + #else +-void glrender (int wait) ++void netgen::glrender (int wait) + { + ; + } +diff -N -r -u netgen43/libsrc/visualization/stlmeshing.cpp /tmp/netgen43/libsrc/visualization/stlmeshing.cpp +--- netgen43/libsrc/visualization/stlmeshing.cpp 2003-05-07 16:01:43.000000000 +0200 ++++ /tmp/netgen43/libsrc/visualization/stlmeshing.cpp 2003-12-10 15:52:53.000000000 +0100 +@@ -5,7 +5,7 @@ + #include + + #include +-#include ++/*#include */ + + namespace netgen + { +diff -N -r -u netgen43/Makefile /tmp/netgen43/Makefile +--- netgen43/Makefile 2003-05-07 16:01:43.000000000 +0200 ++++ /tmp/netgen43/Makefile 2003-12-10 15:11:41.000000000 +0100 +@@ -35,7 +35,8 @@ + .SUFFIXES: .cpp .o + # + # +-CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL ++#CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL ++CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include + LINKFLAGS1 = -lGL -lGLU -lX11 -lXext -lXmu + # + CPLUSPLUSFLAGS = $(CPLUSPLUSFLAGS1) $(CPLUSPLUSFLAGS2) $(CPLUSPLUSFLAGS3) +diff -N -r -u netgen43/makeForSalome.sh /tmp/netgen43/makeForSalome.sh +--- netgen43/makeForSalome.sh 1970-01-01 01:00:00.000000000 +0100 ++++ /tmp/netgen43/makeForSalome.sh 2004-01-05 12:33:59.000000000 +0100 +@@ -0,0 +1,26 @@ ++#! /bin/sh ++cp ngtcltk/ngnewdelete.* libsrc/interface/ ++ ++MACHINE=LINUX ++export MACHINE ++make -C libsrc/csg ++make -C libsrc/general ++make -C libsrc/geom2d ++make -C libsrc/gprim ++make -C libsrc/interface ++make -C libsrc/linalg ++make -C libsrc/meshing ++make -C libsrc/opti ++make -C libsrc/stlgeom ++ ++if [ ! -d install ] ; then ++ mkdir install ++fi ++ ++cp -r lib install/ ++ ++if [ ! -d install/include ] ; then ++ mkdir install/include ++fi ++ ++cp libsrc/interface/nglib.h install/include diff --git a/src/NETGEN/netgen45ForSalome.patch b/src/NETGEN/netgen45ForSalome.patch index 2ee4dab..1560303 100644 --- a/src/NETGEN/netgen45ForSalome.patch +++ b/src/NETGEN/netgen45ForSalome.patch @@ -1,6 +1,35 @@ -diff -N -r -u netgen45_orig/libsrc/interface/Makefile netgen45_new/libsrc/interface/Makefile ---- netgen45_orig/libsrc/interface/Makefile 2006-04-13 12:58:37.000000000 +0400 -+++ netgen45_new/libsrc/interface/Makefile 2006-04-25 11:55:09.296578936 +0400 +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 +@@ -77,11 +77,12 @@ + } + + +-void MeshOptimize2dSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const ++bool MeshOptimize2dSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const + { + Point<3> hp = p; + geometry.GetSurface(surfind)->Project (hp); + p = hp; ++ return true; + } + + 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 +@@ -45,7 +45,7 @@ + MeshOptimize2dSurfaces (const CSGeometry & ageometry); + + /// +- virtual void ProjectPoint (INDEX surfind, Point3d & p) const; ++ virtual bool ProjectPoint (INDEX surfind, Point3d & p) const; + /// + 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 @@ -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 @@ -8,9 +37,9 @@ diff -N -r -u netgen45_orig/libsrc/interface/Makefile netgen45_new/libsrc/interf # lib = nginterface libpath = libsrc/interface -diff -N -r -u netgen45_orig/libsrc/interface/nglib.cpp netgen45_new/libsrc/interface/nglib.cpp ---- netgen45_orig/libsrc/interface/nglib.cpp 2006-04-13 12:58:37.000000000 +0400 -+++ netgen45_new/libsrc/interface/nglib.cpp 2006-04-25 11:55:09.297578764 +0400 +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 @@ -56,7 +56,8 @@ void Ng_Exit () @@ -21,9 +50,9 @@ diff -N -r -u netgen45_orig/libsrc/interface/nglib.cpp netgen45_new/libsrc/inter } -diff -N -r -u netgen45_orig/libsrc/makefile.inc netgen45_new/libsrc/makefile.inc ---- netgen45_orig/libsrc/makefile.inc 2006-04-13 12:58:37.000000000 +0400 -+++ netgen45_new/libsrc/makefile.inc 2006-04-25 11:55:09.297578764 +0400 +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 @@ -8,17 +8,14 @@ LIBSRC_DIR=$(CPP_DIR)/libsrc LIB_DIR=$(CPP_DIR)/lib/$(MACHINE) @@ -43,13 +72,13 @@ diff -N -r -u netgen45_orig/libsrc/makefile.inc netgen45_new/libsrc/makefile.inc # -CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) +CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \ -+ -DOCCGEOMETRY -DOCC52 -DHAVE_IOSTREAM -DHAVE_LIMITS ++ -DOCCGEOMETRY -DOCC52 -DHAVE_IOSTREAM -DHAVE_LIMITS_H # ARFLAGS = r # -diff -N -r -u netgen45_orig/libsrc/makefile.mach.LINUX netgen45_new/libsrc/makefile.mach.LINUX ---- netgen45_orig/libsrc/makefile.mach.LINUX 2006-04-13 12:58:37.000000000 +0400 -+++ netgen45_new/libsrc/makefile.mach.LINUX 2006-04-25 11:55:09.298578593 +0400 +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 @@ -16,7 +16,7 @@ # CFLAGS2 = @@ -59,9 +88,9 @@ diff -N -r -u netgen45_orig/libsrc/makefile.mach.LINUX netgen45_new/libsrc/makef -ftemplate-depth-99 -finline-limit=10000 \ -Wdisabled-optimization -funroll-loops -DnoNGSOLVE -diff -N -r -u netgen45_orig/libsrc/meshing/improve2.cpp netgen45_new/libsrc/meshing/improve2.cpp ---- netgen45_orig/libsrc/meshing/improve2.cpp 2006-03-29 15:09:49.000000000 +0400 -+++ netgen45_new/libsrc/meshing/improve2.cpp 2006-04-25 11:56:02.693420537 +0400 +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 @@ -4,7 +4,7 @@ #include @@ -71,9 +100,159 @@ diff -N -r -u netgen45_orig/libsrc/meshing/improve2.cpp netgen45_new/libsrc/mesh #endif namespace netgen -diff -N -r -u netgen45_orig/libsrc/occ/occconstruction.cpp netgen45_new/libsrc/occ/occconstruction.cpp ---- netgen45_orig/libsrc/occ/occconstruction.cpp 2006-04-13 12:58:37.000000000 +0400 -+++ netgen45_new/libsrc/occ/occconstruction.cpp 2006-04-25 11:55:09.298578593 +0400 +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 +@@ -32,17 +32,16 @@ + /// + virtual void SelectSurfaceOfPoint (const Point3d & p, + const PointGeomInfo & gi); +- /// +- virtual void ProjectPoint (INDEX /* surfind */, Point3d & /* p */) const { }; ++ ++ /// project point on surface, returns true if success ++ virtual bool ProjectPoint (INDEX /* surfind */, Point3d & /* p */) const { return false; } ++ /// fast project point on surface using point geom info of a neighboring point ++ /// if gi.trignum != 0, ++ /// returns true if success, gi is updated ++ virtual bool ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const ++ { gi.trignum = 1; return ProjectPoint (surfind, p); } + /// + virtual void ProjectPoint2 (INDEX /* surfind */, INDEX /* surfind2 */, Point3d & /* p */) const { }; +- /// liefert zu einem 3d-Punkt die geominfo (Dreieck) und liefert 1, wenn erfolgreich, +- /// 0, wenn nicht (Punkt ausserhalb von chart) +- virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point3d& /*p3*/) const +- { gi.trignum = 1; return 1;}; +- +- virtual int CalcPointGeomInfo(int /* surfind */, PointGeomInfo& gi, const Point3d& p3) const +- { return CalcPointGeomInfo (gi, p3); } + + /// + 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 +@@ -300,7 +300,7 @@ + double Opti2SurfaceMinFunction :: + FuncGrad (const Vector & x, Vector & grad) const + { +- Vec3d n, vgrad; ++ Vec3d vgrad; + Point3d pp1; + double g1x, g1y; + double badness, hbadness; +@@ -308,8 +308,6 @@ + vgrad = 0; + badness = 0; + +- meshthis -> GetNormalVector (surfi, sp1, gi1, n); +- + pp1 = sp1; + pp1.Add2 (x.Get(1), t1, x.Get(2), t2); + +@@ -360,7 +358,7 @@ + double Opti2SurfaceMinFunction :: + FuncDeriv (const Vector & x, const Vector & dir, double & deriv) const + { +- Vec3d n, vgrad; ++ Vec3d vgrad; + Point3d pp1; + double g1x, g1y; + double badness, hbadness; +@@ -368,8 +366,6 @@ + vgrad = 0; + badness = 0; + +- meshthis -> GetNormalVector (surfi, sp1, gi1, n); +- + pp1 = sp1; + pp1.Add2 (x.Get(1), t1, x.Get(2), t2); + +@@ -520,7 +516,7 @@ + // from 2d: + + int j, k, lpi, gpi; +- Vec3d n, vgrad; ++ Vec3d vgrad; + Point3d pp1; + Vec2d g1, vdir; + double badness, hbadness, hbad, hderiv; +@@ -528,8 +524,6 @@ + vgrad = 0; + badness = 0; + +- meshthis -> GetNormalVector (surfi, sp1, gi1, n); +- + pp1 = sp1; + pp1.Add2 (x.Get(1), t1, x.Get(2), t2); + +@@ -593,7 +587,7 @@ + // from 2d: + + int j, k, lpi, gpi; +- Vec3d n, vgrad; ++ Vec3d vgrad; + Point3d pp1; + Vec2d g1, vdir; + double badness, hbadness, hbad, hderiv; +@@ -601,8 +595,6 @@ + vgrad = 0; + badness = 0; + +- meshthis -> GetNormalVector (surfi, sp1, gi1, n); +- + pp1 = sp1; + pp1.Add2 (x.Get(1), t1, x.Get(2), t2); + +@@ -859,19 +851,21 @@ + locelements.SetSize(0); + locrots.SetSize (0); + lochs.SetSize (0); ++ ngi.trignum = 0; + + for (j = 0; j < elementsonpoint[pi].Size(); j++) + { + sei = elementsonpoint[pi][j]; + const Element2d & bel = mesh[sei]; + surfi = mesh.GetFaceDescriptor(bel.GetIndex()).SurfNr(); +- ++ + locelements.Append (sei); + + for (k = 1; k <= bel.GetNP(); k++) + if (bel.PNum(k) == pi) + { + locrots.Append (k); ++ ngi = bel.GeomInfoPi(k); + break; + } + +@@ -942,7 +936,7 @@ + } + + //optimizer loop (if not whole distance is not possible, move only a bit!!!!) +- while (loci <= 5 && !moveisok) ++ while (loci <= 5 && !moveisok) + { + loci ++; + mesh[pi].X() = origp.X() + (x.Get(1) * t1.X() + x.Get(2) * t2.X())*fact; +@@ -951,11 +945,9 @@ + fact = fact/2.; + + +- ProjectPoint (surfi, mesh[pi]); ++ moveisok = ProjectPoint (surfi, mesh[pi], ngi); + +- moveisok = CalcPointGeomInfo(surfi, ngi, mesh[pi]); +- // point lies on same chart in stlsurface +- ++ // point lies on same chart in stlsurface + 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 @@ -28,8 +28,8 @@ #include #include @@ -85,10 +264,56 @@ diff -N -r -u netgen45_orig/libsrc/occ/occconstruction.cpp netgen45_new/libsrc/o #include #include namespace netgen -diff -N -r -u netgen45_orig/libsrc/occ/occgenmesh.cpp netgen45_new/libsrc/occ/occgenmesh.cpp ---- netgen45_orig/libsrc/occ/occgenmesh.cpp 2006-04-13 12:58:37.000000000 +0400 -+++ netgen45_new/libsrc/occ/occgenmesh.cpp 2006-04-25 11:55:09.300578250 +0400 -@@ -112,7 +112,7 @@ +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 +@@ -28,7 +28,7 @@ + return Point<3> (p.X(), p.Y(), p.Z()); + } + +- void DivideEdge (TopoDS_Edge & edge, ++ static void DivideEdge (TopoDS_Edge & edge, + ARRAY & ps, + ARRAY & params, + Mesh & mesh) +@@ -49,23 +49,19 @@ + hvalue[0] = 0; + pnt = c->Value(s0); + +- double olddist = 0; +- double dist = 0; +- +- for (int i = 1; i <= DIVIDEEDGESECTIONS; i++) ++ int i; ++ for (i = 1; i <= DIVIDEEDGESECTIONS; i++) + { + oldpnt = pnt; + pnt = c->Value(s0+(i/double(DIVIDEEDGESECTIONS))*(s1-s0)); ++ double dist = pnt.Distance(oldpnt); + hvalue[i] = hvalue[i-1] + + 1.0/mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z()))* +- pnt.Distance(oldpnt); ++ dist; + + //(*testout) << "mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z())) " << mesh.GetH(Point3d(pnt.X(), pnt.Y(), pnt.Z())) + // << " pnt.Distance(oldpnt) " << pnt.Distance(oldpnt) << endl; + +- +- olddist = dist; +- dist = pnt.Distance(oldpnt); + } + + // nsubedges = int(ceil(hvalue[DIVIDEEDGESECTIONS])); +@@ -74,7 +70,7 @@ + ps.SetSize(nsubedges-1); + params.SetSize(nsubedges+1); + +- int i = 1; ++ i = 1; + int i1 = 0; + do + { +@@ -112,7 +108,7 @@ static void FindEdges (OCCGeometry & geom, Mesh & mesh) { @@ -97,7 +322,44 @@ diff -N -r -u netgen45_orig/libsrc/occ/occgenmesh.cpp netgen45_new/libsrc/occ/oc multithread.task = "Edge meshing"; (*testout) << "edge meshing" << endl; -@@ -394,7 +394,7 @@ +@@ -124,6 +120,7 @@ + (*testout) << "nedges = " << nedges << endl; + + double eps = 1e-6 * geom.GetBoundingBox().Diam(); ++ double eps2 = eps * eps; + + for (int i = 1; i <= nvertices; i++) + { +@@ -133,7 +130,7 @@ + bool exists = 0; + if (merge_solids) + for (PointIndex pi = 1; pi <= mesh.GetNP(); pi++) +- if ( Dist2 (mesh[pi], Point<3>(mp)) < eps*eps) ++ if ( Dist2 (mesh[pi], Point<3>(mp)) < eps2) + { + exists = 1; + break; +@@ -276,8 +273,8 @@ + pnums.Last() = -1; + for (PointIndex pi = 1; pi < first_ep; pi++) + { +- if (Dist2 (mesh[pi], fp) < eps*eps) pnums[0] = pi; +- if (Dist2 (mesh[pi], lp) < eps*eps) pnums.Last() = pi; ++ if (Dist2 (mesh[pi], fp) < eps2) pnums[0] = pi; ++ if (Dist2 (mesh[pi], lp) < eps2) pnums.Last() = pi; + } + } + +@@ -287,7 +284,7 @@ + bool exists = 0; + int j; + for (j = first_ep; j <= mesh.GetNP(); j++) +- if ((mesh.Point(j)-Point<3>(mp[i-1])).Length() < eps) ++ if (Dist2(mesh.Point(j), Point<3>(mp[i-1])) < eps2) + { + exists = 1; + break; +@@ -394,7 +391,7 @@ int i, j, k; int changed; @@ -106,7 +368,16 @@ diff -N -r -u netgen45_orig/libsrc/occ/occgenmesh.cpp netgen45_new/libsrc/occ/oc multithread.task = "Surface meshing"; geom.facemeshstatus = 0; -@@ -779,7 +779,7 @@ +@@ -751,7 +748,7 @@ + multithread.task = savetask; + } + +- double ComputeH (double kappa) ++ static double ComputeH (double kappa) + { + double hret; + kappa *= mparam.curvaturesafety; +@@ -779,7 +776,7 @@ double nq = n*q; Point<3> p = p0 + 0.5*n; @@ -115,7 +386,150 @@ diff -N -r -u netgen45_orig/libsrc/occ/occgenmesh.cpp netgen45_new/libsrc/occ/oc if (lambda >= 0 && lambda <= 1) { -@@ -970,7 +970,7 @@ +@@ -799,55 +796,55 @@ + + + +- void RestrictHTriangle (gp_Pnt2d & par0, gp_Pnt2d & par1, gp_Pnt2d & par2, +- BRepLProp_SLProps * prop, Mesh & mesh, const double maxside, int depth, double h = 0) ++ static void RestrictHTriangle (gp_Pnt2d & par0, gp_Pnt2d & par1, gp_Pnt2d & par2, ++ BRepAdaptor_Surface& surf, Mesh & mesh, const double maxside, int depth, double h = 0) + { +- ++ BRepLProp_SLProps prop(surf, 2, 1e-5); + + gp_Pnt2d parmid; + + parmid.SetX(0.3*(par0.X()+par1.X()+par2.X())); + parmid.SetY(0.3*(par0.Y()+par1.Y()+par2.Y())); + +- if (depth == 0) ++ //if (depth == 0) + { + double curvature = 0; + +- prop->SetParameters (parmid.X(), parmid.Y()); +- if (!prop->IsCurvatureDefined()) ++ prop.SetParameters (parmid.X(), parmid.Y()); ++ if (!prop.IsCurvatureDefined()) + { + (*testout) << "curvature not defined!" << endl; + return; + } +- curvature = max(fabs(prop->MinCurvature()), +- fabs(prop->MaxCurvature())); ++ curvature = max(fabs(prop.MinCurvature()), ++ fabs(prop.MaxCurvature())); + +- prop->SetParameters (par0.X(), par0.Y()); +- if (!prop->IsCurvatureDefined()) ++ prop.SetParameters (par0.X(), par0.Y()); ++ if (!prop.IsCurvatureDefined()) + { + (*testout) << "curvature not defined!" << endl; + return; + } +- curvature = max(curvature,max(fabs(prop->MinCurvature()), +- fabs(prop->MaxCurvature()))); ++ curvature = max(curvature,max(fabs(prop.MinCurvature()), ++ fabs(prop.MaxCurvature()))); + +- prop->SetParameters (par1.X(), par1.Y()); +- if (!prop->IsCurvatureDefined()) ++ prop.SetParameters (par1.X(), par1.Y()); ++ if (!prop.IsCurvatureDefined()) + { + (*testout) << "curvature not defined!" << endl; + return; + } +- curvature = max(curvature,max(fabs(prop->MinCurvature()), +- fabs(prop->MaxCurvature()))); ++ curvature = max(curvature,max(fabs(prop.MinCurvature()), ++ fabs(prop.MaxCurvature()))); + +- prop->SetParameters (par2.X(), par2.Y()); +- if (!prop->IsCurvatureDefined()) ++ prop.SetParameters (par2.X(), par2.Y()); ++ if (!prop.IsCurvatureDefined()) + { + (*testout) << "curvature not defined!" << endl; + return; + } +- curvature = max(curvature,max(fabs(prop->MinCurvature()), +- fabs(prop->MaxCurvature()))); ++ curvature = max(curvature,max(fabs(prop.MinCurvature()), ++ fabs(prop.MaxCurvature()))); + + //(*testout) << "curvature " << curvature << endl; + +@@ -886,51 +883,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())); + +- RestrictHTriangle (pm0, pm1, pm2, prop, mesh, 0.5*maxside, depth+1, h); +- RestrictHTriangle (par0, pm1, pm2, prop, mesh, 0.5*maxside, depth+1, h); +- RestrictHTriangle (par1, pm0, pm2, prop, mesh, 0.5*maxside, depth+1, h); +- RestrictHTriangle (par2, pm1, pm0, prop, mesh, 0.5*maxside, depth+1, h); ++ RestrictHTriangle (pm0, pm1, pm2, surf, mesh, 0.5*maxside, depth+1, h); ++ RestrictHTriangle (par0, pm1, pm2, surf, mesh, 0.5*maxside, depth+1, h); ++ RestrictHTriangle (par1, pm0, pm2, surf, mesh, 0.5*maxside, depth+1, h); ++ RestrictHTriangle (par2, pm1, pm0, surf, mesh, 0.5*maxside, depth+1, h); + } + else + { + gp_Pnt pnt; + Point3d p3d; + +- prop->SetParameters (parmid.X(), parmid.Y()); +- pnt = prop->Value(); ++ surf.D0(parmid.X(), parmid.Y(), pnt); + p3d = Point3d(pnt.X(), pnt.Y(), pnt.Z()); + mesh.RestrictLocalH (p3d, h); + + +- prop->SetParameters (par0.X(), par0.Y()); +- pnt = prop->Value(); ++ surf.D0(par0.X(), par0.Y(), pnt); + p3d = Point3d(pnt.X(), pnt.Y(), pnt.Z()); + mesh.RestrictLocalH (p3d, h); + +- prop->SetParameters (par1.X(), par1.Y()); +- pnt = prop->Value(); ++ surf.D0(par1.X(), par1.Y(), pnt); + p3d = Point3d(pnt.X(), pnt.Y(), pnt.Z()); + mesh.RestrictLocalH (p3d, h); + +- prop->SetParameters (par2.X(), par2.Y()); +- pnt = prop->Value(); ++ surf.D0(par2.X(), par2.Y(), pnt); + p3d = Point3d(pnt.X(), pnt.Y(), pnt.Z()); + mesh.RestrictLocalH (p3d, h); + +- (*testout) << "p = " << p3d << ", h = " << h << ", maxside = " << maxside << endl; ++ //(*testout) << "p = " << p3d << ", h = " << h << ", maxside = " << maxside << endl; + /* + (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl; + +- prop->SetParameters (par0.X(), par0.Y()); +- pnt = prop->Value(); ++ prop.SetParameters (par0.X(), par0.Y()); ++ pnt = prop.Value(); + (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl; + +- prop->SetParameters (par1.X(), par1.Y()); +- pnt = prop->Value(); ++ prop.SetParameters (par1.X(), par1.Y()); ++ pnt = prop.Value(); + (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl; + +- prop->SetParameters (par2.X(), par2.Y()); +- pnt = prop->Value(); ++ prop.SetParameters (par2.X(), par2.Y()); ++ pnt = prop.Value(); + (*testout) << pnt.X() << " " << pnt.Y() << " " << pnt.Z() << endl; + */ + } +@@ -970,7 +963,7 @@ if (mparam.uselocalh) { @@ -124,10 +538,56 @@ diff -N -r -u netgen45_orig/libsrc/occ/occgenmesh.cpp netgen45_new/libsrc/occ/oc multithread.percent = 0; mesh->SetLocalH (bb.PMin(), bb.PMax(), mparam.grading); -diff -N -r -u netgen45_orig/libsrc/occ/occgeom.cpp netgen45_new/libsrc/occ/occgeom.cpp ---- netgen45_orig/libsrc/occ/occgeom.cpp 2006-04-13 12:58:37.000000000 +0400 -+++ netgen45_new/libsrc/occ/occgeom.cpp 2006-04-25 11:55:09.301578078 +0400 -@@ -947,13 +947,13 @@ +@@ -1075,7 +1068,6 @@ + if (triangulation.IsNull()) continue; + + BRepAdaptor_Surface sf(face, Standard_True); +- BRepLProp_SLProps prop(sf, 2, 1e-5); + + int ntriangles = triangulation -> NbTriangles(); + for (int j = 1; j <= ntriangles; j++) +@@ -1096,7 +1088,7 @@ + maxside = max (maxside, p[1].Distance(p[2])); + //cout << "\rFace " << i << " pos11 ntriangles " << ntriangles << " maxside " << maxside << flush; + +- RestrictHTriangle (par[0], par[1], par[2], &prop, *mesh, maxside, 0); ++ RestrictHTriangle (par[0], par[1], par[2], sf, *mesh, maxside, 0); + //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 +@@ -7,6 +7,8 @@ + #include "ShapeAnalysis_ShapeContents.hxx" + #include "ShapeAnalysis_CheckSmallFace.hxx" + #include "ShapeAnalysis_DataMapOfShapeListOfReal.hxx" ++#include ++#include + #include "BRepAlgoAPI_Fuse.hxx" + #include "BRepCheck_Analyzer.hxx" + #include "BRepLib.hxx" +@@ -16,11 +18,19 @@ + #include "Partition_Spliter.hxx" + //#include "VrmlAPI.hxx" + //#include "StlAPI.hxx" ++#include + + + namespace netgen + { + ++ OCCGeometry::~OCCGeometry() ++ { ++ NCollection_DataMap::Iterator it(fclsmap); ++ for (; it.More(); it.Next()) ++ delete it.Value(); ++ } ++ + void OCCGeometry :: PrintNrShapes () + { + TopExp_Explorer e; +@@ -947,13 +957,13 @@ void OCCGeometry :: BuildVisualizationMesh () { @@ -144,10 +604,158 @@ diff -N -r -u netgen45_orig/libsrc/occ/occgeom.cpp netgen45_new/libsrc/occ/occge cout << "done" << endl; -diff -N -r -u netgen45_orig/libsrc/occ/occgeom.hpp netgen45_new/libsrc/occ/occgeom.hpp ---- netgen45_orig/libsrc/occ/occgeom.hpp 2006-04-13 12:58:37.000000000 +0400 -+++ netgen45_new/libsrc/occ/occgeom.hpp 2006-04-25 11:55:09.302577907 +0400 -@@ -69,7 +69,7 @@ +@@ -973,8 +983,27 @@ + + } + ++ void OCCGeometry::GetFaceTools(int surfi, Handle(ShapeAnalysis_Surface)& proj, ++ BRepTopAdaptor_FClass2d*& cls) const ++ { ++ //MSV: organize caching projector in the map ++ if (fprjmap.IsBound(surfi)) ++ { ++ proj = fprjmap.Find(surfi); ++ cls = fclsmap.Find(surfi); ++ } ++ else ++ { ++ const TopoDS_Face& aFace = TopoDS::Face(fmap(surfi)); ++ Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace); ++ proj = new ShapeAnalysis_Surface(aSurf); ++ fprjmap.Bind(surfi, proj); ++ cls = new BRepTopAdaptor_FClass2d(aFace,Precision::Confusion()); ++ fclsmap.Bind(surfi, cls); ++ } ++ } + +- void OCCGeometry :: Project (int surfi, Point<3> & p) const ++ bool OCCGeometry :: Project (int surfi, Point<3> & p, double& u, double& v) const + { + static int cnt = 0; + if (++cnt % 1000 == 0) cout << "Project cnt = " << cnt << endl; +@@ -983,18 +1012,22 @@ + + //(*testout) << "before " << pnt.X() << " "<< pnt.Y() << " "<< pnt.Z() << " " << endl; + +- GeomAPI_ProjectPointOnSurf proj(pnt, BRep_Tool::Surface(TopoDS::Face(fmap(surfi)))); +- if (proj.NbPoints() == 0) +- { +- cout << "Projection fails" << endl; +- } +- else +- { +- pnt = proj.NearestPoint(); +- //(*testout) << "after " << pnt.X() << " "<< pnt.Y() << " "<< pnt.Z() << " " << endl; ++ Handle(ShapeAnalysis_Surface) proj; ++ BRepTopAdaptor_FClass2d *cls; ++ GetFaceTools(surfi, proj, cls); + +- p = Point<3> (pnt.X(), pnt.Y(), pnt.Z()); +- } ++ gp_Pnt2d p2d = proj->ValueOfUV(pnt, Precision::Confusion()); ++ if (cls->Perform(p2d) == TopAbs_OUT) ++ { ++ //cout << "Projection fails" << endl; ++ return false; ++ } ++ pnt = proj->Value(p2d); ++ p2d.Coord(u, v); ++ //(*testout) << "after " << pnt.X() << " "<< pnt.Y() << " "<< pnt.Z() << " " << endl; ++ ++ p = Point<3> (pnt.X(), pnt.Y(), pnt.Z()); ++ return true; + } + + +@@ -1002,54 +1035,20 @@ + { + gp_Pnt p(ap(0), ap(1), ap(2)); + +- Handle(Geom_Surface) surface = BRep_Tool::Surface(TopoDS::Face(fmap(surfi))); ++ Handle(ShapeAnalysis_Surface) proj; ++ BRepTopAdaptor_FClass2d *cls; ++ GetFaceTools(surfi, proj, cls); + +- gp_Pnt x = surface->Value (u,v); +- +- if (p.SquareDistance(x) <= sqr(PROJECTION_TOLERANCE)) return true; +- +- gp_Vec du, dv; +- +- surface->D1(u,v,x,du,dv); +- +- int count = 0; +- +- gp_Pnt xold; +- gp_Vec n; +- double det, lambda, mu; +- +- do { +- count++; +- +- n = du^dv; +- +- det = Det3 (n.X(), du.X(), dv.X(), +- n.Y(), du.Y(), dv.Y(), +- n.Z(), du.Z(), dv.Z()); +- +- if (det < 1e-15) return false; +- +- lambda = Det3 (n.X(), p.X()-x.X(), dv.X(), +- n.Y(), p.Y()-x.Y(), dv.Y(), +- n.Z(), p.Z()-x.Z(), dv.Z())/det; +- +- mu = Det3 (n.X(), du.X(), p.X()-x.X(), +- n.Y(), du.Y(), p.Y()-x.Y(), +- n.Z(), du.Z(), p.Z()-x.Z())/det; +- +- u += lambda; +- v += mu; +- +- xold = x; +- surface->D1(u,v,x,du,dv); +- +- } while (xold.SquareDistance(x) > sqr(PROJECTION_TOLERANCE) && count < 50); +- +- // (*testout) << "FastProject count: " << count << endl; +- +- if (count == 50) return false; ++ gp_Pnt2d p2d = proj->NextValueOfUV(gp_Pnt2d(u,v), p, Precision::Confusion()); ++ if (cls->Perform(p2d) == TopAbs_OUT) ++ { ++ //cout << "Projection fails" << endl; ++ return false; ++ } + +- ap = Point<3> (x.X(), x.Y(), x.Z()); ++ p = proj->Value(p2d); ++ p2d.Coord(u, v); ++ ap = Point<3> (p.X(), p.Y(), p.Z()); + + 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 +@@ -15,8 +15,6 @@ + #include "Geom_Curve.hxx" + #include "Geom2d_Curve.hxx" + #include "Geom_Surface.hxx" +-#include "GeomAPI_ProjectPointOnSurf.hxx" +-#include "GeomAPI_ProjectPointOnCurve.hxx" + #include "BRepTools.hxx" + #include "TopExp.hxx" + #include "BRepBuilderAPI_MakeVertex.hxx" +@@ -41,8 +39,6 @@ + #include "Geom_Curve.hxx" + #include "Geom2d_Curve.hxx" + #include "Geom_Surface.hxx" +-#include "GeomAPI_ProjectPointOnSurf.hxx" +-#include "GeomAPI_ProjectPointOnCurve.hxx" + #include "TopoDS_Wire.hxx" + #include "BRepTools_WireExplorer.hxx" + #include "BRepTools.hxx" +@@ -69,7 +65,7 @@ #include "IGESToBRep_Reader.hxx" #include "Interface_Static.hxx" #include "GeomAPI_ExtremaCurveCurve.hxx" @@ -156,7 +764,15 @@ diff -N -r -u netgen45_orig/libsrc/occ/occgeom.hpp netgen45_new/libsrc/occ/occge #include "Standard_Failure.hxx" #include "ShapeUpgrade_ShellSewing.hxx" #include "ShapeFix_Shape.hxx" -@@ -88,7 +88,7 @@ +@@ -84,11 +80,15 @@ + #include "STEPControl_Writer.hxx" + #include "StlAPI_Writer.hxx" + #include "STEPControl_StepModelType.hxx" ++#include ++ ++class Handle_ShapeAnalysis_Surface; ++class BRepTopAdaptor_FClass2d; + namespace netgen { @@ -165,9 +781,249 @@ diff -N -r -u netgen45_orig/libsrc/occ/occgeom.hpp netgen45_new/libsrc/occ/occge // class VisualizationParameters; // extern VisualizationParameters vispar; -diff -N -r -u netgen45_orig/makeForSalome.sh netgen45_new/makeForSalome.sh ---- netgen45_orig/makeForSalome.sh 1970-01-01 03:00:00.000000000 +0300 -+++ netgen45_new/makeForSalome.sh 2006-04-25 11:55:09.302577907 +0400 +@@ -159,6 +159,8 @@ + class OCCGeometry + { + Point<3> center; ++ mutable NCollection_DataMap fprjmap; ++ mutable NCollection_DataMap fclsmap; + + public: + TopoDS_Shape shape; +@@ -189,6 +191,7 @@ + vmap.Clear(); + } + ++ ~OCCGeometry(); + + void BuildFMap(); + +@@ -204,10 +207,12 @@ + Point<3> Center() + { return center; } + +- void Project (int surfi, Point<3> & p) const; ++ bool Project (int surfi, Point<3> & p, double& u, double& v) const; + bool FastProject (int surfi, Point<3> & ap, double& u, double& v) const; + +- ++ void GetFaceTools(int surfi, Handle(ShapeAnalysis_Surface)& proj, ++ BRepTopAdaptor_FClass2d*& cls) const; ++ + 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 +@@ -5,6 +5,8 @@ + #include + #include + #include ++#include ++#include + + + namespace netgen +@@ -411,11 +413,16 @@ + } + + +- void MeshOptimize2dOCCSurfaces :: ProjectPoint (INDEX surfind, Point3d & p) const ++ bool MeshOptimize2dOCCSurfaces :: ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const + { + Point<3> hp = p; +- geometry.Project (surfind, hp); ++ bool ok; ++ if (gi.trignum > 0) ++ ok = geometry.FastProject (surfind, hp, gi.u, gi.v); ++ else ++ ok = geometry.Project (surfind, hp, gi.u, gi.v); + p = hp; ++ return ok; + } + + void MeshOptimize2dOCCSurfaces :: ProjectPoint2 (INDEX surfind, INDEX surfind2, +@@ -506,38 +513,6 @@ + } + + +- int MeshOptimize2dOCCSurfaces :: +- CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point3d& p) const +- { +- Standard_Real u,v; +- +- gp_Pnt pnt(p.X(), p.Y(), p.Z()); +- +- Handle(Geom_Surface) occface; +- occface = BRep_Tool::Surface(TopoDS::Face(geometry.fmap(surfind))); +- +- GeomAPI_ProjectPointOnSurf proj(pnt, occface); +- +- if (proj.NbPoints() < 1) +- { +- cout << "ERROR: OCCSurface :: GetNormalVector: GeomAPI_ProjectPointOnSurf failed!" +- << endl; +- cout << p << endl; +- return 0; +- } +- +- proj.LowerDistanceParameters (u, v); +- +- gi.u = u; +- gi.v = v; +- return 1; +- } +- +- +- +- +- +- + OCCRefinementSurfaces :: OCCRefinementSurfaces (const OCCGeometry & ageometry) + : Refinement(), geometry(ageometry) + { +@@ -627,10 +602,11 @@ + if (!geometry.FastProject (surfi, hnewp, u, v)) + { + cout << "Fast projection to surface fails! Using OCC projection" << endl; +- geometry.Project (surfi, hnewp); ++ double u, v; ++ geometry.Project (surfi, hnewp, u, v); + } + +- newgi.trignum = 1; ++ newgi.trignum = surfi; + } + + newp = hnewp; +@@ -653,14 +629,17 @@ + hnewp = Point<3> (pnt.X(), pnt.Y(), pnt.Z()); + newp = hnewp; + newgi = ap1; +- }; ++ } + + + void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi) + { + if (surfi > 0) +- geometry.Project (surfi, p); +- }; ++ { ++ double u, v; ++ geometry.Project (surfi, p, u, v); ++ } ++ } + + void OCCRefinementSurfaces :: ProjectToSurface (Point<3> & p, int surfi, PointGeomInfo & gi) + { +@@ -668,9 +647,10 @@ + if (!geometry.FastProject (surfi, p, gi.u, gi.v)) + { + cout << "Fast projection to surface fails! Using OCC projection" << endl; +- geometry.Project (surfi, p); ++ double u, v; ++ geometry.Project (surfi, p, u, v); + } +- }; ++ } + + + +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 +@@ -151,7 +151,7 @@ + MeshOptimize2dOCCSurfaces (const OCCGeometry & ageometry); + + /// +- virtual void ProjectPoint (INDEX surfind, Point3d & p) const; ++ virtual bool ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const; + /// + virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const; + /// +@@ -159,9 +159,6 @@ + /// + virtual void GetNormalVector(INDEX surfind, const Point3d & p, PointGeomInfo & gi, Vec3d & n) const; + +- +- virtual int CalcPointGeomInfo(int surfind, PointGeomInfo& gi, const Point3d& p3) const; +- + }; + + +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 +@@ -946,20 +946,23 @@ + } + + +-void MeshOptimizeSTLSurface :: ProjectPoint (INDEX surfind, Point3d & p) const ++bool MeshOptimizeSTLSurface :: ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const + { + Point<3> hp = p; +- if (!geom.Project (hp)) ++ if (gi.trignum > 0) ++ ((STLGeometry&)geom).SelectChartOfTriangle (gi.trignum); ++ if (!(gi.trignum = geom.Project (hp))) + { + PrintMessage(7,"project failed"); + +- if (!geom.ProjectOnWholeSurface(hp)) ++ if (!(gi.trignum = geom.ProjectOnWholeSurface(hp))) + { + PrintMessage(7, "project on whole surface failed"); + } + } + p = hp; + // geometry.GetSurface(surfind)->Project (p); ++ return gi.trignum > 0; + } + + void MeshOptimizeSTLSurface :: ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const +@@ -970,20 +973,6 @@ + */ + } + +-int MeshOptimizeSTLSurface :: CalcPointGeomInfo(PointGeomInfo& gi, const Point3d& p3) const +-{ +- Point<3> hp = p3; +- gi.trignum = geom.Project (hp); +- +- if (gi.trignum) +- { +- return 1; +- } +- +- return 0; +- +-} +- + 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 +@@ -79,12 +79,10 @@ + virtual void SelectSurfaceOfPoint (const Point3d & p, + const PointGeomInfo & gi); + /// +- virtual void ProjectPoint (INDEX surfind, Point3d & p) const; ++ virtual bool ProjectPoint (INDEX surfind, Point3d & p, PointGeomInfo& gi) const; + /// + virtual void ProjectPoint2 (INDEX surfind, INDEX surfind2, Point3d & p) const; + /// +- virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point3d& p3) const; +- /// + 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 @@ -0,0 +1,31 @@ +#! /bin/sh +cp ngtcltk/ngnewdelete.* libsrc/interface/ diff --git a/src/NETGEN/netgen45lib64.patch b/src/NETGEN/netgen45lib64.patch new file mode 100755 index 0000000..1593971 --- /dev/null +++ b/src/NETGEN/netgen45lib64.patch @@ -0,0 +1,45 @@ +diff -ur netgen-4.5.old/libsrc/makefile.inc netgen-4.5.new/libsrc/makefile.inc +--- netgen-4.5/libsrc/makefile.inc 2006-04-27 13:12:54.000000000 +0400 ++++ netgen-4.5/libsrc/makefile.inc 2006-09-05 14:16:32.000000000 +0400 +@@ -14,7 +14,7 @@ + # + 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) \ + -DOCCGEOMETRY -DOCC52 -DHAVE_IOSTREAM -DHAVE_LIMITS_H + # + ARFLAGS = r +diff -ur netgen-4.5.old/libsrc/makefile.mach.LINUX64 netgen-4.5.new/libsrc/makefile.mach.LINUX64 +--- netgen-4.5/libsrc/makefile.mach.LINUX64 2006-03-29 15:09:32.000000000 +0400 ++++ netgen-4.5/libsrc/makefile.mach.LINUX64 2006-09-07 15:48:39.000000000 +0400 +@@ -11,7 +11,7 @@ + # + # + CFLAGS2 = +-CPLUSPLUSFLAGS2 = -pg -march=nocona -O2 -DLINUX -DOPENGL \ ++CPLUSPLUSFLAGS2 = -pg -march=nocona -O2 -DLINUX \ + -ftemplate-depth-99 -finline-limit=100000 \ + -fforce-addr -funroll-loops \ + -DTRAFO -DNGSOLVE -DnoADDON -DnoLAPACK -DnoFAST \ +@@ -23,7 +23,7 @@ + # + # + +-LINKFLAGS2 = -pg -L/usr/openwin/lib64 -L/usr/X11R6/lib64 -L/usr/lib/GL3.5 -L/usr/lib64 ++LINKFLAGS2 = -fPIC -pg -L/usr/openwin/lib64 -L/usr/X11R6/lib64 -L/usr/lib/GL3.5 -L/usr/lib64 + + + SYSLIB2 = -lstdc++ +diff -ur netgen-4.5.old/Makefile netgen-4.5.new/Makefile +--- netgen-4.5/Makefile 2006-03-29 15:09:12.000000000 +0400 ++++ netgen-4.5/Makefile 2006-09-07 15:46:07.000000000 +0400 +@@ -72,7 +72,7 @@ + # + #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) + + LINKFLAGS1 = -lGL -lGLU -lX11 -lXext -lXmu + # diff --git a/src/NETGENPlugin/Makefile.am b/src/NETGENPlugin/Makefile.am new file mode 100644 index 0000000..7a10e1e --- /dev/null +++ b/src/NETGENPlugin/Makefile.am @@ -0,0 +1,71 @@ +# 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 +# +# -* 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 = + +# Libraries targets +lib_LTLIBRARIES = libNETGENEngine.la + +dist_libNETGENEngine_la_SOURCES = \ + NETGENPlugin_NETGEN_3D.cxx \ + NETGENPlugin_NETGEN_3D_i.cxx \ + NETGENPlugin_NETGEN_2D.cxx \ + NETGENPlugin_NETGEN_2D_i.cxx \ + NETGENPlugin_NETGEN_2D3D.cxx \ + NETGENPlugin_NETGEN_2D3D_i.cxx \ + NETGENPlugin_NETGEN_2D_ONLY.cxx \ + NETGENPlugin_NETGEN_2D_ONLY_i.cxx \ + NETGENPlugin_Hypothesis.cxx \ + NETGENPlugin_Hypothesis_i.cxx \ + NETGENPlugin_Hypothesis_2D.cxx \ + NETGENPlugin_Hypothesis_2D_i.cxx \ + NETGENPlugin_Mesher.cxx \ + NETGENPlugin_i.cxx + +libNETGENEngine_la_CPPFLAGS = \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(GEOM_CXXFLAGS) \ + $(CAS_CPPFLAGS) \ + $(NETGEN_INCLUDES) \ + $(SMESH_CXXFLAGS) \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + -I$(top_builddir)/idl \ + -I$(top_builddir)/salome_adm/unix + +libNETGENEngine_la_LDFLAGS = \ + ../NETGEN/libNETGEN.la \ + ../../idl/libSalomeIDLNETGENPLUGIN.la \ + $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \ + $(KERNEL_LDFLAGS) -lSalomeGenericObj diff --git a/src/NETGENPlugin/Makefile.in b/src/NETGENPlugin/Makefile.in deleted file mode 100644 index 10a6742..0000000 --- a/src/NETGENPlugin/Makefile.in +++ /dev/null @@ -1,66 +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 -# -# -* Makefile *- -# -# Author : Edward AGAPOV (OCC) -# Module : NETGENPLUGIN -# Date : 10/01/2004 -# -# - -# source path -top_srcdir=@top_srcdir@ -top_builddir=../.. -srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:${KERNEL_ROOT_DIR}/idl/salome:${GUI_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome:${SMESH_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome - -@COMMENCE@ - -LIB_SRC = \ - NETGENPlugin_NETGEN_3D.cxx \ - NETGENPlugin_NETGEN_3D_i.cxx \ - NETGENPlugin_NETGEN_2D.cxx \ - NETGENPlugin_NETGEN_2D_i.cxx \ - NETGENPlugin_NETGEN_2D3D.cxx \ - NETGENPlugin_NETGEN_2D3D_i.cxx \ - NETGENPlugin_Hypothesis.cxx \ - NETGENPlugin_Hypothesis_i.cxx \ - NETGENPlugin_Hypothesis_2D.cxx \ - NETGENPlugin_Hypothesis_2D_i.cxx \ - NETGENPlugin_Mesher.cxx \ - NETGENPlugin_i.cxx - -LIB_SERVER_IDL = NETGENPlugin_Algorithm.idl - -LIB_CLIENT_IDL = \ - SALOME_Component.idl \ - SALOME_Comm.idl \ - GEOM_Gen.idl \ - MED.idl - -# Libraries targets -LIB = libNETGENEngine.la - -NETGEN_INCLUDES = @NETGEN_INCLUDES@ -CPPFLAGS += $(NETGEN_INCLUDES) -CXXFLAGS += $(NETGEN_INCLUDES) -LDFLAGS += -lNETGEN - -@CONCLUDE@ diff --git a/src/NETGENPlugin/NETGENPlugin_Defs.hxx b/src/NETGENPlugin/NETGENPlugin_Defs.hxx new file mode 100755 index 0000000..5ed43a2 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_Defs.hxx @@ -0,0 +1,37 @@ +// 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 +// +//============================================================================= +// File : NETGENPlugin_Defs.hxx +// Author : Alexander A. BORODIN + +#ifndef _NETGENPlugin_DEFS_HXX_ +#define _NETGENPlugin_DEFS_HXX_ + +#ifdef WIN32 + #ifdef NETGENPLUGIN_EXPORTS + #define NETGENPLUGIN_EXPORT __declspec( dllexport ) + #else + #define NETGENPLUGIN_EXPORT __declspec( dllimport ) + #endif +#else + #define NETGENPLUGIN_EXPORT +#endif + +#endif diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx index d5f43cd..bda2508 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx @@ -26,10 +26,11 @@ // $Header$ //============================================================================= -using namespace std; #include #include +using namespace std; + //============================================================================= /*! * diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx index 01a4c3e..f52504b 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx @@ -29,13 +29,17 @@ #ifndef _NETGENPlugin_Hypothesis_HXX_ #define _NETGENPlugin_Hypothesis_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" // Parameters for work of NETGEN // -class NETGENPlugin_Hypothesis: public SMESH_Hypothesis +using namespace std; + +class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis: public SMESH_Hypothesis { public: @@ -87,8 +91,8 @@ public: // Persistence virtual ostream & SaveTo(ostream & save); virtual istream & LoadFrom(istream & load); - friend ostream & operator <<(ostream & save, NETGENPlugin_Hypothesis & hyp); - friend istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp); + friend NETGENPLUGIN_EXPORT ostream & operator <<(ostream & save, NETGENPlugin_Hypothesis & hyp); + friend NETGENPLUGIN_EXPORT istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp); /*! * \brief Does nothing diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx index 46f89ef..0b157fc 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx @@ -26,10 +26,11 @@ // $Header$ //============================================================================= -using namespace std; #include #include +using namespace std; + //============================================================================= /*! * diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx index a9b0acd..5b6d1eb 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx @@ -29,6 +29,8 @@ #ifndef _NETGENPlugin_Hypothesis_2D_HXX_ #define _NETGENPlugin_Hypothesis_2D_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include "NETGENPlugin_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" @@ -36,7 +38,7 @@ // This class is just to give 2D dimension, actually // it inherits all behaviour of the parent -class NETGENPlugin_Hypothesis_2D: public NETGENPlugin_Hypothesis +class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D: public NETGENPlugin_Hypothesis { public: diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx index 36ed667..baabaeb 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx @@ -25,8 +25,6 @@ // Project : SALOME // $Header$ //============================================================================= -using namespace std; - #include "NETGENPlugin_Hypothesis_2D_i.hxx" #include "SMESH_Gen.hxx" #include "SMESH_PythonDump.hxx" @@ -34,6 +32,8 @@ using namespace std; #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * NETGENPlugin_Hypothesis_2D_i::NETGENPlugin_Hypothesis_2D_i diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx index 1df8e19..44b8db2 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx @@ -29,6 +29,8 @@ #ifndef _NETGENPlugin_Hypothesis_2D_i_HXX_ #define _NETGENPlugin_Hypothesis_2D_i_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include #include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) @@ -39,7 +41,7 @@ class SMESH_Gen; // NETGENPlugin parameters hypothesis (2D case) -class NETGENPlugin_Hypothesis_2D_i: +class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D_i: public virtual POA_NETGENPlugin::NETGENPlugin_Hypothesis_2D, public NETGENPlugin_Hypothesis_i { diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx index 313fe31..9836d2c 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx @@ -25,8 +25,6 @@ // Project : SALOME // $Header$ //============================================================================= -using namespace std; - #include "NETGENPlugin_Hypothesis_i.hxx" #include "SMESH_Gen.hxx" #include "SMESH_PythonDump.hxx" @@ -34,6 +32,8 @@ using namespace std; #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * NETGENPlugin_Hypothesis_i::NETGENPlugin_Hypothesis_i diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx index edde231..6651617 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx @@ -29,6 +29,8 @@ #ifndef _NETGENPlugin_Hypothesis_i_HXX_ #define _NETGENPlugin_Hypothesis_i_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include #include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) @@ -39,7 +41,7 @@ class SMESH_Gen; // NETGENPlugin parameters hypothesis -class NETGENPlugin_Hypothesis_i: +class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_i: public virtual POA_NETGENPlugin::NETGENPlugin_Hypothesis, public virtual SMESH_Hypothesis_i { diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 09c51aa..b1be861 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -25,11 +25,14 @@ // Project : SALOME // $Header$ //============================================================================= -using namespace std; #include "NETGENPlugin_Mesher.hxx" #include "NETGENPlugin_Hypothesis_2D.hxx" +#include +#include +#include +#include #include #include #include @@ -42,6 +45,9 @@ using namespace std; #include #include #include +#include +#include +#include // Netgen include files namespace nglib { @@ -56,36 +62,43 @@ namespace netgen { extern MeshingParameters mparam; } +using namespace std; + //============================================================================= /*! * */ //============================================================================= -NETGENPlugin_Mesher::NETGENPlugin_Mesher (SMESHDS_Mesh* meshDS, +NETGENPlugin_Mesher::NETGENPlugin_Mesher (SMESH_Mesh* mesh, const TopoDS_Shape& aShape, const bool isVolume) - : _meshDS (meshDS), + : _mesh (mesh), _shape (aShape), _isVolume(isVolume), _optimize(true) { +#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 - netgen::mparam.maxh = NETGENPlugin_Hypothesis::GetDefaultMaxSize(); + mparams.maxh = NETGENPlugin_Hypothesis::GetDefaultMaxSize(); // minimal number of segments per edge - netgen::mparam.segmentsperedge = NETGENPlugin_Hypothesis::GetDefaultNbSegPerEdge(); + mparams.segmentsperedge = NETGENPlugin_Hypothesis::GetDefaultNbSegPerEdge(); // rate of growth of size between elements - netgen::mparam.grading = NETGENPlugin_Hypothesis::GetDefaultGrowthRate(); + mparams.grading = NETGENPlugin_Hypothesis::GetDefaultGrowthRate(); // safety factor for curvatures (elements per radius) - netgen::mparam.curvaturesafety = NETGENPlugin_Hypothesis::GetDefaultNbSegPerRadius(); + mparams.curvaturesafety = NETGENPlugin_Hypothesis::GetDefaultNbSegPerRadius(); // create elements of second order - netgen::mparam.secondorder = NETGENPlugin_Hypothesis::GetDefaultSecondOrder() ? 1 : 0; + mparams.secondorder = NETGENPlugin_Hypothesis::GetDefaultSecondOrder() ? 1 : 0; // quad-dominated surface meshing if (_isVolume) - netgen::mparam.quad = 0; + mparams.quad = 0; else - netgen::mparam.quad = NETGENPlugin_Hypothesis_2D::GetDefaultQuadAllowed() ? 1 : 0; + mparams.quad = NETGENPlugin_Hypothesis_2D::GetDefaultQuadAllowed() ? 1 : 0; } //============================================================================= @@ -97,21 +110,26 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp) { if (hyp) { +#ifdef WNT + netgen::MeshingParameters& mparams = netgen::GlobalMeshingParameters(); +#else + netgen::MeshingParameters& mparams = netgen::mparam; +#endif // Initialize global NETGEN parameters: // maximal mesh segment size - netgen::mparam.maxh = hyp->GetMaxSize(); + mparams.maxh = hyp->GetMaxSize(); // minimal number of segments per edge - netgen::mparam.segmentsperedge = hyp->GetNbSegPerEdge(); + mparams.segmentsperedge = hyp->GetNbSegPerEdge(); // rate of growth of size between elements - netgen::mparam.grading = hyp->GetGrowthRate(); + mparams.grading = hyp->GetGrowthRate(); // safety factor for curvatures (elements per radius) - netgen::mparam.curvaturesafety = hyp->GetNbSegPerRadius(); + mparams.curvaturesafety = hyp->GetNbSegPerRadius(); // create elements of second order - netgen::mparam.secondorder = hyp->GetSecondOrder() ? 1 : 0; + mparams.secondorder = hyp->GetSecondOrder() ? 1 : 0; // quad-dominated surface meshing // only triangles are allowed for volumic mesh if (!_isVolume) - netgen::mparam.quad = static_cast + mparams.quad = static_cast (hyp)->GetQuadAllowed() ? 1 : 0; _optimize = hyp->GetOptimize(); } @@ -140,6 +158,33 @@ Standard_Boolean IsEqual(const Link& aLink1, const Link& aLink2) aLink1.n1 == aLink2.n2 && aLink1.n2 == aLink2.n1); } +//================================================================================ +/*! + * \brief Initialize netgen::OCCGeometry with OCCT shape + */ +//================================================================================ + +void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo, + const TopoDS_Shape& shape) +{ + occgeo.shape = shape; + occgeo.changed = 1; + occgeo.BuildFMap(); + + BRepTools::Clean (shape); + BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, 0.01, true); + Bnd_Box bb; + BRepBndLib::Add (shape, bb); + double x1,y1,z1,x2,y2,z2; + bb.Get (x1,y1,z1,x2,y2,z2); + MESSAGE("shape bounding box:\n" << + "(" << x1 << " " << y1 << " " << z1 << ") " << + "(" << x2 << " " << y2 << " " << z2 << ")"); + 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); +} + //============================================================================= /*! * Here we are going to use the NETGEN mesher @@ -147,15 +192,21 @@ Standard_Boolean IsEqual(const Link& aLink1, const Link& aLink2) //============================================================================= bool NETGENPlugin_Mesher::Compute() { +#ifdef WNT + netgen::MeshingParameters& mparams = netgen::GlobalMeshingParameters(); +#else + netgen::MeshingParameters& mparams = netgen::mparam; +#endif MESSAGE("Compute with:\n" - " max size = " << netgen::mparam.maxh << "\n" - " segments per edge = " << netgen::mparam.segmentsperedge); + " max size = " << mparams.maxh << "\n" + " segments per edge = " << mparams.segmentsperedge); MESSAGE("\n" - " growth rate = " << netgen::mparam.grading << "\n" - " elements per radius = " << netgen::mparam.curvaturesafety << "\n" - " second order = " << netgen::mparam.secondorder << "\n" - " quad allowed = " << netgen::mparam.quad); + " growth rate = " << mparams.grading << "\n" + " elements per radius = " << mparams.curvaturesafety << "\n" + " second order = " << mparams.secondorder << "\n" + " quad allowed = " << mparams.quad); + SMESH_ComputeErrorPtr error = SMESH_ComputeError::New(); nglib::Ng_Init(); // ------------------------- @@ -163,21 +214,7 @@ bool NETGENPlugin_Mesher::Compute() // ------------------------- netgen::OCCGeometry occgeo; - occgeo.shape = _shape; - occgeo.changed = 1; - occgeo.BuildFMap(); - BRepTools::Clean (_shape); - BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (_shape, 0.01, true); - Bnd_Box bb; - BRepBndLib::Add (_shape, bb); - double x1,y1,z1,x2,y2,z2; - bb.Get (x1,y1,z1,x2,y2,z2); - MESSAGE("shape bounding box:\n" << - "(" << x1 << " " << y1 << " " << z1 << ") " << - "(" << x2 << " " << y2 << " " << z2 << ")"); - 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); + PrepareOCCgeometry( occgeo, _shape ); // ------------------------- // Generate the mesh @@ -190,19 +227,22 @@ bool NETGENPlugin_Mesher::Compute() int endWith = (_optimize ? (_isVolume ? netgen::MESHCONST_OPTVOLUME : netgen::MESHCONST_OPTSURFACE) : netgen::MESHCONST_MESHSURFACE); - char *optstr; + char *optstr = 0; int err = 0; + SMESH_Comment comment; try { err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr); + if (err) comment << "Error in netgen::OCCGenerateMesh()"; if (!err && !_optimize) { // we have got surface mesh only, so generate volume mesh startWith = endWith = netgen::MESHCONST_MESHVOLUME; err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr); + if (err) comment << "Error in netgen::OCCGenerateMesh()"; } - if (!err && netgen::mparam.secondorder > 0) + if (!err && mparams.secondorder > 0) { netgen::OCCRefinementSurfaces ref (occgeo); ref.MakeSecondOrder (*ngMesh); @@ -210,8 +250,8 @@ bool NETGENPlugin_Mesher::Compute() } catch (netgen::NgException exc) { - MESSAGE ("Exception in NETGEN: " << exc.What()); - err = 1; + error->myName = err = COMPERR_ALGO_FAILED; + comment << exc.What(); } int nbNod = ngMesh->GetNP(); @@ -229,8 +269,9 @@ bool NETGENPlugin_Mesher::Compute() // Feed back the SMESHDS with the generated Nodes and Elements // ----------------------------------------------------------- + SMESHDS_Mesh* meshDS = _mesh->GetMeshDS(); bool isOK = ( !err && (_isVolume ? (nbVol > 0) : (nbFac > 0)) ); - if ( isOK ) + if ( true /*isOK*/ ) // get whatever built { // vector of nodes in which node index == netgen ID vector< SMDS_MeshNode* > nodeVec ( nbNod + 1 ); @@ -238,7 +279,7 @@ bool NETGENPlugin_Mesher::Compute() NCollection_Map pindMap; // create and insert nodes into nodeVec int i; - for (i = 1; i <= nbNod && isOK; ++i ) + for (i = 1; i <= nbNod /*&& isOK*/; ++i ) { const netgen::MeshPoint& ngPoint = ngMesh->Point(i); SMDS_MeshNode* node = NULL; @@ -248,7 +289,7 @@ bool NETGENPlugin_Mesher::Compute() { // point on vertex aVert = TopoDS::Vertex(occgeo.vmap(i)); - SMESHDS_SubMesh * submesh = _meshDS->MeshElements(aVert); + SMESHDS_SubMesh * submesh = meshDS->MeshElements(aVert); if (submesh) { SMDS_NodeIteratorPtr it = submesh->GetNodes(); @@ -262,25 +303,26 @@ bool NETGENPlugin_Mesher::Compute() newNodeOnVertex = true; } if (!node) - node = _meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z()); + node = meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z()); if (!node) { MESSAGE("Cannot create a mesh node"); - isOK = false; + if ( !comment.size() ) comment << "Cannot create a mesh node"; + nbSeg = nbFac = nbVol = isOK = 0; break; } nodeVec.at(i) = node; if (newNodeOnVertex) { // point on vertex - _meshDS->SetNodeOnVertex(node, aVert); + meshDS->SetNodeOnVertex(node, aVert); pindMap.Add(i); } } // create mesh segments along geometric edges NCollection_Map linkMap; - for (i = 1; i <= nbSeg && isOK; ++i ) + for (i = 1; i <= nbSeg/* && isOK*/; ++i ) { const netgen::Segment& seg = ngMesh->LineSegment(i); Link link(seg.p1, seg.p2); @@ -314,28 +356,29 @@ bool NETGENPlugin_Mesher::Compute() continue; if (!aEdge.IsNull()) { - _meshDS->SetNodeOnEdge(nodeVec.at(pind), aEdge, param); + meshDS->SetNodeOnEdge(nodeVec.at(pind), aEdge, param); pindMap.Add(pind); } } SMDS_MeshEdge* edge; if (nbp < 3) // second order ? - edge = _meshDS->AddEdge(nodeVec.at(pinds[0]), nodeVec.at(pinds[1])); + edge = meshDS->AddEdge(nodeVec.at(pinds[0]), nodeVec.at(pinds[1])); else - edge = _meshDS->AddEdge(nodeVec.at(pinds[0]), nodeVec.at(pinds[1]), + edge = meshDS->AddEdge(nodeVec.at(pinds[0]), nodeVec.at(pinds[1]), nodeVec.at(pinds[2])); if (!edge) { + if ( !comment.size() ) comment << "Cannot create a mesh edge"; MESSAGE("Cannot create a mesh edge"); - isOK = false; + nbSeg = nbFac = nbVol = isOK = 0; break; } if (!aEdge.IsNull()) - _meshDS->SetMeshElementOnShape(edge, aEdge); + meshDS->SetMeshElementOnShape(edge, aEdge); } // create mesh faces along geometric faces - for (i = 1; i <= nbFac && isOK; ++i ) + for (i = 1; i <= nbFac/* && isOK*/; ++i ) { const netgen::Element2d& elem = ngMesh->SurfaceElement(i); int aGeomFaceInd = elem.GetIndex(); @@ -353,7 +396,7 @@ bool NETGENPlugin_Mesher::Compute() if (!aFace.IsNull()) { const netgen::PointGeomInfo& pgi = elem.GeomInfoPi(j); - _meshDS->SetNodeOnFace(node, aFace, pgi.u, pgi.v); + meshDS->SetNodeOnFace(node, aFace, pgi.u, pgi.v); pindMap.Add(pind); } } @@ -361,16 +404,16 @@ bool NETGENPlugin_Mesher::Compute() switch (elem.GetType()) { case netgen::TRIG: - face = _meshDS->AddFace(nodes[0],nodes[1],nodes[2]); + face = meshDS->AddFace(nodes[0],nodes[1],nodes[2]); break; case netgen::QUAD: - face = _meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[3]); + face = meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[3]); break; case netgen::TRIG6: - face = _meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[5],nodes[3],nodes[4]); + face = meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[5],nodes[3],nodes[4]); break; case netgen::QUAD8: - face = _meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[3], + face = meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[3], nodes[4],nodes[7],nodes[5],nodes[6]); break; default: @@ -379,18 +422,19 @@ bool NETGENPlugin_Mesher::Compute() } if (!face) { + if ( !comment.size() ) comment << "Cannot create a mesh face"; MESSAGE("Cannot create a mesh face"); - isOK = false; + nbSeg = nbFac = nbVol = isOK = 0; break; } if (!aFace.IsNull()) - _meshDS->SetMeshElementOnShape(face, aFace); + meshDS->SetMeshElementOnShape(face, aFace); } // create tetrahedra - for (i = 1; i <= nbVol && isOK; ++i) + for (i = 1; i <= nbVol/* && isOK*/; ++i) { - const netgen::Element& elem = ngMesh->VolumeElement(i); + const netgen::Element& elem = ngMesh->VolumeElement(i); int aSolidInd = elem.GetIndex(); TopoDS_Solid aSolid; if (aSolidInd > 0 && aSolidInd <= occgeo.somap.Extent()) @@ -406,7 +450,7 @@ bool NETGENPlugin_Mesher::Compute() if (!aSolid.IsNull()) { // point in solid - _meshDS->SetNodeInVolume(node, aSolid); + meshDS->SetNodeInVolume(node, aSolid); pindMap.Add(pind); } } @@ -414,11 +458,11 @@ bool NETGENPlugin_Mesher::Compute() switch (elem.GetType()) { case netgen::TET: - vol = _meshDS->AddVolume(nodes[0],nodes[1],nodes[2],nodes[3]); + vol = meshDS->AddVolume(nodes[0],nodes[1],nodes[2],nodes[3]); break; case netgen::TET10: - vol = _meshDS->AddVolume(nodes[0],nodes[1],nodes[2],nodes[3], - nodes[4],nodes[7],nodes[5],nodes[6],nodes[8],nodes[9]); + vol = meshDS->AddVolume(nodes[0],nodes[1],nodes[2],nodes[3], + nodes[4],nodes[7],nodes[5],nodes[6],nodes[8],nodes[9]); break; default: MESSAGE("NETGEN created a volume of unexpected type, ignoring"); @@ -426,17 +470,61 @@ bool NETGENPlugin_Mesher::Compute() } if (!vol) { + if ( !comment.size() ) comment << "Cannot create a mesh volume"; MESSAGE("Cannot create a mesh volume"); - isOK = false; + nbSeg = nbFac = nbVol = isOK = 0; break; } if (!aSolid.IsNull()) - _meshDS->SetMeshElementOnShape(vol, aSolid); + meshDS->SetMeshElementOnShape(vol, aSolid); + } + } + + if ( error->IsOK() && ( !isOK || comment.size() > 0 )) + error->myName = COMPERR_ALGO_FAILED; + if ( !comment.empty() ) + error->myComment = comment; + + // set bad compute error to subshapes of all failed subshapes shapes + if ( !error->IsOK() && err ) + { + for (int i = 1; i <= occgeo.fmap.Extent(); i++) { + int status = occgeo.facemeshstatus[i-1]; + if (status == 1 ) continue; + if ( SMESH_subMesh* sm = _mesh->GetSubMeshContaining( occgeo.fmap( i ))) { + SMESH_ComputeErrorPtr& smError = sm->GetComputeError(); + if ( !smError || smError->IsOK() ) { + if ( status == -1 ) + smError.reset( new SMESH_ComputeError( error->myName, error->myComment )); + else + smError.reset( new SMESH_ComputeError( COMPERR_ALGO_FAILED, "Ignored" )); + } + } } } nglib::Ng_DeleteMesh((nglib::Ng_Mesh*)ngMesh); nglib::Ng_Exit(); - return isOK; + RemoveTmpFiles(); + + return error->IsOK(); +} + +//================================================================================ +/*! + * \brief Remove "test.out" and "problemfaces" files in current directory + */ +//================================================================================ + +void NETGENPlugin_Mesher::RemoveTmpFiles() +{ + TCollection_AsciiString str("test.out"); + OSD_Path path1( str ); + OSD_File file1( path1 ); + file1.Remove(); + str = "problemfaces"; + OSD_Path path2( str ); + OSD_File file2( path2 ); + file2.Remove(); } diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.hxx b/src/NETGENPlugin/NETGENPlugin_Mesher.hxx index 4d09177..7795e6b 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.hxx @@ -29,28 +29,40 @@ #ifndef _NETGENPlugin_Mesher_HXX_ #define _NETGENPlugin_Mesher_HXX_ +#include "NETGENPlugin_Defs.hxx" +#include "StdMeshers_FaceSide.hxx" + +class SMESH_Mesh; class SMESHDS_Mesh; class TopoDS_Shape; class NETGENPlugin_Hypothesis; +namespace netgen { + class OCCGeometry; +} /*! * \brief This class calls the NETGEN mesher of OCC geometry */ -class NETGENPlugin_Mesher +class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher { public: // ---------- PUBLIC METHODS ---------- - NETGENPlugin_Mesher (SMESHDS_Mesh* meshDS, const TopoDS_Shape& aShape, + NETGENPlugin_Mesher (SMESH_Mesh* mesh, const TopoDS_Shape& aShape, const bool isVolume); void SetParameters(const NETGENPlugin_Hypothesis* hyp); bool Compute(); + static void PrepareOCCgeometry(netgen::OCCGeometry& occgeom, + const TopoDS_Shape& shape); + + static void RemoveTmpFiles(); + private: - SMESHDS_Mesh* _meshDS; + SMESH_Mesh* _mesh; const TopoDS_Shape& _shape; bool _isVolume; bool _optimize; diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx index fcf4153..719ec01 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx @@ -25,8 +25,6 @@ // Project : SALOME // $Header$ //============================================================================= -using namespace std; - #include "NETGENPlugin_NETGEN_2D.hxx" #include "NETGENPlugin_Hypothesis_2D.hxx" #include "NETGENPlugin_Mesher.hxx" @@ -39,6 +37,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * @@ -119,53 +119,10 @@ bool NETGENPlugin_NETGEN_2D::CheckHypothesis bool NETGENPlugin_NETGEN_2D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) { - SMESHDS_Mesh* meshDS = aMesh.GetMeshDS(); + //SMESHDS_Mesh* meshDS = aMesh.GetMeshDS(); - NETGENPlugin_Mesher mesher(meshDS, aShape, false); + NETGENPlugin_Mesher mesher(&aMesh, aShape, false); +// NETGENPlugin_Mesher mesher(meshDS, aShape, false); mesher.SetParameters(_hypothesis); return mesher.Compute(); } - -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & NETGENPlugin_NETGEN_2D::SaveTo(ostream & save) -{ - return save; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & NETGENPlugin_NETGEN_2D::LoadFrom(istream & load) -{ - return load; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & operator << (ostream & save, NETGENPlugin_NETGEN_2D & hyp) -{ - return hyp.SaveTo( save ); -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & operator >> (istream & load, NETGENPlugin_NETGEN_2D & hyp) -{ - return hyp.LoadFrom( load ); -} diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx index aafcb2e..11ed70d 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx @@ -29,6 +29,8 @@ #ifndef _NETGENPlugin_NETGEN_2D_HXX_ #define _NETGENPlugin_NETGEN_2D_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include "SMESH_2D_Algo.hxx" #include "SMESH_Mesh.hxx" #include "StdMeshers_MaxElementVolume.hxx" @@ -36,7 +38,7 @@ class NETGENPlugin_Hypothesis_2D; -class NETGENPlugin_NETGEN_2D: public SMESH_2D_Algo +class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D: public SMESH_2D_Algo { public: NETGENPlugin_NETGEN_2D(int hypId, int studyId, SMESH_Gen* gen); @@ -49,11 +51,6 @@ public: virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); - ostream & SaveTo(ostream & save); - istream & LoadFrom(istream & load); - friend ostream & operator << (ostream & save, NETGENPlugin_NETGEN_2D & hyp); - friend istream & operator >> (istream & load, NETGENPlugin_NETGEN_2D & hyp); - protected: const NETGENPlugin_Hypothesis_2D* _hypothesis; }; diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx index 0f392c1..24bbe48 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx @@ -25,8 +25,6 @@ // Project : SALOME // $Header$ //============================================================================= -using namespace std; - #include "NETGENPlugin_NETGEN_2D3D.hxx" #include "NETGENPlugin_Hypothesis.hxx" #include "NETGENPlugin_Mesher.hxx" @@ -39,6 +37,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * @@ -121,53 +121,10 @@ bool NETGENPlugin_NETGEN_2D3D::CheckHypothesis bool NETGENPlugin_NETGEN_2D3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) { - SMESHDS_Mesh* meshDS = aMesh.GetMeshDS(); +// SMESHDS_Mesh* meshDS = aMesh.GetMeshDS(); - NETGENPlugin_Mesher mesher(meshDS, aShape, true); + NETGENPlugin_Mesher mesher(&aMesh, aShape, true); +// NETGENPlugin_Mesher mesher(meshDS, aShape, true); mesher.SetParameters(_hypothesis); return mesher.Compute(); } - -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & NETGENPlugin_NETGEN_2D3D::SaveTo(ostream & save) -{ - return save; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & NETGENPlugin_NETGEN_2D3D::LoadFrom(istream & load) -{ - return load; -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & operator << (ostream & save, NETGENPlugin_NETGEN_2D3D & hyp) -{ - return hyp.SaveTo( save ); -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & operator >> (istream & load, NETGENPlugin_NETGEN_2D3D & hyp) -{ - return hyp.LoadFrom( load ); -} diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx index 169cb15..9d086ad 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx @@ -29,6 +29,8 @@ #ifndef _NETGENPlugin_NETGEN_2D3D_HXX_ #define _NETGENPlugin_NETGEN_2D3D_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include "SMESH_3D_Algo.hxx" #include "SMESH_Mesh.hxx" #include "StdMeshers_MaxElementVolume.hxx" @@ -36,7 +38,7 @@ class NETGENPlugin_Hypothesis; -class NETGENPlugin_NETGEN_2D3D: public SMESH_3D_Algo +class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D: public SMESH_3D_Algo { public: NETGENPlugin_NETGEN_2D3D(int hypId, int studyId, SMESH_Gen* gen); @@ -49,11 +51,6 @@ public: virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); - ostream & SaveTo(ostream & save); - istream & LoadFrom(istream & load); - friend ostream & operator << (ostream & save, NETGENPlugin_NETGEN_2D3D & hyp); - friend istream & operator >> (istream & load, NETGENPlugin_NETGEN_2D3D & hyp); - protected: const NETGENPlugin_Hypothesis* _hypothesis; }; diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx index accbeaf..e0afd74 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx @@ -24,13 +24,14 @@ // Module : NETGENPlugin // $Header$ -using namespace std; #include "NETGENPlugin_NETGEN_2D3D_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * NETGENPlugin_NETGEN_2D3D_i::NETGENPlugin_NETGEN_2D3D_i diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx index dc8f6d8..a6483d3 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx @@ -27,6 +27,8 @@ #ifndef _NETGENPlugin_NETGEN_2D3D_I_HXX_ #define _NETGENPlugin_NETGEN_2D3D_I_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include #include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) @@ -36,7 +38,7 @@ // ====================================================== // NETGEN 3d algorithm // ====================================================== -class NETGENPlugin_NETGEN_2D3D_i: +class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D_i: public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D3D, public virtual SMESH_3D_Algo_i { diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx new file mode 100644 index 0000000..a474e03 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx @@ -0,0 +1,437 @@ +// 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 +// +// File : NETGENPlugin_NETGEN_2D_ONLY.cxx +// Author : Edward AGAPOV (OCC) +// Project : SALOME + + +#include "NETGENPlugin_NETGEN_2D_ONLY.hxx" + +#include "NETGENPlugin_Mesher.hxx" + +#include "SMDS_MeshElement.hxx" +#include "SMDS_MeshNode.hxx" +#include "SMESHDS_Mesh.hxx" +#include "SMESH_Comment.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_Mesh.hxx" +#include "SMESH_MesherHelper.hxx" +#include "StdMeshers_FaceSide.hxx" +#include "StdMeshers_MaxElementArea.hxx" +#include "StdMeshers_LengthFromEdges.hxx" +#include "StdMeshers_QuadranglePreference.hxx" + +#include +#include + +#include "utilities.h" + +#include +#include + +/* + Netgen include files +*/ +namespace nglib { +#include +} +#define OCCGEOMETRY +#include +#include +//#include +namespace netgen { + extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*); + /*extern*/ MeshingParameters mparam; +} + +using namespace std; +using namespace netgen; +using namespace nglib; + +//============================================================================= +/*! + * + */ +//============================================================================= + +NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY(int hypId, int studyId, + SMESH_Gen* gen) + : SMESH_2D_Algo(hypId, studyId, gen) +{ + MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY"); + _name = "NETGEN_2D_ONLY"; + + _shapeType = (1 << TopAbs_FACE);// 1 bit /shape type + + _compatibleHypothesis.push_back("MaxElementArea"); + _compatibleHypothesis.push_back("LengthFromEdges"); + _compatibleHypothesis.push_back("QuadranglePreference"); + + _hypMaxElementArea = 0; + _hypLengthFromEdges = 0; + _hypQuadranglePreference = 0; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +NETGENPlugin_NETGEN_2D_ONLY::~NETGENPlugin_NETGEN_2D_ONLY() +{ + MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::~NETGENPlugin_NETGEN_2D_ONLY"); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +bool NETGENPlugin_NETGEN_2D_ONLY::CheckHypothesis (SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + Hypothesis_Status& aStatus) +{ + _hypMaxElementArea = 0; + _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 + + list::const_iterator ith; + for (ith = hyps.begin(); ith != hyps.end(); ++ith ) + { + const SMESHDS_Hypothesis* hyp = (*ith); + + string hypName = hyp->GetName(); + + if ( hypName == "MaxElementArea") + _hypMaxElementArea = static_cast (hyp); + else if ( hypName == "LengthFromEdges" ) + _hypLengthFromEdges = static_cast (hyp); + else if ( hypName == "QuadranglePreference" ) + _hypQuadranglePreference = static_cast(hyp); + else { + aStatus = HYP_INCOMPATIBLE; + return false; + } + } + + if ( _hypMaxElementArea && _hypLengthFromEdges ) { + aStatus = HYP_CONCURENT; + return false; + } + + if ( _hypMaxElementArea || _hypLengthFromEdges ) + aStatus = HYP_OK; + + return aStatus == HYP_OK; +} + +//================================================================================ +/*! + * \brief Fill netgen mesh with segments + * \retval SMESH_ComputeErrorPtr - error description + */ +//================================================================================ + +static TError AddSegmentsToMesh(netgen::Mesh& ngMesh, + OCCGeometry& geom, + const TSideVector& wires, + SMESH_MesherHelper& helper, + vector< const SMDS_MeshNode* > & nodeVec) +{ + // ---------------------------- + // Check wires and count nodes + // ---------------------------- + int nbNodes = 0; + for ( int iW = 0; iW < wires.size(); ++iW ) + { + StdMeshers_FaceSidePtr wire = wires[ iW ]; + if ( wire->MissVertexNode() ) + return TError + (new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH, "Missing nodes on vertices")); + + const vector& uvPtVec = wire->GetUVPtStruct(); + if ( uvPtVec.size() != wire->NbPoints() ) + return TError + (new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH, + SMESH_Comment("Unexpected nb of points on wire ") << iW + << ": " << uvPtVec.size()<<" != "<NbPoints())); + nbNodes += wire->NbSegments(); + } + nodeVec.reserve( nbNodes ); + + // ----------------- + // Fill netgen mesh + // ----------------- + +// netgen::Box<3> bb = geom.GetBoundingBox(); +// bb.Increase (bb.Diam()/10); +// ngMesh.SetLocalH (bb.PMin(), bb.PMax(), 0.5); // set grading + + const int faceID = 1, solidID = 0; + ngMesh.AddFaceDescriptor (FaceDescriptor(faceID, solidID, solidID, 0)); + + for ( int iW = 0; iW < wires.size(); ++iW ) + { + StdMeshers_FaceSidePtr wire = wires[ iW ]; + const vector& uvPtVec = wire->GetUVPtStruct(); + + int firstPointID = ngMesh.GetNP() + 1; + int edgeID = 1, posID = -2; + for ( int i = 0; i < wire->NbSegments(); ++i ) // loop on segments + { + // Add the first point of a segment + const SMDS_MeshNode * n = uvPtVec[ i ].node; + const int posShapeID = n->GetPosition()->GetShapeId(); + + // skip nodes on degenerated edges + if ( helper.IsDegenShape( posShapeID ) && + helper.IsDegenShape( uvPtVec[ i+1 ].node->GetPosition()->GetShapeId() )) + continue; + + nodeVec.push_back( n ); + + MeshPoint mp( Point<3> (n->X(), n->Y(), n->Z()) ); + ngMesh.AddPoint ( mp, 1, EDGEPOINT ); + + // Add the segment + Segment seg; + + seg.p1 = ngMesh.GetNP(); // ng node id + seg.p2 = seg.p1 + 1; // ng node id + seg.edgenr = ngMesh.GetNSeg() + 1;// segment id + seg.si = faceID; // = geom.fmap.FindIndex (face); + + for ( int iEnd = 0; iEnd < 2; ++iEnd) + { + const UVPtStruct& pnt = uvPtVec[ i + iEnd ]; + + seg.epgeominfo[ iEnd ].dist = pnt.param; // param on curve + seg.epgeominfo[ iEnd ].u = pnt.u; + seg.epgeominfo[ iEnd ].v = pnt.v; + + // find out edge id and node parameter on edge + bool onVertex = ( pnt.node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_VERTEX ); + if ( onVertex || posShapeID != posID ) + { + // get edge id + double normParam = pnt.normParam; + if ( onVertex ) + normParam = 0.5 * ( uvPtVec[ i ].normParam + uvPtVec[ i+1 ].normParam ); + const TopoDS_Edge& edge = wire->Edge( wire->EdgeIndex( normParam )); + edgeID = geom.emap.FindIndex( edge ); + posID = posShapeID; + if ( onVertex ) // param on curve is different on each of two edges + seg.epgeominfo[ iEnd ].dist = helper.GetNodeU( edge, pnt.node ); + } + seg.epgeominfo[ iEnd ].edgenr = edgeID; // = geom.emap.FindIndex(edge); + } + + ngMesh.AddSegment (seg); + +// cout << "Segment: " << seg.edgenr << endl +// << "\tp1: " << seg.p1 << endl +// << "\tp2: " << seg.p2 << endl +// << "\tp0 param: " << seg.epgeominfo[ 0 ].dist << endl +// << "\tp0 uv: " << seg.epgeominfo[ 0 ].u <<", "<< seg.epgeominfo[ 0 ].v << endl +// << "\tp0 edge: " << seg.epgeominfo[ 0 ].edgenr << endl +// << "\tp1 param: " << seg.epgeominfo[ 1 ].dist << endl +// << "\tp1 uv: " << seg.epgeominfo[ 1 ].u <<", "<< seg.epgeominfo[ 1 ].v << endl +// << "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << endl; + } + Segment& seg = ngMesh.LineSegment( ngMesh.GetNSeg() ); + seg.p2 = firstPointID; + } + + ngMesh.CalcSurfacesOfNode(); + + return TError(); +} + +//============================================================================= +/*! + *Here we are going to use the NETGEN mesher + */ +//============================================================================= + +bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape) +{ + MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::Compute()"); + + SMESHDS_Mesh* meshDS = aMesh.GetMeshDS(); + int faceID = meshDS->ShapeToIndex( aShape ); + + SMESH_MesherHelper helper(aMesh); + _quadraticMesh = helper.IsQuadraticSubMesh(aShape); + helper.SetElementsOnShape( true ); + const bool ignoreMediumNodes = _quadraticMesh; + + // ------------------------ + // get all edges of a face + // ------------------------ + const TopoDS_Face F = TopoDS::Face( aShape.Oriented( TopAbs_FORWARD )); + TError problem; + TSideVector wires = StdMeshers_FaceSide::GetFaceWires( F, aMesh, ignoreMediumNodes, problem ); + if ( problem && !problem->IsOK() ) + return error( problem ); + int nbWires = wires.size(); + if ( nbWires == 0 ) + return error( "Problem in StdMeshers_FaceSide::GetFaceWires()"); + if ( wires[0]->NbSegments() < 3 ) // ex: a circle with 2 segments + return error(COMPERR_BAD_INPUT_MESH, + SMESH_Comment("Too few segments: ")<NbSegments()); + + // ------------------------- + // Make input netgen mesh + // ------------------------- + + Ng_Init(); + netgen::Mesh * ngMesh = new netgen::Mesh (); + + netgen::OCCGeometry occgeo; + NETGENPlugin_Mesher::PrepareOCCgeometry( occgeo, F ); + + vector< const SMDS_MeshNode* > nodeVec; + problem = AddSegmentsToMesh( *ngMesh, occgeo, wires, helper, nodeVec ); + if ( problem && !problem->IsOK() ) { + delete ngMesh; Ng_Exit(); + return error( problem ); + } + + // -------------------- + // compute edge length + // -------------------- + + double edgeLength = 0; + if (_hypLengthFromEdges) + { + int nbSegments = 0; + for ( int iW = 0; iW < nbWires; ++iW ) + { + edgeLength += wires[ iW ]->Length(); + nbSegments += wires[ iW ]->NbSegments(); + } + if ( nbSegments ) + edgeLength /= nbSegments; + } + if ( _hypMaxElementArea ) + { + double maxArea = _hypMaxElementArea->GetMaxArea(); + edgeLength = sqrt(2. * maxArea/sqrt(3.0)); + } + if ( edgeLength < DBL_MIN ) + edgeLength = occgeo.GetBoundingBox().Diam(); + + //cout << " edgeLength = " << edgeLength << endl; + + netgen::mparam.maxh = edgeLength; + netgen::mparam.quad = _hypQuadranglePreference ? 1 : 0; + //ngMesh->SetGlobalH ( edgeLength ); + + // ------------------------- + // Generate surface mesh + // ------------------------- + + char *optstr; + int startWith = MESHCONST_MESHSURFACE; + int endWith = MESHCONST_OPTSURFACE; + int err = 1; + + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr); + } + catch (Standard_Failure& ex) { + string comment = ex.DynamicType()->Name(); + if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) { + comment += ": "; + comment += ex.GetMessageString(); + } + error(COMPERR_OCC_EXCEPTION, comment); + } + catch (NgException exc) { + error( SMESH_Comment("NgException: ") << exc.What() ); + } + catch (...) { + error(COMPERR_EXCEPTION,"Exception in netgen::OCCGenerateMesh()"); + } + + // ---------------------------------------------------- + // Fill the SMESHDS with the generated nodes and faces + // ---------------------------------------------------- + + int nbNodes = ngMesh->GetNP(); + int nbFaces = ngMesh->GetNSE(); + + int nbInputNodes = nodeVec.size(); + nodeVec.resize( nbNodes, 0 ); + + // add nodes + for ( int i = nbInputNodes + 1; i <= nbNodes; ++i ) + { + const MeshPoint& ngPoint = ngMesh->Point(i); + SMDS_MeshNode * node = meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z()); + nodeVec[ i-1 ] = node; + } + + // create faces + bool reverse = ( aShape.Orientation() == TopAbs_REVERSED ); + for ( int i = 1; i <= nbFaces ; ++i ) + { + const Element2d& elem = ngMesh->SurfaceElement(i); + vector nodes( elem.GetNP() ); + for (int j=1; j <= elem.GetNP(); ++j) + { + int pind = elem.PNum(j); + const SMDS_MeshNode* node = nodeVec.at(pind-1); + if ( reverse ) + nodes[ nodes.size()-j ] = node; + else + nodes[ j-1 ] = node; + if ( node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_3DSPACE ) + { + const PointGeomInfo& pgi = elem.GeomInfoPi(j); + meshDS->SetNodeOnFace((SMDS_MeshNode*)node, faceID, pgi.u, pgi.v); + } + } + SMDS_MeshFace* face = 0; + if ( elem.GetType() == TRIG ) + face = helper.AddFace(nodes[0],nodes[1],nodes[2]); + else + face = helper.AddFace(nodes[0],nodes[1],nodes[2],nodes[3]); + } + + Ng_DeleteMesh((nglib::Ng_Mesh*)ngMesh); + Ng_Exit(); + + NETGENPlugin_Mesher::RemoveTmpFiles(); + + return !err; +} diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx new file mode 100644 index 0000000..f77a3d9 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx @@ -0,0 +1,84 @@ +// 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 +// +// File : NETGENPlugin_NETGEN_2D_ONLY.hxx +// Project : SALOME +// Author : Edward AGAPOV (OCC) + +#ifndef _NETGENPlugin_NETGEN_2D_ONLY_HXX_ +#define _NETGENPlugin_NETGEN_2D_ONLY_HXX_ + +#include "SMESH_2D_Algo.hxx" +#include "SMESH_Mesh.hxx" + +/*#define OCCGEOMETRY +#include +#include //amv*/ + +class StdMeshers_MaxElementArea; +class StdMeshers_LengthFromEdges; +class StdMeshers_QuadranglePreference; +//class NETGENPlugin_Hypothesis; + +/*namespace netgen { + class OCCGeometry; +}*/ +/*namespace netgen { + class OCCGeometry; + extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*); + extern MeshingParameters mparam; +}*/ + +//using namespace netgen; + +/*! + * \brief Mesher generating 2D elements on a geometrical face taking + * into account pre-existing nodes on face boundaries + * + * Historically, NETGENPlugin_NETGEN_2D is actually 1D-2D, that is why + * the class is named NETGENPlugin_NETGEN_2D_ONLY. Renaming is useless as + * algorithm field "_name" can't be changed + */ +class NETGENPlugin_NETGEN_2D_ONLY: public SMESH_2D_Algo +{ +public: + NETGENPlugin_NETGEN_2D_ONLY(int hypId, int studyId, SMESH_Gen* gen); + virtual ~NETGENPlugin_NETGEN_2D_ONLY(); + + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + Hypothesis_Status& aStatus); + + virtual bool Compute(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape); + + /*static TError AddSegmentsToMesh(netgen::Mesh& ngMesh, + OCCGeometry& geom, + const TSideVector& wires, + SMESH_MesherHelper& helper, + vector< const SMDS_MeshNode* > & nodeVec); //amv*/ + +protected: + const StdMeshers_MaxElementArea* _hypMaxElementArea; + const StdMeshers_LengthFromEdges* _hypLengthFromEdges; + const StdMeshers_QuadranglePreference* _hypQuadranglePreference; + // const NETGENPlugin_Hypothesis* _hypothesis; +}; + +#endif diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx new file mode 100644 index 0000000..d5ae240 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx @@ -0,0 +1,81 @@ +// 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" + +#include "utilities.h" + +//============================================================================= +/*! + * NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i + * + * Constructor + */ +//============================================================================= + +NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + SMESH_Algo_i( thePOA ), + SMESH_2D_Algo_i( thePOA ) +{ + MESSAGE( "NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i" ); + myBaseImpl = new ::NETGENPlugin_NETGEN_2D_ONLY( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} + +//============================================================================= +/*! + * NETGENPlugin_NETGEN_2D_ONLY_i::~NETGENPlugin_NETGEN_2D_ONLY_i + * + * Destructor + */ +//============================================================================= + +NETGENPlugin_NETGEN_2D_ONLY_i::~NETGENPlugin_NETGEN_2D_ONLY_i() +{ + MESSAGE( "NETGENPlugin_NETGEN_2D_ONLY_i::~NETGENPlugin_NETGEN_2D_ONLY_i" ); +} + +//============================================================================= +/*! + * NETGENPlugin_NETGEN_2D_ONLY_i::GetImpl + * + * Get implementation + */ +//============================================================================= + +::NETGENPlugin_NETGEN_2D_ONLY* NETGENPlugin_NETGEN_2D_ONLY_i::GetImpl() +{ + MESSAGE( "NETGENPlugin_NETGEN_2D_ONLY_i::GetImpl" ); + return ( ::NETGENPlugin_NETGEN_2D_ONLY* )myBaseImpl; +} + diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx new file mode 100644 index 0000000..ad4f87d --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx @@ -0,0 +1,56 @@ +// 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_ + +#include +#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) + +#include "SMESH_2D_Algo_i.hxx" +#include "NETGENPlugin_NETGEN_2D_ONLY.hxx" + +// ====================================================== +// NETGEN 2D algorithm +// ====================================================== +class NETGENPlugin_NETGEN_2D_ONLY_i: + public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D_ONLY, + public virtual SMESH_2D_Algo_i +{ +public: + // Constructor + NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + // Destructor + virtual ~NETGENPlugin_NETGEN_2D_ONLY_i(); + + // Get implementation + ::NETGENPlugin_NETGEN_2D_ONLY* GetImpl(); +}; + +#endif diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx index 060af2e..0ba4c91 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx @@ -24,13 +24,14 @@ // Module : NETGENPlugin // $Header$ -using namespace std; #include "NETGENPlugin_NETGEN_2D_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * NETGENPlugin_NETGEN_2D_i::NETGENPlugin_NETGEN_2D_i diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx index af8e9fe..c574225 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx @@ -27,6 +27,8 @@ #ifndef _NETGENPlugin_NETGEN_2D_I_HXX_ #define _NETGENPlugin_NETGEN_2D_I_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include #include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) @@ -36,7 +38,7 @@ // ====================================================== // NETGEN 3d algorithm // ====================================================== -class NETGENPlugin_NETGEN_2D_i: +class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D_i: public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D, public virtual SMESH_2D_Algo_i { diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx index c9031d8..66e3b95 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx @@ -26,16 +26,17 @@ // Copyright : CEA 2003 // $Header$ //============================================================================= -using namespace std; - #include "NETGENPlugin_NETGEN_3D.hxx" -#include "SMESH_Gen.hxx" -#include "SMESH_Mesh.hxx" -#include "SMESH_ControlsDef.hxx" -#include "SMESHDS_Mesh.hxx" +#include "NETGENPlugin_Mesher.hxx" + #include "SMDS_MeshElement.hxx" #include "SMDS_MeshNode.hxx" +#include "SMESHDS_Mesh.hxx" +#include "SMESH_Comment.hxx" +#include "SMESH_ControlsDef.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_Mesh.hxx" #include "SMESH_MesherHelper.hxx" #include @@ -43,6 +44,9 @@ using namespace std; #include #include +#include +#include + #include "utilities.h" #include @@ -160,7 +164,8 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, // get triangles on aShell and make a map of nodes to Netgen node IDs // ------------------------------------------------------------------- - SMESH_MesherHelper* myTool = new SMESH_MesherHelper(aMesh); + SMESH_MesherHelper helper(aMesh); + SMESH_MesherHelper* myTool = &helper; bool _quadraticMesh = myTool->IsQuadraticSubMesh(aShape); typedef map< const SMDS_MeshNode*, int> TNodeToIDMap; @@ -187,12 +192,12 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, { // check element const SMDS_MeshElement* elem = iteratorElem->next(); - if ( !elem || - !( elem->NbNodes()==3 || ( _quadraticMesh && elem->NbNodes()==6) ) ) { - INFOS( "NETGENPlugin_NETGEN_3D::Compute(), bad mesh"); - delete myTool; myTool = 0; - return false; - } + 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 ); @@ -312,12 +317,28 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, Ng_Result status; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif status = Ng_GenerateVolumeMesh(Netgen_mesh, &Netgen_param); } + catch (Standard_Failure& exc) { + error(COMPERR_OCC_EXCEPTION, exc.GetMessageString()); + status = NG_VOLUME_FAILURE; + } catch (...) { - MESSAGE("An exception has been caught during the Volume Mesh Generation ..."); + error("Exception in Ng_GenerateVolumeMesh()"); status = NG_VOLUME_FAILURE; } + if ( GetComputeError()->IsOK() ) { + switch ( status ) { + case NG_SURFACE_INPUT_ERROR:error( status, "NG_SURFACE_INPUT_ERROR"); + case NG_VOLUME_FAILURE: error( status, "NG_VOLUME_FAILURE"); + case NG_STL_INPUT_ERROR: error( status, "NG_STL_INPUT_ERROR"); + case NG_SURFACE_FAILURE: error( status, "NG_SURFACE_FAILURE"); + case NG_FILE_NOT_FOUND: error( status, "NG_FILE_NOT_FOUND"); + }; + } int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh); @@ -331,7 +352,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, // Feed back the SMESHDS with the generated Nodes and Volume Elements // ------------------------------------------------------------------- - bool isOK = ( status == NG_OK && Netgen_NbOfTetra > 0 ); + bool isOK = ( /*status == NG_OK &&*/ Netgen_NbOfTetra > 0 );// get whatever built if ( isOK ) { // vector of nodes in which node index == netgen ID @@ -368,51 +389,185 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, Ng_DeleteMesh(Netgen_mesh); Ng_Exit(); - delete myTool; myTool = 0; + NETGENPlugin_Mesher::RemoveTmpFiles(); - return isOK; + return (status == NG_OK); } -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & NETGENPlugin_NETGEN_3D::SaveTo(ostream & save) +bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, + SMESH_MesherHelper* aHelper) { - return save; -} + MESSAGE("NETGENPlugin_NETGEN_3D::Compute with maxElmentsize = " << _maxElementVolume); + const int invalid_ID = -1; + bool _quadraticMesh = false; + typedef map< const SMDS_MeshNode*, int> TNodeToIDMap; + TNodeToIDMap nodeToNetgenID; + list< const SMDS_MeshElement* > triangles; + SMESHDS_Mesh* MeshDS = aHelper->GetMeshDS(); + + SMESH_MesherHelper::MType MeshType = aHelper->IsQuadraticMesh(); + + if(MeshType == SMESH_MesherHelper::COMP) + return error( COMPERR_BAD_INPUT_MESH, + SMESH_Comment("Mesh with linear and quadratic elements given.")); + else if (MeshType == SMESH_MesherHelper::QUADRATIC) + _quadraticMesh = true; + + 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 )); + } + } -//============================================================================= -/*! - * - */ -//============================================================================= + // --------------------------------- + // Feed the Netgen with surface mesh + // --------------------------------- -istream & NETGENPlugin_NETGEN_3D::LoadFrom(istream & load) -{ - return load; -} + int Netgen_NbOfNodes = 0; + int Netgen_param2ndOrder = 0; + double Netgen_paramFine = 1.; + double Netgen_paramSize = _maxElementVolume; + + double Netgen_point[3]; + int Netgen_triangle[3]; + int Netgen_tetrahedron[4]; -//============================================================================= -/*! - * - */ -//============================================================================= + Ng_Init(); -ostream & operator << (ostream & save, NETGENPlugin_NETGEN_3D & hyp) -{ - return hyp.SaveTo( save ); -} + Ng_Mesh * Netgen_mesh = Ng_NewMesh(); -//============================================================================= -/*! - * - */ -//============================================================================= + // set nodes and remember thier netgen IDs + + TNodeToIDMap::iterator n_id = nodeToNetgenID.begin(); + for ( ; n_id != nodeToNetgenID.end(); ++n_id ) + { + const SMDS_MeshNode* node = n_id->first; -istream & operator >> (istream & load, NETGENPlugin_NETGEN_3D & hyp) -{ - return hyp.LoadFrom( load ); + Netgen_point [ 0 ] = node->X(); + Netgen_point [ 1 ] = node->Y(); + Netgen_point [ 2 ] = node->Z(); + Ng_AddPoint(Netgen_mesh, Netgen_point); + n_id->second = ++Netgen_NbOfNodes; // set netgen ID + + } + + // set triangles + list< const SMDS_MeshElement* >::iterator tria = triangles.begin(); + for ( ; tria != triangles.end(); ++tria) + { + int i = 0; + SMDS_ElemIteratorPtr triangleNodesIt = (*tria)->nodesIterator(); + while ( triangleNodesIt->more() ) { + const SMDS_MeshNode * node = + static_cast(triangleNodesIt->next()); + if(aHelper->IsMedium(node)) + continue; + Netgen_triangle[ i ] = nodeToNetgenID[ node ]; + ++i; + } + + Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle); + } + + // ------------------------- + // Generate the volume mesh + // ------------------------- + + Ng_Meshing_Parameters Netgen_param; + + Netgen_param.secondorder = Netgen_param2ndOrder; + Netgen_param.fineness = Netgen_paramFine; + Netgen_param.maxh = Netgen_paramSize; + + Ng_Result status; + + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + status = Ng_GenerateVolumeMesh(Netgen_mesh, &Netgen_param); + } + catch (Standard_Failure& exc) { + error(COMPERR_OCC_EXCEPTION, exc.GetMessageString()); + status = NG_VOLUME_FAILURE; + } + catch (...) { + error("Bad mesh input!!!"); + status = NG_VOLUME_FAILURE; + } + if ( GetComputeError()->IsOK() ) { + error( status, "Bad mesh input!!!"); + } + + int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh); + + int Netgen_NbOfTetra = Ng_GetNE(Netgen_mesh); + + MESSAGE("End of Volume Mesh Generation. status=" << status << + ", nb new nodes: " << Netgen_NbOfNodesNew - Netgen_NbOfNodes << + ", nb tetra: " << Netgen_NbOfTetra); + + // ------------------------------------------------------------------- + // Feed back the SMESHDS with the generated Nodes and Volume Elements + // ------------------------------------------------------------------- + + bool isOK = ( Netgen_NbOfTetra > 0 );// get whatever built + if ( isOK ) + { + // vector of nodes in which node index == netgen ID + vector< const SMDS_MeshNode* > nodeVec ( Netgen_NbOfNodesNew + 1 ); + // insert old nodes into nodeVec + for ( n_id = nodeToNetgenID.begin(); n_id != nodeToNetgenID.end(); ++n_id ) { + nodeVec.at( n_id->second ) = n_id->first; + } + // create and insert new nodes into nodeVec + int nodeIndex = Netgen_NbOfNodes + 1; + + for ( ; nodeIndex <= Netgen_NbOfNodesNew; ++nodeIndex ) + { + Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point ); + SMDS_MeshNode * node = aHelper->AddNode(Netgen_point[0], + Netgen_point[1], + Netgen_point[2]); + nodeVec.at(nodeIndex) = node; + } + + // create tetrahedrons + for ( int elemIndex = 1; elemIndex <= Netgen_NbOfTetra; ++elemIndex ) + { + 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] )); + } + } + + Ng_DeleteMesh(Netgen_mesh); + Ng_Exit(); + + NETGENPlugin_Mesher::RemoveTmpFiles(); + + return (status == NG_OK); } diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx index e0d39f3..1824689 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx @@ -23,19 +23,20 @@ // Created : lundi 27 Janvier 2003 // Author : Nadir BOUHAMOU (CEA) // Project : SALOME -// Copyright : CEA 2003 // $Header$ //============================================================================= #ifndef _NETGENPlugin_NETGEN_3D_HXX_ #define _NETGENPlugin_NETGEN_3D_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include "SMESH_3D_Algo.hxx" #include "SMESH_Mesh.hxx" #include "StdMeshers_MaxElementVolume.hxx" #include "Utils_SALOME_Exception.hxx" -class NETGENPlugin_NETGEN_3D: public SMESH_3D_Algo +class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_3D: public SMESH_3D_Algo { public: NETGENPlugin_NETGEN_3D(int hypId, int studyId, SMESH_Gen* gen); @@ -48,11 +49,9 @@ public: virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); - ostream & SaveTo(ostream & save); - istream & LoadFrom(istream & load); - friend ostream & operator << (ostream & save, NETGENPlugin_NETGEN_3D & hyp); - friend istream & operator >> (istream & load, NETGENPlugin_NETGEN_3D & hyp); - + virtual bool Compute(SMESH_Mesh& aMesh, + SMESH_MesherHelper* aHelper); + protected: double _maxElementVolume; diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx index 0429bc9..53f1f4c 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx @@ -27,13 +27,14 @@ // Module : SMESH // $Header$ -using namespace std; #include "NETGENPlugin_NETGEN_3D_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx index 08e0101..9fac5f3 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx @@ -30,6 +30,8 @@ #ifndef _NETGENPlugin_NETGEN_3D_I_HXX_ #define _NETGENPlugin_NETGEN_3D_I_HXX_ +#include "NETGENPlugin_Defs.hxx" + #include #include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm) @@ -39,7 +41,7 @@ // ====================================================== // NETGEN 3d algorithm // ====================================================== -class NETGENPlugin_NETGEN_3D_i: +class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_3D_i: public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_3D, public virtual SMESH_3D_Algo_i { diff --git a/src/NETGENPlugin/NETGENPlugin_i.cxx b/src/NETGENPlugin/NETGENPlugin_i.cxx index 720ba0a..2b27c98 100644 --- a/src/NETGENPlugin/NETGENPlugin_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_i.cxx @@ -26,11 +26,11 @@ // Module : SMESH // $Header$ -using namespace std; #include "utilities.h" #include "NETGENPlugin_NETGEN_3D_i.hxx" #include "NETGENPlugin_NETGEN_2D_i.hxx" +#include "NETGENPlugin_NETGEN_2D_ONLY_i.hxx" #include "NETGENPlugin_NETGEN_2D3D_i.hxx" #include "NETGENPlugin_Hypothesis_i.hxx" #include "NETGENPlugin_Hypothesis_2D_i.hxx" @@ -49,6 +49,7 @@ template class NETGENPlugin_Creator_i:public HypothesisCreator_i extern "C" { + NETGENPLUGIN_EXPORT GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName) { MESSAGE("GetHypothesisCreator " << aHypName); @@ -62,6 +63,8 @@ extern "C" aCreator = new NETGENPlugin_Creator_i; else if (strcmp(aHypName, "NETGEN_2D") == 0) aCreator = new NETGENPlugin_Creator_i; + else if (strcmp(aHypName, "NETGEN_2D_ONLY") == 0) + aCreator = new NETGENPlugin_Creator_i; else if (strcmp(aHypName, "NETGEN_2D3D") == 0) aCreator = new NETGENPlugin_Creator_i; // Hypotheses diff --git a/src/NETGENPlugin/NETGENPlugin_icons.po b/src/NETGENPlugin/NETGENPlugin_icons.po new file mode 100644 index 0000000..a3f6297 --- /dev/null +++ b/src/NETGENPlugin/NETGENPlugin_icons.po @@ -0,0 +1,20 @@ +# 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"