From: vsr Date: Tue, 17 Feb 2009 07:37:27 +0000 (+0000) Subject: Merge from BR_V5_DEV 17Feb09 X-Git-Tag: V0~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7fedf888e6b6916b2e756465b49e4a47e03a7937;p=plugins%2Fblsurfplugin.git Merge from BR_V5_DEV 17Feb09 --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..8173fb7 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,55 @@ +# Copyright (C) 2006-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# +# File : AUTHORS +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# +# --- +# +# The format of this file was inspired by the Linux kernel CREDITS file. +# +# Authors and contributors are listed alphabetically. +# +# The fields are: name (N), email (E), web-address (W), CVS account login (C), +# PGP key ID and fingerprint (P), description (D), and snail-mail address (S). +# +# --- + +N: Francis KLOSS, Open CASCADE S.A.S +E: francis.kloss@opencascade.com +D: Initial development + +N: Lioka RAZAFINDRAZAKA, CEA +E: lioka.razafindrazaka@cea.fr +D: Initial development + +N: Patrick LAUG, INRIA +D: Initial development + +N: Aurelien ALLEAUME, DISTENE +D: Initial development + +N: Edward AGAPOV, Open CASCADE S.A.S +E: edward.agapov@opencascade.com +D: Debug, improve meshing algorithms + +N: Vadim SANDLER, Open CASCADE S.A.S +E: vadim.sandler@opencascade.com +D: Porting to automake, porting to SALOME series 5x diff --git a/BLSURFPLUGIN_version.h.in b/BLSURFPLUGIN_version.h.in index ee5d1d4..c90b4f2 100644 --- a/BLSURFPLUGIN_version.h.in +++ b/BLSURFPLUGIN_version.h.in @@ -1,26 +1,26 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// This library is 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. // -// See http://www.salome-platform.org/ +// 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 : BLSURFPLUGIN_version.h +// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +// --- // -// File : BLSURFPLUGIN_version.h -// Author : Vadim SANDLER -// Module : SALOME - #if !defined(__BLSURFPLUGIN_VERSION_H__) #define __BLSURFPLUGIN_VERSION_H__ 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..ca38f41 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,44 @@ +# Copyright (C) 2006-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# +# File : ChangeLog +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# +# --- +# +# Changes are listed by modification time in the descending order, +# i.e. newer changes are listed at the top of the file. +# +# Each record lists the modification date, author and short description of +# the made changes. +# +# --- + +2008-08-26 Vadim SANDLER + + * Porting to automake, porting to SALOME series 5x + +2007-2008 Edward AGAPOV + + * Debug, improve meshing algorithms + +2006 Francis KLOSS, Lioka RAZAFINDRAZAKA, Patrick LAUG, Aurelien ALLEAUME + + * Initial development diff --git a/INSTALL b/INSTALL index b21c1f4..9c9abf9 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,29 @@ -This is the version 4.1.0 of BLSURFPLUGIN -Compatible with : - - KERNEL 4.1.0 - - GUI 4.1.0 - - SMESH 4.1.0 +# Copyright (C) 2006-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# +# File : INSTALL +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# +# --- + +SALOME2 : BLSURFPLUGIN module (SMESH plugin) + +For installation instructions and other information, please refer to +the README file. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..d5c2257 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,54 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +if BLSURFPLUGIN_ENABLE_GUI + ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ + -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ + -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ + -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ + -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ + -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files +else !BLSURFPLUGIN_ENABLE_GUI + ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ + -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ + -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ + -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ + -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files +endif + +SUBDIRS = idl adm_local resources src bin + +DIST_SUBDIRS = idl adm_local resources src bin + +DISTCLEANFILES = a.out aclocal.m4 configure + +salomeinclude_DATA = BLSURFPLUGIN_version.h + +EXTRA_DIST += \ + build_configure \ + clean_configure + +dist-hook: + rm -rf `find $(distdir) -name CVS` diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 5e3abf4..0000000 --- a/Makefile.in +++ /dev/null @@ -1,93 +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/ -# -# -* Makefile *- -# -# Author : Patrick GOLDBRONN (CEA) -# Date : 28/06/2001 -# - -# source path -top_srcdir=@top_srcdir@ -top_builddir=. -srcdir=@srcdir@ -VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:./bin:@top_srcdir@/idl - - -@COMMENCE@ - -SUBDIRS = idl src adm_local - -RESOURCES_FILES = \ - BLSURFPlugin.xml \ - mesh_algo_BLSURF.png \ - mesh_hypo_BLSURF.png \ - mesh_tree_algo_BLSURF.png \ - mesh_tree_hypo_BLSURF.png \ - BLSURF.png - -BIN_SCRIPT = VERSION - -# copy header files in common directory ------------ - -ifeq ($(HAVE_SSTREAM),yes) - include_list=include/salome/SALOMEconfig.h -else - include_list=include/salome/SALOMEconfig.h include/salome/sstream -endif - -inc: idl $(include_list) - -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) ../../$< $@ - -# 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 diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..6a0b1eb --- /dev/null +++ b/NEWS @@ -0,0 +1,29 @@ +# Copyright (C) 2006-2008 OPEN CASCADE, CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# +# File : NEWS +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# +# --- +# +# Changes are listed by modification time in the descending order, +# i.e. newer changes are listed at the top of the file. +# +# --- diff --git a/README b/README new file mode 100644 index 0000000..dd2c657 --- /dev/null +++ b/README @@ -0,0 +1,127 @@ +SALOME platform +BLSURF meshing plugin +------------------------------ + +Contents: + +1. Pre-requisites +2. Installation +3. Launch SALOME with BLSURFPLUGIN +4. BLSURFPLUGIN plugin usage + +----------------- +1. Pre-requisites +----------------- + +The information in this file assumes that: + +* The SALOME platform is installed to the directory +* The blsurf product is installed to the directory /blsurf +* The decimesh binary is vaiable via environment variable PATH + +--------------- +2. Installation +--------------- + +2.1. Unpack BLSURFPLUGIN module sources + +cd +tar zxf BLSURFPLUGIN_SRC.tgz + +2.2. Build BLSURFPLUGIN module + +* set environment + +bash +cd +source env_build.sh +export BLSURFHOME=/blsurf + +Note: you can avoid setting BLSURFHOME environment variable but use +--with-blsurf key of configure script instead. + +* configure build system + +cd BLSURFPLUGIN_SRC +./build_configure + +cd .. +mkdir BLSURFPLUGIN_BUILD +cd BLSURFPLUGIN_BUILD +../BLSURFPLUGIN_SRC/configure --prefix=/BLSURFPLUGIN_INSTALL + +Note: you can use --with-blsurf option to pass the root directory of +blsurf product to the confogure script. In this case you can avoid +setting BLSURFHOME environment variable. Try 'configure --help' +command to learn more about available configure script options. + +Check "Summary" area in the log output of the configure script to +verify that all pre-requisites required for the successful compilation +of BLSURFPLUFIN module have been found. All pre-requisite products +should have status "yes". If any product has status "no", the +compilation procedure will fail. + +* compile and install plugin module + +make +make install + +exit + +If the compilation is finished successfully (make and make install +steps are finished without errors) the BLSURFPLUGIN meshing module +should be installed in the directory /BLSURFPLUGIN_INSTALL. + +---------------------------------- +3. Launch SALOME with BLSURFPLUGIN +---------------------------------- + +* set environment + +bash +cd +source env_products.sh + +export BLSURFPLUGIN_ROOT_DIR=/BLSURFPLUGIN_INSTALL +export SalomeAppConfig=${BLSURFPLUGIN_ROOT_DIR}/share/salome/resources/blsurfplugin +export DISTENE_LICENSE_FILE=/dlim8.key + +Note: DISTENE_LICENSE_FILE environment variable should point to the +blsurf product license file. + +* run SALOME + +runSalome + +---------------------------- +4. BLSURFPLUGIN plugin usage +---------------------------- + +* Create new study + +* Activate Geometry module and create simple geometry object + +* Activate Mesh module + +* Invoke menu "Mesh/Create Mesh" + +* Select previously created geometry object by clicking it with the +mouse in the Object Browser + +* In the "Create mesh" dialog box: +- activate "2D" page +- In the "Algorithm" combo box select "BLSURF" +- Click on the button at the right of the "Hypothesis" combo box and +select "BLSURF parameters" item in the drop-down menu + +* In the "Hypothesis Construction" dialog box set parameters of BLSURF + meshing algorithm and click "OK" button + +* In the "Create mesh" dialog box Click "Apply & Close" button to + define mesh and close the dialog box + +* In the Object Browser select "Mesh_1" object, invoke context popup +menu for it by clicking right mouse button and select "Compute" item + +The resulting mesh created with BLSURF plugin will be shown in the 3D +viewer. diff --git a/README.txt b/README.txt deleted file mode 100644 index 702784f..0000000 --- a/README.txt +++ /dev/null @@ -1,84 +0,0 @@ -1) Hypothèses - ---------- - -a) Une version de SALOME est installée dans le répertoire : - -b) Le produit BLSURF est installé dans le répertoire /BLSurf - -c) Le produit "decimesh" doit être dans la variable d'environnement PATH - -2) tgz - --- - -cd -tar zxf BLSURFPLUGIN_SRC.tgz - -3) Construire le plugin BLSURF - --------------------------- - -bash -cd -source env_build.sh -source BLSURFPLUGIN_SRC_3.2.4/env_blsurf.sh - -cd BLSURFPLUGIN_SRC_3.2.4 -./build_configure - -cd .. -mkdir BLSURFPLUGIN_BUILD -mkdir BLSURFPLUGIN_INSTALL -cd BLSURFPLUGIN_BUILD -../BLSURFPLUGIN_SRC_3.2.4/configure --prefix=/BLSURFPLUGIN_INSTALL - -# Dans les traces chercher la rubrique "Summary", -# et vérifier que toutes les réponses sont à yes. -# S'il y a au moins 1 "no", il faut résoudre cela avant de poursuivre. - -make -make install - -exit - -4) Lancer SALOME avec BLSURF - ------------------------- - -bash -cd - -cp BLSURFPLUGIN_SRC_3.2.4/SalomeApprc.3.2.4 ~/.SalomeApprc. -# Cette copie est à faire une fois - -source env_products.sh -source BLSURFPLUGIN_SRC_3.2.4/env_blsurf.sh - -runSalome - -5) Session interactive - ------------------- - -a) Aller dans le module de géométrie et construire une figure simple - -b) Aller dans le module de maillage - -c) Aller dans le menu de création d'un maillage - -d) Choisir la figure simple comme géométrie à mailler - -e) Aller dans l'onglet 2D - -f) Choisir BLSURF - -g) Cliquer dans le bouton parametre, une boite de dialogue apparait, cette boite n'est pas terminée. - Seul la case à cocher "optimize" est signifiante: - - décochée: uniquement BLSURF - - cochée : BLSURF + decimesh - -h) Cliquer OK - -i) Aller dans le menu de maillage et lancer l'item "Compute" - -j) Résultat: un maillage créer par BLSURF et visualiser dans SALOME - -k) Pour paramétrer BLSURF: il faut pour l'instant créer un fichier blsurf.env dans le répertoire de lancement de SALOME - -l) fin diff --git a/SalomeApprc.3.2.4 b/SalomeApprc.3.2.4 deleted file mode 100644 index d748e5b..0000000 --- a/SalomeApprc.3.2.4 +++ /dev/null @@ -1,115 +0,0 @@ - - -
- - -
-
- -
-
- -
-
- - - - -
-
- - - - - - -
-
- - - - - - - -
-
- - -
-
- -
-
- - - -
-
- - - - -
-
- -
-
- - - -
-
- - - - - -
-
- - -
-
- - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - -
-
- - - - -
-
diff --git a/adm_local/Makefile.am b/adm_local/Makefile.am new file mode 100644 index 0000000..3f9a07d --- /dev/null +++ b/adm_local/Makefile.am @@ -0,0 +1,26 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +SUBDIRS = unix diff --git a/adm_local/Makefile.in b/adm_local/Makefile.in deleted file mode 100644 index b19e7c1..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/ -# -# 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..f70a09e --- /dev/null +++ b/adm_local/unix/Makefile.am @@ -0,0 +1,26 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@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..5091235 --- /dev/null +++ b/adm_local/unix/config_files/Makefile.am @@ -0,0 +1,28 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +dist_admlocalm4_DATA = \ + check_BLSURF.m4 \ + check_BLSURFPLUGIN.m4 diff --git a/adm_local/unix/config_files/check_BLSURF.m4 b/adm_local/unix/config_files/check_BLSURF.m4 new file mode 100644 index 0000000..cfe354a --- /dev/null +++ b/adm_local/unix/config_files/check_BLSURF.m4 @@ -0,0 +1,110 @@ +dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +dnl +dnl File : check_BLSURF.m4 +dnl Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) + +AC_DEFUN([CHECK_BLSURF],[ + +AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_PROG_CXXCPP])dnl + +AC_CHECKING(for BLSURF commercial product) + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +BLSURF_INCLUDES="" +BLSURF_LIBS="" + +AC_ARG_WITH(blsurf, + [ --with-blsurf=DIR root directory path of BLSURF installation]) + +BLSURF_ok=no + +if test "$with_blsurf" != "no" ; then + if test "$with_blsurf" == "yes" || test "$with_blsurf" == "auto"; then + BLSURF_HOME="" + else + BLSURF_HOME="$with_blsurf" + fi + + if test "$BLSURF_HOME" == "" ; then + if test "x$BLSURFHOME" != "x" ; then + BLSURF_HOME=$BLSURFHOME + fi + fi + + if test "x$BLSURF_HOME" != "x"; then + + echo + echo ------------------------------------------------- + echo You are about to choose to use somehow the + echo BLSURF commercial product to generate 2D mesh. + echo + + BLSURF_INCLUDES="-I$BLSURF_HOME/include" + BLSURF_LIBS="-L$BLSURF_HOME/lib -lBLSurf" + + CPPFLAGS_old="$CPPFLAGS" + CXXFLAGS_old="$CXXFLAGS" + CPPFLAGS="$BLSURF_INCLUDES $CPPFLAGS" + CXXFLAGS="$BLSURF_INCLUDES $CXXFLAGS" + + AC_MSG_CHECKING(for BLSURF header file) + + AC_CHECK_HEADER(distene/api.h,BLSURF_ok=yes,BLSURF_ok=no) + + if test "x$BLSURF_ok" == "xyes"; then + + AC_MSG_CHECKING(for BLSURF library) + + LDFLAGS_old="$LDFLAGS" + LDFLAGS="-L. -$BLSURF_LIBS $LDFLAGS" + + AC_TRY_LINK( + #include "distene/api.h", + BLSURF_init();, + BLSURF_ok=yes,BLSURF_ok=no + ) + + LDFLAGS="$LDFLAGS_old" + + AC_MSG_RESULT($BLSURF_ok) + fi + + CPPFLAGS="$CPPFLAGS_old" + CXXFLAGS="$CXXFLAGS_old" + + fi +fi + +if test "x$BLSURF_ok" == xno ; then + AC_MSG_RESULT(for BLSURF: no) + AC_MSG_WARN(BLSURF includes or libraries are not found or are not properly installed) + AC_MSG_WARN(Cannot build without BLSURF. Use --with-blsurf option to define BLSURF installation.) +else + AC_MSG_RESULT(for BLSURF: yes) +fi + +AC_SUBST(BLSURF_INCLUDES) +AC_SUBST(BLSURF_LIBS) + +AC_LANG_RESTORE + +])dnl diff --git a/adm_local/unix/config_files/check_BLSURFPLUGIN.m4 b/adm_local/unix/config_files/check_BLSURFPLUGIN.m4 index dd551be..1756adf 100644 --- a/adm_local/unix/config_files/check_BLSURFPLUGIN.m4 +++ b/adm_local/unix/config_files/check_BLSURFPLUGIN.m4 @@ -1,86 +1,64 @@ -AC_DEFUN([CHECK_BLSURF],[ - -AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_PROG_CXXCPP])dnl - -AC_CHECKING(for BLSURF comercial product) - -AC_LANG_SAVE -AC_LANG_CPLUSPLUS - -AC_ARG_WITH(, - [ --with-BLSURF=DIR root directory path of BLSUF installation], - BLSURF_HOME=$withval,BLSURF_HOME="") - -BLSURF_INCLUDES="" -BLSURF_LIBS="" - -BLSURF_ok=no - -if test "x$BLSURF_HOME" == "x" ; then - -# no --with-BLSURF option used - if test "x$BLSURFHOME" != "x" ; then - - # BLSURFHOME environment variable defined - BLSURF_HOME=$BLSURFHOME - - fi -# -fi - -if test "x$BLSURF_HOME" != "x"; then - - echo - echo ------------------------------------------------- - echo You are about to choose to use somehow the - echo BLSURF commercial product to generate 2D mesh. - echo - - - - BLSURF_INCLUDES="-I$BLSURF_HOME/include" - BLSURF_LIBS="-L$BLSURF_HOME/lib -lBLSurf" - - CPPFLAGS_old="$CPPFLAGS" - CXXFLAGS_old="$CXXFLAGS" - LDFLAGS_old="$LDFLAGS" - - CPPFLAGS="$BLSURF_INCLUDES $CPPFLAGS" - CXXFLAGS="$BLSURF_INCLUDES $CXXFLAGS" - LDFLAGS="-L. -$BLSURF_LIBS $LDFLAGS" - - AC_MSG_CHECKING(for BLSURF header file) - - AC_CHECK_HEADER(distene/api.h,BLSURF_ok=yes,BLSURF_ok=no) - if test "x$BLSURF_ok" == "xyes"; then - - AC_MSG_CHECKING(for BLSURF library) - - AC_TRY_COMPILE(#include "distene/api.h", - BLSURF_init(); - ,BLSURF_ok=yes; - $CXX -shared -o linopt.o -c - ,BLSURF_ok=no) - - fi - - CPPFLAGS="$CPPFLAGS_old" - CXXFLAGS="$CXXFLAGS_old" - LDFLAGS="$LDFLAGS_old" - - if test "x$BLSURF_ok" == xno ; then - AC_MSG_RESULT(no) - AC_MSG_WARN(BLSURF includes or libraries are not found or are not properly installed) - else - AC_MSG_RESULT(yes) - fi - +dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +dnl +dnl File : check_BLSURFPLUGIN.m4 +dnl Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) + +AC_DEFUN([CHECK_BLSURFPLUGIN],[ + +AC_CHECKING(for BLSURF mesh plugin) + +BLSURFplugin_ok=no + +BLSURFPLUGIN_LDFLAGS="" +BLSURFPLUGIN_CXXFLAGS="" + +AC_ARG_WITH(BLSURFplugin, + [ --with-BLSURFplugin=DIR root directory path of BLSURF mesh plugin installation ]) + +if test "$with_BLSURFplugin" != "no" ; then + if test "$with_BLSURFplugin" == "yes" || test "$with_BLSURFplugin" == "auto"; then + if test "x$BLSURFPLUGIN_ROOT_DIR" != "x" ; then + BLSURFPLUGIN_DIR=$BLSURFPLUGIN_ROOT_DIR + fi + else + BLSURFPLUGIN_DIR="$with_BLSURFplugin" + fi + + if test "x$BLSURFPLUGIN_DIR" != "x" ; then + if test -f ${BLSURFPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome/libBLSURFEngine.so ; then + BLSURFplugin_ok=yes + AC_MSG_RESULT(Using BLSURF mesh plugin distribution in ${BLSURFPLUGIN_DIR}) + BLSURFPLUGIN_ROOT_DIR=${BLSURFPLUGIN_DIR} + BLSURFPLUGIN_LDFLAGS=-L${BLSURFPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome + BLSURFPLUGIN_CXXFLAGS=-I${BLSURFPLUGIN_DIR}/include/salome + else + AC_MSG_WARN("Cannot find compiled BLSURF mesh plugin distribution") + fi + else + AC_MSG_WARN("Cannot find compiled BLSURF mesh plugin distribution") + fi fi -AC_SUBST(BLSURF_INCLUDES) -AC_SUBST(BLSURF_LIBS) - -AC_LANG_RESTORE +AC_MSG_RESULT(for BLSURF mesh plugin: $BLSURFplugin_ok) +AC_SUBST(BLSURFPLUGIN_ROOT_DIR) +AC_SUBST(BLSURFPLUGIN_LDFLAGS) +AC_SUBST(BLSURFPLUGIN_CXXFLAGS) + ])dnl diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in deleted file mode 100644 index afa9ef5..0000000 --- a/adm_local/unix/make_commence.in +++ /dev/null @@ -1,284 +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 += -L${KERNEL_ROOT_DIR}/lib@LIB_LOCATION_SUFFIX@/salome -L${SMESH_ROOT_DIR}/lib@LIB_LOCATION_SUFFIX@/salome -L${GEOM_ROOT_DIR}/lib@LIB_LOCATION_SUFFIX@/salome -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -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@@LIB_LOCATION_SUFFIX@/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@@LIB_LOCATION_SUFFIX@/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 - -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 index 5339413..56185e3 100644 --- a/adm_local/unix/make_common_starter.am +++ b/adm_local/unix/make_common_starter.am @@ -1,49 +1,84 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D # +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : make_common_starter.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- # ============================================================ # This file defines the common definitions used in several # Makefile. This file must be included, if needed, by the file # Makefile.am. # ============================================================ -# - # Standard directory for installation -salomeincludedir = $(includedir)/@PACKAGE@ -libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/@PACKAGE@ -bindir = $(prefix)/bin/@PACKAGE@ +# +salomeincludedir = $(includedir)/salome +libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome +bindir = $(prefix)/bin/salome salomescriptdir = $(bindir) +salomepythondir = $(pythondir)/salome +salomepyexecdir = $(pyexecdir)/salome # Directory for installing idl files -salomeidldir = $(prefix)/idl/@PACKAGE@ +salomeidldir = $(prefix)/idl/salome # Directory for installing resource files -salomeresdir = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@ +salomeresdir = $(prefix)/share/salome/resources/@MODULE_NAME@ # Directories for installing admin files -admlocaldir = $(prefix)/adm_local -admlocalunixdir = $(admlocaldir)/unix -admlocalm4dir = $(admlocaldir)/unix/config_files +admlocaldir = $(prefix)/adm_local +admlocalunixdir = $(admlocaldir)/unix +admlocalm4dir = $(admlocaldir)/unix/config_files # Shared modules installation directory -sharedpkgpythondir =$(pkgpythondir)/shared_modules +sharedpkgpythondir = $(salomepythondir)/shared_modules # Documentation directory -docdir = $(datadir)/doc/@PACKAGE@ +docdir = $(datadir)/doc/salome # common rules -# moc-files generation +# meta object implementation files generation (moc) %_moc.cxx: %.h $(MOC) $< -o $@ -# qm-files generation -%.qm: %.po - $(MSG2QM) $< $@ +# translation (*.qm) files generation (lrelease) +%.qm: %.ts + $(LRELEASE) $< -qm $@ + +# resource files generation (qrcc) +qrc_%.cxx: %.qrc + $(QRCC) $< -o $@ -name $(*F) + +# qt forms files generation (uic) +ui_%.h: %.ui + $(UIC) -o $@ $< -EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.po) +# extra distributed files +EXTRA_DIST = $(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cxx=%.qrc) \ + $(UIC_FILES:ui_%.h=%.ui) $(nodist_salomeres_DATA:%.qm=%.ts) +# customize clean operation mostlyclean-local: rm -f @builddir@/*_moc.cxx rm -f @builddir@/*.qm + rm -f @builddir@/ui_*.h + rm -f @builddir@/qrc_*.cxx # tests tests: unittest diff --git a/adm_local/unix/make_omniorb.in b/adm_local/unix/make_omniorb.in deleted file mode 100644 index 217e040..0000000 --- a/adm_local/unix/make_omniorb.in +++ /dev/null @@ -1,61 +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 -# - -# 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..4af7144 --- /dev/null +++ b/bin/Makefile.am @@ -0,0 +1,30 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# non-distributed files +nodist_salomescript_DATA = VERSION + +# distributed files +dist_salomescript_SCRIPTS = diff --git a/bin/VERSION b/bin/VERSION deleted file mode 100755 index c6df2bf..0000000 --- a/bin/VERSION +++ /dev/null @@ -1 +0,0 @@ -THIS IS SALOME - BLSURFPLUGIN VERSION: 4.1.0 diff --git a/bin/VERSION.in b/bin/VERSION.in new file mode 100755 index 0000000..8dc58d9 --- /dev/null +++ b/bin/VERSION.in @@ -0,0 +1 @@ +THIS IS SALOME - BLSURFPLUGIN VERSION: @VERSION@ diff --git a/build_configure b/build_configure index 249463d..0307b0e 100755 --- a/build_configure +++ b/build_configure @@ -1,15 +1,30 @@ #!/bin/bash - +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D # -# Tool for updating list of .in file for the SALOME project -# and regenerating configure script +# 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. # -# Author : Marc Tajchman - CEA -# Date : 10/10/2002 +# 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 : build_configure +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- # - ORIG_DIR=`pwd` CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` +BLSURFPLUGIN_WITH_GUI="yes" ######################################################################## # Test if the KERNEL_ROOT_DIR is set correctly @@ -25,12 +40,27 @@ fi # echo "failed : KERNEL_SRC variable is not correct !" # exit #fi + +for option +do + case $option in + -with-gui | --with-gui) + BLSURFPLUGIN_WITH_GUI="yes" + break;; + -without-gui | --without-gui | -with-gui=no | --with-gui=no) + BLSURFPLUGIN_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 ${BLSURFPLUGIN_WITH_GUI} = yes; then + if test ! -d "${GUI_ROOT_DIR}"; then + echo "failed : GUI_ROOT_DIR variable is not correct !" + exit + fi fi ######################################################################## @@ -57,196 +87,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 ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED \ - -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 BLSURFPLUGIN_WITH_GUI variable +sed -e s/BLSURFPLUGIN_WITH_GUI=[a-z]*/BLSURFPLUGIN_WITH_GUI=${BLSURFPLUGIN_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 ${BLSURFPLUGIN_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/clean_configure b/clean_configure new file mode 100755 index 0000000..8f00366 --- /dev/null +++ b/clean_configure @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : clean_configure +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +rm -rf autom4te.cache aclocal.m4 configure make_config +find . -name "*~" -print -exec rm {} \; +find . -name "*.pyc" -print -exec rm {} \; + +# ... + +find bin -name Makefile.in | xargs rm -f +find doc -name Makefile.in | xargs rm -f +find idl -name Makefile.in | xargs rm -f +find resources -name Makefile.in | xargs rm -f +find salome_adm -name Makefile.in | xargs rm -f +find src -name Makefile.in | xargs rm -f +rm -f Makefile.in diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..57c3fd7 --- /dev/null +++ b/configure.ac @@ -0,0 +1,412 @@ +#!/bin/bash +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : configure.ac +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +AC_INIT([Salome2 Project BLSURFPLUGIN module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeBLSURFPLUGIN]) +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=blsurfplugin +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 + +BLSURFPLUGIN_WITH_GUI=yes + +AM_CONDITIONAL(BLSURFPLUGIN_ENABLE_GUI, [test "${BLSURFPLUGIN_WITH_GUI}" = "yes"]) + +if test "${BLSURFPLUGIN_WITH_GUI}" = "yes"; then + 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 BLSURFPLUGIN 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 BLSURF +echo --------------------------------------------- +echo + +CHECK_BLSURF + +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 SMesh +echo --------------------------------------------- +echo + +CHECK_SMESH + +echo +echo --------------------------------------------- +echo Summary +echo --------------------------------------------- +echo + +#AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"]) + +echo Configure +if test "${BLSURFPLUGIN_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 Med_ok SMesh_ok SalomeGUI_ok BLSURF_ok" +fi +if test "${BLSURFPLUGIN_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 Med_ok SMesh_ok BLSURF_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 \ + ./idl/Makefile \ + ./resources/Makefile \ + ./src/Makefile \ + ./src/BLSURFPlugin/Makefile \ + ./src/GUI/Makefile \ + ./BLSURFPLUGIN_version.h \ + Makefile \ +]) diff --git a/configure.in.base b/configure.in.base deleted file mode 100644 index 2dd3674..0000000 --- a/configure.in.base +++ /dev/null @@ -1,427 +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/DEPRECATED) -AC_CANONICAL_HOST - -PACKAGE=salome -AC_SUBST(PACKAGE) - -VERSION=0.0.1 -AC_SUBST(VERSION) - -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 - -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 BOOST Library -echo --------------------------------------------- -echo - -CHECK_BOOST - -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 BLSURFPLUGIN 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 BLSURF -echo --------------------------------------------- -echo - -CHECK_BLSURF - -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 BLSURF_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${LIB_LOCATION_SUFFIX}/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/env_BLSURFplugin-Src.sh b/env_BLSURFplugin-Src.sh deleted file mode 100644 index 27dcce6..0000000 --- a/env_BLSURFplugin-Src.sh +++ /dev/null @@ -1,3 +0,0 @@ -#------ BLSURFplugin-Src ------ -export BLSURFPLUGIN_SRC_DIR=${INSTALL_ROOT}/BLSURFPLUGIN_SRC -## diff --git a/env_blsurf.sh b/env_blsurf.sh deleted file mode 100644 index 8f41511..0000000 --- a/env_blsurf.sh +++ /dev/null @@ -1,18 +0,0 @@ -#------ Licence Distene ------ -export DISTENE_LICENSE_FILE=${INSTALL_ROOT}/dlim8.key -## -#------ BLSURF ------ -export BLSURFHOME=${INSTALL_ROOT/BLSurf -## -#------ BLSURFplugin-Src ------ -export BLSURFPLUGIN_SRC_DIR=${INSTALL_ROOT}/BLSURFPLUGIN_SRC_3.2.4 -## -#------ BLSURFplugin-Bin ------ -export BLSURFPLUGIN_ROOT_DIR=${INSTALL_ROOT}/BLSURFPLUGIN_INSTALL -if [ -n "${ENV_FOR_LAUNCH}" ] ; then - if [ "${ENV_FOR_LAUNCH}" == "1" ] ; then - exportp LD_LIBRARY_PATH ${BLSURFPLUGIN_ROOT_DIR}/lib/salome:${BLSURFHOME}/lib - exportp PYTHONPATH ${BLSURFPLUGIN_ROOT_DIR}/lib64/salome:${BLSURFPLUGIN_ROOT_DIR}/lib64/python${PYTHON_VERSION}/site-packages/salome - fi -fi -## diff --git a/idl/BLSURFPlugin_Algorithm.idl b/idl/BLSURFPlugin_Algorithm.idl index 062a409..026602a 100644 --- a/idl/BLSURFPlugin_Algorithm.idl +++ b/idl/BLSURFPlugin_Algorithm.idl @@ -1,37 +1,39 @@ -// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_Algorithm.idl +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) +// --- // -// File : BLSURFPlugin_Algorithm.idl -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) - #ifndef _SMESH_BLSURFALGORITHM_IDL_ #define _SMESH_BLSURFALGORITHM_IDL_ #include "SMESH_Hypothesis.idl" +#include "SALOME_Exception.idl" /*! * BLSURFPlugin: interfaces to BLSURF related hypotheses and algorithms */ module BLSURFPlugin { + typedef sequence string_array; + /*! * BLSURFPlugin_BLSURF: interface of BLSURF algorithm */ @@ -44,29 +46,120 @@ module BLSURFPlugin */ interface BLSURFPlugin_Hypothesis : SMESH::SMESH_Hypothesis { - void SetTopology(in long value); + /*! + * Sets topology usage way defining how mesh conformity is assured + * value=0 - mesh conformity is assured by conformity of a shape + * value=1,2 - mesh conformity is assured by pre-processing a CAD model + */ + void SetTopology(in long way); long GetTopology(); - void SetPhysicalMesh(in long value); + /*! + * Sets a way to define size of mesh elements to generate + * 0 - size is defined automatically + * 1 - size is set by SetPhySize() method + */ + void SetPhysicalMesh(in long isCustom); long GetPhysicalMesh(); - void SetPhySize(in double value); + /*! + * Sets size of mesh elements to generate + */ + void SetPhySize(in double size); double GetPhySize(); - void SetGeometricMesh(in long value); + /*! + * Sets lower boundary of mesh element size (PhySize) + */ + void SetPhyMin(in double theMinSize); + double GetPhyMin(); + + /*! + * Sets upper boundary of mesh element size (PhySize) + */ + void SetPhyMax(in double theMaxSize); + double GetPhyMax(); + + /*! + * Sets a way to define maximum angular deflection of mesh from CAD model + * 0 - deflection is defined automatically + * 1 - deflection is set by SetAngleMeshS() and SetAngleMeshC() methods + */ + void SetGeometricMesh(in long isCustom); long GetGeometricMesh(); - void SetAngleMeshS(in double value); + /*! + * Sets angular deflection (in degrees) of a mesh face from CAD surface + */ + void SetAngleMeshS(in double angle); double GetAngleMeshS(); - void SetGradation(in double value); + /*! + * Sets angular deflection (in degrees) of a mesh edge from CAD curve + */ + void SetAngleMeshC(in double angle); + double GetAngleMeshC(); + + /*! + * Sets lower boundary of mesh element size computed to respect angular deflection + */ + void SetGeoMin(in double theMinSize); + double GetGeoMin(); + + /*! + * Sets upper boundary of mesh element size computed to respect angular deflection + */ + void SetGeoMax(in double theMaxSize); + double GetGeoMax(); + + /*! + * Sets maximal allowed ratio between the lengths of two adjacent edges + */ + void SetGradation(in double ratio); double GetGradation(); - void SetQuadAllowed(in boolean value); + /*! + * Sets to create quadrilateral elements or not + */ + void SetQuadAllowed(in boolean allowed); boolean GetQuadAllowed(); - void SetDecimesh(in boolean value); + /*! + * To respect geometrical edges or not + */ + void SetDecimesh(in boolean toIgnoreEdges); boolean GetDecimesh(); + + /*! + * Sets verbosity level in the range 0 to 100. + */ + void SetVerbosity(in short theVal) raises (SALOME::SALOME_Exception); + short GetVerbosity(); + + /*! + * Sets advanced option value + */ + void SetOptionValue(in string optionName, + in string optionValue) raises (SALOME::SALOME_Exception); + string GetOptionValue(in string optionName) raises (SALOME::SALOME_Exception); + /*! + * Unsets advanced option + */ + void UnsetOption(in string optionName); + + /*! + * Return array of strings each of which is option name concatenated + * with option value devided by semicolon - "option_name:option_value". + * Option value is empty if an option is not set. + * Note: the method is mostly for interaction with GUI. + */ + string_array GetOptionValues(); + + /*! + * Set option values each in the form "option_name[:option_value]". + * Note: the method is mostly for interaction with GUI. + */ + void SetOptionValues(in string_array options); }; }; diff --git a/idl/Makefile.am b/idl/Makefile.am new file mode 100644 index 0000000..d12329e --- /dev/null +++ b/idl/Makefile.am @@ -0,0 +1,117 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# This Makefile is responsible of generating the client and server +# implementation of IDL interfaces for both C++ and python usage. +# The building process of the C++ files is in charge of each source +# package and then is not manage here. +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +BASEIDL_FILES = BLSURFPlugin_Algorithm.idl + +# This variable defines the files to be installed +dist_salomeidl_DATA = $(BASEIDL_FILES) + +# GUI idl common library +lib_LTLIBRARIES = libSalomeIDLBLSURFPLUGIN.la + +# Sources built from idl files +nodist_libSalomeIDLBLSURFPLUGIN_la_SOURCES = BLSURFPlugin_AlgorithmSK.cc + +# header files must be exported: other modules have to use this library +nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh) + +libSalomeIDLBLSURFPLUGIN_la_CPPFLAGS = \ + $(KERNEL_CXXFLAGS) \ + $(GEOM_CXXFLAGS) \ + $(SMESH_CXXFLAGS) \ + @CORBA_CXXFLAGS@ \ + @CORBA_INCLUDES@ \ + -I$(top_builddir)/salome_adm/unix \ + -I$(top_builddir)/idl + +libSalomeIDLBLSURFPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0 +libSalomeIDLBLSURFPLUGIN_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 $(DESTDIR)$(salomepythondir) + ls $^ | while read file; do \ + $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \ + done + +# uninstall-local removes too much, but it works in distcheck +uninstall-local: + rm -rf $(DESTDIR)$(salomepythondir)/* + +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 d232a85..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/ -# -# -# 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 = BLSURFPlugin_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${LIB_LOCATION_SUFFIX}/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/resources/BLSURFPlugin.xml b/resources/BLSURFPlugin.xml index f72a611..ab99b32 100644 --- a/resources/BLSURFPlugin.xml +++ b/resources/BLSURFPlugin.xml @@ -1,5 +1,25 @@ + @@ -19,7 +39,7 @@ diff --git a/resources/Makefile.am b/resources/Makefile.am new file mode 100644 index 0000000..42aa3da --- /dev/null +++ b/resources/Makefile.am @@ -0,0 +1,37 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +dist_salomeres_DATA = \ + BLSURFPlugin.xml \ + SalomeApp.xml + +if BLSURFPLUGIN_ENABLE_GUI + dist_salomeres_DATA += \ + BLSURF.png \ + mesh_algo_BLSURF.png \ + mesh_hypo_BLSURF.png \ + mesh_tree_algo_BLSURF.png \ + mesh_tree_hypo_BLSURF.png +endif diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml new file mode 100644 index 0000000..c4acae6 --- /dev/null +++ b/resources/SalomeApp.xml @@ -0,0 +1,29 @@ + + +
+ +
+
+ + +
+
diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 51df496..39e7d49 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -1,32 +1,27 @@ -// BLSURFPlugin : C++ implementation +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- // File : BLSURFPlugin_BLSURF.cxx // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) // & Aurelien ALLEAUME (DISTENE) -// Date : 20/03/2006 -// Project : SALOME -//============================================================================= -using namespace std; - +// --- +// #include "BLSURFPlugin_BLSURF.hxx" #include "BLSURFPlugin_Hypothesis.hxx" @@ -48,6 +43,7 @@ using namespace std; #include #include #include +#include extern "C"{ #include @@ -68,6 +64,10 @@ extern "C"{ #include #include +#ifndef WNT +#include +#endif + //============================================================================= /*! * @@ -132,7 +132,12 @@ bool BLSURFPlugin_BLSURF::CheckHypothesis { _hypothesis = static_cast (theHyp); ASSERT(_hypothesis); - aStatus = SMESH_Hypothesis::HYP_OK; + if ( _hypothesis->GetPhysicalMesh() == BLSURFPlugin_Hypothesis::DefaultSize && + _hypothesis->GetGeometricMesh() == BLSURFPlugin_Hypothesis::DefaultGeom ) + // hphy_flag = 0 and hgeo_flag = 0 is not allowed (spec) + aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER; + else + aStatus = SMESH_Hypothesis::HYP_OK; } else aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; @@ -160,50 +165,75 @@ inline std::string to_string(int i) return o.str(); } -void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls) { +void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls) +{ + int _topology = BLSURFPlugin_Hypothesis::GetDefaultTopology(); + int _physicalMesh = BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh(); + double _phySize = BLSURFPlugin_Hypothesis::GetDefaultPhySize(); + int _geometricMesh = BLSURFPlugin_Hypothesis::GetDefaultGeometricMesh(); + double _angleMeshS = BLSURFPlugin_Hypothesis::GetDefaultAngleMeshS(); + double _angleMeshC = BLSURFPlugin_Hypothesis::GetDefaultAngleMeshC(); + double _gradation = BLSURFPlugin_Hypothesis::GetDefaultGradation(); + bool _quadAllowed = BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed(); + bool _decimesh = BLSURFPlugin_Hypothesis::GetDefaultDecimesh(); + int _verb = BLSURFPlugin_Hypothesis::GetDefaultVerbosity(); + if (hyp) { MESSAGE("BLSURFPlugin_BLSURF::SetParameters"); - _topology = (int) hyp->GetTopology(); - _physicalMesh = (int) hyp->GetPhysicalMesh(); - _phySize = hyp->GetPhySize(); + _topology = (int) hyp->GetTopology(); + _physicalMesh = (int) hyp->GetPhysicalMesh(); + _phySize = hyp->GetPhySize(); _geometricMesh = (int) hyp->GetGeometricMesh(); - _angleMeshS = hyp->GetAngleMeshS(); - _gradation = hyp->GetGradation(); - _quadAllowed = hyp->GetQuadAllowed(); - _decimesh = hyp->GetDecimesh(); + _angleMeshS = hyp->GetAngleMeshS(); + _angleMeshC = hyp->GetAngleMeshC(); + _gradation = hyp->GetGradation(); + _quadAllowed = hyp->GetQuadAllowed(); + _decimesh = hyp->GetDecimesh(); + _verb = hyp->GetVerbosity(); + + if ( hyp->GetPhyMin() != ::BLSURFPlugin_Hypothesis::undefinedDouble() ) + blsurf_set_param(bls, "hphymin", to_string(hyp->GetPhyMin()).c_str()); + if ( hyp->GetPhyMax() != ::BLSURFPlugin_Hypothesis::undefinedDouble() ) + blsurf_set_param(bls, "hphymax", to_string(hyp->GetPhyMax()).c_str()); + if ( hyp->GetGeoMin() != ::BLSURFPlugin_Hypothesis::undefinedDouble() ) + blsurf_set_param(bls, "hgeomin", to_string(hyp->GetGeoMin()).c_str()); + if ( hyp->GetGeoMax() != ::BLSURFPlugin_Hypothesis::undefinedDouble() ) + blsurf_set_param(bls, "hgeomax", to_string(hyp->GetGeoMax()).c_str()); + + const BLSURFPlugin_Hypothesis::TOptionValues & opts = hyp->GetOptionValues(); + BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt; + for ( opIt = opts.begin(); opIt != opts.end(); ++opIt ) + if ( !opIt->second.empty() ) { +#ifdef _DEBUG_ + cout << "blsurf_set_param(): " << opIt->first << " = " << opIt->second << endl; +#endif + blsurf_set_param(bls, opIt->first.c_str(), opIt->second.c_str()); + } + } else { MESSAGE("BLSURFPlugin_BLSURF::SetParameters using defaults"); - _topology = BLSURFPlugin_Hypothesis::GetDefaultTopology(); - _physicalMesh = BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh(); - _phySize = BLSURFPlugin_Hypothesis::GetDefaultPhySize(); - _geometricMesh = BLSURFPlugin_Hypothesis::GetDefaultGeometricMesh(); - _angleMeshS = BLSURFPlugin_Hypothesis::GetDefaultAngleMeshS(); - _gradation = BLSURFPlugin_Hypothesis::GetDefaultGradation(); - _quadAllowed = BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed(); - _decimesh = BLSURFPlugin_Hypothesis::GetDefaultDecimesh(); - } - blsurf_set_param(bls, "topo_points", _topology > 0 ? "1" : "0"); - blsurf_set_param(bls, "topo_curves", _topology > 0 ? "1" : "0"); - blsurf_set_param(bls, "topo_project", _topology > 0 ? "1" : "0"); - blsurf_set_param(bls, "clean_boundary", _topology > 1 ? "1" : "0"); - blsurf_set_param(bls, "close_boundary", _topology > 1 ? "1" : "0"); - blsurf_set_param(bls, "hphy_flag", to_string(_physicalMesh).c_str()); - blsurf_set_param(bls, "hphydef", to_string(_phySize).c_str()); - blsurf_set_param(bls, "hgeo_flag", to_string(_geometricMesh).c_str()); - blsurf_set_param(bls, "angle_meshs", to_string(_angleMeshS).c_str()); - blsurf_set_param(bls, "angle_meshc", to_string(_angleMeshS).c_str()); - blsurf_set_param(bls, "gradation", to_string(_gradation).c_str()); - // blsurf_set_param(bls, "patch_independent", to_string(_decimesh).c_str()); + blsurf_set_param(bls, "topo_points", _topology > 0 ? "1" : "0"); + blsurf_set_param(bls, "topo_curves", _topology > 0 ? "1" : "0"); + blsurf_set_param(bls, "topo_project", _topology > 0 ? "1" : "0"); + blsurf_set_param(bls, "clean_boundary", _topology > 1 ? "1" : "0"); + blsurf_set_param(bls, "close_boundary", _topology > 1 ? "1" : "0"); + blsurf_set_param(bls, "hphy_flag", to_string(_physicalMesh).c_str()); + blsurf_set_param(bls, "hphydef", to_string(_phySize).c_str()); + blsurf_set_param(bls, "hgeo_flag", to_string(_geometricMesh).c_str()); + blsurf_set_param(bls, "angle_meshs", to_string(_angleMeshS).c_str()); + blsurf_set_param(bls, "angle_meshc", to_string(_angleMeshC).c_str()); + blsurf_set_param(bls, "gradation", to_string(_gradation).c_str()); blsurf_set_param(bls, "patch_independent", _decimesh ? "1" : "0"); - blsurf_set_param(bls, "element", _quadAllowed ? "q1.0" : "p1"); - blsurf_set_param(bls, "verb", "10"); + blsurf_set_param(bls, "element", _quadAllowed ? "q1.0" : "p1"); + blsurf_set_param(bls, "verb", to_string(_verb).c_str()); } status_t curv_fun(real t, real *uv, real *dt, real *dtt, void *user_data); status_t surf_fun(real *uv, real *xyz, real*du, real *dv, real *duu, real *duv, real *dvv, void *user_data); +status_t message_callback(message_t *msg, void *user_data); //============================================================================= /*! @@ -223,8 +253,10 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) }; context_t *ctx = context_new(); - cad_t *c = cad_new(ctx); + context_set_message_callback(ctx, message_callback, &_comment); + cad_t *c = cad_new(ctx); + TopTools_IndexedMapOfShape fmap; TopTools_IndexedMapOfShape emap; TopTools_IndexedMapOfShape pmap; @@ -265,6 +297,8 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) cad_edge_t *edg = cad_edge_new(fce, ic, tmin, tmax, curv_fun, curves.back()); cad_edge_set_tag(edg, ic); cad_edge_set_property(edg, EDGE_PROPERTY_SOFT_REQUIRED); + if (e.Orientation() == TopAbs_INTERNAL) + cad_edge_set_property(edg, EDGE_PROPERTY_INTERNAL); int npts = 0; int ip1, ip2, *ip; @@ -297,7 +331,7 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) } } // for edge } //for face - + @@ -310,12 +344,40 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) cout << "Beginning of Surface Mesh generation" << endl; cout << endl; - if (blsurf_compute_mesh(bls) != STATUS_OK){ + // Issue 0019864. On DebianSarge, FE signals do not obey to OSD::SetSignal(false) +#ifndef WNT + feclearexcept( FE_ALL_EXCEPT ); + int oldFEFlags = fedisableexcept( FE_ALL_EXCEPT ); +#endif + + status_t status = STATUS_ERROR; + + try { + OCC_CATCH_SIGNALS; + + status = blsurf_compute_mesh(bls); + + } + catch ( std::exception& exc ) { + _comment += exc.what(); + } + catch (Standard_Failure& ex) { + _comment += ex.DynamicType()->Name(); + if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) { + _comment += ": "; + _comment += ex.GetMessageString(); + } + } + catch (...) { + if ( _comment.empty() ) + _comment = "Exception in blsurf_compute_mesh()"; + } + if ( status != STATUS_OK) { blsurf_session_delete(bls); cad_delete(c); context_delete(ctx); - return false; + return error(_comment); } cout << endl; @@ -329,7 +391,8 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) cad_delete(c); context_delete(ctx); - return false; + return error(_comment); + //return false; } integer nv, ne, nt, nq, vtx[4], tag; @@ -428,6 +491,13 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) context_delete(ctx); + // Issue 0019864. On DebianSarge, FE signals do not obey to OSD::SetSignal(false) +#ifndef WNT + if ( oldFEFlags > 0 ) + feenableexcept( oldFEFlags ); + feclearexcept( FE_ALL_EXCEPT ); +#endif + return true; } @@ -533,3 +603,25 @@ status_t surf_fun(real *uv, real *xyz, real*du, real *dv, return 0; } + +status_t message_callback(message_t *msg, void *user_data) +{ + integer errnumber = 0; + char *desc; + message_get_number(msg, &errnumber); + message_get_description(msg, &desc); + if ( errnumber < 0 ) { + string * error = (string*)user_data; +// if ( !error->empty() ) +// *error += "\n"; + // remove ^A from the tail + int len = strlen( desc ); + while (len > 0 && desc[len-1] != '\n') + len--; + error->append( desc, len ); + } + else { + cout << desc; + } + return STATUS_OK; +} diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx index 7ec8b22..8dd022f 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx @@ -1,31 +1,27 @@ -// BLSURFPlugin : C++ implementation +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_BLSURF.hxx +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) +// & Aurelien ALLEAUME (DISTENE) +// --- // -// File : BLSURFPlugin_BLSURF.hxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) -// & Aurelien ALLEAUME (DISTENE) -// Date : 20/03/2006 -// Project : SALOME -//============================================================================= - #ifndef _BLSURFPlugin_BLSURF_HXX_ #define _BLSURFPlugin_BLSURF_HXX_ @@ -59,16 +55,6 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo { protected: const BLSURFPlugin_Hypothesis* _hypothesis; - - private: - int _topology; - int _physicalMesh; - double _phySize; - int _geometricMesh; - double _angleMeshS; - double _gradation; - bool _quadAllowed; - bool _decimesh; }; #endif diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx index f8d2cfc..24fa3c2 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx @@ -1,29 +1,26 @@ -// BLSURFPlugin : idl implementation +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_BLSURF_i.cxx +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) +// --- // -// File : BLSURFPlugin_BLSURF_i.cxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) -// Module : BLSURFPlugin - -using namespace std; #include "BLSURFPlugin_BLSURF_i.hxx" #include "SMESH_Gen.hxx" diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx index d078468..85bb614 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx @@ -1,28 +1,26 @@ -// BLSURFPlugin : idl implementation +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_BLSURF_i.hxx +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) +// --- // -// File : BLSURFPlugin_BLSURF_2D_i.hxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) -// Module : BLSURFPlugin - #ifndef _BLSURFPlugin_BLSURF_I_HXX_ #define _BLSURFPlugin_BLSURF_I_HXX_ diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index 02f5d0c..ad35365 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -1,39 +1,30 @@ -// BLSURFPlugin : C++ implementation +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_Hypothesis.cxx +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) +// & Aurelien ALLEAUME (DISTENE) +// --- // -// File : BLSURFPlugin_Hypothesis.cxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) -// & Aurelien ALLEAUME (DISTENE) -// Date : 28/03/2006 -// Project : SALOME -//============================================================================= - -using namespace std; #include #include -//============================================================================= -/*! - * - */ //============================================================================= BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis (int hypId, int studyId, SMESH_Gen * gen) @@ -41,20 +32,96 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis (int hypId, int studyId, _topology(GetDefaultTopology()), _physicalMesh(GetDefaultPhysicalMesh()), _phySize(GetDefaultPhySize()), + _phyMax(GetDefaultMaxSize()), + _phyMin(GetDefaultMinSize()), + _hgeoMax(GetDefaultMaxSize()), + _hgeoMin(GetDefaultMinSize()), _geometricMesh(GetDefaultGeometricMesh()), _angleMeshS(GetDefaultAngleMeshS()), + _angleMeshC(GetDefaultAngleMeshC()), _gradation(GetDefaultGradation()), _quadAllowed(GetDefaultQuadAllowed()), - _decimesh(GetDefaultDecimesh()) + _decimesh(GetDefaultDecimesh()), + _verb( GetDefaultVerbosity() ) { _name = "BLSURF_Parameters"; _param_algo_dim = 2; + + // to desable writing boundaries + //_phyMin = _phyMax = _hgeoMin = _hgeoMax = undefinedDouble(); + + + const char* intOptionNames[] = { + "addsurf_ivertex", + "background", + "CheckAdjacentEdges", + "CheckCloseEdges", + "CheckWellDefined", + "coiter", + "communication", + "decim", + "export_flag", + "file_h", + "frontal", + "gridnu", + "gridnv", + "hinterpol_flag", + "hmean_flag", + "intermedfile", + "memory", + "normals", + "optim", + "pardom_flag", + "pinch", + "refs", + "rigid", + "surforient", + "tconf", + "topo_collapse", + "" // mark of end + }; + const char* doubleOptionNames[] = { + "addsurf_angle", + "addsurf_R", + "addsurf_H", + "addsurf_FG", + "addsurf_r", + "addsurf_PA", + "angle_compcurv", + "angle_ridge", + "CoefRectangle", + "eps_collapse", + "eps_ends", + "eps_pardom", + "LSS", + "topo_eps1", + "topo_eps2", + "" // mark of end + }; + const char* charOptionNames[] = { + "export_format", + "export_option", + "import_option", + "prefix", + "" // mark of end + }; + + int i = 0; + while ( intOptionNames[i][0] ) + _option2value[ intOptionNames[i++] ].clear(); + + i = 0; + while ( doubleOptionNames[i][0] ) { + _doubleOptions.insert( doubleOptionNames[i] ); + _option2value[ doubleOptionNames[i++] ].clear(); + } + i = 0; + while ( charOptionNames[i][0] ) { + _charOptions.insert( charOptionNames[i] ); + _option2value[ charOptionNames[i++] ].clear(); + } } -//============================================================================= -/*! - * - */ //============================================================================= void BLSURFPlugin_Hypothesis::SetTopology(Topology theTopology) { @@ -64,10 +131,6 @@ void BLSURFPlugin_Hypothesis::SetTopology(Topology theTopology) } } -//============================================================================= -/*! - * - */ //============================================================================= void BLSURFPlugin_Hypothesis::SetPhysicalMesh(PhysicalMesh thePhysicalMesh) { @@ -83,10 +146,6 @@ void BLSURFPlugin_Hypothesis::SetPhysicalMesh(PhysicalMesh thePhysicalMesh) } } -//============================================================================= -/*! - * - */ //============================================================================= void BLSURFPlugin_Hypothesis::SetPhySize(double theVal) { @@ -97,9 +156,42 @@ void BLSURFPlugin_Hypothesis::SetPhySize(double theVal) } //============================================================================= -/*! - * - */ +void BLSURFPlugin_Hypothesis::SetPhyMin(double theMinSize) +{ + if (theMinSize != _phyMin) { + _phyMin = theMinSize; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +void BLSURFPlugin_Hypothesis::SetPhyMax(double theMaxSize) +{ + if (theMaxSize != _phyMax) { + _phyMax = theMaxSize; + NotifySubMeshesHypothesisModification(); + } +} + + +//============================================================================= +void BLSURFPlugin_Hypothesis::SetGeoMin(double theMinSize) +{ + if (theMinSize != _hgeoMin) { + _hgeoMin = theMinSize; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +void BLSURFPlugin_Hypothesis::SetGeoMax(double theMaxSize) +{ + if (theMaxSize != _hgeoMax) { + _hgeoMax = theMaxSize; + NotifySubMeshesHypothesisModification(); + } +} + //============================================================================= void BLSURFPlugin_Hypothesis::SetGeometricMesh(GeometricMesh theGeometricMesh) { @@ -116,10 +208,6 @@ void BLSURFPlugin_Hypothesis::SetGeometricMesh(GeometricMesh theGeometricMesh) } } -//============================================================================= -/*! - * - */ //============================================================================= void BLSURFPlugin_Hypothesis::SetAngleMeshS(double theVal) { @@ -130,9 +218,14 @@ void BLSURFPlugin_Hypothesis::SetAngleMeshS(double theVal) } //============================================================================= -/*! - * - */ +void BLSURFPlugin_Hypothesis::SetAngleMeshC(double theVal) +{ + if (theVal != _angleMeshC) { + _angleMeshC = theVal; + NotifySubMeshesHypothesisModification(); + } +} + //============================================================================= void BLSURFPlugin_Hypothesis::SetGradation(double theVal) { @@ -142,10 +235,6 @@ void BLSURFPlugin_Hypothesis::SetGradation(double theVal) } } -//============================================================================= -/*! - * - */ //============================================================================= void BLSURFPlugin_Hypothesis::SetQuadAllowed(bool theVal) { @@ -155,10 +244,6 @@ void BLSURFPlugin_Hypothesis::SetQuadAllowed(bool theVal) } } -//============================================================================= -/*! - * - */ //============================================================================= void BLSURFPlugin_Hypothesis::SetDecimesh(bool theVal) { @@ -169,115 +254,270 @@ void BLSURFPlugin_Hypothesis::SetDecimesh(bool theVal) } //============================================================================= -/*! - * - */ +void BLSURFPlugin_Hypothesis::SetVerbosity(int theVal) +{ + if (theVal != _verb) { + _verb = theVal; + NotifySubMeshesHypothesisModification(); + } +} +//============================================================================= +void BLSURFPlugin_Hypothesis::SetOptionValue(const std::string& optionName, + const std::string& optionValue) + throw (std::invalid_argument) +{ + TOptionValues::iterator op_val = _option2value.find( optionName ); + if ( op_val == _option2value.end() ) { + std::string msg = "Unknown BLSURF option: '" + optionName + "'"; + throw std::invalid_argument(msg); + } + if ( op_val->second != optionValue ) { + const char* ptr = optionValue.c_str(); + // strip white spaces + while ( ptr[0] == ' ' ) + ptr++; + int i = strlen( ptr ); + while ( i != 0 && ptr[i-1] == ' ') + i--; + // check value type + bool typeOk = true; + std::string typeName; + if ( i == 0 ) { + // empty string + } + else if ( _charOptions.find( optionName ) != _charOptions.end() ) { + // do not check strings + } + else if ( _doubleOptions.find( optionName ) != _doubleOptions.end() ) { + // check if value is double + char * endPtr; + strtod(ptr, &endPtr); + typeOk = ( ptr != endPtr ); + typeName = "real"; + } + else { + // check if value is int + char * endPtr; + strtol(ptr, &endPtr,10); + typeOk = ( ptr != endPtr ); + typeName = "integer"; + } + if ( !typeOk ) { + std::string msg = "Advanced option '" + optionName + "' = '" + optionValue + + "' but must be " + typeName; + throw std::invalid_argument(msg); + } + op_val->second = optionValue; + NotifySubMeshesHypothesisModification(); + } +} + //============================================================================= -ostream & BLSURFPlugin_Hypothesis::SaveTo(ostream & save) +std::string BLSURFPlugin_Hypothesis::GetOptionValue(const std::string& optionName) + throw (std::invalid_argument) { -// save << _maxSize << " " << _fineness; + TOptionValues::iterator op_val = _option2value.find( optionName ); + if ( op_val == _option2value.end() ) { + std::string msg = "Unknown BLSURF option: <"; + msg += optionName + ">"; + throw std::invalid_argument(msg); + } + return op_val->second; +} -// if (_fineness == UserDefined) -// save << " " << _growthRate << " " << _nbSegPerEdge << " " << _nbSegPerRadius; +//============================================================================= +void BLSURFPlugin_Hypothesis::ClearOption(const std::string& optionName) +{ + TOptionValues::iterator op_val = _option2value.find( optionName ); + if ( op_val != _option2value.end() ) + op_val->second.clear(); +} -// save << " " << (int)_secondOrder << " " << (int)_optimize; +//============================================================================= +std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) +{ + save << " " << (int)_topology + << " " << (int)_physicalMesh + << " " << (int)_geometricMesh + << " " << _phySize + << " " << _angleMeshS + << " " << _gradation + << " " << (int)_quadAllowed + << " " << (int)_decimesh; + save << " " << _phyMin + << " " << _phyMax + << " " << _angleMeshC + << " " << _hgeoMin + << " " << _hgeoMax + << " " << _verb; + + TOptionValues::iterator op_val = _option2value.begin(); + for ( ; op_val != _option2value.end(); ++op_val ) { + if ( !op_val->second.empty() ) + save << " " << op_val->first + << " " << op_val->second << "%#"; // "%#" is a mark of value end + } return save; } //============================================================================= -/*! - * - */ -//============================================================================= -istream & BLSURFPlugin_Hypothesis::LoadFrom(istream & load) -{ -// bool isOK = true; -// int is; -// double val; - -// isOK = (load >> val); -// if (isOK) -// _maxSize = val; -// else -// load.clear(ios::badbit | load.rdstate()); - -// isOK = (load >> is); -// if (isOK) -// SetFineness((Fineness) is); -// else -// load.clear(ios::badbit | load.rdstate()); - -// if (_fineness == UserDefined) -// { -// isOK = (load >> val); -// if (isOK) -// _growthRate = val; -// else -// load.clear(ios::badbit | load.rdstate()); - -// isOK = (load >> val); -// if (isOK) -// _nbSegPerEdge = val; -// else -// load.clear(ios::badbit | load.rdstate()); - -// isOK = (load >> val); -// if (isOK) -// _nbSegPerRadius = val; -// else -// load.clear(ios::badbit | load.rdstate()); -// } - -// isOK = (load >> is); -// if (isOK) -// _secondOrder = (bool) is; -// else -// load.clear(ios::badbit | load.rdstate()); - -// isOK = (load >> is); -// if (isOK) -// _optimize = (bool) is; -// else -// load.clear(ios::badbit | load.rdstate()); +std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) +{ + bool isOK = true; + int i; + double val; + + isOK = (load >> i); + if (isOK) + _topology = (Topology) i; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> i); + if (isOK) + _physicalMesh = (PhysicalMesh) i; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> i); + if (isOK) + _geometricMesh = (GeometricMesh) i; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _phySize = val; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _angleMeshS = val; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _gradation = val; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> i); + if (isOK) + _quadAllowed = (bool) i; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> i); + if (isOK) + _decimesh = (bool) i; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _phyMin = val; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _phyMax = val; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _angleMeshC = val; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _hgeoMin = val; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> val); + if (isOK) + _hgeoMax = val; + else + load.clear(std::ios::badbit | load.rdstate()); + + isOK = (load >> i); + if (isOK) + _verb = i; + else + load.clear(std::ios::badbit | load.rdstate()); + + std::string optName, optValue; + while (isOK) { + isOK = (load >> optName); + if (isOK) + isOK = (load >> optValue); + if (isOK) { + std::string & value = _option2value[ optName ]; + value = optValue; + int len = value.size(); + // continue reading until "%#" encountered + while ( value[len-1] != '#' || value[len-2] != '%' ) + { + isOK = (load >> optValue); + if (isOK) { + value += " "; + value += optValue; + len = value.size(); + } + else { + break; + } + } + value[ len-2 ] = '\0'; //cut off "%#" + } + } + return load; } //============================================================================= -/*! - * - */ -//============================================================================= -ostream & operator <<(ostream & save, BLSURFPlugin_Hypothesis & hyp) +std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp) { return hyp.SaveTo( save ); } //============================================================================= -/*! - * - */ -//============================================================================= -istream & operator >>(istream & load, BLSURFPlugin_Hypothesis & hyp) +std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp) { return hyp.LoadFrom( load ); } - //================================================================================ /*! * \brief Does nothing - * \param theMesh - the built mesh - * \param theShape - the geometry of interest - * \retval bool - always false */ //================================================================================ + bool BLSURFPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape) { return false; } +//============================================================================= +/*! + * \brief Initialize my parameter values by default parameters. + * \retval bool - true if parameter values have been successfully defined + */ +//============================================================================= + +bool BLSURFPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts, + const SMESH_Mesh* theMesh) +{ + return bool( _phySize = dflts._elemLength ); +} + //============================================================================= BLSURFPlugin_Hypothesis::Topology BLSURFPlugin_Hypothesis::GetDefaultTopology() { @@ -296,7 +536,19 @@ double BLSURFPlugin_Hypothesis::GetDefaultPhySize() return 10; } -//============================================================================= +//====================================================================== +double BLSURFPlugin_Hypothesis::GetDefaultMaxSize() +{ + return undefinedDouble(); // 1e+4; +} + +//====================================================================== +double BLSURFPlugin_Hypothesis::GetDefaultMinSize() +{ + return undefinedDouble(); //1e-4; +} + +//====================================================================== BLSURFPlugin_Hypothesis::GeometricMesh BLSURFPlugin_Hypothesis::GetDefaultGeometricMesh() { return DefaultGeom; diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index e0e0f3b..a8fb7d2 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -1,37 +1,35 @@ -// BLSURFPlugin : C++ implementation +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_Hypothesis.hxx +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) +// & Aurelien ALLEAUME (DISTENE) +// --- // -// File : BLSURFPlugin_Hypothesis.hxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) -// & Aurelien ALLEAUME (DISTENE) -// Date : 27/03/2006 -// Project : SALOME -// $Header$ -//============================================================================= - #ifndef _BLSURFPlugin_Hypothesis_HXX_ #define _BLSURFPlugin_Hypothesis_HXX_ #include "SMESH_Hypothesis.hxx" -#include "Utils_SALOME_Exception.hxx" +#include +#include +#include +#include // Parameters for work of BLSURF @@ -65,12 +63,27 @@ public: void SetPhySize(double thePhySize); double GetPhySize() const { return _phySize; } + void SetPhyMin(double theMinSize); + double GetPhyMin() const { return _phyMin; } + + void SetPhyMax(double theMaxSize); + double GetPhyMax() const { return _phyMax; } + void SetGeometricMesh(GeometricMesh theGeometricMesh); GeometricMesh GetGeometricMesh() const { return _geometricMesh; } void SetAngleMeshS(double theAngle); double GetAngleMeshS() const { return _angleMeshS; } + void SetAngleMeshC(double theAngle); + double GetAngleMeshC() const { return _angleMeshC; } + + void SetGeoMin(double theMinSize); + double GetGeoMin() const { return _hgeoMin; } + + void SetGeoMax(double theMaxSize); + double GetGeoMax() const { return _hgeoMax; } + void SetGradation(double theGradation); double GetGradation() const { return _gradation; } @@ -80,20 +93,38 @@ public: void SetDecimesh(bool theVal); bool GetDecimesh() const { return _decimesh; } - static Topology GetDefaultTopology(); - static PhysicalMesh GetDefaultPhysicalMesh(); - static double GetDefaultPhySize(); + void SetVerbosity(int theVal); + int GetVerbosity() const { return _verb; } + + static Topology GetDefaultTopology(); + static PhysicalMesh GetDefaultPhysicalMesh(); + static double GetDefaultPhySize(); + static double GetDefaultMaxSize(); + static double GetDefaultMinSize(); static GeometricMesh GetDefaultGeometricMesh(); - static double GetDefaultAngleMeshS(); - static double GetDefaultGradation(); - static bool GetDefaultQuadAllowed(); - static bool GetDefaultDecimesh(); + static double GetDefaultAngleMeshS(); + static double GetDefaultAngleMeshC() { return GetDefaultAngleMeshS(); } + static double GetDefaultGradation(); + static bool GetDefaultQuadAllowed(); + static bool GetDefaultDecimesh(); + static int GetDefaultVerbosity() { return 10; } + + static double undefinedDouble() { return -1.0; } + + typedef std::map< std::string, std::string > TOptionValues; + typedef std::set< std::string > TOptionNames; + + void SetOptionValue(const std::string& optionName, + const std::string& optionValue) throw (std::invalid_argument); + std::string GetOptionValue(const std::string& optionName) throw (std::invalid_argument); + void ClearOption(const std::string& optionName); + const TOptionValues& GetOptionValues() const { return _option2value; } // Persistence - virtual ostream & SaveTo(ostream & save); - virtual istream & LoadFrom(istream & load); - friend ostream & operator <<(ostream & save, BLSURFPlugin_Hypothesis & hyp); - friend istream & operator >>(istream & load, BLSURFPlugin_Hypothesis & hyp); + virtual std::ostream & SaveTo(std::ostream & save); + virtual std::istream & LoadFrom(std::istream & load); + friend std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp); + friend std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp); /*! * \brief Does nothing @@ -103,15 +134,24 @@ public: */ virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + /*! + * \brief Initialize my parameter values by default parameters. + * \retval bool - true if parameter values have been successfully defined + */ + virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); + private: Topology _topology; PhysicalMesh _physicalMesh; - double _phySize; + double _phySize, _phyMin, _phyMax; GeometricMesh _geometricMesh; - double _angleMeshS; + double _angleMeshS, _angleMeshC, _hgeoMin, _hgeoMax; double _gradation; bool _quadAllowed; bool _decimesh; + int _verb; + TOptionValues _option2value; + TOptionNames _doubleOptions, _charOptions; }; #endif diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index 32984aa..55ca0d8 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -1,31 +1,26 @@ -// BLSURFPlugin : C++ implementation +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_Hypothesis.cxx +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) +// --- // -// File : BLSURFPlugin_Hypothesis_i.cxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) -// Date : 03/04/2006 -// Project : SALOME -//============================================================================= -using namespace std; - #include "BLSURFPlugin_Hypothesis_i.hxx" #include "SMESH_Gen.hxx" #include "SMESH_PythonDump.hxx" @@ -33,6 +28,8 @@ using namespace std; #include "Utils_CorbaException.hxx" #include "utilities.h" +#include + //============================================================================= /*! * BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i @@ -155,6 +152,42 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() return this->GetImpl()->GetPhySize(); } +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize) +{ + ASSERT(myBaseImpl); + if ( GetPhyMin() != theMinSize ) { + this->GetImpl()->SetPhyMin(theMinSize); + SMESH::TPythonDump() << _this() << ".SetPhyMin( " << theMinSize << " )"; + } +} + +//============================================================================= +CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin() +{ + ASSERT(myBaseImpl); + return this->GetImpl()->GetPhyMin(); +} + + +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize) +{ + ASSERT(myBaseImpl); + if ( GetPhyMax() != theMaxSize ) { + this->GetImpl()->SetPhyMax(theMaxSize); + SMESH::TPythonDump() << _this() << ".SetPhyMax( " << theMaxSize << " )"; + } +} + +//============================================================================= +CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax() +{ + ASSERT(myBaseImpl); + return this->GetImpl()->GetPhyMax(); +} + + //============================================================================= /*! * BLSURFPlugin_Hypothesis_i::SetGeometricMesh @@ -214,6 +247,55 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS() return this->GetImpl()->GetAngleMeshS(); } +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double angle) +{ + ASSERT(myBaseImpl); + this->GetImpl()->SetAngleMeshC(angle); + SMESH::TPythonDump() << _this() << ".SetAngleMeshC( " << angle << " )"; +} + +//============================================================================= +CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC() +{ + ASSERT(myBaseImpl); + return this->GetImpl()->GetAngleMeshC(); +} + +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize) +{ + ASSERT(myBaseImpl); + if ( GetGeoMin() != theMinSize ) { + this->GetImpl()->SetGeoMin(theMinSize); + SMESH::TPythonDump() << _this() << ".SetGeoMin( " << theMinSize << " )"; + } +} + +//============================================================================= +CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin() +{ + ASSERT(myBaseImpl); + return this->GetImpl()->GetGeoMin(); +} + +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize) +{ + ASSERT(myBaseImpl); + if ( GetGeoMax() != theMaxSize ) { + this->GetImpl()->SetGeoMax(theMaxSize); + SMESH::TPythonDump() << _this() << ".SetGeoMax( " << theMaxSize << " )"; + } +} + +//============================================================================= +CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax() +{ + ASSERT(myBaseImpl); + return this->GetImpl()->GetGeoMax(); +} + //============================================================================= /*! * BLSURFPlugin_Hypothesis_i::SetGradation @@ -301,6 +383,130 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh() return this->GetImpl()->GetDecimesh(); } +//============================================================================= +void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal) + throw (SALOME::SALOME_Exception) +{ + ASSERT(myBaseImpl); + if ( theVal < 0 || theVal > 100 ) + THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM ); + this->GetImpl()->SetVerbosity(theVal); + SMESH::TPythonDump() << _this() << ".SetVerbosity( " << theVal << " )"; +} + +//============================================================================= + +CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity() +{ + ASSERT(myBaseImpl); + return (CORBA::Short) this->GetImpl()->GetVerbosity(); +} + +//============================================================================= + +void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, + const char* optionValue) + throw (SALOME::SALOME_Exception) +{ + ASSERT(myBaseImpl); + bool valueChanged = false; + try { + valueChanged = ( this->GetImpl()->GetOptionValue(optionName) != optionValue ); + if ( valueChanged ) + this->GetImpl()->SetOptionValue(optionName, optionValue); + } + catch (const std::invalid_argument& ex) { + SALOME::ExceptionStruct ExDescription; + ExDescription.text = ex.what(); + ExDescription.type = SALOME::BAD_PARAM; + ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetOptionValue(name,value)"; + ExDescription.lineNumber = 0; + throw SALOME::SALOME_Exception(ExDescription); + } + catch (SALOME_Exception& ex) { + THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM ); + } + if ( valueChanged ) + SMESH::TPythonDump() << _this() << ".SetOptionValue( '" + << optionName << "', '" << optionValue << "' )"; +} + +//============================================================================= + +char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName) + throw (SALOME::SALOME_Exception) +{ + ASSERT(myBaseImpl); + try { + return CORBA::string_dup( this->GetImpl()->GetOptionValue(optionName).c_str() ); + } + catch (const std::invalid_argument& ex) { + SALOME::ExceptionStruct ExDescription; + ExDescription.text = ex.what(); + ExDescription.type = SALOME::BAD_PARAM; + ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetOptionValue(name)"; + ExDescription.lineNumber = 0; + throw SALOME::SALOME_Exception(ExDescription); + } + catch (SALOME_Exception& ex) { + THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM ); + } + return 0; +} + +//============================================================================= + +void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName) +{ + ASSERT(myBaseImpl); + this->GetImpl()->ClearOption(optionName); + SMESH::TPythonDump() << _this() << ".UnsetOption( '" << optionName << "' )"; +} + +//============================================================================= + +BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues() +{ + ASSERT(myBaseImpl); + BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array(); + + const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetOptionValues(); + result->length( opts.size() ); + + ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin(); + for ( int i = 0 ; opIt != opts.end(); ++opIt, ++i ) { + string name_value = opIt->first; + if ( !opIt->second.empty() ) { + name_value += ":"; + name_value += opIt->second; + } + result[i] = CORBA::string_dup(name_value.c_str()); + } + return result._retn(); +} + +//============================================================================= + +void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options) + throw (SALOME::SALOME_Exception) +{ + ASSERT(myBaseImpl); + for (int i = 0; i < options.length(); ++i) + { + string name_value = options[i].in(); + int colonPos = name_value.find( ':' ); + string name, value; + if ( colonPos == string::npos ) // ':' not found + name = name_value; + else { + name = name_value.substr( 0, colonPos); + if ( colonPos < name_value.size()-1 && name_value[colonPos] != ' ') + value = name_value.substr( colonPos+1 ); + } + SetOptionValue( name.c_str(), value.c_str() ); + } +} + //============================================================================= /*! * BLSURFPlugin_Hypothesis_i::GetImpl diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index 0df0f0d..76b826f 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -1,30 +1,26 @@ -// BLSURFPlugin : C++ implementation +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_Hypothesis.hxx +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) +// --- // -// File : BLSURFPlugin_Hypothesis_i.hxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) -// Date : 03/04/2006 -// Project : SALOME -//============================================================================= - #ifndef _BLSURFPlugin_Hypothesis_i_HXX_ #define _BLSURFPlugin_Hypothesis_i_HXX_ @@ -59,12 +55,27 @@ class BLSURFPlugin_Hypothesis_i: void SetPhySize(CORBA::Double theValue); CORBA::Double GetPhySize(); + void SetPhyMin(CORBA::Double theMinSize); + CORBA::Double GetPhyMin(); + + void SetPhyMax(CORBA::Double theMaxSize); + CORBA::Double GetPhyMax(); + void SetGeometricMesh(CORBA::Long theValue); CORBA::Long GetGeometricMesh(); void SetAngleMeshS(CORBA::Double theValue); CORBA::Double GetAngleMeshS(); + void SetAngleMeshC(CORBA::Double angle); + CORBA::Double GetAngleMeshC(); + + void SetGeoMin(CORBA::Double theMinSize); + CORBA::Double GetGeoMin(); + + void SetGeoMax(CORBA::Double theMaxSize); + CORBA::Double GetGeoMax(); + void SetGradation(CORBA::Double theValue); CORBA::Double GetGradation(); @@ -74,6 +85,19 @@ class BLSURFPlugin_Hypothesis_i: void SetDecimesh(CORBA::Boolean theValue); CORBA::Boolean GetDecimesh(); + void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception); + CORBA::Short GetVerbosity(); + + void SetOptionValue(const char* optionName, + const char* optionValue) throw (SALOME::SALOME_Exception); + char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception); + + void UnsetOption(const char* optionName); + + BLSURFPlugin::string_array* GetOptionValues(); + + void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception); + // Get implementation ::BLSURFPlugin_Hypothesis* GetImpl(); diff --git a/src/BLSURFPlugin/BLSURFPlugin_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_i.cxx index 6ffe80c..6eceece 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_i.cxx @@ -1,31 +1,26 @@ -// SMESH BLSURFPlugin : implementaion of SMESH idl descriptions +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPlugin_i.cxx +// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) +// --- // -// File : BLSURFPlugin_i.cxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) -// Module : SMESH - -using namespace std; #include "utilities.h" #include "BLSURFPlugin_BLSURF_i.hxx" diff --git a/src/BLSURFPlugin/Makefile.am b/src/BLSURFPlugin/Makefile.am new file mode 100644 index 0000000..e78b060 --- /dev/null +++ b/src/BLSURFPlugin/Makefile.am @@ -0,0 +1,61 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# header files +salomeinclude_HEADERS = + +# Libraries targets +lib_LTLIBRARIES = libBLSURFEngine.la + +dist_libBLSURFEngine_la_SOURCES = \ + BLSURFPlugin_BLSURF.hxx \ + BLSURFPlugin_BLSURF.cxx \ + BLSURFPlugin_BLSURF_i.hxx \ + BLSURFPlugin_BLSURF_i.cxx \ + BLSURFPlugin_Hypothesis.hxx \ + BLSURFPlugin_Hypothesis.cxx \ + BLSURFPlugin_Hypothesis_i.hxx \ + BLSURFPlugin_Hypothesis_i.cxx \ + BLSURFPlugin_i.cxx + +libBLSURFEngine_la_CPPFLAGS = \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(GEOM_CXXFLAGS) \ + $(CAS_CPPFLAGS) \ + $(BLSURF_INCLUDES) \ + $(SMESH_CXXFLAGS) \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + -I$(top_builddir)/idl \ + -I$(top_builddir)/salome_adm/unix + +libBLSURFEngine_la_LDFLAGS = \ + ../../idl/libSalomeIDLBLSURFPLUGIN.la \ + $(BLSURF_LIBS) \ + $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \ + $(KERNEL_LDFLAGS) -lSalomeGenericObj diff --git a/src/BLSURFPlugin/Makefile.in b/src/BLSURFPlugin/Makefile.in deleted file mode 100644 index d71f2d0..0000000 --- a/src/BLSURFPlugin/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/ -# -# -* Makefile *- -# -# Author : Edward AGAPOV (OCC) -# Module : BLSURFPLUGIN -# 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 = \ - BLSURFPlugin_BLSURF.cxx \ - BLSURFPlugin_BLSURF_i.cxx \ - BLSURFPlugin_Hypothesis.cxx \ - BLSURFPlugin_Hypothesis_i.cxx \ - BLSURFPlugin_i.cxx - -LIB_SERVER_IDL = BLSURFPlugin_Algorithm.idl - -LIB_CLIENT_IDL = \ - SALOME_Component.idl \ - SALOME_Comm.idl \ - GEOM_Gen.idl \ - MED.idl - -# Libraries targets -LIB = libBLSURFEngine.la - -BLSURF_INCLUDES = @BLSURF_INCLUDES@ -BLSURF_LIBS = "@BLSURF_LIBS@" -CPPFLAGS += $(BLSURF_INCLUDES) -CXXFLAGS += $(BLSURF_INCLUDES) -LDFLAGS += $(BLSURF_LIBS) - -@CONCLUDE@ diff --git a/src/BLSURFPlugin/cad_occ.cxx b/src/BLSURFPlugin/cad_occ.cxx deleted file mode 100644 index 0a3c04c..0000000 --- a/src/BLSURFPlugin/cad_occ.cxx +++ /dev/null @@ -1,588 +0,0 @@ -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// File : BLSURFlugin_Mesher.cxx -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) -// Date : 31/03/2006 -// Project : SALOME -//============================================================================= -// using namespace std; - -// #include "BLSURFPlugin_Mesher.hxx" -// #include "BLSURFPlugin_Hypothesis.hxx" - -// #include -// #include -// #include -// #include - -// #include - -// #include -// #include -// #include -// #include -// #include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TSMO blw->bls_glo.tsmo - -bool BL_SURF::init(const TopoDS_Shape& _shape) { - cout << "BLSURF_init: begin" << endl; - - if (_shape.ShapeType() == TopAbs_COMPOUND) { - cout << "BLSURF_init: the shape is a COMPOUND" << endl; - } else { - cout << "BLSURF_init: the shape is UNKNOWN" << endl; - } - - cout << "BLSURF_init: exploring faces and edges " << endl; - int i=0; - for (TopExp_Explorer expf(_shape, TopAbs_FACE); expf.More(); expf.Next()) { - const TopoDS_Shape& face = expf.Current(); - i++; - int j=0; - for (TopExp_Explorer expe(face, TopAbs_EDGE); expe.More(); expe.Next()) { - // const TopoDS_Shape& edge = expe.Current(); -> warning: unused variable 'edge' - j++; - } - // cout << "BLSURF_init: face " << i << " has " << j << " edges" << endl; - } - cout << "BLSURF_init: total number of faces = " << i << endl; - - TopoDS_Shape the_shape; - the_shape = _shape; - - // return(true); - return(run(the_shape)); -} - -// #define TC2D blw.bls_glo.TC2dNew - -void BL_SURF::get_blw(blw_*& blw_param) { - blw_param = &blw; -} - -bool BL_SURF::end() { - bls_free(&blw); - if (blw.error[0]) { - return(false); - } else { - return(true); - } -} - -double norm(vector v) -{ - double res=0.; - for (int i=0;i operator-(vector v1, vector v2) -{ - assert(v1.size()==v2.size()); - vector res(v1.size(),0.); - for (int i=0;ibuild()) { - surfaces.push_back(bl_surface); - } else { - cout<<"Weird surface detected !"<Value(t); - C[0]=P.X(); C[1]=P.Y(); -} - -void BL_EDGE::method_curv1(const double &t, double *C) -{ - gp_Vec2d V1; - - V1=parametric_geometry->DN(t,1); - C[0]=V1.X(); C[1]=V1.Y(); -} - -void BL_EDGE::method_curv2(const double &t, double *C) -{ - gp_Vec2d V2; - - V2=parametric_geometry->DN(t,2); - C[0]=V2.X(); C[1]=V2.Y(); -} - -void BL_SURFACE::method_surf0(const double *UV, double *S) -{ - gp_Pnt P; - - P=geometry->Value(UV[0],UV[1]); // S.D0(U,V,P); - S[0]=P.X(); S[1]=P.Y(); S[2]=P.Z(); -} - -void BL_SURFACE::method_surf1(const double *UV, double *Su, double *Sv) -{ - gp_Pnt P; - gp_Vec D1U,D1V; - - geometry->D1(UV[0],UV[1],P,D1U,D1V); - Su[0]=D1U.X(); Su[1]=D1U.Y(); Su[2]=D1U.Z(); - Sv[0]=D1V.X(); Sv[1]=D1V.Y(); Sv[2]=D1V.Z(); -} - -void BL_SURFACE::method_surf2(const double *UV, double *Suu, double *Suv, double *Svv) -{ - gp_Pnt P; - gp_Vec D1U,D1V; - gp_Vec D2U,D2V,D2UV; - - geometry->D2(UV[0],UV[1],P,D1U,D1V,D2U,D2V,D2UV); - Suu[0]=D2U.X(); Suu[1]=D2U.Y(); Suu[2]=D2U.Z(); - Suv[0]=D2UV.X(); Suv[1]=D2UV.Y(); Suv[2]=D2UV.Z(); - Svv[0]=D2V.X(); Svv[1]=D2V.Y(); Svv[2]=D2V.Z(); -} - -static vector *current_list_of_faces=NULL; -BL_SURF* BL_SURF::active_blsurf=NULL; - -void cad_surf0 (blw_ *blw, int *refs, double *uv, double *S) -{ - BL_SURFACE *surf=(*current_list_of_faces)[*refs-1]; - surf->method_surf0(uv,S); -} - -void cad_surf1 (blw_ *blw, int *refs, double *uv, double *Su, double *Sv) -{ - BL_SURFACE *surf=(*current_list_of_faces)[*refs-1]; - surf->method_surf1(uv,Su,Sv); -} - -// calcul discret -// double du, dv, uvg[2], uvd[2], uvb[2], uvh[2], Sg[3], Sd[3], Sb[3], Sh[3]; -// double Sucont[3], Svcont[3]; -// if (*refs == 33) { -// Sucont[0] = Su[0]; Sucont[1] = Su[1]; Sucont[2] = Su[2]; -// Svcont[0] = Sv[0]; Svcont[1] = Sv[1]; Svcont[2] = Sv[2]; -// BL_SURFACE *surf=(*current_list_of_faces)[*refs-1]; -// du = (TSMO[*refs].uvmax[0] - TSMO[*refs].uvmin[0]) * 0.08; -// dv = (TSMO[*refs].uvmax[1] - TSMO[*refs].uvmin[1]) * 0.08; -// uvg[0] = uv[0]-du; -// uvg[1] = uv[1]; -// uvd[0] = uv[0]+du; -// uvd[1] = uv[1]; -// uvb[0] = uv[0]; -// uvb[1] = uv[1]-dv; -// uvh[0] = uv[0]; -// uvh[1] = uv[1]+dv; -// if (uvg[0] < TSMO[*refs].uvmin[0]) uvg[0] = TSMO[*refs].uvmin[0]; -// if (uvd[0] > TSMO[*refs].uvmax[0]) uvd[0] = TSMO[*refs].uvmax[0]; -// if (uvb[1] < TSMO[*refs].uvmin[1]) uvb[1] = TSMO[*refs].uvmin[1]; -// if (uvh[1] > TSMO[*refs].uvmax[1]) uvh[1] = TSMO[*refs].uvmax[1]; -// surf->method_surf0(uvg,Sg); -// surf->method_surf0(uvd,Sd); -// surf->method_surf0(uvb,Sb); -// surf->method_surf0(uvh,Sh); -// du = uvd[0] - uvg[0]; -// dv = uvh[1] - uvb[1]; -// Su[0] = (Sd[0] - Sg[0]) / du; -// Su[1] = (Sd[1] - Sg[1]) / du; -// Su[2] = (Sd[2] - Sg[2]) / du; -// Sv[0] = (Sh[0] - Sb[0]) / dv; -// Sv[1] = (Sh[1] - Sb[1]) / dv; -// Sv[2] = (Sh[2] - Sb[2]) / dv; -// fprintf(blw->out, "Su cont %g %g %g\n", Sucont[0], Sucont[1], Sucont[2]); -// fprintf(blw->out, "Su disc %g %g %g\n", Su[0], Su[1], Su[2]); -// fprintf(blw->out, "Sv cont %g %g %g\n", Svcont[0], Svcont[1], Svcont[2]); -// fprintf(blw->out, "Sv disc %g %g %g\n", Sv[0], Sv[1], Sv[2]); -// } - -void cad_surf2 (blw_ *blw, int *refs, double uv[2], double Suu[3], double Suv[3], double Svv[3]) -{ - BL_SURFACE *surf=(*current_list_of_faces)[*refs-1]; - surf->method_surf2(uv,Suu,Suv,Svv); - -// // calcul discret -// double du, dv, uvg[2], uvd[2], uvb[2], uvh[2], Sug[3], Sud[3], Sub[3], Suh[3], Svg[3], Svd[3], Svb[3], Svh[3]; -// double Suucont[3], Suvcont[3], Svvcont[3]; -// if (*refs >= 0) { -// Suucont[0] = Suu[0]; Suucont[1] = Suu[1]; Suucont[2] = Suu[2]; -// Suvcont[0] = Suv[0]; Suvcont[1] = Suv[1]; Suvcont[2] = Suv[2]; -// Svvcont[0] = Svv[0]; Svvcont[1] = Svv[1]; Svvcont[2] = Svv[2]; -// du = (TSMO[*refs].uvmax[0] - TSMO[*refs].uvmin[0]) * 0.08; -// dv = (TSMO[*refs].uvmax[1] - TSMO[*refs].uvmin[1]) * 0.08; -// uvg[0] = uv[0]-du; -// uvg[1] = uv[1]; -// uvd[0] = uv[0]+du; -// uvd[1] = uv[1]; -// uvb[0] = uv[0]; -// uvb[1] = uv[1]-dv; -// uvh[0] = uv[0]; -// uvh[1] = uv[1]+dv; -// if (uvg[0] < TSMO[*refs].uvmin[0]) uvg[0] = TSMO[*refs].uvmin[0]; -// if (uvd[0] > TSMO[*refs].uvmax[0]) uvd[0] = TSMO[*refs].uvmax[0]; -// if (uvb[1] < TSMO[*refs].uvmin[1]) uvb[1] = TSMO[*refs].uvmin[1]; -// if (uvh[1] > TSMO[*refs].uvmax[1]) uvh[1] = TSMO[*refs].uvmax[1]; -// surf->method_surf1(uvg,Sug,Svg); -// surf->method_surf1(uvd,Sud,Svd); -// surf->method_surf1(uvb,Sub,Svb); -// surf->method_surf1(uvh,Suh,Svh); -// du = uvd[0] - uvg[0]; -// dv = uvh[1] - uvb[1]; -// Suu[0] = (Sud[0] - Sug[0]) / du; -// Suu[1] = (Sud[1] - Sug[1]) / du; -// Suu[2] = (Sud[2] - Sug[2]) / du; -// Svv[0] = (Svh[0] - Svb[0]) / dv; -// Svv[1] = (Svh[1] - Svb[1]) / dv; -// Svv[2] = (Svh[2] - Svb[2]) / dv; -// Suv[0] = ((Suh[0] - Sub[0]) / dv + (Svd[0] - Svg[0]) / du) * 0.5; -// Suv[1] = ((Suh[1] - Sub[1]) / dv + (Svd[1] - Svg[1]) / du) * 0.5; -// Suv[2] = ((Suh[2] - Sub[2]) / dv + (Svd[2] - Svg[2]) / du) * 0.5; -// // fprintf(blw->out, "disc uv %g %g Suu %g %g %g\n", uv[0], uv[1], Suu[0], Suu[1], Suu[2]); -// // fprintf(blw->out, "Suv disc %g %g %g\n", Suv[0], Suv[1], Suv[2]); -// // fprintf(blw->out, "Svv disc %g %g %g\n", Svv[0], Svv[1], Svv[2]); -// } -} - -void cad_curvint (blw_ *blw, int *refs, int *ic, double *a, double *b) -{ - *a=(*current_list_of_faces)[*refs-1]->edges[*ic-1]->parametric_min; - *b=(*current_list_of_faces)[*refs-1]->edges[*ic-1]->parametric_max; -} - -void cad_curv0 (blw_ *blw, int *refs, int *ic, double *t, double *C) -{ - (*current_list_of_faces)[*refs-1]->edges[*ic-1]->method_curv0(*t,C); -} - -void cad_curv1 (blw_ *blw, int *refs, int *ic, double *t, double *Ct) -{ - (*current_list_of_faces)[*refs-1]->edges[*ic-1]->method_curv1(*t,Ct); -} - -void cad_curv2 (blw_ *blw, int *refs, int *ic, double *t, double *Ctt) -{ - (*current_list_of_faces)[*refs-1]->edges[*ic-1]->method_curv2(*t,Ctt); -} - -void cad_hphys (blw_ *blw, int *refs, double *uv, double *h) {} -void cad_hphyc (blw_ *blw, int *refs, int *ic, double *t, double *h) {} -void cad_hphyp (blw_ *blw, int *refp, double *h) {} - -void cad_rads (blw_ *blw, int *refs, double *uv, double *rhos) { - sprintf(blw->error, "cad_rads should not be called\n"); -} - -void cad_radc (blw_ *blw, int *refs, int *ic, double *t, double *rhoc) { - sprintf(blw->error, "cad_radc should not be called"); -} - -void cad_hageos(blw_ *blw, int *refs, double uv[2], double hageos[6]) { - sprintf(blw->error, "cad_hageos should not be called\n"); -} - -void cad_refphyc(blw_ *blw, int *refc, int *phyc) { - *phyc = *refc; -} - -void cad_refphyp(blw_ *blw, int *refp, int *phyp) { - *phyp = *refp; -} - -void cad_refphys(blw_ *blw, int *refs, int *phys) { - *phys = *refs; -} - -void cad_edgetag(blw_ *blw, int *refc, int *required) { - *required = 1; -} - -void cad_curvparam(blw_ *blw, int *refs, int *ic, int *n, double tab[]) { - *n = 0; -} - -void BL_SURF::init_tsmo(blw_ *blw) { /* cf. bls_read_pardom */ - int is, ns, ic, nc, j, igloP, igloQ, isurf; - TopoDS_Vertex v; - gp_Pnt p; - double a, b, uv[2], xyz[3], xyzP[3], xyzQ[3]; - - ns = surfaces.size(); - if (blw->env.verb >= 10) fprintf(blw->out, "\ninit_tsmo: %d surfaces\n", ns); - if (ns <= 0) { - TSMO = NULL; - blw->bls_glo.number_of_patches = 0; - return; - } - - TopTools_IndexedMapOfShape fmap_edges; - TopTools_IndexedMapOfShape fmap_points; - fmap_edges.Clear(); - fmap_points.Clear(); - for (isurf=0; isurftopology; - for (TopExp_Explorer ex_face(face ,TopAbs_EDGE); ex_face.More(); ex_face.Next()) { - TopoDS_Edge e = TopoDS::Edge(ex_face.Current()); - if (fmap_edges.FindIndex(e) <= 0) { /* not found => FindIndex = 0, found => FindIndex > 0 */ - fmap_edges.Add(e); - j = 0; - for (TopExp_Explorer ex_edge(e ,TopAbs_VERTEX); ex_edge.More(); ex_edge.Next()) { - v = TopoDS::Vertex(ex_edge.Current()); - ++j; - if (fmap_points.FindIndex(v) <= 0) fmap_points.Add(v); - } - if (j != 2) { - sprintf(blw->error, "init_tsmo: surface is=%d: an edge has %d != 2 extremities\n", isurf+1, j); return; - } - } - } - } - - MALLOC(surface_, TSMO, ns+1); if (blw->error[0]) return; - blw->bls_glo.number_of_patches = ns; - for (isurf=0; isurfedges.size(); - if (blw->env.verb >= 70) fprintf(blw->out, "init_tsmo: surface is=%d: %d curves\n", is, nc); - - bls_init_surface(blw, &(TSMO[is]), nc); - TSMO[is].iglos = is; - TSMO[is].pardom_side = 0; - TSMO[is].surforient = +1; - for (int icurv=0;icurvedges[icurv]; - TopoDS_Edge edge = curve->topology; - TSMO[is].TC[ic].igloc = fmap_edges.FindIndex(edge); - - TopExp_Explorer ex_edge(edge, TopAbs_VERTEX); - v = TopoDS::Vertex(ex_edge.Current()); - p = BRep_Tool::Pnt(v); - xyzP[0] = p.X(); xyzP[1] = p.Y(); xyzP[2] = p.Z(); - igloP = fmap_points.FindIndex(v); - - ex_edge.Next(); - v = TopoDS::Vertex(ex_edge.Current()); - p = BRep_Tool::Pnt(v); - xyzQ[0] = p.X(); xyzQ[1] = p.Y(); xyzQ[2] = p.Z(); - igloQ = fmap_points.FindIndex(v); - - cad_curvint (blw, &is, &ic, &a, &b); - cad_curv0 (blw, &is, &ic, &a, uv); - cad_surf0 (blw, &is, uv, xyz); - xyzP[0] -= xyz[0]; xyzP[1] -= xyz[1]; xyzP[2] -= xyz[2]; - xyzQ[0] -= xyz[0]; xyzQ[1] -= xyz[1]; xyzQ[2] -= xyz[2]; - if (NORM3DPOW2(xyzP) <= NORM3DPOW2(xyzQ)) { - TSMO[is].TC[ic].iglope[0] = igloP; - TSMO[is].TC[ic].iglope[1] = igloQ; - } else { - TSMO[is].TC[ic].iglope[0] = igloQ; - TSMO[is].TC[ic].iglope[1] = igloP; - } - } - } -} - -int BL_SURF::bls_main(blw_ *blw) { - FILE *file; - - /* banner */ - blw->out = stdout; - bls_banner(blw, 1); - - /* initialiser l'environnement de BLSURF */ - init_blsenv(blw); - - /* lire l'environnement de BLSURF */ - /* par defaut : strcpy(blw->dirname, ""); */ - /* sinon : strcpy(blw->dirname, "C:\\Documents and Settings\\xxx\\"); */ - sprintf(blw->filename, "%sblsurf.env", blw->dirname); - FOPEN(file, "r"); - if (blw->error[0]) { - fprintf(blw->out, "File blsurf.env not found. Default values will be used.\n"); - blw->error[0] = 0; - } else { - read_blsenv(blw, file); - FCLOSE(file); - if (blw->error[0]) goto error; /* read_blsenv: unknown keyword */ - } - - /* copier les variables communes entre "bl2denv" et blsenv (en particulier verb) */ - copy_common_env(blw); - - /* imprimer l'environnement de BLSURF */ - if (blw->env.verb >= 70) print_blsenv(blw); - - /* initialiser TSMO */ - current_list_of_faces = &surfaces; - BL_SURF::init_tsmo(blw); if (blw->error[0]) goto error; - - /* generer le maillage surfacique */ - bls_init(blw); if (blw->error[0]) goto error; - bls_mesh(blw); if (blw->error[0]) goto error; - bls_surforient(blw); if (blw->error[0]) goto error; - bls_export(blw); if (blw->error[0]) goto error; - /* a voir : les tableaux pointes par current_list_of_faces sont liberes ? handles ? */ - - bls_banner(blw, 2); - return(0); - - error: - fprintf(blw->out, "\nBLSURF ERROR MESSAGE:\n%s\n", blw->error); - bls_banner(blw, 2); - return(1); -} diff --git a/src/BLSURFPlugin/cad_occ.h b/src/BLSURFPlugin/cad_occ.h deleted file mode 100644 index 67766f0..0000000 --- a/src/BLSURFPlugin/cad_occ.h +++ /dev/null @@ -1,188 +0,0 @@ -#ifndef __BL_SURF__ -#define __BL_SURF__ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -class BL_SURFACE; -class BL_CURVE_SIZER; -class BL_SURFACE_SIZER; -class BL_POINT_SIZER; - -class BL_EDGE -{ - public : - Handle(Geom2d_Curve) parametric_geometry; - Handle(Geom_Curve) space_geometry; - TopoDS_Edge topology; - BL_SURFACE *boss; - BL_CURVE_SIZER *sizer; - bool splitted_closed; - int splitted_part; - vector P1,P2,MP; - string name; - int i_P1,i_P2; - int typc,refc; - - double parametric_min,parametric_max; - double space_min,space_max; - - BL_EDGE(TopoDS_Edge&,BL_SURFACE*,Handle(Geom2d_Curve),double,double); - ~BL_EDGE(); - - bool verification(); - - void method_curv0(const double&, double*); - void method_curv1(const double&, double*); - void method_curv2(const double&, double*); -}; - -class BL_POINT { - public : - BL_POINT_SIZER *sizer; - BL_SURFACE *boss; - double u,v; - - BL_POINT() { u=v=0.; boss=NULL; sizer=NULL; } - BL_POINT(BL_SURFACE *b, double du, double dv) { u=du; v=dv; boss=b; sizer=NULL; } - BL_POINT(double du, double dv) { u=du; v=dv; boss=NULL; sizer=NULL; } - ~BL_POINT() { } - - BL_POINT& operator=(BL_POINT p) { u=p.u; v=p.v; return(*this); } - bool operator==(BL_POINT p) { return((u==p.u)&&(v==p.v)); } -}; - -class BL_SURFACE { - public : - Handle(Geom_Surface) geometry; - TopoDS_Face topology; - bool to_delete; - - BL_SURFACE_SIZER *sizer; - vector edges; - vector points; - - BL_SURFACE(TopoDS_Face&); - ~BL_SURFACE(); - - bool build(); - bool verification(); - - void method_surf0(double const*, double*); - void method_surf1(double const*, double*, double*); - void method_surf2(double const*, double*, double*, double*); - - bool add(TopoDS_Edge&); - void add(double u, double v); -}; - -class BL_SURF -{ - protected: - - // void build_blsurf_data_file(); - void init_tsmo(blw_ *blw); - int bls_main(blw_ *blw); - - // void set_reference_points(); - void build_surfaces(TopoDS_Shape&); - // void build_from_occ_references(TopoDS_Shape&); - - void analyse_identical_faces(); - - public: - static BL_SURF *active_blsurf; - TopoDS_Shape the_object; - - vector all_edges; - vector surfaces; - - vector internal_points; - vector internal_face_points; - - vector internal_edges; - vector internal_faces; - - vector conforming_source_face; - vector conforming_dest_face; - - vector< vector* > faces_to_merge; - vector< vector* > vertices_tags; - vector< vector* > edges_tags; - - // string blsurf_fname; - // bool mesh_2D, auto_merge, use_occ_refs; - - // enum WHAT_MESH { SURFACE_MESH=0, VOLUME_MESH=1 }; - // enum MESH_ORDER { LINEAR=0, QUADRATIC=1 }; - - blw_ blw; - // int auto_connectivity; - // int Verbosity; - // int hphy_flag; - // int hinterpol_flag,hmean_flag; - // int eps_glue_flag,eps_ends_flag,eps_collapse_flag; - // double eps_glue,eps_ends,eps_collapse,shockmax; - // double angle_mesh,angle_smo; - // WHAT_MESH WhatMesh; - // MESH_ORDER MeshOrder; - // int ComponentToMesh; - - // double Pmin,Pmax; - // double Gmin,Gmax; - // vector Poptions; // Goptions - - // vector remaining_faces; - - BL_SURF() { - // Verbosity=25; - // hphy_flag=0; - // hinterpol_flag=0; - // hmean_flag=0; - // auto_connectivity=1; // PL valait 0 - // use_occ_refs=false; - // Poptions.resize(1); Poptions[0]=0; - // WhatMesh=SURFACE_MESH; - // MeshOrder=LINEAR; - // mesh_2D=false; - // eps_glue=eps_ends=eps_collapse=1e-8; - // eps_glue_flag=eps_ends_flag=eps_collapse_flag=0; - // shockmax=1.e100; - // blsurf_fname=""; - // auto_merge=false; - // ComponentToMesh=0; - // angle_mesh=8.; angle_smo=1.; - } - ~BL_SURF() { } - - bool init(const TopoDS_Shape&); - // int vertices(double*&); - void get_blw(blw_*&); - // int number_of_patches(); - // bool all_triangles(); - // void face_mesh(int is, int*& F, int*& FRef, int*& iglops, int& nF, int& ndom, int& surforient); - bool end(); - - bool run(TopoDS_Shape&); - bool run(); - void reset(); -}; - -#endif - -// PL Gmin, Gmax, hgeo_flag, Goptions ont deja ete elimines -// PL hphy_flag, Poptions, ... sont a eliminer aussi -// bls.Gmin=0.01; -// bls.Gmax=1000; -// bls.hgeo_flag=1; -// bls.Goptions[0]=1; diff --git a/src/GUI/BLSURFPluginGUI.cxx b/src/GUI/BLSURFPluginGUI.cxx index f16fb52..9414ad1 100755 --- a/src/GUI/BLSURFPluginGUI.cxx +++ b/src/GUI/BLSURFPluginGUI.cxx @@ -1,29 +1,26 @@ -// BLSURFPlugin GUI: GUI for plugged-in mesher BLSURFPlugin +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2003 CEA -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// File : BLSURFPluginGUI.cxx +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPluginGUI.cxx // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) -// Module : BLSURFPlugin - +// --- +// #include "BLSURFPluginGUI_HypothesisCreator.h" //============================================================================= @@ -33,6 +30,7 @@ //============================================================================= extern "C" { + BLSURFPLUGIN_GUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType ) { SMESHGUI_GenericHypothesisCreator* aCreator = NULL; diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index 3a41e48..ba14fc8 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -1,51 +1,55 @@ -// BLSURFPlugin GUI: GUI for plugged-in mesher BLSURFPlugin +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2003 CEA -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// File : BLSURFPluginGUI_HypothesisCreator.cxx +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPluginGUI_HypothesisCreator.cxx // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) -// Module : BLSURFPlugin -// $Header: - +// & Aurelien ALLEAUME (DISTENE) +// --- +// #include "BLSURFPluginGUI_HypothesisCreator.h" #include #include -#include CORBA_SERVER_HEADER(BLSURFPlugin_Algorithm) - #include - +#include +#include #include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define WITH_SIZE_BOUNDARIES enum Topology { FromCAD, @@ -53,22 +57,29 @@ enum Topology { Process2 }; - enum PhysicalMesh { - DefaultSize, + DefaultSize = 0, PhysicalUserDefined }; enum GeometricMesh { - DefaultGeom, + DefaultGeom = 0, UserDefined }; +enum { + STD_TAB = 0, + ADV_TAB, + OPTION_ID_COLUMN = 0, + OPTION_NAME_COLUMN, + OPTION_VALUE_COLUMN, + NB_COLUMNS +}; + BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator( const QString& theHypType ) -: SMESHGUI_GenericHypothesisCreator( theHypType ), - myIs2D(true) + : SMESHGUI_GenericHypothesisCreator( theHypType ) { } @@ -76,140 +87,286 @@ BLSURFPluginGUI_HypothesisCreator::~BLSURFPluginGUI_HypothesisCreator() { } +namespace { + inline bool isDouble( const QString& theText, const bool emptyOK=false ) { + QString str = theText.trimmed(); + bool isOk = true; + if ( !str.isEmpty() ) + str.toDouble(&isOk); + else + isOk = emptyOK; + return isOk; + } +} + bool BLSURFPluginGUI_HypothesisCreator::checkParams() const { - BlsurfHypothesisData data_old, data_new; - readParamsFromHypo( data_old ); - readParamsFromWidgets( data_new ); - bool res = storeParamsToHypo( data_new ); - return res; + bool ok = true; + if ( !isDouble( myPhySize->text(), false )) { + if ( myPhySize->text().isEmpty() ) + myPhySize->setText(tr("OBLIGATORY_VALUE")); + myPhySize->selectAll(); + ok = false; + } + if ( !isDouble( myPhyMin->text(), true )) { + myPhyMin->selectAll(); + ok = false; + } + if ( !isDouble( myPhyMax->text(), true )) { + myPhyMax->selectAll(); + ok = false; + } + if ( !isDouble( myGeoMin->text(), true )) { + myGeoMin->selectAll(); + ok = false; + } + if ( !isDouble( myGeoMin->text(), true )) { + myGeoMin->selectAll(); + ok = false; + } + if ( ok ) + { + myOptionTable->setFocus(); + QApplication::instance()->processEvents(); + + BLSURFPlugin::BLSURFPlugin_Hypothesis_var h = + BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis() ); + + int row = 0, nbRows = myOptionTable->rowCount(); + for ( ; row < nbRows; ++row ) + { + QString name = myOptionTable->item( row, OPTION_NAME_COLUMN )->text(); + QString value = myOptionTable->item( row, OPTION_VALUE_COLUMN )->text().trimmed(); + if ( !value.isEmpty() ) { + try { + h->SetOptionValue( name.toLatin1().constData(), value.toLatin1().constData() ); + } + catch ( const SALOME::SALOME_Exception& ex ) + { + SUIT_MessageBox::critical( dlg(), + tr("SMESH_ERROR"), + ex.details.text.in() ); + ok = false; + } + } + } + h->SetOptionValues( myOptions ); // restore values + } + + return ok; } QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() { - QFrame* fr = new QFrame( 0, "myframe" ); - QVBoxLayout* lay = new QVBoxLayout( fr, 5, 0 ); - - QGroupBox* GroupC1 = new QGroupBox( 2, Qt::Horizontal, fr, "GroupC1" ); - lay->addWidget( GroupC1 ); - - GroupC1->setTitle( tr( "SMESH_ARGUMENTS" ) ); - GroupC1->layout()->setSpacing( 6 ); - GroupC1->layout()->setMargin( 11 ); - + QFrame* fr = new QFrame( 0 ); + QVBoxLayout* lay = new QVBoxLayout( fr ); + lay->setMargin( 5 ); + lay->setSpacing( 0 ); + + // tab + QTabWidget* tab = new QTabWidget( fr ); + tab->setTabShape( QTabWidget::Rounded ); + tab->setTabPosition( QTabWidget::North ); + lay->addWidget( tab ); + + // basic parameters + myStdGroup = new QWidget(); + QGridLayout* aStdLayout = new QGridLayout( myStdGroup ); + aStdLayout->setSpacing( 6 ); + aStdLayout->setMargin( 11 ); + + int row = 0; myName = 0; if( isCreation() ) { - new QLabel( tr( "SMESH_NAME" ), GroupC1 ); - myName = new QLineEdit( GroupC1 ); + aStdLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), myStdGroup ), row, 0, 1, 1 ); + myName = new QLineEdit( myStdGroup ); + aStdLayout->addWidget( myName, row++, 1, 1, 1 ); } - new QLabel( tr( "BLSURF_TOPOLOGY" ), GroupC1 ); - myTopology = new QtxComboBox( GroupC1 ); - QStringList topologyTypes; - topologyTypes.append( QObject::tr( "BLSURF_TOPOLOGY_CAD" ) ); - topologyTypes.append( QObject::tr( "BLSURF_TOPOLOGY_PROCESS" ) ); - topologyTypes.append( QObject::tr( "BLSURF_TOPOLOGY_PROCESS2" ) ); - myTopology->insertStringList( topologyTypes ); - - new QLabel( tr( "BLSURF_PHY_MESH" ), GroupC1 ); - myPhysicalMesh = new QtxComboBox( GroupC1 ); + aStdLayout->addWidget( new QLabel( tr( "BLSURF_PHY_MESH" ), myStdGroup ), row, 0, 1, 1 ); + myPhysicalMesh = new QComboBox( myStdGroup ); + aStdLayout->addWidget( myPhysicalMesh, row++, 1, 1, 1 ); QStringList physicalTypes; - physicalTypes.append( QObject::tr( "BLSURF_DEFAULT_USER" ) ); - physicalTypes.append( QObject::tr( "BLSURF_CUSTOM_USER" ) ); - myPhysicalMesh->insertStringList( physicalTypes ); - - new QLabel( tr( "BLSURF_HPHYDEF" ), GroupC1 ); - myPhySize = new QtxDblSpinBox( GroupC1 ); - myPhySize->setMinValue( 1e-02 ); - myPhySize->setMaxValue( 1e+02 ); - myPhySize->setLineStep( 1 ); - - new QLabel( tr( "BLSURF_GEOM_MESH" ), GroupC1 ); - myGeometricMesh = new QtxComboBox( GroupC1 ); + physicalTypes << tr( "BLSURF_DEFAULT_USER" ) << tr( "BLSURF_CUSTOM_USER" ); + myPhysicalMesh->addItems( physicalTypes ); + + aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYDEF" ), myStdGroup), row, 0, 1, 1 ); + myPhySize = new QLineEdit( myStdGroup ); + aStdLayout->addWidget( myPhySize, row++, 1, 1, 1 ); + +#ifdef WITH_SIZE_BOUNDARIES + aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYMIN" ), myStdGroup ), row, 0, 1, 1 ); + myPhyMin = new QLineEdit( myStdGroup ); + aStdLayout->addWidget( myPhyMin, row++, 1, 1, 1 ); + + aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYMAX" ), myStdGroup ), row, 0, 1, 1 ); + myPhyMax = new QLineEdit( myStdGroup ); + aStdLayout->addWidget( myPhyMax, row++, 1, 1, 1 ); +#endif + + aStdLayout->addWidget( new QLabel( tr( "BLSURF_GEOM_MESH" ), myStdGroup ), row, 0, 1, 1 ); + myGeometricMesh = new QComboBox( myStdGroup ); + aStdLayout->addWidget( myGeometricMesh, row++, 1, 1, 1 ); QStringList types; - types.append( QObject::tr( "BLSURF_DEFAULT_GEOM" ) ); - types.append( QObject::tr( "BLSURF_CUSTOM_GEOM" ) ); - myGeometricMesh->insertStringList( types ); - -// new QLabel( tr( "BLSURF_GROWTH_RATE" ), GroupC1 ); -// myGrowthRate = new QtxDblSpinBox( GroupC1 ); -// myGrowthRate->setMinValue( 0.1 ); -// myGrowthRate->setMaxValue( 10 ); -// myGrowthRate->setLineStep( 0.1 ); - - new QLabel( tr( "BLSURF_ANGLE_MESH_S" ), GroupC1 ); - myAngleMeshS = new QtxDblSpinBox( GroupC1 ); - myAngleMeshS->setMinValue( 0 ); - myAngleMeshS->setMaxValue( 16 ); - myAngleMeshS->setLineStep( 0.5 ); + types << tr( "BLSURF_DEFAULT_GEOM" ) << tr( "BLSURF_CUSTOM_GEOM" ); + myGeometricMesh->addItems( types ); + + aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_S" ), myStdGroup ), row, 0, 1, 1 ); + myAngleMeshS = new QtxDoubleSpinBox( myStdGroup ); + aStdLayout->addWidget( myAngleMeshS, row++, 1, 1, 1 ); + myAngleMeshS->setMinimum( 0 ); + myAngleMeshS->setMaximum( 16 ); + myAngleMeshS->setSingleStep( 0.5 ); - new QLabel( tr( "BLSURF_GRADATION" ), GroupC1 ); - myGradation = new QtxDblSpinBox( GroupC1 ); - myGradation->setMinValue( 1.1 ); - myGradation->setMaxValue( 2.5 ); - myGradation->setLineStep( 0.1 ); - -// new QLabel( tr( "BLSURF_SEG_PER_RADIUS" ), GroupC1 ); -// myNbSegPerRadius = new QtxDblSpinBox( GroupC1 ); -// myNbSegPerRadius->setMinValue( 0.2 ); -// myNbSegPerRadius->setMaxValue( 5.0 ); - - myAllowQuadrangles = new QCheckBox( tr( "BLSURF_ALLOW_QUADRANGLES" ), GroupC1 ); - GroupC1->addSpace(0); -// myIs2D = true; - - myDecimesh = new QCheckBox( tr( "BLSURF_DECIMESH" ), GroupC1 ); - GroupC1->addSpace(0); - + aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_C" ), myStdGroup ), row, 0, 1, 1 ); + myAngleMeshC = new QtxDoubleSpinBox( myStdGroup ); + aStdLayout->addWidget( myAngleMeshC, row++, 1, 1, 1 ); + myAngleMeshC->setMinimum( 0 ); + myAngleMeshC->setMaximum( 16 ); + myAngleMeshC->setSingleStep( 0.5 ); + + aStdLayout->addWidget( new QLabel( tr( "BLSURF_GRADATION" ), myStdGroup ), row, 0, 1, 1 ); + myGradation = new QtxDoubleSpinBox( myStdGroup ); + aStdLayout->addWidget( myGradation, row++, 1, 1, 1 ); + myGradation->setMinimum( 1.1 ); + myGradation->setMaximum( 2.5 ); + myGradation->setSingleStep( 0.1 ); + +#ifdef WITH_SIZE_BOUNDARIES + aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMIN" ), myStdGroup ), row, 0, 1, 1 ); + myGeoMin = new QLineEdit( myStdGroup ); + aStdLayout->addWidget( myGeoMin, row++, 1, 1, 1 ); + + aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMAX" ), myStdGroup ), row, 0, 1, 1 ); + myGeoMax = new QLineEdit( myStdGroup ); + aStdLayout->addWidget( myGeoMax, row++, 1, 1, 1 ); +#endif + + myAllowQuadrangles = new QCheckBox( tr( "BLSURF_ALLOW_QUADRANGLES" ), myStdGroup ); + aStdLayout->addWidget( myAllowQuadrangles, row++, 0, 1, 2 ); + + myDecimesh = new QCheckBox( tr( "BLSURF_DECIMESH" ), myStdGroup ); + aStdLayout->addWidget( myDecimesh, row++, 0, 1, 2 ); + + // advanced parameters + myAdvGroup = new QWidget(); + QGridLayout* anAdvLayout = new QGridLayout( myAdvGroup ); + anAdvLayout->setSpacing( 6 ); + anAdvLayout->setMargin( 11 ); + + anAdvLayout->addWidget( new QLabel( tr( "BLSURF_TOPOLOGY" ), myAdvGroup ), 0, 0, 1, 1 ); + myTopology = new QComboBox( myAdvGroup ); + anAdvLayout->addWidget( myTopology, 0, 1, 1, 1 ); + QStringList topologyTypes; + topologyTypes << tr( "BLSURF_TOPOLOGY_CAD" ) << tr( "BLSURF_TOPOLOGY_PROCESS" ) << tr( "BLSURF_TOPOLOGY_PROCESS2" ); + myTopology->addItems( topologyTypes ); + + anAdvLayout->addWidget( new QLabel( tr( "BLSURF_VERBOSITY" ), myAdvGroup ), 1, 0, 1, 1 ); + myVerbosity = new QSpinBox( myAdvGroup ); + anAdvLayout->addWidget( myVerbosity, 1, 1, 1, 1 ); + myVerbosity->setMinimum( 0 ); + myVerbosity->setMaximum( 100 ); + myVerbosity->setSingleStep( 5 ); + + myOptionTable = new QTableWidget( 0, NB_COLUMNS, myAdvGroup ); + anAdvLayout->addWidget( myOptionTable, 2, 0, 3, 2 ); + QStringList headers; + headers << tr( "OPTION_ID_COLUMN" ) << tr( "OPTION_NAME_COLUMN" ) << tr( "OPTION_VALUE_COLUMN" ); + myOptionTable->setHorizontalHeaderLabels( headers ); + myOptionTable->horizontalHeader()->hideSection( OPTION_ID_COLUMN ); + //myOptionTable->setColumnReadOnly( OPTION_NAME_COLUMN, TRUE );////// + //myOptionTable->setColumnReadOnly( OPTION_VALUE_COLUMN, FALSE );///// + myOptionTable->verticalHeader()->hide(); + //myOptionTable->setSelectionBehavior( QAbstractItemView::SelectRows ); + + QPushButton* addBtn = new QPushButton( tr( "ADD_OPTION"), myAdvGroup ); + anAdvLayout->addWidget( addBtn, 2, 2, 1, 1 ); + addBtn->setMenu( new QMenu() ); + + QPushButton* rmBtn = new QPushButton( tr( "REMOVE_OPTION"), myAdvGroup ); + anAdvLayout->addWidget( rmBtn, 3, 2, 1, 1 ); + + anAdvLayout->setRowStretch( 4, 5 ); + anAdvLayout->setColumnStretch( 1, 5 ); + + // --- + tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) ); + tab->insertTab( ADV_TAB, myAdvGroup, tr( "GHS3D_ADV_ARGS" ) ); + tab->setCurrentIndex( STD_TAB ); + + // --- connect( myGeometricMesh, SIGNAL( activated( int ) ), this, SLOT( onGeometricMeshChanged() ) ); connect( myPhysicalMesh, SIGNAL( activated( int ) ), this, SLOT( onPhysicalMeshChanged() ) ); + connect( addBtn->menu(), SIGNAL( aboutToShow() ), this, SLOT( onAddOption() ) ); + connect( addBtn->menu(), SIGNAL( triggered( QAction* ) ), this, SLOT( onOptionChosenInPopup( QAction* ) ) ); + connect( rmBtn, SIGNAL( clicked()), this, SLOT( onDeleteOption() ) ); return fr; } void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const { + BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; + BlsurfHypothesisData data; - readParamsFromHypo( data ); + that->readParamsFromHypo( data ); - if( myName ) + if ( myName ) { myName->setText( data.myName ); - myTopology->setCurrentItem( data.myTopology ); - myPhysicalMesh->setCurrentItem( data.myPhysicalMesh ); - myPhySize->setValue( data.myPhySize ); - myGeometricMesh->setCurrentItem( data.myGeometricMesh ); - myAngleMeshS->setValue( data.myAngleMeshS); - myGradation->setValue( data.myGradation); + QFontMetrics metrics( myName->font() ); + myName->setMinimumWidth( metrics.width( data.myName )+5 ); + } + myTopology->setCurrentIndex( data.myTopology ); + myPhysicalMesh->setCurrentIndex( data.myPhysicalMesh ); + myPhySize->setText( data.myPhySize ); +#ifdef WITH_SIZE_BOUNDARIES + myPhyMin->setText( data.myPhyMin ); + myPhyMax->setText( data.myPhyMax ); + myGeoMin->setText( data.myGeoMin ); + myGeoMax->setText( data.myGeoMax ); +#endif + myGeometricMesh->setCurrentIndex( data.myGeometricMesh ); + myAngleMeshS->setValue( data.myAngleMeshS ); + myAngleMeshC->setValue( data.myAngleMeshC ); + myGradation->setValue( data.myGradation ); myAllowQuadrangles->setChecked( data.myAllowQuadrangles ); myDecimesh->setChecked( data.myDecimesh ); + myVerbosity->setValue( data.myVerbosity ); + + if ( myOptions.operator->() ) { + printf("retrieveParams():myOptions->length()=%d\n",myOptions->length()); + for ( int i = 0, nb = myOptions->length(); i < nb; ++i ) { + QString option = that->myOptions[i].in(); + QStringList name_value = option.split( ":", QString::KeepEmptyParts ); + if ( name_value.count() > 1 ) { + QString idStr = QString("%1").arg( i ); + int row = myOptionTable->rowCount(); + myOptionTable->setRowCount( row+1 ); + myOptionTable->setItem( row, OPTION_ID_COLUMN, new QTableWidgetItem( idStr ) ); + myOptionTable->item( row, OPTION_ID_COLUMN )->setFlags( 0 ); + myOptionTable->setItem( row, OPTION_NAME_COLUMN, new QTableWidgetItem( name_value[0] ) ); + myOptionTable->item( row, OPTION_NAME_COLUMN )->setFlags( 0 ); + myOptionTable->setItem( row, OPTION_VALUE_COLUMN, new QTableWidgetItem( name_value[1] ) ); + myOptionTable->item( row, OPTION_VALUE_COLUMN )->setFlags( Qt::ItemIsSelectable | + Qt::ItemIsEditable | + Qt::ItemIsEnabled ); + } + } + } + myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN ); // update widgets - - bool isPhysicalCustom = (myPhysicalMesh->currentItem() == PhysicalUserDefined); - myPhySize->setEnabled(isPhysicalCustom); - - bool isCustom = (myGeometricMesh->currentItem() == UserDefined); - myAngleMeshS->setEnabled(isCustom); - myGradation->setEnabled(isCustom); + that->onPhysicalMeshChanged(); + that->onGeometricMeshChanged(); } QString BLSURFPluginGUI_HypothesisCreator::storeParams() const { - BlsurfHypothesisData data; - readParamsFromWidgets( data ); - storeParamsToHypo( data ); + BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; - QString guiHyp; - guiHyp += tr("BLSURF_TOPOLOGY") + " = " + QString::number( data.myTopology ) + "; "; - guiHyp += tr("BLSURF_PHY_MESH") + " = " + QString::number( data.myPhysicalMesh ) + "; "; - guiHyp += tr("BLSURF_HPHYDEF") + " = " + QString::number( data.myPhySize ) + "; "; - guiHyp += tr("BLSURF_GEOM_MESH") + " = " + QString::number( data.myGeometricMesh ) + "; "; - guiHyp += tr("BLSURF_ANGLE_MESH_S") + " = " + QString::number( data.myAngleMeshS ) + "; "; - guiHyp += tr("BLSURF_GRADATION") + " = " + QString::number( data.myGradation ) + "; "; - guiHyp += tr("BLSURF_ALLOW_QUADRANGLES") + " = " + QString(data.myAllowQuadrangles ? "yes" : "no") + "; "; - guiHyp += tr("BLSURF_DECIMESH") + " = " + QString(data.myDecimesh ? "yes" : "no") + "; "; - - cout << "guiHyp : " << guiHyp << endl; + BlsurfHypothesisData data; + QString guiHyp = that->readParamsFromWidgets( data ); + that->storeParamsToHypo( data ); return guiHyp; } @@ -220,16 +377,33 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis() ); HypothesisData* data = SMESH::GetHypothesisData( hypType() ); - h_data.myName = isCreation() && data ? data->Label : ""; - - h_data.myTopology = (int) h->GetTopology(); - h_data.myPhysicalMesh = (int) h->GetPhysicalMesh(); - h_data.myPhySize = h->GetPhySize(); - h_data.myGeometricMesh = (int) h->GetGeometricMesh(); - h_data.myAngleMeshS = h->GetAngleMeshS(); - h_data.myGradation = h->GetGradation(); + h_data.myName = isCreation() && data ? hypName() : ""; + + h_data.myTopology = (int) h->GetTopology(); + h_data.myPhysicalMesh = (int) h->GetPhysicalMesh(); + h_data.myPhySize = QString::number( h->GetPhySize() ); + h_data.myGeometricMesh = (int) h->GetGeometricMesh(); + h_data.myAngleMeshS = h->GetAngleMeshS(); + h_data.myAngleMeshC = h->GetAngleMeshC(); + h_data.myGradation = h->GetGradation(); h_data.myAllowQuadrangles = h->GetQuadAllowed(); - h_data.myDecimesh = h->GetDecimesh(); + h_data.myDecimesh = h->GetDecimesh(); + h_data.myVerbosity = h->GetVerbosity(); + +#ifdef WITH_SIZE_BOUNDARIES + double PhyMin = h->GetPhyMin(); + double PhyMax = h->GetPhyMax(); + double GeoMin = h->GetGeoMin(); + double GeoMax = h->GetGeoMax(); + if ( PhyMin > 0 ) + h_data.myPhyMin = PhyMin > 0 ? QString::number( h->GetPhyMin() ) : QString(""); + h_data.myPhyMax = PhyMax > 0 ? QString::number( h->GetPhyMax() ) : QString(""); + h_data.myGeoMin = GeoMin > 0 ? QString::number( h->GetGeoMin() ) : QString(""); + h_data.myGeoMax = GeoMax > 0 ? QString::number( h->GetGeoMax() ) : QString(""); +#endif + + BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; + that->myOptions = h->GetOptionValues(); return true; } @@ -243,21 +417,54 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi try { if( isCreation() ) - SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.latin1() ); - - h->SetTopology( (int) h_data.myTopology ); - h->SetPhysicalMesh( (int) h_data.myPhysicalMesh ); - h->SetPhySize( h_data.myPhySize ); - h->SetGeometricMesh( (int) h_data.myGeometricMesh ); - h->SetGradation( h_data.myGradation ); - h->SetQuadAllowed( h_data.myAllowQuadrangles ); - h->SetDecimesh( h_data.myDecimesh ); - - if( (int) h_data.myPhysicalMesh == PhysicalUserDefined ) - h->SetPhySize( h_data.myPhySize ); - - if( (int) h_data.myGeometricMesh == UserDefined ) - h->SetAngleMeshS( h_data.myAngleMeshS ); + SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().constData() ); + + if ( h->GetTopology() != h_data.myTopology ) // avoid duplication of DumpPython commands + h->SetTopology( (int) h_data.myTopology ); + if ( h->GetPhysicalMesh() != h_data.myPhysicalMesh ) + h->SetPhysicalMesh( (int) h_data.myPhysicalMesh ); + if ( h->GetGeometricMesh() != (int) h_data.myGeometricMesh ) + h->SetGeometricMesh( (int) h_data.myGeometricMesh ); + if ( h->GetGradation() != h_data.myGradation ) + h->SetGradation( h_data.myGradation ); + if ( h->GetQuadAllowed() != h_data.myAllowQuadrangles ) + h->SetQuadAllowed( h_data.myAllowQuadrangles ); + if ( h->GetDecimesh() != h_data.myDecimesh ) + h->SetDecimesh( h_data.myDecimesh ); + if ( h->GetVerbosity() != h_data.myVerbosity ) + h->SetVerbosity( h_data.myVerbosity ); + + if( (int) h_data.myPhysicalMesh == PhysicalUserDefined ) { + if ( h->GetPhySize() != h_data.myPhySize.toDouble() ) + h->SetPhySize( h_data.myPhySize.toDouble() ); + } + if( (int) h_data.myGeometricMesh == UserDefined ) { + if ( h->GetAngleMeshS() != h_data.myAngleMeshS ) + h->SetAngleMeshS( h_data.myAngleMeshS ); + if ( h->GetAngleMeshC() != h_data.myAngleMeshC ) + h->SetAngleMeshC( h_data.myAngleMeshC ); + } +#ifdef WITH_SIZE_BOUNDARIES + if ( !isDouble( h_data.myPhyMin )) + h->SetPhyMin( -1 ); + else if ( h->GetPhyMin() != h_data.myPhyMin.toDouble() ) + h->SetPhyMin( h_data.myPhyMin.toDouble() ); + if ( !isDouble( h_data.myPhyMax )) + h->SetPhyMax( -1 ); + else if ( h->GetPhyMax() != h_data.myPhyMax.toDouble() ) + h->SetPhyMax( h_data.myPhyMax.toDouble() ); + if ( !isDouble( h_data.myGeoMin )) + h->SetGeoMin( -1 ); + else if ( h->GetGeoMin() != h_data.myGeoMin.toDouble() ) + h->SetGeoMin( h_data.myGeoMin.toDouble() ); + if ( !isDouble( h_data.myGeoMax )) + h->SetGeoMax( -1 ); + else if ( h->GetGeoMax() != h_data.myGeoMax.toDouble() ) + h->SetGeoMax( h_data.myGeoMax.toDouble() ); +#endif + + printf("storeParamsToHypo():myOptions->length()=%d\n",myOptions->length()); + h->SetOptionValues( myOptions ); // is set in checkParams() } catch(const SALOME::SALOME_Exception& ex) { @@ -267,45 +474,101 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi return ok; } -bool BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothesisData& h_data ) const +QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothesisData& h_data ) const { h_data.myName = myName ? myName->text() : ""; - h_data.myTopology = myTopology->currentItem(); - h_data.myPhysicalMesh = myPhysicalMesh->currentItem(); - h_data.myPhySize = myPhySize->value(); - h_data.myGeometricMesh = myGeometricMesh->currentItem(); + h_data.myTopology = myTopology->currentIndex(); + h_data.myPhysicalMesh = myPhysicalMesh->currentIndex(); + h_data.myPhySize = myPhySize->text(); +#ifdef WITH_SIZE_BOUNDARIES + h_data.myPhyMin = myPhyMin->text(); + h_data.myPhyMax = myPhyMax->text(); + h_data.myGeoMin = myGeoMin->text(); + h_data.myGeoMax = myGeoMax->text(); +#endif + h_data.myGeometricMesh = myGeometricMesh->currentIndex(); h_data.myAngleMeshS = myAngleMeshS->value(); + h_data.myAngleMeshC = myAngleMeshC->value(); h_data.myGradation = myGradation->value(); h_data.myAllowQuadrangles = myAllowQuadrangles->isChecked(); h_data.myDecimesh = myDecimesh->isChecked(); + h_data.myVerbosity = myVerbosity->value(); - return true; + QString guiHyp; + guiHyp += tr("BLSURF_TOPOLOGY") + " = " + QString::number( h_data.myTopology ) + "; "; + guiHyp += tr("BLSURF_PHY_MESH") + " = " + QString::number( h_data.myPhysicalMesh ) + "; "; + guiHyp += tr("BLSURF_HPHYDEF") + " = " + h_data.myPhySize + "; "; + guiHyp += tr("BLSURF_GEOM_MESH") + " = " + QString::number( h_data.myGeometricMesh ) + "; "; + guiHyp += tr("BLSURF_ANGLE_MESH_S") + " = " + QString::number( h_data.myAngleMeshS ) + "; "; + guiHyp += tr("BLSURF_GRADATION") + " = " + QString::number( h_data.myGradation ) + "; "; + guiHyp += tr("BLSURF_ALLOW_QUADRANGLES") + " = " + QString(h_data.myAllowQuadrangles ? "yes" : "no") + "; "; + guiHyp += tr("BLSURF_DECIMESH") + " = " + QString(h_data.myDecimesh ? "yes" : "no") + "; "; +#ifdef WITH_SIZE_BOUNDARIES + if ( isDouble( h_data.myPhyMin )) guiHyp += "hphymin = " + h_data.myPhyMin + "; "; + if ( isDouble( h_data.myPhyMax )) guiHyp += "hphymax = " + h_data.myPhyMax + "; "; + if ( isDouble( h_data.myGeoMin )) guiHyp += "hgeomin = " + h_data.myGeoMin + "; "; + if ( isDouble( h_data.myGeoMax )) guiHyp += "hgeomax = " + h_data.myGeoMax + "; "; +#endif + + BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; + int row = 0, nbRows = myOptionTable->rowCount(); + for ( ; row < nbRows; ++row ) + { + int id = myOptionTable->item( row, OPTION_ID_COLUMN )->text().toInt(); + if ( id >= 0 && id < myOptions->length() ) + { + QString name = myOptionTable->item( row, OPTION_NAME_COLUMN )->text(); + QString value = myOptionTable->item( row, OPTION_VALUE_COLUMN )->text().trimmed(); + if ( value.isNull() ) + value = ""; + that->myOptions[ id ] = ( name + ":" + value).toLatin1().constData(); + if ( value != "" ) + guiHyp += name + " = " + value + "; "; + } + } + + cout << "guiHyp : " << guiHyp.toLatin1().data() << endl; + + return guiHyp; } void BLSURFPluginGUI_HypothesisCreator::onPhysicalMeshChanged() { - bool isCustom = (myPhysicalMesh->currentItem() == PhysicalUserDefined); + bool isCustom = (myPhysicalMesh->currentIndex() == PhysicalUserDefined); myPhySize->setEnabled(isCustom); + myPhyMax->setEnabled(isCustom); + myPhyMin->setEnabled(isCustom); - if ( ! isCustom ) { - double aPhySize; - switch( myPhysicalMesh->currentItem() ) { + if ( !isCustom ) { + QString aPhySize = ""; + switch( myPhysicalMesh->currentIndex() ) { case DefaultSize: default: - aPhySize = 10; + aPhySize = "10"; break; } - myPhySize->setValue( aPhySize ); + myPhySize->setText( aPhySize ); + if ( !isDouble( myPhyMin->text(), true )) + myPhyMin->setText(""); + if ( !isDouble( myPhyMax->text(), true )) + myPhyMax->setText(""); + if ( myGeometricMesh->currentIndex() == DefaultGeom ) { + myGeometricMesh->setCurrentIndex( UserDefined ); + onGeometricMeshChanged(); + } } } void BLSURFPluginGUI_HypothesisCreator::onGeometricMeshChanged() { - bool isCustom = (myGeometricMesh->currentItem() == UserDefined); + bool isCustom = (myGeometricMesh->currentIndex() == UserDefined); myAngleMeshS->setEnabled(isCustom); + myAngleMeshC->setEnabled(isCustom); myGradation->setEnabled(isCustom); + myGeoMax->setEnabled(isCustom); + myGeoMin->setEnabled(isCustom); if ( ! isCustom ) { double aAngleMeshS, aGradation; - switch( myGeometricMesh->currentItem() ) { + switch( myGeometricMesh->currentIndex() ) { case DefaultGeom: default: aAngleMeshS = 8; @@ -313,22 +576,108 @@ void BLSURFPluginGUI_HypothesisCreator::onGeometricMeshChanged() { break; } myAngleMeshS->setValue( aAngleMeshS ); + myAngleMeshC->setValue( aAngleMeshS ); myGradation->setValue( aGradation ); + if ( !isDouble( myGeoMin->text(), true )) + myGeoMin->setText(""); + if ( !isDouble( myGeoMax->text(), true )) + myGeoMax->setText(""); + // hphy_flag = 0 and hgeo_flag = 0 is not allowed (spec) + if ( myPhysicalMesh->currentIndex() == DefaultSize ) { + myPhysicalMesh->setCurrentIndex( PhysicalUserDefined ); + onPhysicalMeshChanged(); + } + } +} + +void BLSURFPluginGUI_HypothesisCreator::onAddOption() +{ + QMenu* menu = (QMenu*)sender(); + // fill popup with option names + menu->clear(); + if ( myOptions.operator->() ) { + for ( int i = 0, nb = myOptions->length(); i < nb; ++i ) { + QString name_value = myOptions[i].in(); + QString name = name_value.split( ":", QString::KeepEmptyParts )[0]; + menu->addAction( name ); + } } } +void BLSURFPluginGUI_HypothesisCreator::onOptionChosenInPopup( QAction* a ) +{ + myOptionTable->setFocus(); + QMenu* menu = (QMenu*)( a->parent() ); + + int idx = menu->actions().indexOf( a ); + QString idStr = QString("%1").arg( idx ); + QString option = myOptions[idx].in(); + QString optionName = option.split( ":", QString::KeepEmptyParts )[0]; + + // look for a row with optionName + int row = 0, nbRows = myOptionTable->rowCount(); + for ( ; row < nbRows; ++row ) + if ( myOptionTable->item( row, OPTION_ID_COLUMN )->text() == idStr ) + break; + // add a row if not found + if ( row == nbRows ) { + myOptionTable->setRowCount( row+1 ); + myOptionTable->setItem( row, OPTION_ID_COLUMN, new QTableWidgetItem( idStr ) ); + myOptionTable->item( row, OPTION_ID_COLUMN )->setFlags( 0 ); + myOptionTable->setItem( row, OPTION_NAME_COLUMN, new QTableWidgetItem( optionName ) ); + myOptionTable->item( row, OPTION_NAME_COLUMN )->setFlags( 0 ); + myOptionTable->setItem( row, OPTION_VALUE_COLUMN, new QTableWidgetItem( "" ) ); + myOptionTable->item( row, OPTION_VALUE_COLUMN )->setFlags( Qt::ItemIsSelectable | + Qt::ItemIsEditable | + Qt::ItemIsEnabled ); + myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN ); + } + myOptionTable->clearSelection(); + myOptionTable->scrollToItem( myOptionTable->item( row, OPTION_VALUE_COLUMN ) ); + //myOptionTable->item( row, OPTION_VALUE_COLUMN )->setSelected( true ); + myOptionTable->setCurrentCell( row, OPTION_VALUE_COLUMN ); + //myOptionTable->openPersistentEditor( myOptionTable->item( row, OPTION_VALUE_COLUMN ) ); +} + +void BLSURFPluginGUI_HypothesisCreator::onDeleteOption() +{ + // clear option values and remember selected row + QList selectedRows; + QList selected = myOptionTable->selectedItems(); + QTableWidgetItem* item; + foreach( item, selected ) { + int row = item->row(); + if ( !selectedRows.contains( row ) ) { + selectedRows.append( row ); + int id = myOptionTable->item( row, OPTION_ID_COLUMN )->text().toInt(); + if ( id >= 0 && id < myOptions->length() ) + myOptions[ id ] = myOptionTable->item( row, OPTION_NAME_COLUMN )->text().toLatin1().constData(); + } + } + qSort( selectedRows ); + QListIterator it( selectedRows ); + it.toBack(); + while ( it.hasPrevious() ) + myOptionTable->removeRow( it.previous() ); +} + + QString BLSURFPluginGUI_HypothesisCreator::caption() const { - return tr( QString( "BLSURF_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")) ); + return tr( "BLSURF_TITLE" ); } QPixmap BLSURFPluginGUI_HypothesisCreator::icon() const { - QString hypIconName = tr( QString("ICON_DLG_BLSURF_PARAMETERS%1").arg(myIs2D?QString(""):QString("")) ); - return SUIT_Session::session()->resourceMgr()->loadPixmap( "BLSURFPlugin", hypIconName ); + return SUIT_Session::session()->resourceMgr()->loadPixmap( "BLSURFPlugin", tr( "ICON_DLG_BLSURF_PARAMETERS") ); } QString BLSURFPluginGUI_HypothesisCreator::type() const { - return tr( QString( "BLSURF_%1_HYPOTHESIS" ).arg(myIs2D?QString("2D"):QString("3D")) ); + return tr( "BLSURF_HYPOTHESIS" ); +} + +QString BLSURFPluginGUI_HypothesisCreator::helpPage() const +{ + return "blsurf_hypo_page.html"; } diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h index a5b596d..15e701e 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h @@ -1,57 +1,69 @@ -// BLSURFPlugin GUI: GUI for plugged-in mesher BLSURFPlugin +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D // -// Copyright (C) 2003 CEA -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// File : BLSURFPluginGUI_HypothesisCreator.h +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// --- +// File : BLSURFPluginGUI_HypothesisCreator.h // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) // & Aurelien ALLEAUME (DISTENE) -// Module : BLSURFPlugin -// $Header: +// --- +// +#ifndef BLSURFPLUGINGUI_HypothesisCreator_H +#define BLSURFPLUGINGUI_HypothesisCreator_H -#ifndef BLSURFPLUGINGUI_HypothesisCreator_HeaderFile -#define BLSURFPLUGINGUI_HypothesisCreator_HeaderFile +#ifdef WIN32 + #ifdef BLSURFPLUGIN_GUI_EXPORTS + #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllexport ) + #else + #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllimport ) + #endif +#else + #define BLSURFPLUGIN_GUI_EXPORT +#endif #include +#include +#include CORBA_SERVER_HEADER(BLSURFPlugin_Algorithm) -class QtxDblSpinBox; -class QtxComboBox; +class QGroupBox; +class QtxDoubleSpinBox; +class QComboBox; class QCheckBox; class QLineEdit; +class QTableWidget; +class QSpinBox; +class QMenu; +class QAction; typedef struct { - int myTopology; + int myTopology, myVerbosity; int myPhysicalMesh, myGeometricMesh; - double myPhySize, myAngleMeshS, myGradation; + double myAngleMeshS, myAngleMeshC, myGradation; + QString myPhySize, myGeoMin, myGeoMax, myPhyMin, myPhyMax; bool myAllowQuadrangles, myDecimesh; QString myName; + } BlsurfHypothesisData; /*! * \brief Class for creation of BLSURF hypotheses */ - -class BLSURFPlugin_Hypothesis; - -class BLSURFPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator +class BLSURFPLUGIN_GUI_EXPORT BLSURFPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator { Q_OBJECT @@ -59,7 +71,8 @@ public: BLSURFPluginGUI_HypothesisCreator( const QString& ); virtual ~BLSURFPluginGUI_HypothesisCreator(); - virtual bool checkParams() const; + virtual bool checkParams() const; + virtual QString helpPage() const; protected: virtual QFrame* buildFrame (); @@ -71,26 +84,39 @@ protected: virtual QString type() const; protected slots: - virtual void onPhysicalMeshChanged(); - virtual void onGeometricMeshChanged(); + void onPhysicalMeshChanged(); + void onGeometricMeshChanged(); + void onAddOption(); + void onDeleteOption(); + void onOptionChosenInPopup( QAction* ); private: - bool readParamsFromHypo( BlsurfHypothesisData& ) const; - bool readParamsFromWidgets( BlsurfHypothesisData& ) const; - bool storeParamsToHypo( const BlsurfHypothesisData& ) const; + bool readParamsFromHypo( BlsurfHypothesisData& ) const; + QString readParamsFromWidgets( BlsurfHypothesisData& ) const; + bool storeParamsToHypo( const BlsurfHypothesisData& ) const; private: - QLineEdit* myName; - QtxComboBox* myTopology; - QtxComboBox* myPhysicalMesh; - QtxDblSpinBox* myPhySize; - QtxComboBox* myGeometricMesh; - QtxDblSpinBox* myAngleMeshS; - QtxDblSpinBox* myGradation; - QCheckBox* myAllowQuadrangles; - QCheckBox* myDecimesh; + QWidget* myStdGroup; + QLineEdit* myName; + QComboBox* myPhysicalMesh; + QLineEdit* myPhySize; + QLineEdit* myPhyMin; + QLineEdit* myPhyMax; + QComboBox* myGeometricMesh; + QtxDoubleSpinBox* myAngleMeshS; + QtxDoubleSpinBox* myAngleMeshC; + QLineEdit* myGeoMin; + QLineEdit* myGeoMax; + QtxDoubleSpinBox* myGradation; + QCheckBox* myAllowQuadrangles; + QCheckBox* myDecimesh; - bool myIs2D; + QWidget* myAdvGroup; + QComboBox* myTopology; + QSpinBox* myVerbosity; + QTableWidget* myOptionTable; + + BLSURFPlugin::string_array_var myOptions; }; -#endif +#endif // BLSURFPLUGINGUI_HypothesisCreator_H diff --git a/src/GUI/BLSURFPlugin_images.po b/src/GUI/BLSURFPlugin_images.po deleted file mode 100755 index 56fcee0..0000000 --- a/src/GUI/BLSURFPlugin_images.po +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ -# -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" -# would be translated to "Pub", not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - - -#----------------------------------------------------------- -# Hypothesis -#----------------------------------------------------------- - -msgid "ICON_DLG_BLSURF_PARAMETERS" -msgstr "mesh_hypo_BLSURF.png" - -msgid "ICON_DLG_BLSURF_PARAMETERS_2D" -msgstr "mesh_hypo_BLSURF.png" - -#----------------------------------------------------------- -# ObjectBrowser -#----------------------------------------------------------- - -msgid "ICON_SMESH_TREE_ALGO_BLSURF_3D" -msgstr "mesh_tree_algo_tetra.png" - -msgid "ICON_SMESH_TREE_ALGO_BLSURF_2D" -msgstr "mesh_tree_algo_BLSURF.png" - -msgid "ICON_SMESH_TREE_ALGO_BLSURF_2D3D" -msgstr "mesh_tree_algo_BLSURF.png" - -msgid "ICON_SMESH_TREE_HYPO_BLSURF_Parameters" -msgstr "mesh_tree_hypo_BLSURF.png" - -msgid "ICON_SMESH_TREE_HYPO_BLSURF_Parameters_2D" -msgstr "mesh_tree_hypo_BLSURF.png" diff --git a/src/GUI/BLSURFPlugin_images.ts b/src/GUI/BLSURFPlugin_images.ts new file mode 100644 index 0000000..1ccb479 --- /dev/null +++ b/src/GUI/BLSURFPlugin_images.ts @@ -0,0 +1,38 @@ + + + + + @default + + ICON_DLG_BLSURF_PARAMETERS + mesh_hypo_BLSURF.png + + + ICON_SMESH_TREE_ALGO_BLSURF + mesh_tree_algo_BLSURF.png + + + ICON_SMESH_TREE_HYPO_BLSURF_Parameters + mesh_tree_hypo_BLSURF.png + + + diff --git a/src/GUI/BLSURFPlugin_msg_en.po b/src/GUI/BLSURFPlugin_msg_en.po deleted file mode 100755 index 9fd9f1d..0000000 --- a/src/GUI/BLSURFPlugin_msg_en.po +++ /dev/null @@ -1,91 +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/ -# -# 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". -// -// File : BLSURFPlugin_msg_en.po -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA) -// & Aurelien ALLEAUME (DISTENE) -// Date : 28/03/2006 -// Project : SALOME -//============================================================================= - -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:46:48 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - -msgid "BLSURF_2D_HYPOTHESIS" -msgstr "BLSURF 2D" - -msgid "BLSURF_TOPOLOGY" -msgstr "Topology" - -msgid "BLSURF_TOPOLOGY_CAD" -msgstr "From CAD" - -msgid "BLSURF_TOPOLOGY_PROCESS" -msgstr "Pre-process" - -msgid "BLSURF_TOPOLOGY_PROCESS2" -msgstr "Pre-process++" - -msgid "BLSURF_PHY_MESH" -msgstr "Physical Mesh" - -msgid "BLSURF_DEFAULT_USER" -msgstr "Default" - -msgid "BLSURF_CUSTOM_USER" -msgstr "Custom" - -msgid "BLSURF_HPHYDEF" -msgstr "User Size" - -msgid "BLSURF_GEOM_MESH" -msgstr "Geometrical Mesh" - -msgid "BLSURF_DEFAULT_GEOM" -msgstr "Default" - -msgid "BLSURF_CUSTOM_GEOM" -msgstr "Custom" - -msgid "BLSURF_ANGLE_MESH_S" -msgstr "Angle Mesh S" - -msgid "BLSURF_GRADATION" -msgstr "Gradation" - -msgid "BLSURF_DECIMESH" -msgstr "Patch independent" - -msgid "BLSURF_ALLOW_QUADRANGLES" -msgstr "Allow Quadrangles (Test)" - -msgid "BLSURF_2D_TITLE" -msgstr "Hypothesis Construction" - -msgid "BLSURF_3D_TITLE" -msgstr "Hypothesis Construction" diff --git a/src/GUI/BLSURFPlugin_msg_en.ts b/src/GUI/BLSURFPlugin_msg_en.ts new file mode 100644 index 0000000..0e4e862 --- /dev/null +++ b/src/GUI/BLSURFPlugin_msg_en.ts @@ -0,0 +1,138 @@ + + + + + @default + + ADD_OPTION + Add option + + + BLSURF_ALLOW_QUADRANGLES + Allow Quadrangles (Test) + + + BLSURF_ANGLE_MESH_C + Angle Mesh C + + + BLSURF_ANGLE_MESH_S + Angle Mesh S + + + BLSURF_CUSTOM_GEOM + Custom + + + BLSURF_CUSTOM_USER + Custom + + + BLSURF_DECIMESH + Patch independent + + + BLSURF_DEFAULT_GEOM + None + + + BLSURF_DEFAULT_USER + None + + + BLSURF_GEOM_MESH + Geometrical Mesh + + + BLSURF_GRADATION + Gradation + + + BLSURF_HGEOMAX + Max Geometrical Size + + + BLSURF_HGEOMIN + Min Geometrical Size + + + BLSURF_HPHYDEF + User Size + + + BLSURF_HPHYMAX + Max Physical Size + + + BLSURF_HPHYMIN + Min Physical Size + + + BLSURF_HYPOTHESIS + BLSURF 2D + + + BLSURF_PHY_MESH + Physical Mesh + + + BLSURF_TITLE + Hypothesis Construction + + + BLSURF_TOPOLOGY + Topology + + + BLSURF_TOPOLOGY_CAD + From CAD + + + BLSURF_TOPOLOGY_PROCESS + Pre-process + + + BLSURF_TOPOLOGY_PROCESS2 + Pre-process++ + + + BLSURF_VERBOSITY + Verbosity level + + + OBLIGATORY_VALUE + (Obligatory value) + + + OPTION_NAME_COLUMN + Option + + + OPTION_VALUE_COLUMN + Value + + + REMOVE_OPTION + Clear option + + + diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am new file mode 100644 index 0000000..20136b4 --- /dev/null +++ b/src/GUI/Makefile.am @@ -0,0 +1,70 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# header files +salomeinclude_HEADERS = + +# Libraries targets +lib_LTLIBRARIES = libBLSURFPluginGUI.la + +dist_libBLSURFPluginGUI_la_SOURCES = \ + BLSURFPluginGUI.cxx \ + BLSURFPluginGUI_HypothesisCreator.h \ + BLSURFPluginGUI_HypothesisCreator.cxx + +MOC_FILES = \ + BLSURFPluginGUI_HypothesisCreator_moc.cxx + +nodist_libBLSURFPluginGUI_la_SOURCES = \ + $(MOC_FILES) + +# additionnal information to compil and link file + +libBLSURFPluginGUI_la_CPPFLAGS = \ + $(QT_INCLUDES) \ + $(CAS_CPPFLAGS) \ + $(PYTHON_INCLUDES) \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(GEOM_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(SMESH_CXXFLAGS) \ + $(BOOST_CPPFLAGS) \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ + $(BLSURF_INCLUDES) \ + -I$(srcdir)/../BLSURFPlugin \ + -I$(top_builddir)/idl \ + -I$(top_builddir)/salome_adm/unix + +libBLSURFPluginGUI_la_LDFLAGS = \ + ../BLSURFPlugin/libBLSURFEngine.la \ + ${SMESH_LDFLAGS} -lSMESH \ + $(CAS_KERNEL) $(BLSURF_LIBS) + +# resources files +nodist_salomeres_DATA = \ + BLSURFPlugin_images.qm \ + BLSURFPlugin_msg_en.qm diff --git a/src/GUI/Makefile.in b/src/GUI/Makefile.in deleted file mode 100644 index 885f073..0000000 --- a/src/GUI/Makefile.in +++ /dev/null @@ -1,73 +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/ -# -# File : Makefile.in -// Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) -# Module : BLSURFPLUGIN - -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 = \ - BLSURFPlugin_images.po \ - BLSURFPlugin_msg_en.po - -# Libraries targets -LIB = libBLSURFPluginGUI.la - -LIB_SRC = \ - BLSURFPluginGUI.cxx \ - BLSURFPluginGUI_HypothesisCreator.cxx - -LIB_MOC = \ - BLSURFPluginGUI_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 \ - BLSURFPlugin_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${LIB_LOCATION_SUFFIX}/salome \ - -L${GUI_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome -L${GEOM_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome \ - -L${SMESH_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome - -@CONCLUDE@ diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..5768f50 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,32 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) +# --- +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +SUBDIRS = BLSURFPlugin + +if BLSURFPLUGIN_ENABLE_GUI + SUBDIRS += GUI +endif + +DIST_SUBDIRS = BLSURFPlugin GUI \ No newline at end of file diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index eb2857b..0000000 --- a/src/Makefile.in +++ /dev/null @@ -1,35 +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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : Makefile.in -# Author : Patrick GOLDBRONN (CEA) -# Module : SMESH - -top_srcdir=@top_srcdir@ -top_builddir=.. -srcdir=@srcdir@ -VPATH=.:@srcdir@ - -@COMMENCE@ - -SUBDIRS = BLSURFPlugin GUI - -@MODULE@