]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
Merge from V6_main_20120808 08Aug12
authorvsr <vsr@opencascade.com>
Thu, 9 Aug 2012 11:51:48 +0000 (11:51 +0000)
committervsr <vsr@opencascade.com>
Thu, 9 Aug 2012 11:51:48 +0000 (11:51 +0000)
81 files changed:
AUTHORS
BLSURFPLUGIN_version.h.in
ChangeLog
INSTALL
Makefile.am
NEWS
adm_local/Makefile.am
adm_local/cmake_files/FindBLSURF.cmake [new file with mode: 0644]
adm_local/cmake_files/Makefile.am [new file with mode: 0644]
adm_local/unix/Makefile.am
adm_local/unix/config_files/Makefile.am
adm_local/unix/config_files/check_BLSURF.m4
adm_local/unix/config_files/check_BLSURFPLUGIN.m4
adm_local/unix/make_common_starter.am
bin/Makefile.am
bin/VERSION.in
build_cmake [new file with mode: 0755]
build_cmake.bat [new file with mode: 0644]
build_configure
clean_configure
configure.ac
doc/Makefile.am [new file with mode: 0644]
doc/salome/Makefile.am [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/Makefile.am [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/doxyfile.in [new file with mode: 0755]
doc/salome/gui/BLSURFPLUGIN/doxyfile_py.in [new file with mode: 0755]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_attractors.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_attractors2.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_const_size_near_shape.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_const_size_near_shape2.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_advanced.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_enforced_vertices.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap1.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap2.png [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/images/head.png [new file with mode: 0755]
doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/input/blsurfplugin_python_interface.doc [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/input/index.doc [new file with mode: 0644]
doc/salome/gui/BLSURFPLUGIN/static/doxygen.css [new file with mode: 0755]
doc/salome/gui/BLSURFPLUGIN/static/footer.html [new file with mode: 0755]
doc/salome/gui/BLSURFPLUGIN/static/header.html.in [new file with mode: 0755]
doc/salome/gui/BLSURFPLUGIN/static/header_py.html.in [new file with mode: 0644]
doc/salome/gui/Makefile.am [new file with mode: 0644]
doc/salome/tui/Makefile.am [new file with mode: 0644]
doc/salome/tui/doxyfile.in [new file with mode: 0755]
doc/salome/tui/images/Application-About.png [new file with mode: 0755]
doc/salome/tui/images/application.gif [new file with mode: 0755]
doc/salome/tui/images/html_comments.gif [new file with mode: 0755]
doc/salome/tui/images/logocorp.gif [new file with mode: 0755]
doc/salome/tui/static/doxygen.css [new file with mode: 0755]
doc/salome/tui/static/footer.html [new file with mode: 0755]
doc/salome/tui/static/myheader.html [new file with mode: 0755]
idl/BLSURFPlugin_Algorithm.idl
idl/Makefile.am
resources/BLSURFPlugin.xml
resources/Makefile.am
resources/SalomeApp.xml
resources/mesh_select_BLSURF.png [new file with mode: 0644]
src/BLSURFPlugin/BLSURFPluginDC.py [new file with mode: 0644]
src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx [new file with mode: 0644]
src/BLSURFPlugin/BLSURFPlugin_Attractor.hxx [new file with mode: 0644]
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx
src/BLSURFPlugin/BLSURFPlugin_i.cxx
src/BLSURFPlugin/Makefile.am
src/GUI/BLSURFPluginGUI.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.h
src/GUI/BLSURFPlugin_images.ts
src/GUI/BLSURFPlugin_msg_en.ts
src/GUI/BLSURFPlugin_msg_fr.ts [new file with mode: 0755]
src/GUI/Makefile.am
src/Makefile.am

diff --git a/AUTHORS b/AUTHORS
index 8173fb71483e5ce469096015a773ea9b6df99292..7bdd20e1b09247b8dfe4cebc56ea70b4904cd996 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 OPEN CASCADE, CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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
@@ -16,6 +16,7 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # ---
 #
 # File   : AUTHORS
index c90b4f2af3f50454333c2eb5bf4b6773817b9663..facaf9be244490a28f32d8457f00d444114eed26 100644 (file)
@@ -1,21 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
@@ -30,5 +31,6 @@
 
 #define BLSURFPLUGIN_VERSION_STR "@VERSION@"
 #define BLSURFPLUGIN_VERSION     @XVERSION@
+#define BLSURFPLUGIN_DEVELOPMENT @VERSION_DEV@
 
 #endif // __BLSURFPLUGIN_VERSION_H__
index ca38f417a1af96eb523e71711b155c910a85dac9..edde3d35b4a73d23ea8e100f80f2e3b36f2bb78a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 OPEN CASCADE, CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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
@@ -16,6 +16,7 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # ---
 #
 # File   : ChangeLog
diff --git a/INSTALL b/INSTALL
index 9c9abf944cbe573a98a4ac3b83598bf6298f89ea..9b0b3a0af2c76ce77675982cf1c1c8cab8e06830 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 OPEN CASCADE, CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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
@@ -16,6 +16,7 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # ---
 #
 # File   : INSTALL
index d5c22572df24cfda12977fc160613ad5f8161248..d70863f7c9c3a28d315835fe7463f212dfa9dcfb 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
@@ -38,17 +39,28 @@ else !BLSURFPLUGIN_ENABLE_GUI
                     -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files
 endif
 
-SUBDIRS = idl adm_local resources src bin
+SUBDIRS = idl adm_local resources src bin doc
 
-DIST_SUBDIRS = idl adm_local resources src bin 
+DIST_SUBDIRS = idl adm_local resources src bin doc 
 
-DISTCLEANFILES = a.out aclocal.m4 configure
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool
 
 salomeinclude_DATA = BLSURFPLUGIN_version.h
 
 EXTRA_DIST += \
        build_configure \
-       clean_configure
+       clean_configure \
+       build_cmake     \
+       build_cmake.bat
 
 dist-hook:
        rm -rf `find $(distdir) -name CVS`
+
+usr_docs:
+       (cd doc && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
+
+docs: usr_docs
+
+dev_docs:
+       (cd doc && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
+
diff --git a/NEWS b/NEWS
index 6a0b1eb2647b79da5e3da220a3a150529febf69c..d22503a457d5cc6e70b570851d41dd6b4efc6337 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2008 OPEN CASCADE, CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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
@@ -16,6 +16,7 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 # ---
 #
 # File   : NEWS
index 3f9a07d4b6b3027ed43f4df8f028aed0c8eeeada..6b3c7d7a20fa996be12aace8e770fe7b5df1990a 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
@@ -23,4 +24,4 @@
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
-SUBDIRS = unix
+SUBDIRS = unix cmake_files
diff --git a/adm_local/cmake_files/FindBLSURF.cmake b/adm_local/cmake_files/FindBLSURF.cmake
new file mode 100644 (file)
index 0000000..5fea852
--- /dev/null
@@ -0,0 +1,46 @@
+# Copyright (C) 2007-2012  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
+#
+
+SET(BLSURFHOME $ENV{BLSURFHOME})
+FIND_PATH(BLSURF_INCLUDES_DIR distene/blsurf.h ${BLSURFHOME}/include)
+SET(BLSURF_INCLUDES)
+SET(BLSURF_INCLUDES ${BLSURF_INCLUDES} -I${BLSURF_INCLUDES_DIR})
+
+SET(BLSURF_LIBS_PATHS)
+SET(BLSURF_LIBS_PATHS ${BLSURF_LIBS_PATHS} ${BLSURFHOME}/lib)
+IF(WINDOWS)
+  SET(BLSURF_LIBS_PATHS ${BLSURF_LIBS_PATHS} ${BLSURFHOME}/lib/WinXP_VC9)
+ELSE(WINDOWS)
+  IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
+    SET(BLSURF_LIBS_PATHS ${BLSURF_LIBS_PATHS} ${BLSURFHOME}/lib/Linux_64)
+  ELSE()
+    SET(BLSURF_LIBS_PATHS ${BLSURF_LIBS_PATHS} ${BLSURFHOME}/lib/Linux)
+  ENDIF()
+ENDIF(WINDOWS)
+
+FIND_LIBRARY(BLSurf BLSurf PATHS ${BLSURF_LIBS_PATHS})
+FIND_LIBRARY(PreCAD PreCAD PATHS ${BLSURF_LIBS_PATHS})
+FIND_LIBRARY(distene distene PATHS ${BLSURF_LIBS_PATHS})
+
+SET(BLSURF_LIBS)
+SET(BLSURF_LIBS ${BLSURF_LIBS} ${BLSurf})
+SET(BLSURF_LIBS ${BLSURF_LIBS} ${PreCAD})
+IF(distene)
+  SET(BLSURF_LIBS ${BLSURF_LIBS} ${distene})
+ENDIF(distene)
diff --git a/adm_local/cmake_files/Makefile.am b/adm_local/cmake_files/Makefile.am
new file mode 100644 (file)
index 0000000..b21e68d
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright (C) 2007-2012  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
+#
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+admlocal_cmakedir = $(admlocaldir)/cmake_files
+
+dist_admlocal_cmake_DATA = \
+FindBLSURF.cmake
+
index f70a09ef543274fb1549e47a2dc25655180d82fa..55a47ce7e41a7f1d271acc0bd06cfd8f39d96c57 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
index 5091235bf954fcbef1b4ea4bea1b531b6224bcab..01174b37ca796749e72c54f15d323b673501cf63 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
index cfe354a86db7de6b283bc16d1d66567e31a7251e..ae7bab81cbd55741e80e34152b3803cb5d72b4bb 100644 (file)
@@ -1,30 +1,31 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+dnl Copyright (C) 2007-2012  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 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 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 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 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)
-
+dnl
 AC_DEFUN([CHECK_BLSURF],[
 
 AC_REQUIRE([AC_PROG_CXX])dnl
 AC_REQUIRE([AC_PROG_CXXCPP])dnl
 
-AC_CHECKING(for BLSURF commercial product)
+AC_CHECKING([for BLSURF commercial product])
 
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
@@ -32,7 +33,7 @@ AC_LANG_CPLUSPLUS
 BLSURF_INCLUDES=""
 BLSURF_LIBS=""
 
-AC_ARG_WITH(blsurf,
+AC_ARG_WITH([blsurf],
            [  --with-blsurf=DIR       root directory path of BLSURF installation])
 
 BLSURF_ok=no
@@ -58,34 +59,43 @@ if test "$with_blsurf" != "no" ; then
     echo BLSURF commercial product to generate 2D mesh.
     echo
 
-    BLSURF_INCLUDES="-I$BLSURF_HOME/include"
-    BLSURF_LIBS="-L$BLSURF_HOME/lib -lBLSurf"
+    LOCAL_INCLUDES="-I$BLSURF_HOME/include"
+    LOCAL_LIBS="-L$BLSURF_HOME/lib/Linux"
+    archtest="$(`which arch`)"
+    if test "x$archtest" = "x" ; then
+      archtest="`uname -m`"
+    fi
+    if test $archtest = "x86_64" ; then
+        LOCAL_LIBS="-L$BLSURF_HOME/lib/Linux_64"
+    fi
+    LOCAL_LIBS="${LOCAL_LIBS} -ldistene -lBLSurf -lPreCAD"
 
     CPPFLAGS_old="$CPPFLAGS"
     CXXFLAGS_old="$CXXFLAGS"
-    CPPFLAGS="$BLSURF_INCLUDES $CPPFLAGS"
-    CXXFLAGS="$BLSURF_INCLUDES $CXXFLAGS"
+    CPPFLAGS="$LOCAL_INCLUDES $CPPFLAGS"
+    CXXFLAGS="$LOCAL_INCLUDES $CXXFLAGS"
 
-    AC_MSG_CHECKING(for BLSURF header file)
+    AC_MSG_CHECKING([for BLSURF header file])
 
-    AC_CHECK_HEADER(distene/api.h,BLSURF_ok=yes,BLSURF_ok=no)
+    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_MSG_CHECKING([for BLSURF library])
 
-      LDFLAGS_old="$LDFLAGS"
-      LDFLAGS="-L. -$BLSURF_LIBS $LDFLAGS"
+      LIBS_old="$LIBS"
+      LIBS="-L. $LOCAL_LIBS $LIBS"
 
       AC_TRY_LINK(
-       #include "distene/api.h",
-       BLSURF_init();,
+extern "C" {
+#include "distene/api.h"
+},  distene_context_new(),
        BLSURF_ok=yes,BLSURF_ok=no
        )
 
-      LDFLAGS="$LDFLAGS_old"
+      LIBS="$LIBS_old"
 
-      AC_MSG_RESULT($BLSURF_ok)
+      AC_MSG_RESULT([$BLSURF_ok])
     fi
 
     CPPFLAGS="$CPPFLAGS_old"
@@ -95,11 +105,13 @@ if test "$with_blsurf" != "no" ; then
 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.)
+  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)
+  BLSURF_INCLUDES=$LOCAL_INCLUDES
+  BLSURF_LIBS=$LOCAL_LIBS
+  AC_MSG_RESULT([for BLSURF: yes])
 fi
 
 AC_SUBST(BLSURF_INCLUDES)
index 1756adf544d336a331fcad9019241032404ad2d0..767c9f2dea5f1423c646a66d72e19ec37b27771c 100644 (file)
@@ -1,24 +1,25 @@
-dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+dnl Copyright (C) 2007-2012  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 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 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 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 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)
-
+dnl
 AC_DEFUN([CHECK_BLSURFPLUGIN],[
 
 AC_CHECKING(for BLSURF mesh plugin)
@@ -29,36 +30,46 @@ BLSURFPLUGIN_LDFLAGS=""
 BLSURFPLUGIN_CXXFLAGS=""
 
 AC_ARG_WITH(BLSURFplugin,
-           [  --with-BLSURFplugin=DIR root directory path of BLSURF mesh plugin installation ])
+      --with-BLSURFplugin=DIR  root directory path of BLSURF mesh plugin installation,
+      BLSURFPLUGIN_DIR="$withval",BLSURFPLUGIN_DIR="")
 
-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
+
+# no --with-BLSURFplugin option used
+
+  if test "x$BLSURFPLUGIN_ROOT_DIR" != "x" ; then
+
+    # SALOME_ROOT_DIR environment variable defined
+    BLSURFPLUGIN_DIR=$BLSURFPLUGIN_ROOT_DIR
 
-    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")
+  else
+
+    # search Salome binaries in PATH variable
+    AC_PATH_PROG(TEMP, libBLSURFEngine.so)
+    if test "x$TEMP" != "x" ; then
+      BLSURFPLUGIN_DIR=`dirname $TEMP`
     fi
+
+  fi
+
 fi
 
-AC_MSG_RESULT(for BLSURF mesh plugin: $BLSURFplugin_ok)
+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})
 
-AC_SUBST(BLSURFPLUGIN_ROOT_DIR)
-AC_SUBST(BLSURFPLUGIN_LDFLAGS)
-AC_SUBST(BLSURFPLUGIN_CXXFLAGS)
+  if test "x$BLSURFPLUGIN_ROOT_DIR" == "x" ; then
+    BLSURFPLUGIN_ROOT_DIR=${BLSURFPLUGIN_DIR}
+  fi
+  BLSURFPLUGIN_CXXFLAGS+=-I${BLSURFPLUGIN_ROOT_DIR}/include/salome
+  BLSURFPLUGIN_LDFLAGS+=-L${BLSURFPLUGIN_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+  AC_SUBST(BLSURFPLUGIN_ROOT_DIR)
+  AC_SUBST(BLSURFPLUGIN_LDFLAGS)
+  AC_SUBST(BLSURFPLUGIN_CXXFLAGS)
+else
+  AC_MSG_WARN("Cannot find compiled BLSURF mesh plugin distribution")
+fi
+  
+AC_MSG_RESULT(for BLSURF mesh plugin: $BLSURFplugin_ok)
  
 ])dnl
index 56185e37c8a6b94ee2c6de6dd28f3c3d1db16d9f..623dfe5a5f596047303a3b56019ba658403f2e02 100644 (file)
@@ -1,25 +1,34 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
 # ---
+# ============================================================
+# The following is to avoid PACKAGE_... env variable
+# redefinition compilation warnings
+# ============================================================
+#
+AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+
 # ============================================================
 # This file defines the common definitions used in several
 # Makefile. This file must be included, if needed, by the file
index 4af71442138f300620512ddc1969e476c1369457..24e249a5c3b0700452f4e00dc365ca6f3d0d09b7 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
index 8dc58d9c8fdbda22b2da422199ad0bd24a047ee9..b5c706466b25446d8b20664ea637990e36cf2175 100755 (executable)
@@ -1 +1,3 @@
-THIS IS SALOME - BLSURFPLUGIN VERSION: @VERSION@
+[SALOME BLSURFPLUGIN] : @VERSION@
+[DEVELOPMENT]         : @VERSION_DEV@
+[DESCRIPTION]         : DISTENE BLSurf meshing plug-in for SALOME Mesh module
diff --git a/build_cmake b/build_cmake
new file mode 100755 (executable)
index 0000000..2a9a278
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2007-2012  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
+#
+
+CURRENT_DIR=`pwd`
+CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+cd ${CONF_DIR}
+python $KERNEL_ROOT_DIR/salome_adm/cmake_files/am2cmake.py --blsurfplugin
+status=$?
+cd ${CURRENT_DIR}
+exit $status
diff --git a/build_cmake.bat b/build_cmake.bat
new file mode 100644 (file)
index 0000000..de8ae03
--- /dev/null
@@ -0,0 +1,20 @@
+@REM Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+@REM
+@REM This library is free software; you can redistribute it and/or
+@REM modify it under the terms of the GNU Lesser General Public
+@REM License as published by the Free Software Foundation; either
+@REM version 2.1 of the License.
+@REM
+@REM This library is distributed in the hope that it will be useful,
+@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+@REM Lesser General Public License for more details.
+@REM
+@REM You should have received a copy of the GNU Lesser General Public
+@REM License along with this library; if not, write to the Free Software
+@REM Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+@REM
+@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+@REM
+
+%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --blsurfplugin\r
index 0307b0e4dd4898773e75c8d807e4ba5b72293060..1b0e6de99742d3663baaa8c2fc725a3e934b8408 100755 (executable)
@@ -1,22 +1,23 @@
 #!/bin/bash
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
@@ -24,7 +25,6 @@
 #
 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
@@ -41,28 +41,6 @@ fi
 #    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 ${BLSURFPLUGIN_WITH_GUI} = yes; then
-    if test ! -d "${GUI_ROOT_DIR}"; then
-        echo "failed : GUI_ROOT_DIR variable is not correct !"
-        exit
-    fi
-fi
-
 ########################################################################
 # Test if the MED_ROOT_DIR is set correctly
 
@@ -91,40 +69,17 @@ cd ${CONF_DIR}
 ABS_CONF_DIR=`pwd`
 
 #######################################################################
-# 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
+# custom macro embedded in the directory adm_local/unix/config_files
 # and KERNEL config_files directory.
 # output:
 #   aclocal.m4
 #   autom4te.cache (directory)
-echo "====================================================== aclocal"
+echo "======================================================= aclocal"
 
-if test ${BLSURFPLUGIN_WITH_GUI} = yes; then
+if test -d "${GUI_ROOT_DIR}"; 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 \
@@ -145,10 +100,10 @@ fi
 # version. The files are created in the directory specified with the
 # AC_CONFIG_AUX_DIR(<mydir>) 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"
+#   adm_local/unix/config_files/config.guess
+#   adm_local/unix/config_files/config.sub
+#   adm_local/unix/config_files/ltmain.sh
+echo "==================================================== libtoolize"
 
 libtoolize --force --copy --automake || exit 1
 
@@ -168,11 +123,11 @@ autoconf
 # AC_CONFIG_AUX_DIR(<mydir>) 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
+#   adm_local/unix/config_files/compile
+#   adm_local/unix/config_files/depcomp
+#   adm_local/unix/config_files/install-sh
+#   adm_local/unix/config_files/missing
+#   adm_local/unix/config_files/py-compile
 #   Makefile.in (from Makefile.am)
 echo "====================================================== automake"
 
index 8f003668b298e183291e6c87c9d5eaec98d5581e..d1179266f5fc59220badc18c778700c903d55889 100755 (executable)
@@ -1,22 +1,23 @@
 #!/bin/bash
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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 . -name Makefile.in | xargs rm -f
+( cd adm_local/unix/config_files && rm -f config.* depcomp install-sh l*.m4 ltmain.sh missing py-compile )
 
-# ... 
-
-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
index 57c3fd7025a96a64f1ea44096058fefb28fb9952..a8d2a7e91a910283afb032a9bc0688f12c872e21 100644 (file)
@@ -1,35 +1,38 @@
 #!/bin/bash
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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_INIT([Salome2 Project BLSURFPLUGIN module], [6.5.0], [webmaster.salome@opencascade.com], [SalomeBLSURFPLUGIN])
+AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([-Wno-portability])
 
 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
 AC_SUBST(XVERSION)
+VERSION_DEV=1
+AC_SUBST(VERSION_DEV)
 
 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
 MODULE_NAME=blsurfplugin
@@ -71,6 +74,7 @@ echo
 
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
+AC_LOCAL_INSTALL
 dnl 
 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
 
@@ -92,7 +96,7 @@ 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
+      INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
       ;;
 esac
 
@@ -152,7 +156,15 @@ dnl testing MPICH
 dnl ---------------------------------------------
 dnl
 
-CHECK_MPICH
+dnl CHECK_MPICH
+
+echo
+echo ---------------------------------------------
+echo testing MPI
+echo ---------------------------------------------
+echo
+
+CHECK_MPI
 
 echo
 echo ---------------------------------------------
@@ -228,11 +240,34 @@ AC_SUBST_FILE(CORBA)
 corba=make_$ORB
 CORBA=adm_local/unix/$corba
 
-BLSURFPLUGIN_WITH_GUI=yes
+echo
+echo ---------------------------------------------
+echo Testing GUI
+echo ---------------------------------------------
+echo
 
-AM_CONDITIONAL(BLSURFPLUGIN_ENABLE_GUI, [test "${BLSURFPLUGIN_WITH_GUI}" = "yes"])
+CHECK_GUI_MODULE
 
-if test "${BLSURFPLUGIN_WITH_GUI}" = "yes"; then
+gui_ok=no
+if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
+  gui_ok=yes
+fi
+
+AM_CONDITIONAL(BLSURFPLUGIN_ENABLE_GUI, [test "${gui_ok}" = "yes"])
+
+if test "${SalomeGUI_need}" == "yes"; then
+  if test "${FullGUI_ok}" != "yes"; then
+    AC_MSG_WARN(For configure BLSURFPLUGIN module necessary full GUI!)
+  fi
+elif test "${SalomeGUI_need}" == "auto"; then
+  if test "${FullGUI_ok}" != "yes"; then
+    AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
+  fi
+elif test "${SalomeGUI_need}" == "no"; then
+  echo Build without GUI option has been chosen
+fi
+
+if test "${gui_ok}" = "yes"; then
     echo
     echo ---------------------------------------------
     echo testing openGL
@@ -248,35 +283,15 @@ if test "${BLSURFPLUGIN_WITH_GUI}" = "yes"; then
     echo
 
     CHECK_QT
+fi
 
-    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
+echo
+echo ---------------------------------------------
+echo testing VTK
+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
+CHECK_VTK
 
 echo
 echo ---------------------------------------------
@@ -351,11 +366,13 @@ 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"
+
+if test "${gui_ok}" = "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 gui_ok BLSURF_ok"
+elif test "${SalomeGUI_need}" != "no"; then
+  variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok SMesh_ok gui_ok BLSURF_ok"
+else
+  variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_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
@@ -376,6 +393,9 @@ else
    AC_SUBST(SETX) SETX="set -x"
 fi
 
+dnl Build with SMESH cancel compute feature
+AC_DEFINE(WITH_SMESH_CANCEL_COMPUTE)
+
 dnl copy shells and utilities contained in the bin directory
 dnl excluding .in files (treated in AC-OUTPUT below) and CVS
 dnl directory
@@ -391,22 +411,43 @@ echo
 #  chmod +x ./bin/salome/*;
 #])
 
+AC_HACK_LIBTOOL
+AC_CONFIG_COMMANDS([hack_libtool],[
+sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
+  $(pwd)/hack_libtool \1 \"\$[@]\" \n\
+}\n\
+CC=\"hack_libtool\"%g" libtool
+sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
+sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
+sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1  if ! test -d \$sss; then continue; fi\n\1  ssss=\$(cd \$sss; pwd)\n\1  if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1    case \$ssss in\n\1      /usr/lib | /usr/lib64 ) ;;\n\1      * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1    esac\n\1  fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
+],[])
+
 # This list is initiated using autoscan and must be updated manually
 # when adding a new file <filename>.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 \
+  adm_local/Makefile \
+  adm_local/unix/Makefile \
+  adm_local/unix/config_files/Makefile \
+  adm_local/cmake_files/Makefile \
+  doc/Makefile \
+  doc/salome/Makefile \
+  doc/salome/gui/Makefile \
+  doc/salome/gui/BLSURFPLUGIN/Makefile \
+  doc/salome/gui/BLSURFPLUGIN/doxyfile \
+  doc/salome/gui/BLSURFPLUGIN/doxyfile_py \
+  doc/salome/gui/BLSURFPLUGIN/static/header.html \
+  doc/salome/gui/BLSURFPLUGIN/static/header_py.html \
+  doc/salome/tui/Makefile \
+  doc/salome/tui/doxyfile \
+  bin/VERSION \
+  bin/Makefile \
+  idl/Makefile \
+  resources/Makefile \
+  src/Makefile \
+  src/BLSURFPlugin/Makefile \
+  src/GUI/Makefile \
+  BLSURFPLUGIN_version.h \
   Makefile \
 ])
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644 (file)
index 0000000..7c206a5
--- /dev/null
@@ -0,0 +1,32 @@
+# Copyright (C) 2007-2012  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
+#
+
+# -* Makefile *- 
+# Author : Patrick GOLDBRONN (CEA)
+# Date : 30/11/2001
+#
+SUBDIRS = salome
+
+usr_docs:
+       (cd salome && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
+
+docs: usr_docs
+
+dev_docs:
+       (cd salome && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
diff --git a/doc/salome/Makefile.am b/doc/salome/Makefile.am
new file mode 100644 (file)
index 0000000..f5de046
--- /dev/null
@@ -0,0 +1,38 @@
+# Copyright (C) 2007-2012  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
+#
+
+# -* Makefile *- 
+# Author : Patrick GOLDBRONN (CEA)
+# Date : 30/11/2001
+#
+SUBDIRS = tui gui
+SUBDIRSTUI = tui
+SUBDIRSGUI = gui
+
+usr_docs:
+       @@SETX@; for d in $(SUBDIRSGUI); do     \
+          (cd $$d && $(MAKE) $@) || exit 1;    \
+       done;
+
+docs: usr_docs
+
+dev_docs:
+       @@SETX@; for d in $(SUBDIRSTUI); do     \
+          (cd $$d && $(MAKE) $@) || exit 1;    \
+       done;
diff --git a/doc/salome/gui/BLSURFPLUGIN/Makefile.am b/doc/salome/gui/BLSURFPLUGIN/Makefile.am
new file mode 100644 (file)
index 0000000..1746a98
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright (C) 2007-2012  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.in
+#  Author : Vasily Rusyaev (Open Cascade NN)
+#  Module : doc
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+EXTRA_DIST += images input static/footer.html static/doxygen.css
+
+guidocdir = $(docdir)/gui/BLSURFPLUGIN
+guidoc_DATA = images/head.png
+
+
+usr_docs: doxyfile
+       echo "===========================================" ;                    \
+       echo "Generating Python interface documentation";                       \
+       echo "===========================================" ;                    \
+       $(DOXYGEN) doxyfile_py                                                  \
+       echo "===========================================" ;                    \
+       echo "Generating GUI documentation" ;                                   \
+       echo "===========================================" ;                    \
+       $(DOXYGEN) doxyfile ;
+
+docs: usr_docs
+
+clean-local:
+       @for filen in `find . -maxdepth 1` ; do                 \
+         case $${filen} in                                     \
+           ./Makefile | ./doxyfile | ./doxyfile_py ) ;;        \
+           . | .. | ./static ) ;;                              \
+           *) echo "Removing $${filen}" ; rm -rf $${filen} ;;  \
+         esac ;                                                \
+       done ;
+
+install-data-local: usr_docs
+       $(INSTALL) -d $(DESTDIR)$(docdir)/gui/BLSURFPLUGIN
+       @for filen in `find . -maxdepth 1` ; do                                                 \
+         case $${filen} in                                                                     \
+           ./Makefile | ./doxyfile | ./doxyfile_py ) ;;                                        \
+           ./doxyfile.bak | ./doxyfile_py.bak ) ;;                                             \
+           . | .. | ./static ) ;;                                                              \
+           *) echo "Installing $${filen}" ; cp -rp $${filen} $(DESTDIR)$(docdir)/gui/BLSURFPLUGIN ;;   \
+         esac ;                                                                                \
+       done ;
+       cp -rp $(srcdir)/images/head.png $(DESTDIR)$(docdir)/gui/BLSURFPLUGIN/blsurfpluginpy_doc/ ;
+
+uninstall-local:
+       rm -rf $(DESTDIR)$(docdir)/gui/BLSURFPLUGIN
\ No newline at end of file
diff --git a/doc/salome/gui/BLSURFPLUGIN/doxyfile.in b/doc/salome/gui/BLSURFPLUGIN/doxyfile.in
new file mode 100755 (executable)
index 0000000..1a8f9a5
--- /dev/null
@@ -0,0 +1,72 @@
+# Copyright (C) 2007-2012  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
+#
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME      = "BLSURFPLUGIN Module Reference Manual v.@VERSION@"
+OUTPUT_DIRECTORY  = .
+CREATE_SUBDIRS   = NO
+OUTPUT_LANGUAGE   = English
+TAB_SIZE          = 5
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET             = NO
+WARNINGS          = YES
+
+#---------------------------------------------------------------------------
+#Input related options
+#---------------------------------------------------------------------------
+INPUT             = @srcdir@/input
+FILE_PATTERNS     = *.doc
+IMAGE_PATH        = @srcdir@/images
+
+#---------------------------------------------------------------------------
+#HTML related options
+#---------------------------------------------------------------------------
+GENERATE_HTML     = YES
+HTML_OUTPUT       = .
+HTML_HEADER       = @builddir@/static/header.html
+HTML_FOOTER       = @srcdir@/static/footer.html
+HTML_STYLESHEET  = @srcdir@/static/doxygen.css
+TOC_EXPAND        = YES
+DISABLE_INDEX     = NO
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH    = 300
+
+#---------------------------------------------------------------------------
+#LaTeX related option
+#---------------------------------------------------------------------------
+GENERATE_LATEX    = NO
+
+#---------------------------------------------------------------------------
+#RTF related options
+#---------------------------------------------------------------------------
+GENERATE_RTF      = NO
+
+#---------------------------------------------------------------------------
+#External reference options
+#---------------------------------------------------------------------------
+
+#rnv: 07.04.2011 Workaround for the doxygen 1.7.3:
+#because it wrongly defines location of the html files for search.
+TAGFILES          = blsurfpluginpy_doc.tag=../BLSURFPLUGIN/blsurfpluginpy_doc
+SEARCHENGINE      = YES
\ No newline at end of file
diff --git a/doc/salome/gui/BLSURFPLUGIN/doxyfile_py.in b/doc/salome/gui/BLSURFPLUGIN/doxyfile_py.in
new file mode 100755 (executable)
index 0000000..68057ba
--- /dev/null
@@ -0,0 +1,159 @@
+# Copyright (C) 2007-2012  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
+#
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "SALOME BLSURFPLUGIN User's Guide"
+OUTPUT_DIRECTORY       = .
+CREATE_SUBDIRS        = NO
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ALWAYS_DETAILED_SEC    = YES
+INLINE_INHERITED_MEMB  = YES
+FULL_PATH_NAMES        = NO
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 5
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = YES
+BUILTIN_STL_SUPPORT    = NO
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = NO
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = YES
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = NO
+SORT_BRIEF_DOCS        = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+MAX_INITIALIZER_LINES  = 25
+SHOW_USED_FILES        = NO
+SHOW_DIRECTORIES       = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+EXCLUDE_SYMLINKS       = NO
+EXAMPLE_RECURSIVE      = NO
+
+#---------------------------------------------------------------------------
+#Input related options
+#---------------------------------------------------------------------------
+INPUT             = @top_srcdir@/src/BLSURFPlugin/BLSURFPluginDC.py
+FILE_PATTERNS     = 
+IMAGE_PATH        = @srcdir@/images
+RECURSIVE         = NO
+EXAMPLE_PATH      =
+
+#---------------------------------------------------------------------------
+#HTML related options
+#---------------------------------------------------------------------------
+GENERATE_HTML     = YES
+HTML_OUTPUT       = blsurfpluginpy_doc
+HTML_HEADER       = @builddir@/static/header_py.html
+HTML_FOOTER       = @srcdir@/static/footer.html
+HTML_STYLESHEET   = @srcdir@/static/doxygen.css
+TOC_EXPAND        = YES
+DISABLE_INDEX     = NO
+GENERATE_TREEVIEW = NO
+
+#---------------------------------------------------------------------------
+#LaTeX related option
+#---------------------------------------------------------------------------
+GENERATE_LATEX    = NO
+
+#---------------------------------------------------------------------------
+#RTF related options
+#---------------------------------------------------------------------------
+GENERATE_RTF      = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = NO
+HIDE_UNDOC_RELATIONS   = NO
+HAVE_DOT               = NO
+CLASS_GRAPH            = NO
+COLLABORATION_GRAPH    = NO
+GROUP_GRAPHS           = NO
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = NO
+INCLUDED_BY_GRAPH      = NO
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = NO
+DIRECTORY_GRAPH        = NO
+DOT_IMAGE_FORMAT       = jpg
+DOT_FONTNAME           = Arial
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1200
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = NO
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+#External reference options
+#---------------------------------------------------------------------------
+GENERATE_TAGFILE  = blsurfpluginpy_doc.tag
+SEARCHENGINE           = YES
\ No newline at end of file
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_attractors.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_attractors.png
new file mode 100644 (file)
index 0000000..a0e0276
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_attractors.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_attractors2.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_attractors2.png
new file mode 100644 (file)
index 0000000..09dc129
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_attractors2.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_const_size_near_shape.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_const_size_near_shape.png
new file mode 100644 (file)
index 0000000..9e5ad6c
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_const_size_near_shape.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_const_size_near_shape2.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_const_size_near_shape2.png
new file mode 100644 (file)
index 0000000..68620f3
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_const_size_near_shape2.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png
new file mode 100644 (file)
index 0000000..4da8a9e
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_advanced.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_advanced.png
new file mode 100644 (file)
index 0000000..4fadb6b
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_advanced.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_enforced_vertices.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_enforced_vertices.png
new file mode 100644 (file)
index 0000000..4a76b1a
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_enforced_vertices.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap.png
new file mode 100644 (file)
index 0000000..2b38197
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap1.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap1.png
new file mode 100644 (file)
index 0000000..4ae88c8
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap1.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap2.png b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap2.png
new file mode 100644 (file)
index 0000000..e5e000d
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/blsurf_parameters_sizemap2.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/images/head.png b/doc/salome/gui/BLSURFPLUGIN/images/head.png
new file mode 100755 (executable)
index 0000000..307d9ef
Binary files /dev/null and b/doc/salome/gui/BLSURFPLUGIN/images/head.png differ
diff --git a/doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc b/doc/salome/gui/BLSURFPLUGIN/input/blsurf_hypo.doc
new file mode 100644 (file)
index 0000000..1964dbe
--- /dev/null
@@ -0,0 +1,458 @@
+/*!
+
+\page blsurf_hypo_page BLSURF Parameters hypothesis
+
+\anchor blsurf_top
+BLSURF Parameters hypothesis works only with \b DISTENE \b BLSurf 2d
+algorithm. This algorithm is a commercial software. To obtain a
+licence, visit http://www.distene.com/corp/eval-distene.html 
+
+\tableofcontents                                            
+
+\section blsurf_general_parameters General parameters
+
+\image html blsurf_parameters.png
+
+- <b>Name</b> - allows defining the name of the hypothesis (BLSURF
+Parameters_n by default).
+
+- <b>Physical Mesh</b> - can be set to <em>None</em>, <em>Custom</em>
+  or <em>Size Map</em>
+
+  - if set to <em>Custom</em>, allows user input in the in <b>User size</b>,
+  <b>Max Physical Size</b> and <b>Min Physical  Size</b> fields.
+
+  - if set to <em>Size Map</em>, behaves like <em>Custom</em> mode and takes into
+  account the custom elements sizes given in the Size Map tab.
+
+- <b>User size</b> - defines the size of the generated mesh elements.
+
+- <b>Max Physical Size</b> - defines the upper limit of mesh element size.
+
+- <b>Min Physical Size</b> - defines the lower limit of mesh element size.
+
+- <b>Geometrical mesh</b> - if set to <em>Custom</em>, allows user input in
+<b>Angle Mesh S</b>, <b>Angle Mesh C</b> and <b>Gradation</b>
+fields. These fields control computation of the element size, so
+called <i>geometrical size</i>, conform to the surface geometry
+considering local curvatures. If both the <b>User size</b> and the
+<i>geometrical size</i> are defined, the  eventual element size
+corresponds to the least of the two.
+
+- <b>Angle Mesh S</b> - maximum angle between the mesh face and the
+tangent to the geometrical surface at each mesh node, in degrees.
+
+- <b>Angle Mesh C</b> - maximum angle between the mesh edge and the
+tangent to the geometrical curve at each mesh node, in degrees.
+
+- <b>Max Geometrical Size</b> - defines the upper limit of the
+  <i>geometrical size</i>.
+
+- <b>Min Geometrical Size</b> - defines the lower limit of the
+  <i>geometrical size</i>.
+
+- <b>Gradation</b> - maximum ratio between the lengths of two adjacent
+  edges.
+
+- <b>Allow Quadrangles</b> - if checked, allows the creation of
+  quadrilateral elements.
+
+- <b>Patch independent</b> - if checked, geometrical edges are not
+respected and all geometrical faces are meshed as one hyper-face.
+
+\ref blsurf_top "Back to top"
+
+\section blsurf_advanced_parameters Advanced parameters
+
+The notion of <i>diag</i> used in the descriptions means the diagonal
+of the bounding box of the geometrical object to mesh.
+
+\image html blsurf_parameters_advanced.png
+
+- <b>Verbosity level</b> - defines the percentage of "verbosity" of
+BLSURF [0-100].
+
+- <b>Topology</b> - allows creation of a conform mesh on a shell of
+not sewed faces. The following choices are allowed:
+
+  - <em>"From CAD"</em> means that mesh conformity is assured by conformity
+  of a shape.
+
+  - <em>"Pre-process"</em> and <em>"Pre-process++"</em> allow the BLSURF software to
+  pre-process the geometrical model to eventually produce a conform
+  mesh.
+
+  - <em>"PreCAD"</em> is an auxiliary CAD pre-processing module which has 
+  two main goals:
+
+    - Complete missing or inadequate CAD descriptions.
+
+    - Perform topology reconstruction and specific geometry 
+    enhancement for mesh generation.
+
+    \n This module requires a specific licence. The following PreCAD
+    options are the most significant and important ones:
+
+    - <b>Merge Edges</b> - allows PreCAD to optimize the geometry by merging some
+    edges. This option is 0 by default.
+
+    - <b>Remove nano edges</b> - allows PreCAD to optimize the geometry by removing 
+    the nano edges whenever possible. This option is 0 by default.
+
+    - <b>Nano edge length</b> - gives the length below which an edge is considered as nano 
+    for the topology processing. See also the \b remove_nano_edges option. If unset, PreCAD
+    default value is \f$\mathrm{diag} \times 10^{-5}\f$.
+
+    - <b>Discard input topology</b> - computes the CAD topology from scratch, 
+    without considering the topological information contained in the original CAD
+    (useful for iges files). This option is 0 by default.
+
+- <b>ExportGMF</b> - saves the computed mesh into a GMF file (.mesh or .meshb).
+
+- <b>Add option</b> - provides the choice of multiple PreCAD and BLSURF 
+advanced options, which appear, if selected, in a table where it is 
+possible to input the value of the option and edit it later.
+
+- <b>Clear option</b> - removes the option selected in the table.
+
+The following BLSURF options are commonly usable:
+
+- \b topo_eps1 (real) - is the tolerance level inside a CAD
+patch. By default is equal to \f$\mathrm{diag} \times 10^{-4}\f$. This tolerance is used to
+identify nodes to merge within one geometrical face when \b Topology
+option is to pre-process.
+
+- \b topo_eps2 (real) - is the tolerance level between two CAD
+patches. By default is equal to \f$\mathrm{diag} \times 10^{-4}\f$. This tolerance is used to
+identify nodes to merge over different geometrical faces when
+\b Topology option is to pre-process.
+
+- \b LSS (real) - is an abbreviation for "length of sub-segment". It is
+a maximal allowed length of a mesh edge. Default is \f$0.5\f$.
+
+- \b frontal (integer)
+
+  - 1 - the mesh generator inserts points with an advancing front method.
+
+  -  0 - it inserts them with an algebraic method (on internal edges). This method is
+  slightly faster but generates less regular meshes.
+
+  \n Default is 0.
+
+- \anchor blsurf_hinterpol_flag \b hinterpol_flag (integer) - determines the computation of an
+interpolated value <i>v</i> between two points <i>P1</i> and <i>P2</i> on a
+curve. Let <i>h1</i> be the value at point <i>P1,</i> <i>h2</i> be the value at point
+<i>P2,</i> and <i>t</i> be a parameter varying from 0 to 1 when moving from <i>P1
+to</i> <i>P2</i>.
+
+  - 0 - the interpolation is linear: \f$v = h1 + t (h2 - h1 )\f$
+
+  - 1 - the interpolation is geometric: \f$v = h1 \times \left( \frac{h1}{h2} \right)^{t}\f$
+
+  - 2 - the interpolation is sinusoidal: \f$v = \frac{h1+h2}{2} + \frac{h1-h2}{2 \cdot \cos(\pi \cdot t)}\f$
+
+  \n Default is 0.
+
+- \anchor blsurf_hmean_flag \b hmean_flag (integer) - determines the computation of the average of several
+values:
+
+  - -1 - the minimum is computed.
+
+  - 0 or 2 - the arithmetic average is computed.
+
+  - 1 - the geometric average is computed.
+
+  \n Default is 0.
+
+- \b CheckAdjacentEdges, \b CheckCloseEdges and \b CheckWellDefined
+(integers) - give the number of calls of equally named subroutines the
+purpose of which is to improve the mesh of domains having narrow
+parts. At each iteration,\b CheckCloseEdges decreases the sizes of the
+edges when two boundary curves are neighboring,\b CheckAdjacentEdges
+balances the sizes of adjacent edges, and \b CheckWellDefined checks if
+the parametric domain is well defined. Default values are 0.
+
+- \b CoefRectangle (real)- defines the relative thickness of the rectangles
+used by subroutine \b CheckCloseEdges (see above). Default is 0.25.
+
+- \b eps_collapse (real) - if more than 0.0, BLSURF removes
+curves whose lengths are less than \b eps_collapse. To obtain an
+approximate value of the length of a curve, it is arbitrarily
+split into 20 edges. Default is 0.0.
+
+- \b eps_ends (real) - is used to detect the curves whose lengths are very
+small, that sometimes constitutes an error. A message is printed
+if \f$\left|P2-P1\right| < eps\_ends\f$, where <i>P1</i> and <i>P2</i> are the
+extremities of a curve. Default is \f$\frac{\mathrm{diag}}{500.0}\f$.
+
+- \b prefix (char) - is a prefix of the files generated by
+BLSURF. Default is "x".
+
+- \b refs (integer) - reference of a surface, used when exporting
+files. Default is 1.
+
+The following PreCAD options are commonly usable. 
+
+- \b closed_geometry (int) - describes whether the working geometry 
+should be closed or not. When activated, this option helps PreCAD to process 
+the dirtiest geometries. By default this option is 0.
+
+- \b debug (int) - If debug = 1 PreCAD will be very verbose and will output 
+some intermediate files in the working directory. By default this
+option is 0.
+
+- \b eps_nano_relative (real) -  the same as \b eps_nano, but relatively to 
+the diagonal of the box bounding the geometry. By default this option is \f$10^{-5}\f$.
+
+- \b eps_sewing (real) - tolerance of the assembly. It rarely requires to be tuned. 
+By default this option is \f$\mathrm{diag} \times 5 \cdot 10^{-4}\f$.
+
+- \b eps_sewing_relative (real) -  the same as \b eps_nano but relatively to 
+the diagonal of the box bounding the geometry. By default this option
+is \f$5 \cdot 10^{-4}\f$.
+
+- \b manifold_geometry (int) - describes whether the working geometry should be manifold or not.
+When activated, this option helps PreCAD to process the dirtiest
+geometries. By default this option is 0.
+
+- \b create_tag_collision (int) - creates new tags from original ones in case 
+of collision (entity merge or association for example). By default
+this option is 0.
+
+- \b periodic_tolerance (real) - defines the maximum distance error accepted between 
+two sets of periodic entities. By default this option is \f$\mathrm{diag} \times 10^{-5}\f$.
+
+- \b periodic_tolerance_relative (real) -  the same as \b periodic_tolerance but in a relative unit.
+By default this option is \f$10^{-5}\f$.
+
+- \b periodic_split_tolerance (real) - This periodicity processing related option defines 
+the minimum distance between a CAD point and an imprinted point. It allows to indirectly 
+control the number of created points and small edges. By default this
+option is \f$\mathrm{diag} \times 10^{-4}\f$.
+
+- \b periodic_split_tolerance_relative (real -  the same as \b
+periodic_split_tolerance but in a relative unit. By default this
+option is \f$10^{-4}\f$.
+
+The following advanced options are not documented and you can use them
+at your own risk.
+
+- Integer variables:
+  - addsurf_ivertex
+  - anisotropic
+  - background
+  - coiter
+  - communication
+  - decim
+  - export_flag
+  - file_h
+  - gridnu
+  - gridnv
+  - intermedfile
+  - memory
+  - normals
+  - optim
+  - pardom_flag
+  - pinch
+  - rigid
+  - surforient
+  - tconf
+  - topo_collapse
+- Real variables:
+  - addsurf_angle
+  - addsurf_R
+  - addsurf_H
+  - addsurf_FG
+  - addsurf_r
+  - addsurf_PA
+  - angle_compcurv
+  - angle_ridge
+  - anisotropic_ratio
+  - eps_pardom
+- String variables:
+  - export_format
+  - export_option
+  - import_option
+
+\ref blsurf_top "Back to top"
+
+\section blsurf_local_size Local size
+
+Local sizes can be defined on faces, edges or vertices:
+
+- The faces, edges and vertices can belong to the meshed geometrical
+object or to its sub-shapes (created using <b>Explode</b> command).
+
+- Groups of faces, edges and vertices are also handled.
+
+- It is possible to attribute the same size to several geometries using multi-selection.
+
+- The sizes are constant values or python functions.
+
+- In case of a python function, the following rules must be respected:
+
+  - The name of the function is f.
+
+  - If geometry is a face or a group of faces, the function is f(u,v).
+
+  - If geometry is an edge or a group of edges, the function is f(t).
+
+  - If geometry is a vertex or a group of vertices, the function is f().
+
+  - The function must return a double.
+
+3 different types of size maps can be defined:
+
+-# \ref blsurf_sizemap_computation "Computation of the physical size"
+-# \ref blsurf_attractor "Advanced maps"
+-# \ref blsurf_attractor_computation "Computation of attractors"
+
+\ref blsurf_top "Back to top"
+
+\subsection blsurf_sizemap_computation Computation of the physical size
+
+\image html blsurf_parameters_sizemap1.png 
+
+The physical size is obtained by querying sizemap functions associated
+to the input CAD object for surfaces, curves and points.
+Each function can either return a value h (which is then trimmed
+between the two bounds hphymin and hphymax), or "no answer" (by not
+assigning a value to h), thus providing great flexibility in the
+specification of the sizes. The computation depends on whether point P
+is internal to a surface, internal to a curve, or at the end of
+several curves:
+
+- If point P is internal to a surface, the CAD surface size function
+is queried. If no answer is returned, one interpolates with the values
+at the vertices of the discretized interface curves.
+
+- If point P is internal to a curve, the CAD curve size function is
+queried first. If no answer is returned, the surface size function is
+queried for every adjacent surface and the mean value of the returned
+values is computed. If no answer is returned, sizes h1 and h2 at both
+ends of the curve are considered (see next item) and the interpolated
+value is computed.
+
+- If point P is at the extremity of several curves, the CAD point size
+function is queried first. If no answer is returned, the curve size
+function is queried for every adjacent curve and the mean value of the
+returned values is computed. If no answer is returned, the surface
+size function is queried for every adjacent surface and the mean value
+of the returned values is computed. If there is still no answer
+returned, the default value hphydef is kept.
+
+In order to compute the mean of several values, the arithmetic mean is
+used by default, but this can be modified by the parameter
+\ref blsurf_hmean_flag "hmean flag". In the same way, in order to
+interpolate two values, a linear interpolation is used by default, but
+this can be modified by \ref blsurf_hinterpol_flag "hinterpol flag". 
+
+\ref blsurf_local_size "Back to \"Local size\""\n
+\ref blsurf_top "Back to top"
+
+\subsection blsurf_attractor Advanced maps
+
+\image html blsurf_parameters_sizemap2.png 
+
+More specific size maps can be defined on faces. 
+
+- <i> Attractors </i> allow to define the size of the mesh elements
+on a face so that the mesh is the finest on the attractor shape and
+becomes coarser when getting far from this shape.
+
+  - The selected attractor can be a Vertex, an Edge, a Wire or a
+  Compound mixing several entities of those types.
+
+  - The attractor doesn't have to be a sub-shape of the shape to mesh.
+
+  - The size will grow exponentially (see the formula below) but is
+  bounded by gradation, \n so if you want the formula to be strictly
+  respected, you should set the <i>gradation</i> 
+  to its maximum (2.5) in the <i>arguments</i> tab. 
+
+- Furthermore you can choose to <i> keep the size constant </i>
+until a certain distance from a shape. This option can be combined or
+not with an <i>attractor</i> size map described above. 
+
+  - If the two options are combined the size will remain constant
+  until the distance specified in "constant over" and grow then as
+  prescribed by the attractor function.
+
+  - Else the growing is only controled by the standard arguments of
+  BLSURF (gradation ...).
+
+\image html blsurf_const_size_near_shape2.png "Example of size map with constant size option, the size is kept constant on the left side of the surface until a certain distance"
+
+\note The validation of the hypothesis might take a few seconds if
+attractors are defined or the "constant size" option is used because a
+map of distances has to be built on the whole surface for each face
+where such a hypothesis has been defined.
+
+\sa Sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including size map.
+
+\ref blsurf_local_size "Back to \"Local size\""\n
+\ref blsurf_top "Back to top"
+
+\subsection blsurf_attractor_computation Computation of attractors
+
+The size grows exponentially following the equation : 
+\f$h(d) = \mathrm{User Size} + (\mathrm{h\_start} - \mathrm{User Size}) \times e ^ { - \left( \frac{d}{R} \right) ^ {2} }\f$
+
+Where :
+
+- h_start is the desired size on the given attractor shape
+
+- d is the distance of the current point from the attractor
+shape. The distance is the geodesic distance (i.e. calculated by following the surface to be meshed)
+
+- R is called the distance of influence and allows controlling the growth rate of the mesh
+
+\image html blsurf_attractors2.png "Example of mesh created using attractors, the attractors here are the side edges and the size grows from the side of the surface towards the apex"
+
+\ref blsurf_local_size "Back to \"Local size\""\n
+\ref blsurf_top "Back to top"
+
+\section blsurf_enforced_elements Enforced vertices
+
+\image html blsurf_parameters_enforced_vertices.png
+
+It is possible to define some enforced vertices to BLSurf algorithm.
+An enforced vertex is defined on a Face or a Compound by
+
+- selecting an existing Vertex or Compound,
+
+- or creating a new vertex given its coordinates.
+
+The enforced vertex is the projection of a point defined by its
+(x,y,z) coordinates on the selected face.
+
+- It is possible to define several enforced vertices on a face or a group of faces.
+
+- If the projected point is on the boundary or outside of the face, it will be ignored.
+
+- If a group name is specified, the enforced nodes will be added in the group. If the group does not exist it will be created.
+
+\sa Sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including enforced vertices.
+
+\ref blsurf_top "Back to top"
+
+\section blsurf_limitations Limitations
+
+Currently BLSURF plugin has the following limitations.
+
+- BLSURF algorithm cannot be used as a local algorithm (on
+sub-meshes) or as a provider of a low-level
+mesh for some 3D algorithms, because the BLSURF mesher (and
+consequently plugin) does not provide the information on node
+parameters on edges (U) and faces (U,V). For example the
+following combinations of algorithms are impossible:
+
+  - global MEFISTO or Quadrangle(mapping) + local BLSURF;
+
+  - BLSURF + Projection 2D from faces meshed by BLSURF;
+
+  - local BLSURF + Extrusion 3D;
+  
+\ref blsurf_top "Back to top"
+
+*/
diff --git a/doc/salome/gui/BLSURFPLUGIN/input/blsurfplugin_python_interface.doc b/doc/salome/gui/BLSURFPLUGIN/input/blsurfplugin_python_interface.doc
new file mode 100644 (file)
index 0000000..0d3efc1
--- /dev/null
@@ -0,0 +1,159 @@
+/*!
+
+\page blsurfplugin_python_interface_page Python Interface
+
+Python package \ref BLSURFPluginDC "BLSURFPlugin" defines several classes, destined for creation of the 2D meshes.
+
+Documentation for BLSURFPlugin package is available in linear form grouped by classes, declared in the BLSURFPluginDC.py file.
+
+Below you can see an example of usage of the BLSURFPlugin package for mesh generation:
+
+\anchor tui_blsurf
+
+\section blsurf_construct_mesh Construction of Mesh using BLSurf algorithm
+
+\subsection blsurf_construct_mesh_basic_hypo Basic hypothesis
+\code
+import geompy
+import smesh
+import BLSURFPlugin
+
+# create a box
+box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
+geompy.addToStudy(box, "box")
+
+# get sub-shapes
+Face_1   = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0]
+Edge_1   = geompy.SubShapeAllSorted(box, geompy.ShapeType["EDGE"])[0]
+Vertex_1 = geompy.SubShapeAllSorted(box, geompy.ShapeType["VERTEX"])[0]
+
+Face_2   = geompy.SubShapeAllSorted(box,    geompy.ShapeType["FACE"])[5]
+Wire_1   = geompy.SubShapeAllSorted(Face_2, geompy.ShapeType["WIRE"])[0]
+
+# Geom object with sizemaps can be unpublished in study.
+# They will then be automatically published.
+geompy.addToStudyInFather(box,Face_1, "Face_1")
+geompy.addToStudyInFather(box,Edge_1, "Edge_1")
+geompy.addToStudyInFather(box,Vertex_1, "Vertex_1")
+
+geompy.addToStudyInFather(box   ,Face_2, "Face_2")
+geompy.addToStudyInFather(Face_2,Wire_1, "Wire_1")
+
+# create a mesh on the box
+blsurfMesh = smesh.Mesh(box,"box: BLSurf mesh")
+
+# create a BLSurf algorithm for faces
+algo2d = blsurfMesh.Triangle(algo=smesh.BLSURF)
+
+# End of script
+\endcode
+
+\subsection blsurf_construct_mesh_sizemaps Adding sizemaps
+\code
+# optional - set physical mesh to 2 = Size Map
+algo2d.SetPhysicalMesh( 2 )
+
+# optional - set global mesh size
+algo2d.SetPhySize( 34.641 )
+
+# set size on Face_1
+algo2d.SetSizeMap(Face_1, 'def f(u,v): return 10' )
+# set size on Edge_1
+algo2d.SetSizeMap(Edge_1, 'def f(t): return 5' )
+# set size on Vertex_1
+algo2d.SetSizeMap(Vertex_1, 'def f(): return 2' )
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# End of script
+\endcode
+
+\subsection blsurf_construct_mesh_enforced_vertices Adding enforced vertices
+\code
+# Add enforced vertex for Face_1 on (50, 50, 50)
+# The projection coordinates will be (50, 50, 0)
+algo2d.SetEnforcedVertex(Face_1, 50, 50, 50)
+
+# Add another enforced vertex on (150, 150, 150)
+algo2d.SetEnforcedVertex(Face_1, 150, 150, 150)
+
+# Retrieve and print the list of enforced vertices defines on Face_1
+enfList = algo2d.GetEnforcedVertices(Face_1)
+print "List of enforced vertices for Face_1: "
+print enfList
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# Remove an enforced vertex and print the list
+algo2d.UnsetEnforcedVertex(Face_1, 50, 50, 50)
+enfList = algo2d.GetEnforcedVertices(Face_1)
+print "List of enforced vertices for Face_1: "
+print enfList
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# Remove all enforced vertices defined on Face_1
+algo2d.UnsetEnforcedVertices(Face_1)
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# End of script
+\endcode
+
+\subsection blsurf_construct_mesh_attractor Adding an attractor
+\code
+# Add an attractor on Face_2, which shape is Wire_1
+
+# The size on Wire_1 is 1 and will grow until a maximum of 36.641 (physical size set above) 
+# The influence distance of the attractor is 20
+# The size is kept constant until a distance of 10
+algo2d.SetAttractorGeom(Face_2, Wire_1, 1, 36.641, 20, 10)
+
+# In order to let the attractor control the growing of the mesh let set
+# the gradation to its maximum
+algo2d.SetGradation( 2.5 )
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# End of script
+\endcode
+
+\subsection blsurf_construct_mesh_internal_vertices Using internal vertices
+\code
+# Creating a geometry containing internal vertices
+Face_3 = geompy.MakeFaceHW(1, 1, 1)
+Vertex_2 = geompy.MakeVertex(0.2, 0.2, 0)
+Partition_1 = geompy.MakePartition([Face_3, Vertex_2], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
+OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
+Multi_Translation_1 = geompy.MakeMultiTranslation2D(Partition_1, OX, 1, 10, OY, 1, 10)
+geompy.addToStudy( Face_3, 'Face_3' )
+geompy.addToStudy( Vertex_2, 'Vertex_2' )
+geompy.addToStudy( Partition_1, 'Partition_1' )
+geompy.addToStudy( OX, 'OX' )
+geompy.addToStudy( OY, 'OY' )
+geompy.addToStudy( Multi_Translation_1, 'Multi-Translation_1' )
+
+# The mesh on the geometry with internal vertices
+blsurfMesh_internal = smesh.Mesh(Multi_Translation_1, "blsurfMesh_internal")
+algo2d = blsurfMesh_internal.Triangle(algo=smesh.BLSURF)
+algo2d.SetPhySize( 0.1 )
+
+# Allows BLSURF to take into account internal vertices
+algo2d.SetInternalEnforcedVertexAllFaces( True )
+
+# Add the created nodes into a group
+algo2d.SetInternalEnforcedVertexAllFacesGroup( "my group" )
+
+# compute the mesh
+blsurfMesh_internal.Compute()
+
+# End of script
+\endcode
+
+*/
diff --git a/doc/salome/gui/BLSURFPLUGIN/input/index.doc b/doc/salome/gui/BLSURFPLUGIN/input/index.doc
new file mode 100644 (file)
index 0000000..3a35d84
--- /dev/null
@@ -0,0 +1,20 @@
+/*!
+
+\mainpage Introduction to BLSURFPLUGIN
+
+\b BLSURFPLUGIN SALOME module represents a meshing plug-in that can be
+used within the SALOME Mesh module for generation of 2D mesh.
+
+\note BLSURFPLUGIN plugin uses DISTENE BLSurf commercial meshing
+software and requires a license at the run time (to work within the
+Mesh module).
+
+\b BLSURFPLUGIN plugin is destined for:
+- Meshing of the 2D geometric entities.
+
+To manage parameters of the BLSURFPLUGIN, use \subpage blsurf_hypo_page.
+
+Also, all BLSURFPLUGIN functionalities are accessible via the
+\subpage blsurfplugin_python_interface_page "BLSURFPLUGIN Python interface".
+
+*/
diff --git a/doc/salome/gui/BLSURFPLUGIN/static/doxygen.css b/doc/salome/gui/BLSURFPLUGIN/static/doxygen.css
new file mode 100755 (executable)
index 0000000..7a2dcbd
--- /dev/null
@@ -0,0 +1,836 @@
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+       font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+       font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+       font-size: 150%;
+}
+
+h2 {
+       font-size: 120%;
+}
+
+h3 {
+       font-size: 100%;
+}
+
+dt {
+       font-weight: bold;
+}
+
+div.multicol {
+       -moz-column-gap: 1em;
+       -webkit-column-gap: 1em;
+       -moz-column-count: 3;
+       -webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+       margin-top: 2px;
+}
+
+p.endli {
+       margin-bottom: 0px;
+}
+
+p.enddd {
+       margin-bottom: 4px;
+}
+
+p.endtd {
+       margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+       font-weight: bold;
+}
+
+span.legend {
+        font-size: 70%;
+        text-align: center;
+}
+
+h3.version {
+        font-size: 90%;
+        text-align: center;
+}
+
+div.qindex, div.navtab{
+       background-color: #EBEFF6;
+       border: 1px solid #A3B4D7;
+       text-align: center;
+       margin: 2px;
+       padding: 2px;
+}
+
+div.qindex, div.navpath {
+       width: 100%;
+       line-height: 140%;
+}
+
+div.navtab {
+       margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+       color: #3D578C;
+       font-weight: normal;
+       text-decoration: none;
+}
+
+.contents a:visited {
+       color: #4665A2;
+}
+
+a:hover {
+       text-decoration: underline;
+}
+
+a.qindex {
+       font-weight: bold;
+}
+
+a.qindexHL {
+       font-weight: bold;
+       background-color: #9CAFD4;
+       color: #ffffff;
+       border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+        color: #ffffff;
+}
+
+a.el {
+       font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+       color: #4665A2;
+}
+
+a.codeRef {
+       color: #4665A2;
+}
+
+/* @end */
+
+dl.el {
+       margin-left: -1cm;
+}
+
+.fragment {
+       font-family: monospace, fixed;
+       font-size: 105%;
+}
+
+pre.fragment {
+       border: 1px solid #C4CFE5;
+       background-color: #FBFCFD;
+       padding: 4px 6px;
+       margin: 4px 8px 4px 2px;
+       overflow: auto;
+       word-wrap: break-word;
+       font-size:  9pt;
+       line-height: 125%;
+}
+
+div.ah {
+       background-color: black;
+       font-weight: bold;
+       color: #ffffff;
+       margin-bottom: 3px;
+       margin-top: 3px;
+       padding: 0.2em;
+       border: solid thin #333;
+       border-radius: 0.5em;
+       -webkit-border-radius: .5em;
+       -moz-border-radius: .5em;
+       box-shadow: 2px 2px 3px #999;
+       -webkit-box-shadow: 2px 2px 3px #999;
+       -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+       background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+       background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+       margin-left: 16px;
+       margin-top: 12px;
+       font-weight: bold;
+}
+
+div.version {
+       border:1px solid #0000FF;
+        color: #CCCCCC;
+       font-family: Arial, Helvetica, sans-serif;
+       font-size: 9pt;
+       text-align: center;
+       width:100px;
+       -moz-border-radius: 8px;
+       margin: 5px;
+}
+                    
+div.footer1 {
+    background-color: #DFE5F1;
+    border: 1px solid #AAAAAA;
+    font-family: Arial, Helvetica, sans-serif;
+    font-size: 11px;
+    padding: 10px;
+    margin-top: 15px;
+}
+           
+
+div.groupText {
+       margin-left: 16px;
+       font-style: italic;
+}
+
+body {
+       background: white;
+       color: black;
+        margin: 0;
+}
+
+div.contents {
+       margin-top: 10px;
+       margin-left: 10px;
+       margin-right: 10px;
+}
+
+td.indexkey {
+       background-color: #EBEFF6;
+       font-weight: bold;
+       border: 1px solid #C4CFE5;
+       margin: 2px 0px 2px 0;
+       padding: 2px 10px;
+}
+
+td.indexvalue {
+       background-color: #EBEFF6;
+       border: 1px solid #C4CFE5;
+       padding: 2px 10px;
+       margin: 2px 0px;
+}
+
+tr.memlist {
+       background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+       text-align: center;
+}
+
+img.formulaDsp {
+       
+}
+
+img.formulaInl {
+       vertical-align: middle;
+}
+
+div.center {
+       text-align: center;
+        margin-top: 0px;
+        margin-bottom: 0px;
+        padding: 0px;
+}
+
+div.center img {
+       border: 0px;
+}
+
+address.footer {
+       text-align: right;
+       padding-right: 12px;
+}
+
+img.footer {
+       border: 0px;
+       vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+       color: #008000
+}
+
+span.keywordtype {
+       color: #604020
+}
+
+span.keywordflow {
+       color: #e08000
+}
+
+span.comment {
+       color: #800000
+}
+
+span.preprocessor {
+       color: #806020
+}
+
+span.stringliteral {
+       color: #002080
+}
+
+span.charliteral {
+       color: #008080
+}
+
+span.vhdldigit { 
+       color: #ff00ff 
+}
+
+span.vhdlchar { 
+       color: #000000 
+}
+
+span.vhdlkeyword { 
+       color: #700070 
+}
+
+span.vhdllogic { 
+       color: #ff0000 
+}
+
+/* @end */
+
+/*
+.search {
+       color: #003399;
+       font-weight: bold;
+}
+
+form.search {
+       margin-bottom: 0px;
+       margin-top: 0px;
+}
+
+input.search {
+       font-size: 75%;
+       color: #000080;
+       font-weight: normal;
+       background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+       font-size: 75%;
+}
+
+.dirtab {
+       padding: 4px;
+       border-collapse: collapse;
+       border: 1px solid #A3B4D7;
+}
+
+th.dirtab {
+       background: #EBEFF6;
+       font-weight: bold;
+}
+
+hr {
+       height: 0px;
+       border: none;
+       border-top: 1px solid #4A6AAA;
+}
+
+hr.footer {
+       height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+       border-spacing: 0px;
+       padding: 0px;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+       background-color: #F9FAFC;
+       border: none;
+       margin: 4px;
+       padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+       padding: 0px 8px 4px 8px;
+       color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+       border-top: 1px solid #C4CFE5;
+}
+
+.memItemLeft, .memTemplItemLeft {
+        white-space: nowrap;
+}
+
+.memTemplParams {
+       color: #4665A2;
+        white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+       font-size: 80%;
+       color: #4665A2;
+       font-weight: normal;
+       margin-left: 9px;
+}
+
+.memnav {
+       background-color: #EBEFF6;
+       border: 1px solid #A3B4D7;
+       text-align: center;
+       margin: 2px;
+       margin-right: 15px;
+       padding: 2px;
+}
+
+.memitem {
+       padding: 0;
+       margin-bottom: 10px;
+}
+
+.memname {
+        white-space: nowrap;
+        font-weight: bold;
+        margin-left: 6px;
+}
+
+.memproto {
+        border-top: 1px solid #A8B8D9;
+        border-left: 1px solid #A8B8D9;
+        border-right: 1px solid #A8B8D9;
+        padding: 6px 0px 6px 0px;
+        color: #253555;
+        font-weight: bold;
+        text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+        /* opera specific markup */
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        border-top-right-radius: 8px;
+        border-top-left-radius: 8px;
+        /* firefox specific markup */
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        -moz-border-radius-topright: 8px;
+        -moz-border-radius-topleft: 8px;
+        /* webkit specific markup */
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        -webkit-border-top-right-radius: 8px;
+        -webkit-border-top-left-radius: 8px;
+        background-image:url('nav_f.png');
+        background-repeat:repeat-x;
+        background-color: #E2E8F2;
+
+}
+
+.memdoc {
+        border-bottom: 1px solid #A8B8D9;      
+        border-left: 1px solid #A8B8D9;      
+        border-right: 1px solid #A8B8D9; 
+        padding: 2px 5px;
+        background-color: #FBFCFD;
+        border-top-width: 0;
+        /* opera specific markup */
+        border-bottom-left-radius: 8px;
+        border-bottom-right-radius: 8px;
+        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        /* firefox specific markup */
+        -moz-border-radius-bottomleft: 8px;
+        -moz-border-radius-bottomright: 8px;
+        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+        background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+        /* webkit specific markup */
+        -webkit-border-bottom-left-radius: 8px;
+        -webkit-border-bottom-right-radius: 8px;
+        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+        background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+.paramkey {
+       text-align: right;
+}
+
+.paramtype {
+       white-space: nowrap;
+}
+
+.paramname {
+       color: #602020;
+       white-space: nowrap;
+}
+.paramname em {
+       font-style: normal;
+}
+
+.params, .retval, .exception, .tparams {
+        border-spacing: 6px 2px;
+}       
+
+.params .paramname, .retval .paramname {
+        font-weight: bold;
+        vertical-align: top;
+}
+        
+.params .paramtype {
+        font-style: italic;
+        vertical-align: top;
+}       
+        
+.params .paramdir {
+        font-family: "courier new",courier,monospace;
+        vertical-align: top;
+}
+
+
+
+
+/* @end */
+
+/* @group Directory (tree) */
+
+/* for the tree view */
+
+.ftvtree {
+       font-family: sans-serif;
+       margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+       font-size: 9pt;
+       font-weight: bold;
+       margin: 5px;
+}
+
+.directory h3 {
+       margin: 0px;
+       margin-top: 1em;
+       font-size: 11pt;
+}
+
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice.  Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+       height: 61px;
+       background-repeat: no-repeat;
+       background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+       display: none;
+}
+*/
+
+.directory > h3 {
+       margin-top: 0;
+}
+
+.directory p {
+       margin: 0px;
+       white-space: nowrap;
+}
+
+.directory div {
+       display: none;
+       margin: 0px;
+}
+
+.directory img {
+       vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+       font-size: 100%;
+       font-weight: bold;
+}
+
+.directory-alt h3 {
+       margin: 0px;
+       margin-top: 1em;
+       font-size: 11pt;
+}
+
+.directory-alt > h3 {
+       margin-top: 0;
+}
+
+.directory-alt p {
+       margin: 0px;
+       white-space: nowrap;
+}
+
+.directory-alt div {
+       display: none;
+       margin: 0px;
+}
+
+.directory-alt img {
+       vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+        margin-top: 8px;
+}
+
+address {
+       font-style: normal;
+       color: #2A3D61;
+}
+
+table.doxtable {
+       border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+       border: 1px solid #2D4068;
+       padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+       background-color: #374F7F;
+       color: #FFFFFF;
+       font-size: 110%;
+       padding-bottom: 4px;
+       padding-top: 5px;
+       text-align:left;
+}
+
+.tabsearch {
+       top: 0px;
+       left: 10px;
+       height: 36px;
+       background-image: url('tab_b.png');
+       z-index: 101;
+       overflow: hidden;
+       font-size: 13px;
+}
+
+.navpath ul
+{
+       font-size: 11px;
+       background-image:url('tab_b.png');
+       background-repeat:repeat-x;
+       height:30px;
+       line-height:30px;
+       color:#8AA0CC;
+       border:solid 1px #C2CDE4;
+       overflow:hidden;
+       margin:0px;
+       padding:0px;
+}
+
+.navpath li
+{
+       list-style-type:none;
+       float:left;
+       padding-left:10px;
+       padding-right:15px;
+       background-image:url('bc_s.png');
+       background-repeat:no-repeat;
+       background-position:right;
+       color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+       height:32px;
+       display:block;
+       text-decoration: none;
+       outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+       color:#6884BD;
+}
+
+.navpath li.footer
+{
+        list-style-type:none;
+        float:right;
+        padding-left:10px;
+        padding-right:15px;
+        background-image:none;
+        background-repeat:no-repeat;
+        background-position:right;
+        color:#364D7C;
+        font-size: 8pt;
+}
+
+
+div.summary
+{
+       float: right;
+       font-size: 8pt;
+       padding-right: 5px;
+       width: 50%;
+       text-align: right;
+}       
+
+div.summary a
+{
+       white-space: nowrap;
+}
+
+div.ingroups
+{
+       font-size: 8pt;
+       padding-left: 5px;
+       width: 50%;
+       text-align: left;
+}
+
+div.ingroups a
+{
+       white-space: nowrap;
+}
+
+div.header
+{
+        background-image:url('nav_h.png');
+        background-repeat:repeat-x;
+       background-color: #F9FAFC;
+       margin:  0px;
+       border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+       padding: 5px 5px 5px 10px;
+}
+
+.title {
+        font-size: 150%;
+        font-weight: bold;
+        margin: 10px 2px;
+}
+
+dl
+{
+        padding: 0 0 0 10px;
+}
+
+dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
+{
+        border-left:4px solid;
+        padding: 0 0 0 6px;
+}
+
+dl.note
+{
+        border-color: #D0D000;
+}
+
+dl.warning, dl.attention
+{
+        border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+        border-color: #00D000;
+}
+
+dl.deprecated
+{
+        border-color: #505050;
+}
+
+dl.todo
+{
+        border-color: #00C0E0;
+}
+
+dl.test
+{
+        border-color: #3030E0;
+}
+
+dl.bug
+{
+        border-color: #C08050;
+}
+
+#projectlogo
+{
+       text-align: center;
+       vertical-align: bottom;
+       border-collapse: separate;
+}
+#projectlogo img
+{ 
+       border: 0px none;
+}
+#projectname
+{
+        background-color: #175783;
+        border: 1px solid;
+        height: 80px;
+       background-repeat: no-repeat;
+/*     font: 300% arial,sans-serif;*/
+       margin: 0px;
+       padding: 0px;
+}
+    
+#projectbrief
+{
+       font: 120% arial,sans-serif;
+       margin: 0px;
+       padding: 0px;
+}
+
+#projectnumber
+{
+       font: 50% arial,sans-serif;
+       margin: 0px;
+       padding: 0px;
+}
+
+#titlearea
+{
+        background: url("head.png");
+        background-color: #175783;
+        border: 1px solid;
+        height: 80px;
+        background-repeat: no-repeat;
+       padding: 0px;
+       margin: 0px;
+       width: 100%;
+       border-bottom: 1px solid #5373B4;
+}
+
diff --git a/doc/salome/gui/BLSURFPLUGIN/static/footer.html b/doc/salome/gui/BLSURFPLUGIN/static/footer.html
new file mode 100755 (executable)
index 0000000..4c89a2b
--- /dev/null
@@ -0,0 +1,12 @@
+    <li class="footer"></li>
+   </ul>
+ </div>
+ <div class="footer1">
+ <div style="text-align: center;">
+ Copyright &copy; 2007-2012  CEA/DEN, EDF R&amp;D, OPEN CASCADE<br>
+ Copyright &copy; 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS<br>
+ </div>
+ </div>
+</body>
+</html>
+               
\ No newline at end of file
diff --git a/doc/salome/gui/BLSURFPLUGIN/static/header.html.in b/doc/salome/gui/BLSURFPLUGIN/static/header.html.in
new file mode 100755 (executable)
index 0000000..4571b43
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+$treeview
+$search
+$mathjax
+<script type="text/javascript">
+$(document).ready(initResizable);
+</script>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body onload='searchBox.OnSelectItem(0);'>
+<div id="top"><!-- do not remove this div! -->
+<div id="titlearea"><div align="right"><div class="version">Version: @VERSION@</div></div></div>
+
+</div>
diff --git a/doc/salome/gui/BLSURFPLUGIN/static/header_py.html.in b/doc/salome/gui/BLSURFPLUGIN/static/header_py.html.in
new file mode 100644 (file)
index 0000000..61414bb
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+$treeview
+$search
+$mathjax
+<script type="text/javascript">
+$(document).ready(initResizable);
+</script>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body onload='searchBox.OnSelectItem(0);'>
+<div id="top"><!-- do not remove this div! -->
+<div id="titlearea"><div align="right"><div class="version">Version: @VERSION@</div></div></div>
+<div align="bottom-left"><a href=../index.html>Home</a></div>
+
+</div>
diff --git a/doc/salome/gui/Makefile.am b/doc/salome/gui/Makefile.am
new file mode 100644 (file)
index 0000000..fab0fec
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2007-2012  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.in
+#  Author : Vasily Rusyaev (Open Cascade NN)
+#  Module : doc
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+SUBDIRS = BLSURFPLUGIN
+
+usr_docs:
+       (cd BLSURFPLUGIN && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
+
+docs: usr_docs
diff --git a/doc/salome/tui/Makefile.am b/doc/salome/tui/Makefile.am
new file mode 100644 (file)
index 0000000..c0aef17
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright (C) 2007-2012  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.in
+#  Author : Vasily Rusyaev (Open Cascade NN)
+#  Module : doc
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+EXTRA_DIST += images static
+
+dev_docs: doxyfile
+       echo "Running doxygen in directory: "`pwd`; \
+       $(DOXYGEN) $<;
+
+clean-local:
+       -rm -fr BLSURFPLUGIN doxygen.bak
+
+install-data-local:
+       if test -d BLSURFPLUGIN; then \
+         $(INSTALL) -d $(DESTDIR)$(docdir)/tui ; \
+         cp -rp BLSURFPLUGIN $(DESTDIR)$(docdir)/tui ; \
+       fi;
+
+uninstall-local:
+       rm -rf $(DESTDIR)$(docdir)/tui/BLSURFPLUGIN
diff --git a/doc/salome/tui/doxyfile.in b/doc/salome/tui/doxyfile.in
new file mode 100755 (executable)
index 0000000..e553b43
--- /dev/null
@@ -0,0 +1,260 @@
+# Copyright (C) 2007-2012  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
+#
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "BLSURFPLUGIN Module Programming Guide v.@VERSION@"
+PROJECT_NUMBER         = 
+OUTPUT_DIRECTORY       = BLSURFPLUGIN
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = NO
+ABBREVIATE_BRIEF       = 
+ALWAYS_DETAILED_SEC    = YES
+INLINE_INHERITED_MEMB  = YES
+FULL_PATH_NAMES        = YES
+STRIP_FROM_PATH        = @top_srcdir@ @top_builddir@
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = NO
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 5
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = YES
+BUILTIN_STL_SUPPORT    = @DOXYGEN_SUPPORT_STL@
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+HIDE_UNDOC_MEMBERS     = YES
+HIDE_UNDOC_CLASSES     = YES
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = NO
+SORT_BRIEF_DOCS        = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 25
+SHOW_USED_FILES        = NO
+SHOW_DIRECTORIES       = NO
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = @top_srcdir@/src \
+                        @top_srcdir@/bin \
+                        @top_srcdir@/idl \
+                        @top_builddir@/bin
+FILE_PATTERNS          = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = YES
+IMAGE_PATH             = @srcdir@/images
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 3
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = .
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = @srcdir@/static/myheader.html
+HTML_FOOTER            = @srcdir@/static/footer.html
+HTML_STYLESHEET        = @srcdir@/static/doxygen.css
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = YES
+TOC_EXPAND             = YES
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = YES
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = NO
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = NO
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = NO
+GROUP_GRAPHS           = NO
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = NO
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = jpg
+DOT_FONTNAME           = Arial
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1200
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = NO
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
diff --git a/doc/salome/tui/images/Application-About.png b/doc/salome/tui/images/Application-About.png
new file mode 100755 (executable)
index 0000000..7b58330
Binary files /dev/null and b/doc/salome/tui/images/Application-About.png differ
diff --git a/doc/salome/tui/images/application.gif b/doc/salome/tui/images/application.gif
new file mode 100755 (executable)
index 0000000..0b05d5c
Binary files /dev/null and b/doc/salome/tui/images/application.gif differ
diff --git a/doc/salome/tui/images/html_comments.gif b/doc/salome/tui/images/html_comments.gif
new file mode 100755 (executable)
index 0000000..f0c0f0b
Binary files /dev/null and b/doc/salome/tui/images/html_comments.gif differ
diff --git a/doc/salome/tui/images/logocorp.gif b/doc/salome/tui/images/logocorp.gif
new file mode 100755 (executable)
index 0000000..7697e08
Binary files /dev/null and b/doc/salome/tui/images/logocorp.gif differ
diff --git a/doc/salome/tui/static/doxygen.css b/doc/salome/tui/static/doxygen.css
new file mode 100755 (executable)
index 0000000..4893b5e
--- /dev/null
@@ -0,0 +1,152 @@
+H1 { 
+   text-align: center; 
+}
+
+CAPTION { 
+   font-weight: bold 
+}
+
+/* Link in the top navbar */
+A.qindex {}
+
+A.qindexRef {}
+
+/* Link to any cross-referenced Doxygen element */
+A.el { 
+   text-decoration: none; 
+   font-weight: bold 
+}
+
+A.elRef { 
+   font-weight: bold 
+}
+
+/* Link to any cross-referenced Doxygen element inside a code section 
+   (ex: header)
+*/
+A.code { 
+   text-decoration: none; 
+   font-weight: normal; 
+   color: #4444ee 
+}
+
+A.codeRef { 
+   font-weight: normal; 
+   color: #4444ee 
+}
+
+A:hover { 
+   text-decoration: none; 
+   background-color: lightblue 
+}
+
+DL.el { 
+   margin-left: -1cm 
+}
+
+/* A code fragment (ex: header) */
+DIV.fragment { 
+   width: 100%; 
+   border: none; 
+   background-color: #CCCCCC 
+}
+
+/* In the alpha list (coumpound index), style of an alphabetical index letter */
+DIV.ah { 
+   background-color: #CCCCCC; 
+   font-weight: bold; 
+   color: #ffffff; 
+   margin-bottom: 3px; 
+   margin-top: 3px 
+}
+
+/* Method name (+ type) */
+TD.md { 
+   background-color: lightblue; 
+   font-weight: bold; 
+}
+
+/* Method parameter (some of them) */
+TD.mdname1 { 
+   background-color: lightblue; 
+   font-weight: bold; color: #602020; 
+}
+
+/* Method parameter (some of them) */
+TD.mdname { 
+   background-color: lightblue; 
+   font-weight: bold; 
+   color: #602020; 
+   width: 600px; 
+}
+
+/* Separator between methods group (usually empty, seems not supported by IE) */
+DIV.groupHeader { 
+   margin-left: 16px; 
+   margin-top: 12px; 
+   margin-bottom: 6px; 
+   font-weight: bold 
+}
+
+DIV.groupText { 
+   margin-left: 16px; 
+   font-style: italic; 
+   font-size: smaller 
+}
+
+BODY { background: #FFFFFF
+}
+
+/* BODY { 
+   background: url(sources/bg_salome.gif) 
+} */
+
+div.tabs { 
+  text-align: justify; 
+  font-weight: bold;
+  color: #FFFFFF;
+}
+
+DIV.div-footer { 
+  margin-left: 1em;
+  margin-right: 1em;
+  margin-bottom: 0.2em;
+  text-align: right;
+  font-size: 9pt; 
+}
+
+/* In File List, Coumpound List, etc, 1st column of the index */
+TD.indexkey { 
+   background-color: #CCCCCC; 
+   font-weight: bold; 
+   padding-right  : 10px; 
+   padding-top    : 2px; 
+   padding-left   : 10px; 
+   padding-bottom : 2px; 
+   margin-left    : 0px; 
+   margin-right   : 0px; 
+   margin-top     : 2px; 
+   margin-bottom  : 2px  
+}
+
+/* In File List, Coumpound List, etc, 2nd column of the index */
+TD.indexvalue { 
+   background-color: #CCCCCC; 
+   font-style: italic; 
+   padding-right  : 10px; 
+   padding-top    : 2px; 
+   padding-left   : 10px; 
+   padding-bottom : 2px; 
+   margin-left    : 0px; 
+   margin-right   : 0px; 
+   margin-top     : 2px; 
+   margin-bottom  : 2px  
+}
+
+span.keyword       { color: #008000 }
+span.keywordtype   { color: #604020 }
+span.keywordflow   { color: #e08000 }
+span.comment       { color: #800000 }
+span.preprocessor  { color: #806020 }
+span.stringliteral { color: #002080 }
+span.charliteral   { color: #008080 }
diff --git a/doc/salome/tui/static/footer.html b/doc/salome/tui/static/footer.html
new file mode 100755 (executable)
index 0000000..29e07ad
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+</head>
+<body>
+<hr style="width: 100%; height: 2px;">
+<div style="text-align: center;">Copyright &copy; 2007-2012 CEA DEN, EDF R&amp;D<br>
+</div>
+</body>
+</html>
diff --git a/doc/salome/tui/static/myheader.html b/doc/salome/tui/static/myheader.html
new file mode 100755 (executable)
index 0000000..d2efb75
--- /dev/null
@@ -0,0 +1,13 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+   <meta name="GENERATOR" content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
+   <title>Main Page</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+<link href="tabs.css" rel="stylesheet" type="text/css">
+</head>
+<body>
+&nbsp;
+</body>
+</html>
index 026602a26cf48d97c7c21ce5399c59df949b483d..d26ce5606cc4a856f5361dba9fc7e1f3d10de719 100644 (file)
@@ -1,30 +1,33 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
+//           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
 //
 #ifndef _SMESH_BLSURFALGORITHM_IDL_
 #define _SMESH_BLSURFALGORITHM_IDL_
 
 #include "SMESH_Hypothesis.idl"
+#include "GEOM_Gen.idl"
 #include "SALOME_Exception.idl"
 
 /*!
@@ -34,6 +37,79 @@ module BLSURFPlugin
 {
   typedef sequence<string> string_array;
 
+  // Enforced vertex name
+  typedef string TEnfName;
+  // Entry
+  typedef string TEntry;
+  typedef sequence<TEntry> TEntryList;
+  // Group name
+  typedef string TEnfGroupName;
+  
+  // Coordinates of enforced vertex
+  typedef sequence<double,3> TEnfVertexCoords;
+  // List of coords
+  typedef sequence<TEnfVertexCoords> TEnfVertexCoordsList;
+  
+  // Enforced vertex
+  struct TEnfVertex {
+    TEnfName name;
+    TEntry geomEntry;
+    TEnfVertexCoords coords;
+    TEnfGroupName grpName;
+    TEntryList faceEntries;
+  };
+  // List of enforced vertices
+  typedef sequence<TEnfVertex> TEnfVertexList;
+
+  // Map Face Entry / List of enforced vertices
+  struct TFaceEntryEnfVertexListMapElement {
+    TEntry faceEntry;
+    TEnfVertexList enfVertexList;
+  };
+  typedef sequence<TFaceEntryEnfVertexListMapElement> TFaceEntryEnfVertexListMap;
+  
+  // Map Face Entry / List of coords
+  struct TFaceEntryCoordsListMapElement {
+    TEntry faceEntry;
+    TEnfVertexCoordsList coordsList;
+  };
+  typedef sequence<TFaceEntryCoordsListMapElement> TFaceEntryCoordsListMap;
+  
+  // Map Face Entry / List of enf vertex entries
+  struct TFaceEntryEnfVertexEntryListMapElement {
+    TEntry faceEntry;
+    TEntryList enfVertexEntryList;
+  };
+  typedef sequence<TFaceEntryEnfVertexEntryListMapElement> TFaceEntryEnfVertexEntryListMap;
+  
+  // Map Coords / Enforced vertex
+  struct TCoordsEnfVertexElement {
+    TEnfVertexCoords coords;
+    TEnfVertex enfVertex;
+  };
+  typedef sequence<TCoordsEnfVertexElement> TCoordsEnfVertexMap;
+  
+  // Map Enf Vertex Entry / Enforced vertex
+  struct TEnfVertexEntryEnfVertexElement {
+    TEntry enfVertexEntry;
+    TEnfVertex enfVertex;
+  };
+  typedef sequence<TEnfVertexEntryEnfVertexElement> TEnfVertexEntryEnfVertexMap;
+
+  // List of Face Entry with internal enforced vertices activated
+  typedef sequence<TEntry> TFaceEntryInternalVerticesList;
+
+  // Attractors
+  struct TAttractorParams {
+    string faceEntry;
+    string attEntry;
+    double startSize;
+    double endSize;
+    double infDist;
+    double constDist;
+  };
+  typedef sequence<TAttractorParams> TAttParamsMap;
+  
   /*!
    * BLSURFPlugin_BLSURF: interface of BLSURF algorithm
    */
@@ -50,6 +126,7 @@ module BLSURFPlugin
      * 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
+     * value=3 - mesh conformity is assured by pre-processing a CAD model with Pre-CAD
      */
     void SetTopology(in long way);
     long GetTopology();
@@ -58,6 +135,7 @@ module BLSURFPlugin
      * Sets a way to define size of mesh elements to generate
      * 0 - size is defined automatically
      * 1 - size is set by SetPhySize() method
+     * 2 - size is set by SetPhySize() method. A sizemap is defined.
      */
     void SetPhysicalMesh(in long isCustom);
     long GetPhysicalMesh();
@@ -136,16 +214,45 @@ module BLSURFPlugin
     void SetVerbosity(in short theVal) raises (SALOME::SALOME_Exception);
     short GetVerbosity();
 
+    /*!
+     * To merges edges.
+     */
+    void SetPreCADMergeEdges(in boolean toMergeEdges);
+    boolean GetPreCADMergeEdges();
+
+    /*!
+     * To remove nano edges.
+     */
+    void SetPreCADRemoveNanoEdges(in boolean toRemoveNanoEdges);
+    boolean GetPreCADRemoveNanoEdges();
+
+    /*!
+     * To compute topology from scratch
+     */
+    void SetPreCADDiscardInput(in boolean toDiscardInput);
+    boolean GetPreCADDiscardInput();
+
+    /*!
+     * Sets the length below which an edge is considered as nano 
+     * for the topology processing.
+     */
+    void SetPreCADEpsNano(in double epsNano);
+    double GetPreCADEpsNano();
+
     /*!
      * Sets advanced option value
      */
     void SetOptionValue(in string optionName,
                         in string optionValue) raises (SALOME::SALOME_Exception);
+    void SetPreCADOptionValue(in string optionName,
+                        in string optionValue) raises (SALOME::SALOME_Exception);
     string GetOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
+    string GetPreCADOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
     /*!
      * Unsets advanced option
      */
     void UnsetOption(in string optionName);
+    void UnsetPreCADOption(in string optionName);
 
     /*!
      * Return array of strings each of which is option name concatenated
@@ -154,14 +261,136 @@ module BLSURFPlugin
      * Note: the method is mostly for interaction with GUI.
      */
     string_array GetOptionValues();
+    string_array GetPreCADOptionValues();
 
     /*!
      * 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);
-  };
+    void SetPreCADOptionValues(in string_array options);
+
+    /*!
+     * SizeMap
+     */
+    void SetSizeMapEntries(in string_array sizeMaps);
+    void ClearSizeMaps();
+
+    void UnsetEntry(in string entry);
+
+    /*!
+     * Set/unset a SizeMap on geom object
+     */
+    void         SetSizeMap(in GEOM::GEOM_Object GeomObj, in string sizeMap);
+    void         UnsetSizeMap(in GEOM::GEOM_Object GeomObj);
+    
+    /*!
+     * Set a SizeMap on geom object given by entry
+     */
+    void         SetSizeMapEntry(in string entry, in string sizeMap);
+    string       GetSizeMapEntry(in string entry);
+    string_array GetSizeMapEntries();
 
+    /*!
+     * Set/unset an attractor on geom object
+     */
+    void         SetAttractor(in GEOM::GEOM_Object GeomObj, in string attractor);
+    void         UnsetAttractor(in GEOM::GEOM_Object GeomObj);
+    
+    /*!
+     * Set an attractor on geom object given by entry
+     */
+    void         SetAttractorEntry(in string entry, in string attractor);
+    string       GetAttractorEntry(in string entry);
+    string_array GetAttractorEntries();
+
+    /*!
+     * Set/unset an attractor given as geom object on another geom object
+     */
+    void         SetAttractorGeom(in GEOM::GEOM_Object GeomObj, in GEOM::GEOM_Object AttractorShape, in double StartSize, in double EndSize, in double ActionRadius, in double ConstantRadius);
+    void         UnsetAttractorGeom(in GEOM::GEOM_Object GeomObj);
+
+    /*!
+     * Set an attractor given by entry on a geom object given by entry
+     */
+    void         SetClassAttractorEntry(in string entry, in string att_entry, in double StartSize, in double EndSize, in double ActionRadius, in double ConstantRadius );
+    BLSURFPlugin::TAttParamsMap GetAttractorParams();
+
+/*
+    void         SetCustomSizeMapEntry(in string entry, in string sizeMap);
+    string       GetCustomSizeMapEntry(in string entry);
+    void         SetCustomSizeMap(in GEOM::GEOM_Object GeomObj, in string sizeMap);
+    void         UnsetCustomSizeMap(in GEOM::GEOM_Object GeomObj);
+    string_array GetCustomSizeMapEntries();
+*/
+    ///////////////////////
+    // ENFORCED VERTEXES //
+    ///////////////////////
+    
+    TFaceEntryEnfVertexListMap      GetAllEnforcedVerticesByFace();
+    TEnfVertexList                  GetAllEnforcedVertices();
+    
+    TFaceEntryCoordsListMap         GetAllCoordsByFace();
+    TCoordsEnfVertexMap             GetAllEnforcedVerticesByCoords();
+    
+    TFaceEntryEnfVertexEntryListMap GetAllEnfVertexEntriesByFace();
+    TEnfVertexEntryEnfVertexMap     GetAllEnforcedVerticesByEnfVertexEntry();
+    
+    void                            ClearAllEnforcedVertices();
+    
+   /*!
+    * Set/get/unset an enforced vertex on geom face
+    */
+    boolean SetEnforcedVertex(in GEOM::GEOM_Object theFace, in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
+    boolean SetEnforcedVertexNamed(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfName theVertexName) raises (SALOME::SALOME_Exception);
+    boolean SetEnforcedVertexGeom(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
+    boolean SetEnforcedVertexWithGroup(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+    boolean SetEnforcedVertexNamedWithGroup(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfName theVertexName, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+    boolean SetEnforcedVertexGeomWithGroup(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+
+    
+    TEnfVertexList GetEnforcedVertices(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
+    
+    boolean UnsetEnforcedVertex(in GEOM::GEOM_Object theFace, in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
+    boolean UnsetEnforcedVertexGeom(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
+    boolean UnsetEnforcedVertices(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
+    
+   /*!
+    * Set/get/unset an enforced vertex on geom face given by entry
+    */
+    boolean SetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, 
+                                   in TEnfName theVertexName, in TEntry theVertexEntry, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+
+    TEnfVertexList GetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
+    boolean UnsetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, in TEntry theVertexEntry) raises (SALOME::SALOME_Exception);
+//    boolean UnsetEnforcedVertexEntryGeom(in TEntry theFaceEntry, in TEntry theVertexEntry) raises (SALOME::SALOME_Exception);
+    boolean UnsetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
+
+    /*!
+     * To get/set internal vertices as enforced vertices
+     */
+    void          SetInternalEnforcedVertexAllFaces(in boolean toEnforceInternalVertices);
+    boolean       GetInternalEnforcedVertexAllFaces();
+    void          SetInternalEnforcedVertexAllFacesGroup(in TEnfGroupName groupName);
+    TEnfGroupName GetInternalEnforcedVertexAllFacesGroup();
+
+//  Enable internal enforced vertices on specific face if requested by user
+//    void          SetInternalEnforcedVertex(in GEOM::GEOM_Object theFace,in boolean toEnforceInternalVertices) raises (SALOME::SALOME_Exception);
+//    void          SetInternalEnforcedVertexWithGroup(in GEOM::GEOM_Object theFace, in boolean toEnforceInternalVertices, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+//    void          SetInternalEnforcedVertexEntry(in TEntry theFaceEntry, in boolean toEnforceInternalVertices, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
+//    boolean       GetInternalEnforcedVertex(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
+//    boolean       GetInternalEnforcedVertexEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
+//    TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesFaces();
+    ///////////////////////
+    
+    /*!
+     * Sets the file for export resulting mesh in GMF format
+     */
+//     void SetGMFFile(in string theFileName, in boolean isBinary);
+    void SetGMFFile(in string theFileName);
+    string GetGMFFile();
+//     boolean GetGMFFileMode();
+  };
 };
 
 #endif
index d12329e9fcd7adee1999a8dd77a4aa384e6a95ad..e9e3d924323bfabb105bae728c9749d2f58afcc0 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
@@ -29,6 +30,8 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 BASEIDL_FILES = BLSURFPlugin_Algorithm.idl
 
+BASEIDL_FILES_PY=$(BASEIDL_FILES:%.idl=%_idl.py)
+
 # This variable defines the files to be installed
 dist_salomeidl_DATA = $(BASEIDL_FILES)
 
@@ -47,7 +50,6 @@ libSalomeIDLBLSURFPLUGIN_la_CPPFLAGS = \
        $(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
@@ -72,8 +74,7 @@ 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
+       -I$(SMESH_ROOT_DIR)/idl/salome
 IDLPYFLAGS  = \
        @IDLPYFLAGS@ \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
@@ -93,9 +94,15 @@ install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%)
          $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
        done
 
-# uninstall-local removes too much, but it works in distcheck
+# we want to remove only staff generated for IDL files and nothing more
 uninstall-local:
-       rm -rf $(DESTDIR)$(salomepythondir)/*
+       @for modulen in BLSURFPlugin ; do \
+         test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \
+         test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \
+       done ; \
+       for filen in $(BASEIDL_FILES_PY) ; do \
+         echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \
+       done
 
 mostlyclean-local:
        -rm -f *.hh *.cc .depidl
@@ -109,7 +116,7 @@ mostlyclean-local:
        @for dep in $^ dummy; do \
          if [ $$dep != "dummy" ]; then \
            echo Building dependencies for $$dep; \
-           $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome -I$(top_builddir)/salome_adm/unix $$dep 2>/dev/null | \
+           $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \
            sed 's/\.o/\SK.cc/' >>$@; \
          fi; \
        done ;
index ab99b324629186f051a0eb837ba49693de34b5a4..ff40d4cb78d75a7392ca3067b51559344b61fc32 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE meshers PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+  Copyright (C) 2007-2012  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
                dim="2"/>
   </hypotheses>
   <algorithms>
+
     <algorithm type="BLSURF"
                label-id="BLSURF"
                icon-id="mesh_algo_BLSURF.png"
                opt-hypos="BLSURF_Parameters"
                output="TRIA,QUAD"
-               dim="2"/>
+               dim="2"
+              support-submeshes="true">
+      <python-wrap>
+        <algo>BLSURF=Triangle(algo=smesh.BLSURF)</algo>
+        <hypo>BLSURF_Parameters=Parameters()</hypo>
+      </python-wrap>
+    </algorithm>
+
   </algorithms>
 </meshers-group>
 
index 42aa3dad517a0b28bb475f6ded91970f86b15e9b..12bb18ad58e137649daee123c630cb5d00391aee 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
@@ -30,6 +31,7 @@ dist_salomeres_DATA =                 \
 if BLSURFPLUGIN_ENABLE_GUI
   dist_salomeres_DATA +=               \
        BLSURF.png                      \
+       mesh_select_BLSURF.png          \
        mesh_algo_BLSURF.png            \
        mesh_hypo_BLSURF.png            \
        mesh_tree_algo_BLSURF.png       \
index c4acae6316a5532596c1c3a40b15695720f9eb45..72c6a4a3e58ebd523d4bd80897831d68e990c9ad 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+  Copyright (C) 2007-2012  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
@@ -26,4 +26,7 @@
     <!-- Default SMESH module plugins -->
     <parameter name="plugins" value="NETGENPlugin,GHS3DPlugin,BLSURFPlugin"/>
   </section>
+  <section name="smesh_help" >
+    <parameter name="Plug-ins/BLSURF plugin User's Guide" value="${BLSURFPLUGIN_ROOT_DIR}/share/doc/salome/gui/BLSURFPLUGIN/index.html"/>
+  </section>
 </document>
diff --git a/resources/mesh_select_BLSURF.png b/resources/mesh_select_BLSURF.png
new file mode 100644 (file)
index 0000000..ecb252a
Binary files /dev/null and b/resources/mesh_select_BLSURF.png differ
diff --git a/src/BLSURFPlugin/BLSURFPluginDC.py b/src/BLSURFPlugin/BLSURFPluginDC.py
new file mode 100644 (file)
index 0000000..8dffd50
--- /dev/null
@@ -0,0 +1,308 @@
+# Copyright (C) 2007-2012  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
+#
+
+from smesh import Mesh_Algorithm, AssureGeomPublished
+
+# Topology treatment way of BLSURF
+FromCAD, PreProcess, PreProcessPlus, PreCAD = 0,1,2,3
+
+# Element size flag of BLSURF
+DefaultSize, DefaultGeom, BLSURF_Custom, SizeMap = 0,0,1,2
+
+
+# import BLSURFPlugin module if possible
+noBLSURFPlugin = 0
+try:
+    import BLSURFPlugin
+except ImportError:
+    noBLSURFPlugin = 1
+    pass
+
+
+
+# a constant to call Mesh.Triangle(BLSURF,geom=0)
+BLSURF = "BLSURF"
+
+## BLSURF 2D algorithm. It is created by calling Mesh.Triangle(BLSURF,geom=0)
+#
+class BLSURF_Algorithm(Mesh_Algorithm):
+
+    meshMethod = "Triangle"
+    algoType   = BLSURF
+
+    _angleMeshS = 8
+    _gradation  = 1.1
+
+    ## Private constructor.
+    def __init__(self, mesh, geom=0):
+        Mesh_Algorithm.__init__(self)
+        if noBLSURFPlugin:
+            print "Warning: BLSURFPlugin module unavailable"            
+        self.Create(mesh, geom, BLSURF, "libBLSURFEngine.so")
+        self.params=None
+        #self.SetPhysicalMesh() - PAL19680
+
+    ## Sets a way to define size of mesh elements to generate.
+    #  @param thePhysicalMesh is: DefaultSize, BLSURF_Custom or SizeMap.
+    def SetPhysicalMesh(self, thePhysicalMesh=DefaultSize):
+        self.Parameters().SetPhysicalMesh(thePhysicalMesh)
+
+    ## Sets size of mesh elements to generate.
+    def SetPhySize(self, theVal):
+        self.Parameters().SetPhySize(theVal)
+
+    ## Sets lower boundary of mesh element size (PhySize).
+    def SetPhyMin(self, theVal=-1):
+        self.Parameters().SetPhyMin(theVal)
+
+    ## Sets upper boundary of mesh element size (PhySize).
+    def SetPhyMax(self, theVal=-1):
+        self.Parameters().SetPhyMax(theVal)
+
+    ## Sets a way to define maximum angular deflection of mesh from CAD model.
+    #  @param theGeometricMesh is: 0 (None) or 1 (Custom)
+    def SetGeometricMesh(self, theGeometricMesh=0):
+        if self.Parameters().GetPhysicalMesh() == 0: theGeometricMesh = 1
+        self.Parameters().SetGeometricMesh(theGeometricMesh)
+
+    ## Sets angular deflection (in degrees) of a mesh face from CAD surface.
+    def SetAngleMeshS(self, theVal=_angleMeshS):
+        if self.Parameters().GetGeometricMesh() == 0: theVal = self._angleMeshS
+        self.Parameters().SetAngleMeshS(theVal)
+
+    ## Sets angular deflection (in degrees) of a mesh edge from CAD curve.
+    def SetAngleMeshC(self, theVal=_angleMeshS):
+        if self.Parameters().GetGeometricMesh() == 0: theVal = self._angleMeshS
+        self.Parameters().SetAngleMeshC(theVal)
+
+    ## Sets lower boundary of mesh element size computed to respect angular deflection.
+    def SetGeoMin(self, theVal=-1):
+        self.Parameters().SetGeoMin(theVal)
+
+    ## Sets upper boundary of mesh element size computed to respect angular deflection.
+    def SetGeoMax(self, theVal=-1):
+        self.Parameters().SetGeoMax(theVal)
+
+    ## Sets maximal allowed ratio between the lengths of two adjacent edges.
+    def SetGradation(self, theVal=_gradation):
+        if self.Parameters().GetGeometricMesh() == 0: theVal = self._gradation
+        self.Parameters().SetGradation(theVal)
+
+    ## Sets topology usage way.
+    # @param way defines how mesh conformity is assured <ul>
+    # <li>FromCAD - mesh conformity is assured by conformity of a shape</li>
+    # <li>PreProcess or PreProcessPlus - by pre-processing a CAD model</li>
+    # <li>PreCAD - by pre-processing with PreCAD a CAD model</li></ul>
+    def SetTopology(self, way):
+        self.Parameters().SetTopology(way)
+
+    ## To respect geometrical edges or not.
+    def SetDecimesh(self, toIgnoreEdges=False):
+        self.Parameters().SetDecimesh(toIgnoreEdges)
+
+    ## Sets verbosity level in the range 0 to 100.
+    def SetVerbosity(self, level):
+        self.Parameters().SetVerbosity(level)
+
+    ## To optimize merges edges.
+    def SetPreCADMergeEdges(self, toMergeEdges=False):
+        self.Parameters().SetPreCADMergeEdges(toMergeEdges)
+
+    ## To remove nano edges.
+    def SetPreCADRemoveNanoEdges(self, toRemoveNanoEdges=False):
+        self.Parameters().SetPreCADRemoveNanoEdges(toRemoveNanoEdges)
+
+    ## To compute topology from scratch
+    def SetPreCADDiscardInput(self, toDiscardInput=False):
+        self.Parameters().SetPreCADDiscardInput(toDiscardInput)
+
+    ## Sets the length below which an edge is considered as nano 
+    #  for the topology processing.
+    def SetPreCADEpsNano(self, epsNano):
+        self.Parameters().SetPreCADEpsNano(epsNano)
+
+    ## Sets advanced option value.
+    def SetOptionValue(self, optionName, level):
+        self.Parameters().SetOptionValue(optionName,level)
+
+    ## Sets advanced PreCAD option value.
+    #  Keyword arguments:
+    #  optionName: name of the option
+    #  optionValue: value of the option
+    def SetPreCADOptionValue(self, optionName, optionValue):
+        self.Parameters().SetPreCADOptionValue(optionName,optionValue)
+
+    ## Sets GMF file for export at computation
+    def SetGMFFile(self, fileName):
+        self.Parameters().SetGMFFile(fileName)
+
+    ## Enforced vertices (BLSURF)
+
+    ## To get all the enforced vertices
+    def GetAllEnforcedVertices(self):
+        return self.Parameters().GetAllEnforcedVertices()
+
+    ## To get all the enforced vertices sorted by face (or group, compound)
+    def GetAllEnforcedVerticesByFace(self):
+        return self.Parameters().GetAllEnforcedVerticesByFace()
+
+    ## To get all the enforced vertices sorted by coords of input vertices
+    def GetAllEnforcedVerticesByCoords(self):
+        return self.Parameters().GetAllEnforcedVerticesByCoords()
+
+    ## To get all the coords of input vertices sorted by face (or group, compound)
+    def GetAllCoordsByFace(self):
+        return self.Parameters().GetAllCoordsByFace()
+
+    ## To get all the enforced vertices on a face (or group, compound)
+    #  @param theFace : GEOM face (or group, compound) on which to define an enforced vertex
+    def GetEnforcedVertices(self, theFace):
+        AssureGeomPublished( self.mesh, theFace )
+        return self.Parameters().GetEnforcedVertices(theFace)
+
+    ## To clear all the enforced vertices
+    def ClearAllEnforcedVertices(self):
+        return self.Parameters().ClearAllEnforcedVertices()
+
+    ## To set an enforced vertex on a face (or group, compound) given the coordinates of a point. If the point is not on the face, it will projected on it. If there is no projection, no enforced vertex is created.
+    #  @param theFace      : GEOM face (or group, compound) on which to define an enforced vertex
+    #  @param x            : x coordinate
+    #  @param y            : y coordinate
+    #  @param z            : z coordinate
+    #  @param vertexName   : name of the enforced vertex
+    #  @param groupName    : name of the group
+    def SetEnforcedVertex(self, theFace, x, y, z, vertexName = "", groupName = ""):
+        AssureGeomPublished( self.mesh, theFace )
+        if vertexName == "":
+            if groupName == "":
+                return self.Parameters().SetEnforcedVertex(theFace, x, y, z)
+            else:
+                return self.Parameters().SetEnforcedVertexWithGroup(theFace, x, y, z, groupName)
+        else:
+            if groupName == "":
+                return self.Parameters().SetEnforcedVertexNamed(theFace, x, y, z, vertexName)
+            else:
+                return self.Parameters().SetEnforcedVertexNamedWithGroup(theFace, x, y, z, vertexName, groupName)
+
+    ## To set an enforced vertex on a face (or group, compound) given a GEOM vertex, group or compound.
+    #  @param theFace      : GEOM face (or group, compound) on which to define an enforced vertex
+    #  @param theVertex    : GEOM vertex (or group, compound) to be projected on theFace.
+    #  @param groupName    : name of the group
+    def SetEnforcedVertexGeom(self, theFace, theVertex, groupName = ""):
+        AssureGeomPublished( self.mesh, theFace )
+        AssureGeomPublished( self.mesh, theVertex )
+        if groupName == "":
+            return self.Parameters().SetEnforcedVertexGeom(theFace, theVertex)
+        else:
+            return self.Parameters().SetEnforcedVertexGeomWithGroup(theFace, theVertex,groupName)
+
+    ## To remove an enforced vertex on a given GEOM face (or group, compound) given the coordinates.
+    #  @param theFace      : GEOM face (or group, compound) on which to remove the enforced vertex
+    #  @param x            : x coordinate
+    #  @param y            : y coordinate
+    #  @param z            : z coordinate
+    def UnsetEnforcedVertex(self, theFace, x, y, z):
+        AssureGeomPublished( self.mesh, theFace )
+        return self.Parameters().UnsetEnforcedVertex(theFace, x, y, z)
+
+    ## To remove an enforced vertex on a given GEOM face (or group, compound) given a GEOM vertex, group or compound.
+    #  @param theFace      : GEOM face (or group, compound) on which to remove the enforced vertex
+    #  @param theVertex    : GEOM vertex (or group, compound) to remove.
+    def UnsetEnforcedVertexGeom(self, theFace, theVertex):
+        AssureGeomPublished( self.mesh, theFace )
+        AssureGeomPublished( self.mesh, theVertex )
+        return self.Parameters().UnsetEnforcedVertexGeom(theFace, theVertex)
+
+    ## To remove all enforced vertices on a given face.
+    #  @param theFace      : face (or group/compound of faces) on which to remove all enforced vertices
+    def UnsetEnforcedVertices(self, theFace):
+        AssureGeomPublished( self.mesh, theFace )
+        return self.Parameters().UnsetEnforcedVertices(theFace)
+
+    ## To tell BLSURF to add a node on internal vertices
+    #  @param toEnforceInternalVertices : boolean; if True the internal vertices are added as enforced vertices
+    def SetInternalEnforcedVertexAllFaces(self, toEnforceInternalVertices):
+        return self.Parameters().SetInternalEnforcedVertexAllFaces(toEnforceInternalVertices)
+
+    ## To know if BLSURF will add a node on internal vertices
+    def GetInternalEnforcedVertexAllFaces(self):
+        return self.Parameters().GetInternalEnforcedVertexAllFaces()
+
+    ## To define a group for the nodes of internal vertices
+    #  @param groupName : string; name of the group
+    def SetInternalEnforcedVertexAllFacesGroup(self, groupName):
+        return self.Parameters().SetInternalEnforcedVertexAllFacesGroup(groupName)
+
+    ## To get the group name of the nodes of internal vertices
+    def GetInternalEnforcedVertexAllFacesGroup(self):
+        return self.Parameters().GetInternalEnforcedVertexAllFacesGroup()
+
+    ## Attractors
+
+    ## Sets an attractor on the chosen face. The mesh size will decrease exponentially with the distance from theAttractor, following the rule h(d) = theEndSize - (theEndSize - theStartSize) * exp [ - ( d / theInfluenceDistance ) ^ 2 ] 
+    #  @param theFace      : face on which the attractor will be defined
+    #  @param theAttractor : geometrical object from which the mesh size "h" decreases exponentially   
+    #  @param theStartSize : mesh size on theAttractor      
+    #  @param theEndSize   : maximum size that will be reached on theFace                                                     
+    #  @param theInfluenceDistance : influence of the attractor ( the size grow slower on theFace if it's high)                                                      
+    #  @param theConstantSizeDistance : distance until which the mesh size will be kept constant on theFace                                                      
+    def SetAttractorGeom(self, theFace, theAttractor, theStartSize, theEndSize, theInfluenceDistance, theConstantSizeDistance):
+        AssureGeomPublished( self.mesh, theFace )
+        AssureGeomPublished( self.mesh, theAttractor )
+        self.Parameters().SetAttractorGeom(theFace, theAttractor, theStartSize, theEndSize, theInfluenceDistance, theConstantSizeDistance)
+
+    ## Unsets an attractor on the chosen face. 
+    #  @param theFace      : face on which the attractor has to be removed                               
+    def UnsetAttractorGeom(self, theFace):
+        AssureGeomPublished( self.mesh, theFace )
+        self.Parameters().SetAttractorGeom(theFace)
+
+    ## Size maps (BLSURF)
+
+    ## To set a size map on a face, edge or vertex (or group, compound) given Python function.
+    #  If theObject is a face, the function can be: def f(u,v): return u+v
+    #  If theObject is an edge, the function can be: def f(t): return t/2
+    #  If theObject is a vertex, the function can be: def f(): return 10
+    #  @param theObject   : GEOM face, edge or vertex (or group, compound) on which to define a size map
+    #  @param theSizeMap  : Size map defined as a string
+    def SetSizeMap(self, theObject, theSizeMap):
+        AssureGeomPublished( self.mesh, theObject )
+        self.Parameters().SetSizeMap(theObject, theSizeMap)
+
+    ## To remove a size map defined on a face, edge or vertex (or group, compound)
+    #  @param theObject   : GEOM face, edge or vertex (or group, compound) on which to define a size map
+    def UnsetSizeMap(self, theObject):
+        AssureGeomPublished( self.mesh, theObject )
+        self.Parameters().UnsetSizeMap(theObject)
+
+    ## To remove all the size maps
+    def ClearSizeMaps(self):
+        self.Parameters().ClearSizeMaps()
+
+    ## Sets QuadAllowed flag.
+    def SetQuadAllowed(self, toAllow=True):
+        self.Parameters().SetQuadAllowed(toAllow)
+
+    ## Defines hypothesis having several parameters
+    #
+    def Parameters(self):
+        if not self.params:
+            self.params = self.Hypothesis("BLSURF_Parameters", [],
+                                          "libBLSURFEngine.so", UseExisting=0)
+        return self.params
diff --git a/src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx b/src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx
new file mode 100644 (file)
index 0000000..57ce592
--- /dev/null
@@ -0,0 +1,332 @@
+// Copyright (C) 2007-2012  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_Attractor.cxx
+// Authors : Renaud Nédélec (OCC)
+// ---
+// 
+// The idea of the algorithm used to calculate the distance on a 
+// non-euclidian parametric surface has been found in the ref. below:
+//
+// Ref:"Accurate Anisotropic Fast Marching for Diffusion-Based Geodesic Tractography"
+// S. Jbabdi, P. Bellec, R. Toro, Daunizeau, M. Pélégrini-Issac, and H. Benali1
+//
+
+#include "BLSURFPlugin_Attractor.hxx"
+#include <utilities.h>
+#include <algorithm>
+#include <cmath>
+
+// cascade include
+#include "ShapeAnalysis.hxx"
+#include "ShapeConstruct_ProjectCurveOnSurface.hxx"
+#include <Precision.hxx>
+
+BLSURFPlugin_Attractor::BLSURFPlugin_Attractor ()
+  : _face(),
+  _attractorShape(),
+  _attEntry(),
+  _gridU(0),
+  _gridV(0),
+  _vectU(),
+  _vectV(),
+  _DMap(),
+  _known(),
+  _trial(),
+  _u1 (0.),
+  _u2 (0.),
+  _v1 (0.),
+  _v2 (0.),
+  _startSize(-1),
+  _endSize(-1),
+  _actionRadius(-1),
+  _constantRadius(-1),
+  _type(-1),
+  _isMapBuilt(false),
+  _isEmpty(true){ MESSAGE("construction of a void attractor"); }
+
+BLSURFPlugin_Attractor::BLSURFPlugin_Attractor (const TopoDS_Face& Face, const TopoDS_Shape& Attractor, const std::string& attEntry) 
+  : _face(),
+  _attractorShape(),
+  _attEntry(attEntry),
+  _gridU(),
+  _gridV(),
+  _vectU(),
+  _vectV(),
+  _DMap(),
+  _known(),
+  _trial(),
+  _u1 (0.),
+  _u2 (0.),
+  _v1 (0.),
+  _v2 (0.),
+  _startSize(-1),
+  _endSize(-1),
+  _actionRadius(-1),
+  _constantRadius(-1),
+  _type(0),
+  _isMapBuilt(false),
+  _isEmpty(false)
+{
+  _face = Face;
+  _attractorShape = Attractor;
+  
+  init();
+}
+
+bool BLSURFPlugin_Attractor::init(){ 
+  Standard_Real u0,v0;
+  int i,j,i0,j0 ;
+  _known.clear();
+  _trial.clear();
+  Handle(Geom_Surface) aSurf = BRep_Tool::Surface(_face);
+  
+  // Calculation of the bounds of the face
+  ShapeAnalysis::GetFaceUVBounds(_face,_u1,_u2,_v1,_v2);
+
+  _gridU = 300;
+  _gridV = 300;
+
+  for (i=0; i<=_gridU; i++){
+    _vectU.push_back(_u1+i*(_u2-_u1)/_gridU) ;
+  }
+  for (j=0; j<=_gridV; j++){
+    _vectV.push_back(_v1+j*(_v2-_v1)/_gridV) ;
+  }
+  
+  // Initialization of _DMap and _known
+  std::vector<double> temp(_gridV+1,std::numeric_limits<double>::infinity());  // Set distance of all "far" points to Infinity 
+  for (i=0; i<=_gridU; i++){
+    _DMap.push_back(temp);
+  }
+  std::vector<bool> temp2(_gridV+1,false);
+  for (i=0; i<=_gridU; i++){
+    _known.push_back(temp2);
+  }
+  
+  
+  // Determination of the starting points
+  TopExp_Explorer anEdgeExp(_attractorShape, TopAbs_EDGE, TopAbs_FACE);
+  TopExp_Explorer aVertExp(_attractorShape, TopAbs_VERTEX, TopAbs_EDGE);
+  
+  for(; anEdgeExp.More(); anEdgeExp.Next()){
+    const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current());
+    edgeInit(aSurf, anEdge);
+  }
+  
+  for(; aVertExp.More(); aVertExp.Next()){
+    const TopoDS_Vertex& aVertex = TopoDS::Vertex(aVertExp.Current());
+    Trial_Pnt TPnt(3,0); 
+    gp_Pnt P = BRep_Tool::Pnt(aVertex);
+    GeomAPI_ProjectPointOnSurf projector( P, aSurf );
+    projector.LowerDistanceParameters(u0,v0);
+    i0 = floor ( (u0 - _u1) * _gridU / (_u2 - _u1) + 0.5 );
+    j0 = floor ( (v0 - _v1) * _gridV / (_v2 - _v1) + 0.5 );
+    TPnt[0]=0.;                                                                // Set the distance of the starting point to 0.
+    TPnt[1]=i0;
+    TPnt[2]=j0;
+    _DMap[i0][j0] = 0.;
+    _trial.insert(TPnt);                                                       // Move starting point to _trial
+  }
+
+  return true;
+}
+
+void BLSURFPlugin_Attractor::edgeInit(Handle(Geom_Surface) theSurf, const TopoDS_Edge& anEdge){
+  gp_Pnt2d P2;
+  double first;
+  double last;
+  int i,j,i0,j0;
+  Trial_Pnt TPnt(3,0);
+  Handle(Geom2d_Curve) aCurve2d; 
+  Handle(Geom_Curve) aCurve3d = BRep_Tool::Curve (anEdge, first, last);
+  ShapeConstruct_ProjectCurveOnSurface curveProjector;
+  curveProjector.Init(theSurf, Precision::Confusion());
+  curveProjector.PerformAdvanced (aCurve3d, first, last, aCurve2d);
+  
+  int N = 1200;
+  for (i=0; i<=N; i++){
+    P2 = aCurve2d->Value(first + i * (last-first) / N);
+    i0 = floor( (P2.X() - _u1) * _gridU / (_u2 - _u1) + 0.5 );
+    j0 = floor( (P2.Y() - _v1) * _gridV / (_v2 - _v1) + 0.5 );
+    TPnt[0] = 0.;
+    TPnt[1] = i0;
+    TPnt[2] = j0;
+    _DMap[i0][j0] = 0.;
+    _trial.insert(TPnt);
+  }
+}  
+
+
+void BLSURFPlugin_Attractor::SetParameters(double Start_Size, double End_Size, double Action_Radius, double Constant_Radius){
+  _startSize = Start_Size;
+  _endSize = End_Size;
+  _actionRadius = Action_Radius;
+  _constantRadius = Constant_Radius;
+}
+
+double BLSURFPlugin_Attractor::_distance(double u, double v){
+  
+  //   BLSURF seems to perform a linear interpolation so it's sufficient to give it a non-continuous distance map
+  int i = floor ( (u - _u1) * _gridU / (_u2 - _u1) + 0.5 );
+  int j = floor ( (v - _v1) * _gridV / (_v2 - _v1) + 0.5 );
+  
+  return _DMap[i][j];
+}
+
+
+double BLSURFPlugin_Attractor::GetSize(double u, double v){   
+  double myDist = 0.5 * (_distance(u,v) - _constantRadius + fabs(_distance(u,v) - _constantRadius));
+  switch(_type)
+  {
+    case TYPE_EXP:
+      if (fabs(_actionRadius) <= std::numeric_limits<double>::epsilon()){ 
+        if (myDist <= std::numeric_limits<double>::epsilon()){
+          return _startSize;
+        }
+        else {
+          return _endSize;
+        }
+      }
+      else{
+        return _endSize - (_endSize - _startSize) * exp(- myDist * myDist / (_actionRadius * _actionRadius) );
+      }
+      break;
+    case TYPE_LIN:
+        return _startSize + ( 0.5 * (_distance(u,v) - _constantRadius + abs(_distance(u,v) - _constantRadius)) ) ;
+      break;
+  }
+}
+
+
+void BLSURFPlugin_Attractor::BuildMap(){ 
+  
+  MESSAGE("building the map");
+  int i, j, k, n;  
+  int count = 0;
+  int ip, jp, kp, np;
+  int i0, j0;
+  gp_Pnt P;
+  gp_Vec D1U,D1V;
+  double Guu, Gvv, Guv;         // Components of the local metric tensor
+  double du, dv;
+  double D_Ref = 0.;
+  double Dist = 0.;
+  bool Dist_changed;
+  IJ_Pnt Current_Pnt(2,0);
+  Trial_Pnt TPnt(3,0);
+  TTrialSet::iterator min;
+  TTrialSet::iterator found;
+  Handle(Geom_Surface) aSurf = BRep_Tool::Surface(_face);
+  
+  // While there are points in "Trial" (representing a kind of advancing front), loop on them -----------------------------------------------------------
+  while (_trial.size() > 0 ){
+    min = _trial.begin();                        // Get trial point with min distance from start
+    i0 = (*min)[1];
+    j0 = (*min)[2];
+    _known[i0][j0] = true;                       // Move it to "Known"
+    _trial.erase(min);                           // Remove it from "Trial"
+    
+    // Loop on neighbours of the trial min --------------------------------------------------------------------------------------------------------------
+    for (i=i0 - 1 ; i <= i0 + 1 ; i++){ 
+      if (!aSurf->IsUPeriodic()){                          // Periodic conditions in U  
+        if (i > _gridU ){
+          break; }
+        else if (i < 0){
+          i++; }
+      }
+      ip = (i + _gridU + 1) % (_gridU+1);                  // We get a periodic index :
+      for (j=j0 - 1 ; j <= j0 + 1 ; j++){                  //    ip=modulo(i,N+2) so that  i=-1->ip=N; i=0 -> ip=0 ; ... ; i=N+1 -> ip=0;  
+        if (!aSurf->IsVPeriodic()){                        // Periodic conditions in V . 
+          if (j > _gridV ){
+            break; }
+          else if (j < 0){
+            j++;
+          }
+        }
+        jp = (j + _gridV + 1) % (_gridV+1);
+      
+        if (!_known[ip][jp]){                              // If the distance is not known yet
+          aSurf->D1(_vectU[ip],_vectV[jp],P,D1U,D1V);      // Calculate the metric tensor at (i,j)
+          // G(i,j)  =  | ||dS/du||**2          *     | 
+          //            | <dS/du,dS/dv>  ||dS/dv||**2 |
+          Guu = D1U.X()*D1U.X() +  D1U.Y()*D1U.Y() + D1U.Z()*D1U.Z();    // Guu = ||dS/du||**2    
+          Gvv = D1V.X()*D1V.X() +  D1V.Y()*D1V.Y() + D1V.Z()*D1V.Z();    // Gvv = ||dS/dv||**2           
+          Guv = D1U.X()*D1V.X() +  D1U.Y()*D1V.Y() + D1U.Z()*D1V.Z();    // Guv = Gvu = < dS/du,dS/dv > 
+          D_Ref = _DMap[ip][jp];                           // Set a ref. distance of the point to its value in _DMap 
+          TPnt[0] = D_Ref;                                 // (may be infinite or uncertain)
+          TPnt[1] = ip;
+          TPnt[2] = jp;
+          Dist_changed = false;
+          
+          // Loop on neighbours to calculate the min distance from them ---------------------------------------------------------------------------------
+          for (k=i - 1 ; k <= i + 1 ; k++){
+            if (!aSurf->IsUPeriodic()){                              // Periodic conditions in U  
+              if(k > _gridU ){
+                break;
+              }
+              else if (k < 0){
+                k++; }
+            }
+            kp = (k + _gridU + 1) % (_gridU+1);                      // periodic index
+            for (n=j - 1 ; n <= j + 1 ; n++){ 
+              if (!aSurf->IsVPeriodic()){                            // Periodic conditions in V 
+                if(n > _gridV){   
+                  break;
+                }
+                else if (n < 0){
+                  n++; }
+              }
+              np = (n + _gridV + 1) % (_gridV+1);                    
+              if (_known[kp][np]){                                   // If the distance of the neighbour is known
+                                                                     // Calculate the distance from (k,n)
+                du = (k-i) * (_u2 - _u1) / _gridU;
+                dv = (n-j) * (_v2 - _v1) / _gridV;
+                Dist = _DMap[kp][np] + sqrt( Guu * du*du + 2*Guv * du*dv + Gvv * dv*dv );   // ds**2 = du'Gdu + 2*du'Gdv + dv'Gdv  (G is always symetrical)
+                if (Dist < D_Ref) {                                  // If smaller than ref. distance  ->  update ref. distance
+                  D_Ref = Dist;
+                  Dist_changed = true;
+                }
+              }
+            }
+          } // End of the loop on neighbours --------------------------------------------------------------------------------------------------------------
+          
+          if (Dist_changed) {                              // If distance has been updated, update _trial 
+            found=_trial.find(TPnt);
+            if (found != _trial.end()){
+              _trial.erase(found);                         // Erase the point if it was already in _trial
+            }
+            TPnt[0] = D_Ref;
+            TPnt[1] = ip;
+            TPnt[2] = jp;
+            _DMap[ip][jp] = D_Ref;                         // Set it distance to the minimum distance found during the loop above
+            _trial.insert(TPnt);                           // Insert it (or reinsert it) in _trial
+          }
+        } // end if (!_known[ip][jp])
+      } // for
+    } // for
+  } // while (_trial)
+  _known.clear();
+  _trial.clear();
+  _isMapBuilt = true;
+} // end of BuildMap()
+
+
+
diff --git a/src/BLSURFPlugin/BLSURFPlugin_Attractor.hxx b/src/BLSURFPlugin/BLSURFPlugin_Attractor.hxx
new file mode 100644 (file)
index 0000000..2c8cb8b
--- /dev/null
@@ -0,0 +1,145 @@
+// Copyright (C) 2007-2012  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_Attractor.hxx
+// Authors : Renaud Nédélec (OCC)
+// ---
+// 
+// The idea of the algorithm used to calculate the distance on a 
+// non-euclidian parametric surface has been found in the ref. below:
+//
+// Ref:"Accurate Anisotropic Fast Marching for Diffusion-Based Geodesic Tractography"
+// S. Jbabdi, P. Bellec, R. Toro, Daunizeau, M. Pélégrini-Issac, and H. Benali1
+//
+
+#ifndef _BLSURFPlugin_Attractor_HXX_
+#define _BLSURFPlugin_Attractor_HXX_
+
+#include <vector>
+#include <map>
+#include <set>
+#include <stdexcept>
+#include <string>
+#include <limits>
+#include <utilities.h>
+
+// OPENCASCADE includes
+#include <BRep_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <NCollection_Map.hxx>
+
+#include <Geom_Surface.hxx>
+#include <Handle_Geom_Surface.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Handle_Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Handle_Geom_Curve.hxx>
+#include <Handle_AIS_InteractiveObject.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Face.hxx>
+
+#include <gp_Pnt2d.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopoDS_Shape.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepTools.hxx>
+
+#include <TopTools_DataMapOfShapeInteger.hxx>
+#include <GProp_GProps.hxx>
+#include <BRepGProp.hxx>
+
+#ifndef WNT
+#include <fenv.h>
+#endif
+
+#include <Standard_ErrorHandler.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <GeomAPI_ProjectPointOnSurf.hxx>
+#include <gp_XY.hxx>
+#include <gp_XYZ.hxx>
+#include <TopTools_MapOfShape.hxx>
+
+#define TYPE_EXP 0
+#define TYPE_LIN 1
+
+class BLSURFPlugin_Attractor {
+  
+  public:
+    
+    BLSURFPlugin_Attractor ();
+    BLSURFPlugin_Attractor (const TopoDS_Face& Face, const TopoDS_Shape& Attractor, const std::string& attEntry); 
+    
+    bool init();                                                // Calculates the discrete points correponding to attractor 
+                                                                // and intialises the map of distances
+    void edgeInit(Handle(Geom_Surface) aSurf, const TopoDS_Edge& anEdge);
+    
+    double              GetSize (double u, double v);
+    TopoDS_Face         GetFace()           const { return _face; }
+    TopoDS_Shape        GetAttractorShape() const { return _attractorShape; }
+    std::string         GetAttractorEntry() const { return _attEntry; }
+    std::vector<double> GetParameters()     const 
+    { 
+      double tab_params[] = {_startSize, _endSize, _actionRadius, _constantRadius}; 
+      std::vector<double> params (tab_params, tab_params + sizeof(tab_params) / sizeof(double) );
+      return params;
+    }
+    
+    void SetParameters(double Start_Size, double End_Size, double Action_Radius, double Constant_Radius);
+    void SetType(int type){ _type = type; }
+    
+    void BuildMap();                                            // Builds the map of distances between source point and any point P(u,v)
+    bool IsMapBuilt() const { return _isMapBuilt; }             // Controls if the map has been built
+    bool Empty()      const { return _isEmpty; }
+  
+    typedef std::vector<double> TDiscreteParam;
+    typedef std::vector< std::vector<double> > TDistMap;
+    typedef std::vector< std::vector<bool> > TPointSet;
+    typedef std::set< std::vector<double> > TTrialSet;
+    typedef std::vector<double> Trial_Pnt;
+    typedef std::vector<int> IJ_Pnt;
+          
+  private:
+    
+    TopoDS_Face       _face;
+    TopoDS_Shape      _attractorShape;
+    std::string       _attEntry;
+    TDiscreteParam    _vectU;
+    TDiscreteParam    _vectV;
+    TDistMap          _DMap;
+    TPointSet         _known;
+    TTrialSet         _trial;
+    int               _type;                                    // Type of function used to calculate the size from the distance (unused for now)
+    int               _gridU;                                   // Number of grid points in U direction
+    int               _gridV;                                   // Number of grid points in V direction
+    double            _u1, _u2, _v1, _v2;                       // Bounds of the parametric space of the face 
+    double            _startSize, _endSize;                     // User parameters
+    double            _actionRadius, _constantRadius;           //
+    
+    bool              _isMapBuilt;
+    bool              _isEmpty;
+    
+    double            _distance(double u, double v);            // Retrieve the value of the distance map at point (u,v) of the parametric space of _face
+};    
+
+#endif
index 39e7d49e6cc99de418743516f2ba0d4651703dff..4743bbaef821c90bed7a808c48ed4aaa9bc345e8 100644 (file)
@@ -1,53 +1,66 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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)
+//           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
-//
+
 #include "BLSURFPlugin_BLSURF.hxx"
 #include "BLSURFPlugin_Hypothesis.hxx"
+#include "BLSURFPlugin_Attractor.hxx"
+
+extern "C"{
+#include <distene/api.h>
+#include <distene/blsurf.h>
+#include <distene/precad.h>
+}
+
+#include <structmember.h>
+
+
+#include <Basics_Utils.hxx>
+#include <Basics_OCCTVersion.hxx>
 
+#include <SMESHDS_Group.hxx>
 #include <SMESH_Gen.hxx>
+#include <SMESH_Group.hxx>
 #include <SMESH_Mesh.hxx>
-#include <SMESH_ControlsDef.hxx>
-
-#include <SMESHDS_Mesh.hxx>
-#include <SMDS_MeshElement.hxx>
-#include <SMDS_MeshNode.hxx>
+#include <SMESH_MeshEditor.hxx>
+#include <SMESH_MesherHelper.hxx>
+#include <StdMeshers_FaceSide.hxx>
 
 #include <utilities.h>
 
+#include <limits>
 #include <list>
 #include <vector>
+#include <set>
+#include <cstdlib>
 
+// OPENCASCADE includes
 #include <BRep_Tool.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
 #include <NCollection_Map.hxx>
-#include <Standard_ErrorHandler.hxx>
-
-extern "C"{
-#include <distene/api.h>
-}
 
 #include <Geom_Surface.hxx>
 #include <Handle_Geom_Surface.hxx>
@@ -55,22 +68,170 @@ extern "C"{
 #include <Handle_Geom2d_Curve.hxx>
 #include <Geom_Curve.hxx>
 #include <Handle_Geom_Curve.hxx>
+#include <Handle_AIS_InteractiveObject.hxx>
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Wire.hxx>
 #include <TopoDS_Face.hxx>
-#include <TopoDS_Shape.hxx>
+
 #include <gp_Pnt2d.hxx>
+#include <gp_Pnt.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
+#include <TopoDS_Shape.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
 #include <BRepTools.hxx>
 
+#include <TopTools_DataMapOfShapeInteger.hxx>
+#include <GProp_GProps.hxx>
+#include <BRepGProp.hxx>
+
 #ifndef WNT
 #include <fenv.h>
 #endif
 
+#include <Standard_ErrorHandler.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <GeomAPI_ProjectPointOnSurf.hxx>
+#include <gp_XY.hxx>
+#include <gp_XYZ.hxx>
+// #include <BRepClass_FaceClassifier.hxx>
+#include <TopTools_MapOfShape.hxx>
+
+/* ==================================
+ * ===========  PYTHON ==============
+ * ==================================*/
+
+typedef struct {
+  PyObject_HEAD
+  int softspace;
+  std::string *out;
+  } PyStdOut;
+
+static void
+PyStdOut_dealloc(PyStdOut *self)
+{
+  PyObject_Del(self);
+}
+
+static PyObject *
+PyStdOut_write(PyStdOut *self, PyObject *args)
+{
+  char *c;
+  int l;
+  if (!PyArg_ParseTuple(args, "t#:write",&c, &l))
+    return NULL;
+
+  //std::cerr << c ;
+  *(self->out)=*(self->out)+c;
+
+  Py_INCREF(Py_None);
+  return Py_None;
+}
+
+static PyMethodDef PyStdOut_methods[] = {
+  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
+    PyDoc_STR("write(string) -> None")},
+  {NULL,    NULL}   /* sentinel */
+};
+
+static PyMemberDef PyStdOut_memberlist[] = {
+  {(char*)"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
+   (char*)"flag indicating that a space needs to be printed; used by print"},
+  {NULL} /* Sentinel */
+};
+
+static PyTypeObject PyStdOut_Type = {
+  /* The ob_type field must be initialized in the module init function
+   * to be portable to Windows without using C++. */
+  PyObject_HEAD_INIT(NULL)
+  0,                            /*ob_size*/
+  "PyOut",                      /*tp_name*/
+  sizeof(PyStdOut),             /*tp_basicsize*/
+  0,                            /*tp_itemsize*/
+  /* methods */
+  (destructor)PyStdOut_dealloc, /*tp_dealloc*/
+  0,                            /*tp_print*/
+  0,                            /*tp_getattr*/
+  0,                            /*tp_setattr*/
+  0,                            /*tp_compare*/
+  0,                            /*tp_repr*/
+  0,                            /*tp_as_number*/
+  0,                            /*tp_as_sequence*/
+  0,                            /*tp_as_mapping*/
+  0,                            /*tp_hash*/
+  0,                            /*tp_call*/
+  0,                            /*tp_str*/
+  PyObject_GenericGetAttr,      /*tp_getattro*/
+  /* softspace is writable:  we must supply tp_setattro */
+  PyObject_GenericSetAttr,      /* tp_setattro */
+  0,                            /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
+  0,                            /*tp_doc*/
+  0,                            /*tp_traverse*/
+  0,                            /*tp_clear*/
+  0,                            /*tp_richcompare*/
+  0,                            /*tp_weaklistoffset*/
+  0,                            /*tp_iter*/
+  0,                            /*tp_iternext*/
+  PyStdOut_methods,             /*tp_methods*/
+  PyStdOut_memberlist,          /*tp_members*/
+  0,                            /*tp_getset*/
+  0,                            /*tp_base*/
+  0,                            /*tp_dict*/
+  0,                            /*tp_descr_get*/
+  0,                            /*tp_descr_set*/
+  0,                            /*tp_dictoffset*/
+  0,                            /*tp_init*/
+  0,                            /*tp_alloc*/
+  0,                            /*tp_new*/
+  0,                            /*tp_free*/
+  0,                            /*tp_is_gc*/
+};
+
+PyObject * newPyStdOut( std::string& out )
+{
+  PyStdOut *self;
+  self = PyObject_New(PyStdOut, &PyStdOut_Type);
+  if (self == NULL)
+    return NULL;
+  self->softspace = 0;
+  self->out=&out;
+  return (PyObject*)self;
+}
+
+
+////////////////////////END PYTHON///////////////////////////
+
+//////////////////MY MAPS////////////////////////////////////////
+TopTools_IndexedMapOfShape FacesWithSizeMap;
+std::map<int,string> FaceId2SizeMap;
+TopTools_IndexedMapOfShape EdgesWithSizeMap;
+std::map<int,string> EdgeId2SizeMap;
+TopTools_IndexedMapOfShape VerticesWithSizeMap;
+std::map<int,string> VertexId2SizeMap;
+
+std::map<int,PyObject*> FaceId2PythonSmp;
+std::map<int,PyObject*> EdgeId2PythonSmp;
+std::map<int,PyObject*> VertexId2PythonSmp;
+
+std::map<int,std::vector<double> > FaceId2AttractorCoords;
+std::map<int,BLSURFPlugin_Attractor*> FaceId2ClassAttractor;
+std::map<int,BLSURFPlugin_Attractor*> FaceIndex2ClassAttractor;
+
+TopTools_IndexedMapOfShape FacesWithEnforcedVertices;
+std::map< int, BLSURFPlugin_Hypothesis::TEnfVertexCoordsList > FaceId2EnforcedVertexCoords;
+std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexCoords > EnfVertexCoords2ProjVertex;
+std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexList > EnfVertexCoords2EnfVertexList;
+
+bool HasSizeMapOnFace=false;
+bool HasSizeMapOnEdge=false;
+bool HasSizeMapOnVertex=false;
+//bool HasAttractorOnFace=false;
+
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -82,15 +243,62 @@ BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF(int hypId, int studyId,
 
   _name = "BLSURF";
   _shapeType = (1 << TopAbs_FACE); // 1 bit /shape type
-  _compatibleHypothesis.push_back("BLSURF_Parameters");
-  _requireDescretBoundary = false;
+  _compatibleHypothesis.push_back(BLSURFPlugin_Hypothesis::GetHypType());
+  _requireDiscreteBoundary = false;
   _onlyUnaryInput = false;
   _hypothesis = NULL;
+  _supportSubmeshes = true;
+
+  smeshGen_i = SMESH_Gen_i::GetSMESHGen();
+  CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
+  SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
+
+  MESSAGE("studyid = " << _studyId);
+
+  myStudy = NULL;
+  myStudy = aStudyMgr->GetStudyByID(_studyId);
+  if (myStudy)
+    MESSAGE("myStudy->StudyId() = " << myStudy->StudyId());
+
+  /* Initialize the Python interpreter */
+  assert(Py_IsInitialized());
+  PyGILState_STATE gstate;
+  gstate = PyGILState_Ensure();
+
+  main_mod = NULL;
+  main_mod = PyImport_AddModule("__main__");
+
+  main_dict = NULL;
+  main_dict = PyModule_GetDict(main_mod);
+
+  PyRun_SimpleString("from math import *");
+  PyGILState_Release(gstate);
+
+  FacesWithSizeMap.Clear();
+  FaceId2SizeMap.clear();
+  EdgesWithSizeMap.Clear();
+  EdgeId2SizeMap.clear();
+  VerticesWithSizeMap.Clear();
+  VertexId2SizeMap.clear();
+  FaceId2PythonSmp.clear();
+  EdgeId2PythonSmp.clear();
+  VertexId2PythonSmp.clear();
+  FaceId2AttractorCoords.clear();
+  FaceId2ClassAttractor.clear();
+  FaceIndex2ClassAttractor.clear();
+  FacesWithEnforcedVertices.Clear();
+  FaceId2EnforcedVertexCoords.clear();
+  EnfVertexCoords2ProjVertex.clear();
+  EnfVertexCoords2EnfVertexList.clear();
+
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+  _compute_canceled = false;
+#endif
 }
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -99,9 +307,10 @@ BLSURFPlugin_BLSURF::~BLSURFPlugin_BLSURF()
   MESSAGE("BLSURFPlugin_BLSURF::~BLSURFPlugin_BLSURF");
 }
 
+
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -165,7 +374,320 @@ inline std::string to_string(int i)
    return o.str();
 }
 
-void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls)
+double _smp_phy_size;
+// #if BLSURF_VERSION_LONG >= "3.1.1"
+// //   sizemap_t *geo_sizemap_e, *geo_sizemap_f;
+//   sizemap_t *iso_sizemap_p, *iso_sizemap_e, *iso_sizemap_f;
+// //   sizemap_t *clean_geo_sizemap_e, *clean_geo_sizemap_f;
+//   sizemap_t *clean_iso_sizemap_p, *clean_iso_sizemap_e, *clean_iso_sizemap_f;
+// #endif
+status_t size_on_surface(integer face_id, real *uv, real *size, void *user_data);
+status_t size_on_edge(integer edge_id, real t, real *size, void *user_data);
+status_t size_on_vertex(integer vertex_id, real *size, void *user_data);
+
+double my_u_min=1e6,my_v_min=1e6,my_u_max=-1e6,my_v_max=-1e6;
+
+typedef struct {
+        gp_XY uv;
+        gp_XYZ xyz;
+} projectionPoint;
+/////////////////////////////////////////////////////////
+projectionPoint getProjectionPoint(const TopoDS_Face& face, const gp_Pnt& point)
+{
+  projectionPoint myPoint;
+  Handle(Geom_Surface) surface = BRep_Tool::Surface(face);
+  GeomAPI_ProjectPointOnSurf projector( point, surface );
+  if ( !projector.IsDone() || projector.NbPoints()==0 )
+    throw "getProjectionPoint: Can't project";
+
+  Quantity_Parameter u,v;
+  projector.LowerDistanceParameters(u,v);
+  myPoint.uv = gp_XY(u,v);
+  gp_Pnt aPnt = projector.NearestPoint();
+  myPoint.xyz = gp_XYZ(aPnt.X(),aPnt.Y(),aPnt.Z());
+  //return gp_XY(u,v);
+  return myPoint;
+}
+/////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////
+double getT(const TopoDS_Edge& edge, const gp_Pnt& point)
+{
+  Standard_Real f,l;
+  Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, f,l);
+  GeomAPI_ProjectPointOnCurve projector( point, curve);
+  if ( projector.NbPoints() == 0 )
+    throw;
+  return projector.LowerDistanceParameter();
+}
+
+/////////////////////////////////////////////////////////
+TopoDS_Shape BLSURFPlugin_BLSURF::entryToShape(std::string entry)
+{
+  MESSAGE("BLSURFPlugin_BLSURF::entryToShape "<<entry );
+  GEOM::GEOM_Object_var aGeomObj;
+  TopoDS_Shape S = TopoDS_Shape();
+  SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() );
+  SALOMEDS::GenericAttribute_var anAttr;
+
+  if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR")) {
+    SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+    CORBA::String_var aVal = anIOR->Value();
+    CORBA::Object_var obj = myStudy->ConvertIORToObject(aVal);
+    aGeomObj = GEOM::GEOM_Object::_narrow(obj);
+  }
+  if ( !aGeomObj->_is_nil() )
+    S = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
+  return S;
+}
+
+void _createEnforcedVertexOnFace(TopoDS_Face faceShape, gp_Pnt aPnt, BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex)
+{
+  BLSURFPlugin_Hypothesis::TEnfVertexCoords enf_coords, coords, s_coords;
+  enf_coords.clear();
+  coords.clear();
+  s_coords.clear();
+
+  // Get the (u,v) values of the enforced vertex on the face
+  projectionPoint myPoint = getProjectionPoint(faceShape,aPnt);
+
+  MESSAGE("Enforced Vertex: " << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z());
+  MESSAGE("Projected Vertex: " << myPoint.xyz.X() << ", " << myPoint.xyz.Y() << ", " << myPoint.xyz.Z());
+  MESSAGE("Parametric coordinates: " << myPoint.uv.X() << ", " << myPoint.uv.Y() );
+
+  enf_coords.push_back(aPnt.X());
+  enf_coords.push_back(aPnt.Y());
+  enf_coords.push_back(aPnt.Z());
+
+  coords.push_back(myPoint.uv.X());
+  coords.push_back(myPoint.uv.Y());
+  coords.push_back(myPoint.xyz.X());
+  coords.push_back(myPoint.xyz.Y());
+  coords.push_back(myPoint.xyz.Z());
+
+  s_coords.push_back(myPoint.xyz.X());
+  s_coords.push_back(myPoint.xyz.Y());
+  s_coords.push_back(myPoint.xyz.Z());
+
+  // Save pair projected vertex / enf vertex
+  MESSAGE("Storing pair projected vertex / enf vertex:");
+  MESSAGE("("<< myPoint.xyz.X() << ", " << myPoint.xyz.Y() << ", " << myPoint.xyz.Z() <<") / (" << aPnt.X() << ", " << aPnt.Y() << ", " << aPnt.Z()<<")");
+  EnfVertexCoords2ProjVertex[s_coords] = enf_coords;
+  MESSAGE("Group name is: \"" << enfVertex->grpName << "\"");
+  pair<BLSURFPlugin_Hypothesis::TEnfVertexList::iterator,bool> ret;
+  BLSURFPlugin_Hypothesis::TEnfVertexList::iterator it;
+  ret = EnfVertexCoords2EnfVertexList[s_coords].insert(enfVertex);
+  if (ret.second == false) {
+    it = ret.first;
+    (*it)->grpName = enfVertex->grpName;
+  }
+
+  int key = 0;
+  if (! FacesWithEnforcedVertices.Contains(faceShape)) {
+    key = FacesWithEnforcedVertices.Add(faceShape);
+  }
+  else {
+    key = FacesWithEnforcedVertices.FindIndex(faceShape);
+  }
+
+  // If a node is already created by an attractor, do not create enforced vertex
+  int attractorKey = FacesWithSizeMap.FindIndex(faceShape);
+  bool sameAttractor = false;
+  if (attractorKey >= 0)
+    if (FaceId2AttractorCoords.count(attractorKey) > 0)
+      if (FaceId2AttractorCoords[attractorKey] == coords)
+        sameAttractor = true;
+
+  if (FaceId2EnforcedVertexCoords.find(key) != FaceId2EnforcedVertexCoords.end()) {
+    MESSAGE("Map of enf. vertex has key " << key)
+    MESSAGE("Enf. vertex list size is: " << FaceId2EnforcedVertexCoords[key].size())
+    if (! sameAttractor)
+      FaceId2EnforcedVertexCoords[key].insert(coords); // there should be no redondant coords here (see std::set management)
+    else
+      MESSAGE("An attractor node is already defined: I don't add the enforced vertex");
+    MESSAGE("New Enf. vertex list size is: " << FaceId2EnforcedVertexCoords[key].size())
+  }
+  else {
+    MESSAGE("Map of enf. vertex has not key " << key << ": creating it")
+    if (! sameAttractor) {
+      BLSURFPlugin_Hypothesis::TEnfVertexCoordsList ens;
+      ens.insert(coords);
+      FaceId2EnforcedVertexCoords[key] = ens;
+    }
+    else
+      MESSAGE("An attractor node is already defined: I don't add the enforced vertex");
+  }
+}
+
+/////////////////////////////////////////////////////////
+void BLSURFPlugin_BLSURF::createEnforcedVertexOnFace(TopoDS_Shape faceShape, BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList)
+{
+  BLSURFPlugin_Hypothesis::TEnfVertex* enfVertex;
+  gp_Pnt aPnt;
+
+  BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator enfVertexListIt = enfVertexList.begin();
+
+  for( ; enfVertexListIt != enfVertexList.end() ; ++enfVertexListIt ) {
+    enfVertex = *enfVertexListIt;
+    // Case of manual coords
+    if (enfVertex->coords.size() != 0) {
+      aPnt.SetCoord(enfVertex->coords[0],enfVertex->coords[1],enfVertex->coords[2]);
+      _createEnforcedVertexOnFace( TopoDS::Face(faceShape),  aPnt, enfVertex);
+    }
+
+    // Case of geom vertex coords
+    if (enfVertex->geomEntry != "") {
+      TopoDS_Shape GeomShape = entryToShape(enfVertex->geomEntry);
+      TopAbs_ShapeEnum GeomType  = GeomShape.ShapeType();
+       if (GeomType == TopAbs_VERTEX){
+         aPnt = BRep_Tool::Pnt(TopoDS::Vertex(GeomShape));
+         _createEnforcedVertexOnFace( TopoDS::Face(faceShape),  aPnt, enfVertex);
+       }
+       // Group Management
+       if (GeomType == TopAbs_COMPOUND){
+         for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
+           if (it.Value().ShapeType() == TopAbs_VERTEX){
+             aPnt = BRep_Tool::Pnt(TopoDS::Vertex(it.Value()));
+             _createEnforcedVertexOnFace( TopoDS::Face(faceShape),  aPnt, enfVertex);
+           }
+         }
+       }
+    }
+  }
+}
+
+/////////////////////////////////////////////////////////
+void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction)
+{
+  MESSAGE("Attractor function: "<< AttractorFunction);
+  double xa, ya, za; // Coordinates of attractor point
+  double a, b;       // Attractor parameter
+  double d = 0.;
+  bool createNode=false; // To create a node on attractor projection
+  int pos1, pos2;
+  const char *sep = ";";
+  // atIt->second has the following pattern:
+  // ATTRACTOR(xa;ya;za;a;b;True|False;d)
+  // where:
+  // xa;ya;za : coordinates of  attractor
+  // a        : desired size on attractor
+  // b        : distance of influence of attractor
+  // d        : distance until which the size remains constant
+  //
+  // We search the parameters in the string
+  // xa
+  pos1 = AttractorFunction.find(sep);
+  if (pos1!=string::npos)
+  xa = atof(AttractorFunction.substr(10, pos1-10).c_str());
+  // ya
+  pos2 = AttractorFunction.find(sep, pos1+1);
+  if (pos2!=string::npos) {
+  ya = atof(AttractorFunction.substr(pos1+1, pos2-pos1-1).c_str());
+  pos1 = pos2;
+  }
+  // za
+  pos2 = AttractorFunction.find(sep, pos1+1);
+  if (pos2!=string::npos) {
+  za = atof(AttractorFunction.substr(pos1+1, pos2-pos1-1).c_str());
+  pos1 = pos2;
+  }
+  // a
+  pos2 = AttractorFunction.find(sep, pos1+1);
+  if (pos2!=string::npos) {
+  a = atof(AttractorFunction.substr(pos1+1, pos2-pos1-1).c_str());
+  pos1 = pos2;
+  }
+  // b
+  pos2 = AttractorFunction.find(sep, pos1+1);
+  if (pos2!=string::npos) {
+  b = atof(AttractorFunction.substr(pos1+1, pos2-pos1-1).c_str());
+  pos1 = pos2;
+  }
+  // createNode
+  pos2 = AttractorFunction.find(sep, pos1+1);
+  if (pos2!=string::npos) {
+    string createNodeStr = AttractorFunction.substr(pos1+1, pos2-pos1-1);
+    MESSAGE("createNode: " << createNodeStr);
+    createNode = (AttractorFunction.substr(pos1+1, pos2-pos1-1) == "True");
+    pos1=pos2;
+  }
+  // d
+  pos2 = AttractorFunction.find(")");
+  if (pos2!=string::npos) {
+  d = atof(AttractorFunction.substr(pos1+1, pos2-pos1-1).c_str());
+  }
+
+  // Get the (u,v) values of the attractor on the face
+  projectionPoint myPoint = getProjectionPoint(TopoDS::Face(GeomShape),gp_Pnt(xa,ya,za));
+  gp_XY uvPoint = myPoint.uv;
+  gp_XYZ xyzPoint = myPoint.xyz;
+  Standard_Real u0 = uvPoint.X();
+  Standard_Real v0 = uvPoint.Y();
+  Standard_Real x0 = xyzPoint.X();
+  Standard_Real y0 = xyzPoint.Y();
+  Standard_Real z0 = xyzPoint.Z();
+  std::vector<double> coords;
+  coords.push_back(u0);
+  coords.push_back(v0);
+  coords.push_back(x0);
+  coords.push_back(y0);
+  coords.push_back(z0);
+  // We construct the python function
+  ostringstream attractorFunctionStream;
+  attractorFunctionStream << "def f(u,v): return ";
+  attractorFunctionStream << _smp_phy_size << "-(" << _smp_phy_size <<"-" << a << ")";
+  //attractorFunctionStream << "*exp(-((u-("<<u0<<"))*(u-("<<u0<<"))+(v-("<<v0<<"))*(v-("<<v0<<")))/(" << b << "*" << b <<"))";
+  // rnc: make possible to keep the size constant until
+  // a defined distance. Distance is expressed as the positiv part
+  // of r-d where r is the distance to (u0,v0)
+  attractorFunctionStream << "*exp(-(0.5*(sqrt((u-"<<u0<<")**2+(v-"<<v0<<")**2)-"<<d<<"+abs(sqrt((u-"<<u0<<")**2+(v-"<<v0<<")**2)-"<<d<<"))/(" << b << "))**2)";
+
+  MESSAGE("Python function for attractor:" << std::endl << attractorFunctionStream.str());
+
+  int key;
+  if (! FacesWithSizeMap.Contains(TopoDS::Face(GeomShape))) {
+    key = FacesWithSizeMap.Add(TopoDS::Face(GeomShape));
+  }
+  else {
+    key = FacesWithSizeMap.FindIndex(TopoDS::Face(GeomShape));
+  }
+  FaceId2SizeMap[key] =attractorFunctionStream.str();
+  if (createNode) {
+    MESSAGE("Creating node on ("<<x0<<","<<y0<<","<<z0<<")");
+    FaceId2AttractorCoords[key] = coords;
+  }
+//   // Test for new attractors
+//   gp_Pnt myP(xyzPoint);
+//   TopoDS_Vertex myV = BRepBuilderAPI_MakeVertex(myP);
+//   BLSURFPlugin_Attractor myAttractor(TopoDS::Face(GeomShape),myV,200);
+//   myAttractor.SetParameters(a, _smp_phy_size, b, d);
+//   myAttractor.SetType(1);
+//   FaceId2ClassAttractor[key] = myAttractor;
+//   if(FaceId2ClassAttractor[key].GetFace().IsNull()){
+//     MESSAGE("face nulle ");
+//   }
+//   else
+//     MESSAGE("face OK");
+//
+//   if (FaceId2ClassAttractor[key].GetAttractorShape().IsNull()){
+//     MESSAGE("pas de point");
+//   }
+//   else
+//     MESSAGE("point OK");
+}
+
+/////////////////////////////////////////////////////////
+
+void BLSURFPlugin_BLSURF::SetParameters(
+// #if BLSURF_VERSION_LONG >= "3.1.1"
+//                                         cad_t *                          c,
+// #endif
+                                        const BLSURFPlugin_Hypothesis* hyp,
+                                        blsurf_session_t *             bls,
+                                        precad_session_t *             pcs,
+                                        SMESH_Mesh&                   mesh,
+                                        bool *                  use_precad
+                                       )
 {
   int    _topology      = BLSURFPlugin_Hypothesis::GetDefaultTopology();
   int    _physicalMesh  = BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh();
@@ -178,6 +700,13 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsu
   bool   _decimesh      = BLSURFPlugin_Hypothesis::GetDefaultDecimesh();
   int    _verb          = BLSURFPlugin_Hypothesis::GetDefaultVerbosity();
 
+  // PreCAD
+  int _precadMergeEdges      = BLSURFPlugin_Hypothesis::GetDefaultPreCADMergeEdges();
+  int _precadRemoveNanoEdges = BLSURFPlugin_Hypothesis::GetDefaultPreCADRemoveNanoEdges();
+  int _precadDiscardInput    = BLSURFPlugin_Hypothesis::GetDefaultPreCADDiscardInput();
+  double _precadEpsNano      = BLSURFPlugin_Hypothesis::GetDefaultPreCADEpsNano();
+
+
   if (hyp) {
     MESSAGE("BLSURFPlugin_BLSURF::SetParameters");
     _topology      = (int) hyp->GetTopology();
@@ -190,7 +719,6 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsu
     _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() )
@@ -204,36 +732,418 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsu
     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
+        MESSAGE("blsurf_set_param(): " << opIt->first << " = " << opIt->second);
         blsurf_set_param(bls, opIt->first.c_str(), opIt->second.c_str());
       }
+      
+    const BLSURFPlugin_Hypothesis::TOptionValues & preCADopts = hyp->GetPreCADOptionValues();
+    for ( opIt = preCADopts.begin(); opIt != preCADopts.end(); ++opIt )
+      if ( !opIt->second.empty() ) {
+        if (_topology == BLSURFPlugin_Hypothesis::PreCAD) {
+          MESSAGE("precad_set_param(): " << opIt->first << " = " << opIt->second);
+          blsurf_set_param(bls, opIt->first.c_str(), opIt->second.c_str());
+        }
+      }
+
+    // PreCAD
+    _precadMergeEdges = hyp->GetPreCADMergeEdges();
+    _precadRemoveNanoEdges = hyp->GetPreCADRemoveNanoEdges();
+    _precadDiscardInput = hyp->GetPreCADDiscardInput();
+    _precadEpsNano = hyp->GetPreCADEpsNano();
 
   } else {
+    //0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry
+    // GetDefaultPhySize() sometimes leads to computation failure
+    _phySize = mesh.GetShapeDiagonalSize() / _gen->GetBoundaryBoxSegmentation();
     MESSAGE("BLSURFPlugin_BLSURF::SetParameters using defaults");
   }
-  
-  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");
+
+  // PreCAD
+  if (_topology == BLSURFPlugin_Hypothesis::PreCAD) {
+    *use_precad = true;
+    precad_set_param(pcs, "verbose",                to_string(_verb).c_str());
+    precad_set_param(pcs, "merge_edges",            _precadMergeEdges ? "1" : "0");
+    precad_set_param(pcs, "remove_nano_edges",      _precadRemoveNanoEdges ? "1" : "0");
+    precad_set_param(pcs, "discard_input_topology", _precadDiscardInput ? "1" : "0");
+    if ( _precadEpsNano != ::BLSURFPlugin_Hypothesis::undefinedDouble() )
+      precad_set_param(pcs, "eps_nano",               to_string(_precadEpsNano).c_str());
+  }
+
+  _smp_phy_size = _phySize;
+  blsurf_set_param(bls, "topo_points",       _topology == BLSURFPlugin_Hypothesis::Process || _topology == BLSURFPlugin_Hypothesis::Process2 ? "1" : "0");
+  blsurf_set_param(bls, "topo_curves",       _topology == BLSURFPlugin_Hypothesis::Process || _topology == BLSURFPlugin_Hypothesis::Process2 ? "1" : "0");
+  blsurf_set_param(bls, "topo_project",      _topology == BLSURFPlugin_Hypothesis::Process || _topology == BLSURFPlugin_Hypothesis::Process2 ? "1" : "0");
+  blsurf_set_param(bls, "clean_boundary",    _topology == BLSURFPlugin_Hypothesis::Process2 ? "1" : "0");
+  blsurf_set_param(bls, "close_boundary",    _topology == BLSURFPlugin_Hypothesis::Process2 ? "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, "relax_size",        _decimesh ? "0": 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",              to_string(_verb).c_str());
+  
+  if (_physicalMesh == BLSURFPlugin_Hypothesis::SizeMap){
+    TopoDS_Shape GeomShape;
+    TopoDS_Shape AttShape;
+    TopAbs_ShapeEnum GeomType;
+    //
+    // Standard Size Maps
+    //
+    MESSAGE("Setting a Size Map");
+    const BLSURFPlugin_Hypothesis::TSizeMap sizeMaps = BLSURFPlugin_Hypothesis::GetSizeMapEntries(hyp);
+    BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
+    for ( ; smIt != sizeMaps.end(); ++smIt ) {
+      if ( !smIt->second.empty() ) {
+        MESSAGE("blsurf_set_sizeMap(): " << smIt->first << " = " << smIt->second);
+        GeomShape = entryToShape(smIt->first);
+        GeomType  = GeomShape.ShapeType();
+        MESSAGE("Geomtype is " << GeomType);
+        int key = -1;
+        // Group Management
+        if (GeomType == TopAbs_COMPOUND){
+          for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
+            // Group of faces
+            if (it.Value().ShapeType() == TopAbs_FACE){
+              HasSizeMapOnFace = true;
+              if (! FacesWithSizeMap.Contains(TopoDS::Face(it.Value()))) {
+                key = FacesWithSizeMap.Add(TopoDS::Face(it.Value()));
+              }
+              else {
+                key = FacesWithSizeMap.FindIndex(TopoDS::Face(it.Value()));
+//                 MESSAGE("Face with key " << key << " already in map");
+              }
+              FaceId2SizeMap[key] = smIt->second;
+            }
+            // Group of edges
+            if (it.Value().ShapeType() == TopAbs_EDGE){
+              HasSizeMapOnEdge = true;
+              HasSizeMapOnFace = true;
+              if (! EdgesWithSizeMap.Contains(TopoDS::Edge(it.Value()))) {
+                key = EdgesWithSizeMap.Add(TopoDS::Edge(it.Value()));
+              }
+              else {
+                key = EdgesWithSizeMap.FindIndex(TopoDS::Edge(it.Value()));
+//                 MESSAGE("Edge with key " << key << " already in map");
+              }
+              EdgeId2SizeMap[key] = smIt->second;
+            }
+            // Group of vertices
+            if (it.Value().ShapeType() == TopAbs_VERTEX){
+              HasSizeMapOnVertex = true;
+              HasSizeMapOnEdge = true;
+              HasSizeMapOnFace = true;
+              if (! VerticesWithSizeMap.Contains(TopoDS::Vertex(it.Value()))) {
+                key = VerticesWithSizeMap.Add(TopoDS::Vertex(it.Value()));
+              }
+              else {
+                key = VerticesWithSizeMap.FindIndex(TopoDS::Vertex(it.Value()));
+                MESSAGE("Group of vertices with key " << key << " already in map");
+              }
+              MESSAGE("Group of vertices with key " << key << " has a size map: " << smIt->second);
+              VertexId2SizeMap[key] = smIt->second;
+            }
+          }
+        }
+        // Single face
+        if (GeomType == TopAbs_FACE){
+          HasSizeMapOnFace = true;
+          if (! FacesWithSizeMap.Contains(TopoDS::Face(GeomShape))) {
+            key = FacesWithSizeMap.Add(TopoDS::Face(GeomShape));
+          }
+          else {
+            key = FacesWithSizeMap.FindIndex(TopoDS::Face(GeomShape));
+//             MESSAGE("Face with key " << key << " already in map");
+          }
+          FaceId2SizeMap[key] = smIt->second;
+        }
+        // Single edge
+        if (GeomType == TopAbs_EDGE){
+          HasSizeMapOnEdge = true;
+          HasSizeMapOnFace = true;
+          if (! EdgesWithSizeMap.Contains(TopoDS::Edge(GeomShape))) {
+            key = EdgesWithSizeMap.Add(TopoDS::Edge(GeomShape));
+          }
+          else {
+            key = EdgesWithSizeMap.FindIndex(TopoDS::Edge(GeomShape));
+//             MESSAGE("Edge with key " << key << " already in map");
+          }
+          EdgeId2SizeMap[key] = smIt->second;
+        }
+        // Single vertex
+        if (GeomType == TopAbs_VERTEX){
+          HasSizeMapOnVertex = true;
+          HasSizeMapOnEdge   = true;
+          HasSizeMapOnFace   = true;
+          if (! VerticesWithSizeMap.Contains(TopoDS::Vertex(GeomShape))) {
+            key = VerticesWithSizeMap.Add(TopoDS::Vertex(GeomShape));
+          }
+          else {
+            key = VerticesWithSizeMap.FindIndex(TopoDS::Vertex(GeomShape));
+             MESSAGE("Vertex with key " << key << " already in map");
+          }
+          MESSAGE("Vertex with key " << key << " has a size map: " << smIt->second);
+          VertexId2SizeMap[key] = smIt->second;
+        }
+      }
+    }
+
+    //
+    // Attractors
+    //
+    // TODO appeler le constructeur des attracteurs directement ici
+    MESSAGE("Setting Attractors");
+    const BLSURFPlugin_Hypothesis::TSizeMap attractors = BLSURFPlugin_Hypothesis::GetAttractorEntries(hyp);
+    BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
+    for ( ; atIt != attractors.end(); ++atIt ) {
+      if ( !atIt->second.empty() ) {
+        MESSAGE("blsurf_set_attractor(): " << atIt->first << " = " << atIt->second);
+        GeomShape = entryToShape(atIt->first);
+        GeomType  = GeomShape.ShapeType();
+        // Group Management
+        if (GeomType == TopAbs_COMPOUND){
+          for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
+            if (it.Value().ShapeType() == TopAbs_FACE){
+              HasSizeMapOnFace = true;
+              createAttractorOnFace(it.Value(), atIt->second);
+            }
+          }
+        }
+
+        if (GeomType == TopAbs_FACE){
+          HasSizeMapOnFace = true;
+          createAttractorOnFace(GeomShape, atIt->second);
+        }
+/*
+        if (GeomType == TopAbs_EDGE){
+          HasSizeMapOnEdge = true;
+          HasSizeMapOnFace = true;
+        EdgeId2SizeMap[TopoDS::Edge(GeomShape).HashCode(IntegerLast())] = atIt->second;
+        }
+        if (GeomType == TopAbs_VERTEX){
+          HasSizeMapOnVertex = true;
+          HasSizeMapOnEdge   = true;
+          HasSizeMapOnFace   = true;
+        VertexId2SizeMap[TopoDS::Vertex(GeomShape).HashCode(IntegerLast())] = atIt->second;
+        }
+*/
+      }
+    }
+
+    // Class Attractors
+    // temporary commented out for testing
+    // TODO
+    //  - Fill in the BLSURFPlugin_Hypothesis::TAttractorMap map in the hypothesis
+    //  - Uncomment and complete this part to construct the attractors from the attractor shape and the passed parameters on each face of the map
+    //  - To do this use the public methodss: SetParameters(several double parameters) and SetType(int type)
+    //  OR, even better:
+    //  - Construct the attractors with an empty dist. map in the hypothesis
+    //  - build the map here for each face with an attractor set and only if the attractor shape as changed since the last call to _buildmap()
+    //  -> define a bool _mapbuilt in the class that is set to false by default and set to true when calling _buildmap()  OK
+
+    const BLSURFPlugin_Hypothesis::TAttractorMap class_attractors = BLSURFPlugin_Hypothesis::GetClassAttractorEntries(hyp);
+    int key=-1;
+    BLSURFPlugin_Hypothesis::TAttractorMap::const_iterator AtIt = class_attractors.begin();
+    for ( ; AtIt != class_attractors.end(); ++AtIt ) {
+      if ( !AtIt->second->Empty() ) {
+       // MESSAGE("blsurf_set_attractor(): " << AtIt->first << " = " << AtIt->second);
+        GeomShape = entryToShape(AtIt->first);
+        AttShape = AtIt->second->GetAttractorShape();
+        GeomType  = GeomShape.ShapeType();
+        // Group Management
+//         if (GeomType == TopAbs_COMPOUND){
+//           for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
+//             if (it.Value().ShapeType() == TopAbs_FACE){
+//               HasAttractorOnFace = true;
+//               myAttractor = BLSURFPluginAttractor(GeomShape, AttShape);
+//             }
+//           }
+//         }
+
+        if (GeomType == TopAbs_FACE
+          && (AttShape.ShapeType() == TopAbs_VERTEX
+           || AttShape.ShapeType() == TopAbs_EDGE
+           || AttShape.ShapeType() == TopAbs_WIRE
+           || AttShape.ShapeType() == TopAbs_COMPOUND) ){
+            HasSizeMapOnFace = true;
+
+            if (! FacesWithSizeMap.Contains(TopoDS::Face(GeomShape)) ) {
+                key = FacesWithSizeMap.Add(TopoDS::Face(GeomShape) );
+            }
+            else {
+              key = FacesWithSizeMap.FindIndex(TopoDS::Face(GeomShape));
+//                 MESSAGE("Face with key " << key << " already in map");
+            }
+
+            FaceId2ClassAttractor[key] = AtIt->second;
+        }
+        else{
+          MESSAGE("Wrong shape type !!")
+        }
+
+      }
+    }
+
+
+    //
+    // Enforced Vertices
+    //
+    MESSAGE("Setting Enforced Vertices");
+    const BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap entryEnfVertexListMap = BLSURFPlugin_Hypothesis::GetAllEnforcedVerticesByFace(hyp);
+    BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator enfIt = entryEnfVertexListMap.begin();
+    for ( ; enfIt != entryEnfVertexListMap.end(); ++enfIt ) {
+      if ( !enfIt->second.empty() ) {
+        GeomShape = entryToShape(enfIt->first);
+        GeomType  = GeomShape.ShapeType();
+        // Group Management
+        if (GeomType == TopAbs_COMPOUND){
+          for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
+            if (it.Value().ShapeType() == TopAbs_FACE){
+              HasSizeMapOnFace = true;
+              createEnforcedVertexOnFace(it.Value(), enfIt->second);
+            }
+          }
+        }
+
+        if (GeomType == TopAbs_FACE){
+          HasSizeMapOnFace = true;
+          createEnforcedVertexOnFace(GeomShape, enfIt->second);
+        }
+      }
+    }
+
+    // Internal vertices
+    bool useInternalVertexAllFaces = BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFaces(hyp);
+    if (useInternalVertexAllFaces) {
+      std::string grpName = BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFacesGroup(hyp);
+      MESSAGE("Setting Internal Enforced Vertices");
+      GeomShape = mesh.GetShapeToMesh();
+      gp_Pnt aPnt;
+      TopExp_Explorer exp (GeomShape, TopAbs_FACE);
+      for (; exp.More(); exp.Next()){
+        MESSAGE("Iterating shapes. Shape type is " << exp.Current().ShapeType());
+        TopExp_Explorer exp_face (exp.Current(), TopAbs_VERTEX);
+        for (; exp_face.More(); exp_face.Next())
+        {
+          // Get coords of vertex
+          // Check if current coords is already in enfVertexList
+          // If coords not in enfVertexList, add new enfVertex
+          aPnt = BRep_Tool::Pnt(TopoDS::Vertex(exp_face.Current()));
+          MESSAGE("Found vertex on face at " << aPnt.X() <<", "<<aPnt.Y()<<", "<<aPnt.Z());
+          BLSURFPlugin_Hypothesis::TEnfVertex* enfVertex = new BLSURFPlugin_Hypothesis::TEnfVertex();
+          enfVertex->coords.push_back(aPnt.X());
+          enfVertex->coords.push_back(aPnt.Y());
+          enfVertex->coords.push_back(aPnt.Z());
+          enfVertex->name = "";
+          enfVertex->faceEntries.clear();
+          enfVertex->geomEntry = "";
+          enfVertex->grpName = grpName;
+          _createEnforcedVertexOnFace( TopoDS::Face(exp.Current()),  aPnt, enfVertex);
+          HasSizeMapOnFace = true;
+        }
+      }
+    }
+
+    MESSAGE("Setting Size Map on FACES ");
+// #if BLSURF_VERSION_LONG < "3.1.1"
+    blsurf_data_set_sizemap_iso_cad_face(bls, size_on_surface, &_smp_phy_size);
+// #else
+//     if (*use_precad)
+//       iso_sizemap_f = sizemap_new(c, distene_sizemap_type_iso_cad_face, (void *)size_on_surface, NULL);
+//     else
+//       clean_iso_sizemap_f = sizemap_new(c, distene_sizemap_type_iso_cad_face, (void *)size_on_surface, NULL);
+// #endif
+
+    if (HasSizeMapOnEdge){
+      MESSAGE("Setting Size Map on EDGES ");
+// #if BLSURF_VERSION_LONG < "3.1.1"
+      blsurf_data_set_sizemap_iso_cad_edge(bls, size_on_edge, &_smp_phy_size);
+// #else
+//       if (*use_precad)
+//         iso_sizemap_e = sizemap_new(c, distene_sizemap_type_iso_cad_edge, (void *)size_on_edge, NULL);
+//       else
+//         clean_iso_sizemap_e = sizemap_new(c, distene_sizemap_type_iso_cad_edge, (void *)size_on_edge, NULL);
+// #endif
+    }
+    if (HasSizeMapOnVertex){
+      MESSAGE("Setting Size Map on VERTICES ");
+// #if BLSURF_VERSION_LONG < "3.1.1"
+      blsurf_data_set_sizemap_iso_cad_point(bls, size_on_vertex, &_smp_phy_size);
+// #else
+//       if (*use_precad)
+//         iso_sizemap_p = sizemap_new(c, distene_sizemap_type_iso_cad_point, (void *)size_on_vertex, NULL);
+//       else
+//         clean_iso_sizemap_p = sizemap_new(c, distene_sizemap_type_iso_cad_point, (void *)size_on_vertex, NULL);
+// #endif
+    }
+  }
 }
 
+namespace
+{
+  /*!
+   * \brief Class correctly terminating usage of BLSURF library at destruction
+   */
+  class BLSURF_Cleaner
+  {
+    context_t *       _ctx;
+    blsurf_session_t* _bls;
+    cad_t *           _cad;
+    dcad_t *          _dcad;
+  public:
+    BLSURF_Cleaner(context_t *       ctx,
+                   blsurf_session_t* bls,
+                   cad_t *           cad,
+                   dcad_t *          dcad)
+      : _ctx ( ctx  ),
+        _bls ( bls  ),
+        _cad ( cad  ),
+        _dcad( dcad )
+    {
+    }
+    ~BLSURF_Cleaner()
+    {
+      blsurf_session_delete(_bls);
+
+      // #if BLSURF_VERSION_LONG >= "3.1.1"
+      // //     if(geo_sizemap_e)
+      // //       distene_sizemap_delete(geo_sizemap_e);
+      // //     if(geo_sizemap_f)
+      // //       distene_sizemap_delete(geo_sizemap_f);
+      //     if(iso_sizemap_p)
+      //       distene_sizemap_delete(iso_sizemap_p);
+      //     if(iso_sizemap_e)
+      //       distene_sizemap_delete(iso_sizemap_e);
+      //     if(iso_sizemap_f)
+      //       distene_sizemap_delete(iso_sizemap_f);
+      // 
+      // //     if(clean_geo_sizemap_e)
+      // //       distene_sizemap_delete(clean_geo_sizemap_e);
+      // //     if(clean_geo_sizemap_f)
+      // //       distene_sizemap_delete(clean_geo_sizemap_f);
+      //     if(clean_iso_sizemap_p)
+      //       distene_sizemap_delete(clean_iso_sizemap_p);
+      //     if(clean_iso_sizemap_e)
+      //       distene_sizemap_delete(clean_iso_sizemap_e);
+      //     if(clean_iso_sizemap_f)
+      //       distene_sizemap_delete(clean_iso_sizemap_f);
+      // #endif
+      
+      cad_delete(_cad);
+      dcad_delete(_dcad);
+      context_delete(_ctx);
+    }
+  };
+} // namespace
+
 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);
+                  real *duu, real *duv, real *dvv, void *user_data);
+status_t message_cb(message_t *msg, void *user_data);
+status_t interrupt_cb(integer *interrupt_status, void *user_data);
 
 //=============================================================================
 /*!
@@ -245,104 +1155,506 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
 
   MESSAGE("BLSURFPlugin_BLSURF::Compute");
 
-  if (aShape.ShapeType() == TopAbs_COMPOUND) {
-    cout << "  the shape is a COMPOUND" << endl;
-  }
-  else {
-    cout << "  the shape is UNKNOWN" << endl;
-  };
+  // Fix problem with locales
+  Kernel_Utils::Localizer aLocalizer;
+
+  /* create a distene context (generic object) */
+  status_t status = STATUS_ERROR;
 
   context_t *ctx =  context_new();
-  context_set_message_callback(ctx, message_callback, &_comment);
 
+  /* Set the message callback in the working context */
+  context_set_message_callback(ctx, message_cb, &_comment);
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+  _compute_canceled = false;
+  context_set_interrupt_callback(ctx, interrupt_cb, this);
+#else
+  context_set_interrupt_callback(ctx, interrupt_cb, NULL);
+#endif
+
+  /* create the CAD object we will work on. It is associated to the context ctx. */
   cad_t *c = cad_new(ctx);
+  dcad_t *dcad = dcad_new(c);
+
+  FacesWithSizeMap.Clear();
+  FaceId2SizeMap.clear();
+  FaceId2ClassAttractor.clear();
+  FaceIndex2ClassAttractor.clear();
+  EdgesWithSizeMap.Clear();
+  EdgeId2SizeMap.clear();
+  VerticesWithSizeMap.Clear();
+  VertexId2SizeMap.clear();
+
+  SMESH_MesherHelper helper( aMesh );
+  // do not call helper.IsQuadraticSubMesh() because submeshes
+  // may be cleaned and helper.myTLinkNodeMap gets invalid in such a case
+  const bool haveQudraticSubMesh = SMESH_MesherHelper( aMesh ).IsQuadraticSubMesh( aShape );
+  helper.SetIsQuadratic( haveQudraticSubMesh );
+  bool needMerge = false;
+  set< SMESH_subMesh* > edgeSubmeshes;
+
+  /* Now fill the CAD object with data from your CAD
+   * environement. This is the most complex part of a successfull
+   * integration.
+   */
+
+  // PreCAD
+  // If user requests it, send the CAD through Distene preprocessor : PreCAD
+  cad_t *cleanc = NULL;
+  precad_session_t *pcs = precad_session_new(ctx);
+  precad_data_set_cad(pcs, c);
+
+  blsurf_session_t *bls = blsurf_session_new(ctx);
+
+  // an object that correctly deletes all blsurf objects at destruction
+  BLSURF_Cleaner cleaner( ctx,bls,c,dcad );
+
+  MESSAGE("BEGIN SetParameters");
+  bool use_precad = false;
+  SetParameters(
+// #if BLSURF_VERSION_LONG >= "3.1.1"
+//     c,
+// #endif
+    _hypothesis, bls, pcs, aMesh, &use_precad);
+  MESSAGE("END SetParameters");
+
+  // needed to prevent the opencascade memory managmement from freeing things
+  vector<Handle(Geom2d_Curve)> curves;
+  vector<Handle(Geom_Surface)> surfaces;
+
+  surfaces.resize(0);
+  curves.resize(0);
+
   TopTools_IndexedMapOfShape fmap;
   TopTools_IndexedMapOfShape emap;
   TopTools_IndexedMapOfShape pmap;
-  vector<Handle(Geom2d_Curve)> curves;
-  vector<Handle(Geom_Surface)> surfaces;
 
   fmap.Clear();
+  FaceId2PythonSmp.clear();
   emap.Clear();
+  EdgeId2PythonSmp.clear();
   pmap.Clear();
-  surfaces.resize(0);
-  curves.resize(0);
+  VertexId2PythonSmp.clear();
+
+  assert(Py_IsInitialized());
+  PyGILState_STATE gstate;
+  gstate = PyGILState_Ensure();
+
+  string theSizeMapStr;
 
+  /****************************************************************************************
+                                  FACES
+  *****************************************************************************************/
   int iface = 0;
+  string bad_end = "return";
+  int faceKey = -1;
+  TopTools_IndexedMapOfShape _map;
+  TopExp::MapShapes(aShape,TopAbs_VERTEX,_map);
+  int ienf = _map.Extent();
+
   for (TopExp_Explorer face_iter(aShape,TopAbs_FACE);face_iter.More();face_iter.Next()) {
     TopoDS_Face f=TopoDS::Face(face_iter.Current());
+
+    // make INTERNAL face oriented FORWARD (issue 0020993)
+    if (f.Orientation() != TopAbs_FORWARD && f.Orientation() != TopAbs_REVERSED )
+      f.Orientation(TopAbs_FORWARD);
+
     if (fmap.FindIndex(f) > 0)
       continue;
-    
+
     fmap.Add(f);
     iface++;
     surfaces.push_back(BRep_Tool::Surface(f));
-    cad_face_t *fce = cad_face_new(c, iface, surf_fun, surfaces.back());  
+
+    /* create an object representing the face for blsurf */
+    /* where face_id is an integer identifying the face.
+     * surf_function is the function that defines the surface
+     * (For this face, it will be called by blsurf with your_face_object_ptr
+     * as last parameter.
+     */
+    cad_face_t *fce = cad_face_new(c, iface, surf_fun, surfaces.back());
+
+    /* by default a face has no tag (color). The following call sets it to the same value as the face_id : */
     cad_face_set_tag(fce, iface);
+
+    /* Set face orientation (optional if you want a well oriented output mesh)*/
     if(f.Orientation() != TopAbs_FORWARD){
       cad_face_set_orientation(fce, CAD_ORIENTATION_REVERSED);
     } else {
       cad_face_set_orientation(fce, CAD_ORIENTATION_FORWARD);
     }
-    
+
+    if (HasSizeMapOnFace && !use_precad){
+//       MESSAGE("A size map is defined on a face")
+//       std::cout << "A size map is defined on a face" << std::endl;
+      // Classic size map
+      faceKey = FacesWithSizeMap.FindIndex(f);
+
+
+      if (FaceId2SizeMap.find(faceKey)!=FaceId2SizeMap.end()){
+        MESSAGE("A size map is defined on face :"<<faceKey)
+        theSizeMapStr = FaceId2SizeMap[faceKey];
+        // check if function ends with "return"
+        if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
+          continue;
+        // Expr To Python function, verification is performed at validation in GUI
+        PyObject * obj = NULL;
+        obj= PyRun_String(theSizeMapStr.c_str(), Py_file_input, main_dict, NULL);
+        Py_DECREF(obj);
+        PyObject * func = NULL;
+        func = PyObject_GetAttrString(main_mod, "f");
+        FaceId2PythonSmp[iface]=func;
+        FaceId2SizeMap.erase(faceKey);
+      }
+
+      // Specific size map = Attractor
+      std::map<int,std::vector<double> >::iterator attractor_iter = FaceId2AttractorCoords.begin();
+
+      for (; attractor_iter != FaceId2AttractorCoords.end(); ++attractor_iter) {
+        if (attractor_iter->first == faceKey) {
+          MESSAGE("Face indice: " << iface);
+          MESSAGE("Adding attractor");
+
+          double xyzCoords[3]  = {attractor_iter->second[2],
+                                  attractor_iter->second[3],
+                                  attractor_iter->second[4]};
+
+          MESSAGE("Check position of vertex =(" << xyzCoords[0] << "," << xyzCoords[1] << "," << xyzCoords[2] << ")");
+          gp_Pnt P(xyzCoords[0],xyzCoords[1],xyzCoords[2]);
+          BRepClass_FaceClassifier scl(f,P,1e-7);
+          // scl.Perform() is bugged. The function was rewritten
+//          scl.Perform();
+          BRepClass_FaceClassifierPerform(&scl,f,P,1e-7);
+          TopAbs_State result = scl.State();
+          MESSAGE("Position of point on face: "<<result);
+          if ( result == TopAbs_OUT )
+              MESSAGE("Point is out of face: node is not created");
+          if ( result == TopAbs_UNKNOWN )
+              MESSAGE("Point position on face is unknown: node is not created");
+          if ( result == TopAbs_ON )
+              MESSAGE("Point is on border of face: node is not created");
+          if ( result == TopAbs_IN )
+          {
+            // Point is inside face and not on border
+            MESSAGE("Point is in face: node is created");
+            double uvCoords[2]   = {attractor_iter->second[0],attractor_iter->second[1]};
+            ienf++;
+            MESSAGE("Add cad point on (u,v)=(" << uvCoords[0] << "," << uvCoords[1] << ") with id = " << ienf);
+            cad_point_t* point_p = cad_point_new(fce, ienf, uvCoords);
+            cad_point_set_tag(point_p, ienf);
+          }
+          FaceId2AttractorCoords.erase(faceKey);
+        }
+      }
+
+      // Class Attractors
+      std::map<int,BLSURFPlugin_Attractor* >::iterator clAttractor_iter = FaceId2ClassAttractor.find(faceKey);
+      if (clAttractor_iter != FaceId2ClassAttractor.end()){
+          MESSAGE("Face indice: " << iface);
+          MESSAGE("Adding attractor");
+          FaceIndex2ClassAttractor[iface]=clAttractor_iter->second;
+          FaceId2ClassAttractor.erase(clAttractor_iter);
+        }
+      }
+
+      // Enforced Vertices
+      faceKey = FacesWithEnforcedVertices.FindIndex(f);
+      std::map<int,BLSURFPlugin_Hypothesis::TEnfVertexCoordsList >::const_iterator evmIt = FaceId2EnforcedVertexCoords.find(faceKey);
+      if (evmIt != FaceId2EnforcedVertexCoords.end()) {
+        MESSAGE("Some enforced vertices are defined");
+        BLSURFPlugin_Hypothesis::TEnfVertexCoordsList evl;
+        MESSAGE("Face indice: " << iface);
+        MESSAGE("Adding enforced vertices");
+        evl = evmIt->second;
+        MESSAGE("Number of vertices to add: "<< evl.size());
+        BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator evlIt = evl.begin();
+        for (; evlIt != evl.end(); ++evlIt) {
+          BLSURFPlugin_Hypothesis::TEnfVertexCoords xyzCoords;
+          xyzCoords.push_back(evlIt->at(2));
+          xyzCoords.push_back(evlIt->at(3));
+          xyzCoords.push_back(evlIt->at(4));
+          MESSAGE("Check position of vertex =(" << xyzCoords[0] << "," << xyzCoords[1] << "," << xyzCoords[2] << ")");
+          gp_Pnt P(xyzCoords[0],xyzCoords[1],xyzCoords[2]);
+          BRepClass_FaceClassifier scl(f,P,1e-7);
+          // OCC 6.3sp6 : scl.Perform() is bugged. The function was rewritten
+//          BRepClass_FaceClassifierPerform(&scl,f,P,1e-7);
+          // OCC 6.5.2: scl.Perform() is not bugged anymore
+          scl.Perform(f, P, 1e-7);
+          TopAbs_State result = scl.State();
+          MESSAGE("Position of point on face: "<<result);
+          if ( result == TopAbs_OUT ) {
+            MESSAGE("Point is out of face: node is not created");
+            if (EnfVertexCoords2ProjVertex.find(xyzCoords) != EnfVertexCoords2ProjVertex.end()) {
+              EnfVertexCoords2ProjVertex.erase(xyzCoords);
+              EnfVertexCoords2EnfVertexList.erase(xyzCoords);
+            }
+          }
+          if ( result == TopAbs_UNKNOWN ) {
+            MESSAGE("Point position on face is unknown: node is not created");
+            if (EnfVertexCoords2ProjVertex.find(xyzCoords) != EnfVertexCoords2ProjVertex.end()) {
+              EnfVertexCoords2ProjVertex.erase(xyzCoords);
+              EnfVertexCoords2EnfVertexList.erase(xyzCoords);
+            }
+          }
+          if ( result == TopAbs_ON ) {
+            MESSAGE("Point is on border of face: node is not created");
+            if (EnfVertexCoords2ProjVertex.find(xyzCoords) != EnfVertexCoords2ProjVertex.end()) {
+              EnfVertexCoords2ProjVertex.erase(xyzCoords);
+              EnfVertexCoords2EnfVertexList.erase(xyzCoords);
+            }
+          }
+          if ( result == TopAbs_IN )
+          {
+            // Point is inside face and not on border
+            MESSAGE("Point is in face: node is created");
+            double uvCoords[2]   = {evlIt->at(0),evlIt->at(1)};
+            ienf++;
+            MESSAGE("Add cad point on (u,v)=(" << uvCoords[0] << "," << uvCoords[1] << ") with id = " << ienf);
+            cad_point_t* point_p = cad_point_new(fce, ienf, uvCoords);
+            cad_point_set_tag(point_p, ienf);
+          }
+        }
+        FaceId2EnforcedVertexCoords.erase(faceKey);
+      }
+//       else
+//         std::cout << "No enforced vertex defined" << std::endl;
+//     }
+
+
+    /****************************************************************************************
+                                    EDGES
+                   now create the edges associated to this face
+    *****************************************************************************************/
+    int edgeKey = -1;
     for (TopExp_Explorer edge_iter(f,TopAbs_EDGE);edge_iter.More();edge_iter.Next()) {
       TopoDS_Edge e = TopoDS::Edge(edge_iter.Current());
       int ic = emap.FindIndex(e);
       if (ic <= 0)
-       ic = emap.Add(e);
-      
+        ic = emap.Add(e);
+
       double tmin,tmax;
       curves.push_back(BRep_Tool::CurveOnSurface(e, f, tmin, tmax));
+
+      if (HasSizeMapOnEdge){
+        edgeKey = EdgesWithSizeMap.FindIndex(e);
+        if (EdgeId2SizeMap.find(edgeKey)!=EdgeId2SizeMap.end()) {
+          MESSAGE("Sizemap defined on edge with index " << edgeKey);
+          theSizeMapStr = EdgeId2SizeMap[edgeKey];
+          if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
+            continue;
+          // Expr To Python function, verification is performed at validation in GUI
+          PyObject * obj = NULL;
+          obj= PyRun_String(theSizeMapStr.c_str(), Py_file_input, main_dict, NULL);
+          Py_DECREF(obj);
+          PyObject * func = NULL;
+          func = PyObject_GetAttrString(main_mod, "f");
+          EdgeId2PythonSmp[ic]=func;
+          EdgeId2SizeMap.erase(edgeKey);
+        }
+      }
+
+      /* attach the edge to the current blsurf face */
       cad_edge_t *edg = cad_edge_new(fce, ic, tmin, tmax, curv_fun, curves.back());
+
+      /* by default an edge has no tag (color). The following call sets it to the same value as the edge_id : */
       cad_edge_set_tag(edg, ic);
+
+      /* by default, an edge does not necessalry appear in the resulting mesh,
+     unless the following property is set :
+      */
       cad_edge_set_property(edg, EDGE_PROPERTY_SOFT_REQUIRED);
+
+      /* by default an edge is a boundary edge */
       if (e.Orientation() == TopAbs_INTERNAL)
         cad_edge_set_property(edg, EDGE_PROPERTY_INTERNAL);
 
+      // pass existing nodes of sub-meshes to BLSURF
+      SMESH_subMesh* sm = aMesh.GetSubMesh( e );
+      if ( !sm->IsEmpty() )
+      {
+        edgeSubmeshes.insert( sm );
+
+        StdMeshers_FaceSide edgeOfFace( f, e, &aMesh, e.Orientation() == TopAbs_FORWARD,
+                                        /*ignoreMedium=*/haveQudraticSubMesh);
+        if ( edgeOfFace.MissVertexNode() )
+          return error(COMPERR_BAD_INPUT_MESH,"No node on vertex");
+
+        const int nbNodes = edgeOfFace.NbPoints();
+
+        dcad_edge_discretization_t *dedge;
+        dcad_get_edge_discretization(dcad, edg, &dedge);
+        dcad_edge_discretization_set_vertex_count( dedge, nbNodes );
+
+        const std::vector<UVPtStruct>& nodeData = edgeOfFace.GetUVPtStruct();
+        for ( int iN = 0; iN < nbNodes; ++iN )
+        {
+          const UVPtStruct& nData = nodeData[ iN ];
+          double t                = nData.param;
+          real uv[2]              = { nData.u, nData.v };
+          SMESH_TNodeXYZ nXYZ( nData.node );
+          dcad_edge_discretization_set_vertex_coordinates( dedge, iN+1, t, uv, nXYZ._xyz );
+        }
+        dcad_edge_discretization_set_property(dedge, DISTENE_DCAD_PROPERTY_REQUIRED);
+      }
+
+      /****************************************************************************************
+                                      VERTICES
+      *****************************************************************************************/
+
       int npts = 0;
       int ip1, ip2, *ip;
       gp_Pnt2d e0 = curves.back()->Value(tmin);
       gp_Pnt ee0 = surfaces.back()->Value(e0.X(), e0.Y());
       Standard_Real d1=0,d2=0;
+
+      int vertexKey = -1;
       for (TopExp_Explorer ex_edge(e ,TopAbs_VERTEX); ex_edge.More(); ex_edge.Next()) {
-       TopoDS_Vertex v = TopoDS::Vertex(ex_edge.Current());
-
-       ++npts;
-       if (npts == 1){
-         ip = &ip1;
-         d1 = ee0.SquareDistance(BRep_Tool::Pnt(v));
-       } else {
-         ip = &ip2;
+        TopoDS_Vertex v = TopoDS::Vertex(ex_edge.Current());
+        ++npts;
+        if (npts == 1){
+          ip = &ip1;
+          d1 = ee0.SquareDistance(BRep_Tool::Pnt(v));
+        } else {
+          ip = &ip2;
           d2 = ee0.SquareDistance(BRep_Tool::Pnt(v));
-       }
-       *ip = pmap.FindIndex(v);
-       if(*ip <= 0)
-         *ip = pmap.Add(v);
+        }
+        *ip = pmap.FindIndex(v);
+        if(*ip <= 0)
+          *ip = pmap.Add(v);
+
+        if (HasSizeMapOnVertex){
+          vertexKey = VerticesWithSizeMap.FindIndex(v);
+          if (VertexId2SizeMap.find(vertexKey)!=VertexId2SizeMap.end()){
+            theSizeMapStr = VertexId2SizeMap[vertexKey];
+            //MESSAGE("VertexId2SizeMap[faceKey]: " << VertexId2SizeMap[vertexKey]);
+            if (theSizeMapStr.find(bad_end) == (theSizeMapStr.size()-bad_end.size()-1))
+              continue;
+            // Expr To Python function, verification is performed at validation in GUI
+            PyObject * obj = NULL;
+            obj= PyRun_String(theSizeMapStr.c_str(), Py_file_input, main_dict, NULL);
+            Py_DECREF(obj);
+            PyObject * func = NULL;
+            func = PyObject_GetAttrString(main_mod, "f");
+            VertexId2PythonSmp[*ip]=func;
+            VertexId2SizeMap.erase(vertexKey);   // do not erase if using a vector
+          }
+        }
       }
       if (npts != 2) {
-       // should not happen 
-       cout << "An edge does not have 2 extremities." << endl;
+        // should not happen
+        MESSAGE("An edge does not have 2 extremities.");
       } else {
-       if (d1 < d2)
-         cad_edge_set_extremities(edg, ip1, ip2);
-       else
-         cad_edge_set_extremities(edg, ip2, ip1);
+        if (d1 < d2) {
+          // This defines the curves extremity connectivity
+          cad_edge_set_extremities(edg, ip1, ip2);
+          /* set the tag (color) to the same value as the extremity id : */
+          cad_edge_set_extremities_tag(edg, ip1, ip2);
+        }
+        else {
+          cad_edge_set_extremities(edg, ip2, ip1);
+          cad_edge_set_extremities_tag(edg, ip2, ip1);
+        }
       }
     } // for edge
   } //for face
 
+  // Clear mesh from already meshed edges if possible else
+  // remember that merge is needed
+  set< SMESH_subMesh* >::iterator smIt = edgeSubmeshes.begin();
+  for ( ; smIt != edgeSubmeshes.end(); ++smIt )
+  {
+    SMESH_subMesh* sm = *smIt;
+    SMESH_subMeshIteratorPtr subsmIt = sm->getDependsOnIterator( /*includeSelf=*/true,
+                                                                 /*complexFirst=*/false);
+    while ( subsmIt->more() )
+    {
+      sm = subsmIt->next();
+      if ( SMESHDS_SubMesh* smDS = sm->GetSubMeshDS() )
+      {
+        SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
+        if ( nIt->more() )
+        {
+          const SMDS_MeshNode* n = nIt->next();
+          if ( n->NbInverseElements( SMDSAbs_Face ) > 0 )
+          {
+            needMerge = true;
+            // add existing medium nodes to helper
+            if ( aMesh.NbEdges( ORDER_QUADRATIC ) > 0 )
+            {
+              SMDS_ElemIteratorPtr edgeIt = smDS->GetElements();
+              while ( edgeIt->more() )
+                helper.AddTLinks( static_cast<const SMDS_MeshEdge*>(edgeIt->next()));
+            }
+          }
+          else
+          {
+            sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
+          }
+        }
+      }
+    }
+  }
 
+  PyGILState_Release(gstate);
 
+  if (use_precad){
+    /* Now launch the PreCAD process */
+    status = precad_process(pcs);
+    if(status != STATUS_OK){
+      cout << "PreCAD processing failed with error code " << status << "\n";
+      // Now we can delete the PreCAD session
+      precad_session_delete(pcs);
+    }
+    else {
+      // retrieve the pre-processed CAD object
+      cleanc = precad_new_cad(pcs);
+      if(!cleanc){
+        cout << "Unable to retrieve PreCAD result \n";
+      }
+      cout << "PreCAD processing successfull \n";
+
+// #if BLSURF_VERSION_LONG >= "3.1.1"
+//       /* We can now get the updated sizemaps (if any) */
+// //       if(geo_sizemap_e)
+// //         clean_geo_sizemap_e = precad_new_sizemap(pcs, geo_sizemap_e);
+// // 
+// //       if(geo_sizemap_f)
+// //         clean_geo_sizemap_f = precad_new_sizemap(pcs, geo_sizemap_f);
+// 
+//       if(iso_sizemap_p)
+//         clean_iso_sizemap_p = precad_new_sizemap(pcs, iso_sizemap_p);
+// 
+//       if(iso_sizemap_e)
+//         clean_iso_sizemap_e = precad_new_sizemap(pcs, iso_sizemap_e);
+// 
+//       if(iso_sizemap_f)
+//         clean_iso_sizemap_f = precad_new_sizemap(pcs, iso_sizemap_f);
+// #endif
+      
+      // Now we can delete the PreCAD session 
+      precad_session_delete(pcs);
+    }
+  }
 
-  blsurf_session_t *bls = blsurf_session_new(ctx);
-  blsurf_data_set_cad(bls, c);
+  blsurf_data_set_dcad(bls, dcad);
+  if (cleanc) {
+    // Give the pre-processed CAD object to the current BLSurf session
+    blsurf_data_set_cad(bls, cleanc);
+  }
+  else {
+    // Use the original one
+    blsurf_data_set_cad(bls, c);
+  }
 
-  SetParameters(_hypothesis, bls);
+// #if BLSURF_VERSION_LONG >= "3.1.1"
+//   blsurf_data_set_sizemap(bls, clean_iso_sizemap_p);
+//   blsurf_data_set_sizemap(bls, clean_iso_sizemap_e);
+//   blsurf_data_set_sizemap(bls, clean_iso_sizemap_f);
+// #endif
 
-  cout << endl;
-  cout << "Beginning of Surface Mesh generation" << endl;
-  cout << endl;
+  std::cout << std::endl;
+  std::cout << "Beginning of Surface Mesh generation" << std::endl;
+  std::cout << std::endl;
 
   // Issue 0019864. On DebianSarge, FE signals do not obey to OSD::SetSignal(false)
 #ifndef WNT
@@ -350,8 +1662,6 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
   int oldFEFlags = fedisableexcept( FE_ALL_EXCEPT );
 #endif
 
-    status_t status = STATUS_ERROR;
-
   try {
     OCC_CATCH_SIGNALS;
 
@@ -373,28 +1683,49 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
       _comment = "Exception in blsurf_compute_mesh()";
   }
   if ( status != STATUS_OK) {
-    blsurf_session_delete(bls);
-    cad_delete(c);
-    context_delete(ctx);
-
-    return error(_comment);
+    // There was an error while meshing
+    //return error(_comment);
   }
 
-  cout << endl;
-  cout << "End of Surface Mesh generation" << endl;
-  cout << endl;
+  std::cout << std::endl;
+  std::cout << "End of Surface Mesh generation" << std::endl;
+  std::cout << std::endl;
 
-  mesh_t *msh;
+  mesh_t *msh = NULL;
   blsurf_data_get_mesh(bls, &msh);
   if(!msh){
-    blsurf_session_delete(bls);
-    cad_delete(c);
-    context_delete(ctx);
-    
+    /* release the mesh object */
+    blsurf_data_regain_mesh(bls, msh);
     return error(_comment);
-    //return false;
   }
-  
+
+  std::string GMFFileName = BLSURFPlugin_Hypothesis::GetDefaultGMFFile();
+  if (_hypothesis)
+    GMFFileName = _hypothesis->GetGMFFile();
+  if (GMFFileName != "") {
+//     bool GMFFileMode = _hypothesis->GetGMFFileMode();
+    bool asciiFound = (GMFFileName.find(".mesh",GMFFileName.length()-5) != std::string::npos);
+    bool binaryFound = (GMFFileName.find(".meshb",GMFFileName.length()-6) != std::string::npos);
+    if (!asciiFound && !binaryFound)
+      GMFFileName.append(".mesh");
+    /*
+    if (GMFFileMode) {
+      if (!binaryFound) {
+        if (asciiFound)
+          GMFFileName.append("b");
+        else
+          GMFFileName.append(".meshb");
+      }
+    }
+    else {
+      if (!asciiFound)
+        GMFFileName.append(".mesh");
+    }
+    */
+    mesh_write_mesh(msh, GMFFileName.c_str());
+  }
+
+  /* retrieve mesh data (see distene/mesh.h) */
   integer nv, ne, nt, nq, vtx[4], tag;
   real xyz[3];
 
@@ -403,17 +1734,86 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
   mesh_get_triangle_count(msh, &nt);
   mesh_get_quadrangle_count(msh, &nq);
 
-  
+
   SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
   SMDS_MeshNode** nodes = new SMDS_MeshNode*[nv+1];
   bool* tags = new bool[nv+1];
 
+  /* enumerated vertices */
   for(int iv=1;iv<=nv;iv++) {
     mesh_get_vertex_coordinates(msh, iv, xyz);
-    mesh_get_vertex_tag(msh, iv, &tag);    
+    mesh_get_vertex_tag(msh, iv, &tag);
+    // Issue 0020656. Use vertex coordinates
+    if ( tag > 0 && tag <= pmap.Extent() ) {
+      TopoDS_Vertex v = TopoDS::Vertex(pmap(tag));
+      double tol = BRep_Tool::Tolerance( v );
+      gp_Pnt p = BRep_Tool::Pnt( v );
+      if ( p.IsEqual( gp_Pnt( xyz[0], xyz[1], xyz[2]), 2*tol))
+        xyz[0] = p.X(), xyz[1] = p.Y(), xyz[2] = p.Z();
+      else
+        tag = 0; // enforced or attracted vertex
+    }
     nodes[iv] = meshDS->AddNode(xyz[0], xyz[1], xyz[2]);
+
+    // Create group of enforced vertices if requested
+    BLSURFPlugin_Hypothesis::TEnfVertexCoords projVertex;
+    projVertex.clear();
+    projVertex.push_back((double)xyz[0]);
+    projVertex.push_back((double)xyz[1]);
+    projVertex.push_back((double)xyz[2]);
+    std::map< BLSURFPlugin_Hypothesis::TEnfVertexCoords, BLSURFPlugin_Hypothesis::TEnfVertexList >::const_iterator enfCoordsIt = EnfVertexCoords2EnfVertexList.find(projVertex);
+    if (enfCoordsIt != EnfVertexCoords2EnfVertexList.end()) {
+      MESSAGE("Found enforced vertex @ " << xyz[0] << ", " << xyz[1] << ", " << xyz[2]);
+      BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator enfListIt = enfCoordsIt->second.begin();
+      BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
+      for (; enfListIt != enfCoordsIt->second.end(); ++enfListIt) {
+        currentEnfVertex = (*enfListIt);
+        if (currentEnfVertex->grpName != "") {
+          bool groupDone = false;
+          SMESH_Mesh::GroupIteratorPtr grIt = aMesh.GetGroups();
+          MESSAGE("currentEnfVertex->grpName: " << currentEnfVertex->grpName);
+          MESSAGE("Parsing the groups of the mesh");
+          while (grIt->more()) {
+            SMESH_Group * group = grIt->next();
+            if ( !group ) continue;
+            MESSAGE("Group: " << group->GetName());
+            SMESHDS_GroupBase* groupDS = group->GetGroupDS();
+            if ( !groupDS ) continue;
+            MESSAGE("group->SMDSGroup().GetType(): " << (groupDS->GetType()));
+            MESSAGE("group->SMDSGroup().GetType()==SMDSAbs_Node: " << (groupDS->GetType()==SMDSAbs_Node));
+            MESSAGE("currentEnfVertex->grpName.compare(group->GetStoreName())==0: " << (currentEnfVertex->grpName.compare(group->GetName())==0));
+            if ( groupDS->GetType()==SMDSAbs_Node && currentEnfVertex->grpName.compare(group->GetName())==0) {
+              SMESHDS_Group* aGroupDS = static_cast<SMESHDS_Group*>( groupDS );
+              aGroupDS->SMDSGroup().Add(nodes[iv]);
+              MESSAGE("Node ID: " << nodes[iv]->GetID());
+              // How can I inform the hypothesis ?
+//                 _hypothesis->AddEnfVertexNodeID(currentEnfVertex->grpName,nodes[iv]->GetID());
+              groupDone = true;
+              MESSAGE("Successfully added enforced vertex to existing group " << currentEnfVertex->grpName);
+              break;
+            }
+          }
+          if (!groupDone)
+          {
+            int groupId;
+            SMESH_Group* aGroup = aMesh.AddGroup(SMDSAbs_Node, currentEnfVertex->grpName.c_str(), groupId);
+            aGroup->SetName( currentEnfVertex->grpName.c_str() );
+            SMESHDS_Group* aGroupDS = static_cast<SMESHDS_Group*>( aGroup->GetGroupDS() );
+            aGroupDS->SMDSGroup().Add(nodes[iv]);
+            MESSAGE("Successfully created enforced vertex group " << currentEnfVertex->grpName);
+            groupDone = true;
+          }
+          if (!groupDone)
+            throw SALOME_Exception(LOCALIZED("An enforced vertex node was not added to a group"));
+        }
+        else
+          MESSAGE("Group name is empty: '"<<currentEnfVertex->grpName<<"' => group is not created");
+      }
+    }
+
+
     // internal point are tagged to zero
-    if(tag){
+    if(tag > 0 && tag <= pmap.Extent() ){
       meshDS->SetNodeOnVertex(nodes[iv], TopoDS::Vertex(pmap(tag)));
       tags[iv] = false;
     } else {
@@ -421,27 +1821,28 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
     }
   }
 
+  /* enumerate edges */
   for(int it=1;it<=ne;it++) {
-    mesh_get_edge_vertices(msh, it, vtx);
-    SMDS_MeshEdge* edg = meshDS->AddEdge(nodes[vtx[0]], nodes[vtx[1]]);
-    mesh_get_edge_tag(msh, it, &tag);    
 
+    mesh_get_edge_vertices(msh, it, vtx);
+    mesh_get_edge_tag(msh, it, &tag);
     if (tags[vtx[0]]) {
-      meshDS->SetNodeOnEdge(nodes[vtx[0]], TopoDS::Edge(emap(tag)));
+      Set_NodeOnEdge(meshDS, nodes[vtx[0]], emap(tag));
       tags[vtx[0]] = false;
     };
     if (tags[vtx[1]]) {
-      meshDS->SetNodeOnEdge(nodes[vtx[1]], TopoDS::Edge(emap(tag)));
+      Set_NodeOnEdge(meshDS, nodes[vtx[1]], emap(tag));
       tags[vtx[1]] = false;
     };
+    SMDS_MeshEdge* edg = helper.AddEdge(nodes[vtx[0]], nodes[vtx[1]]);
     meshDS->SetMeshElementOnShape(edg, TopoDS::Edge(emap(tag)));
-    
   }
 
+  /* enumerate triangles */
   for(int it=1;it<=nt;it++) {
     mesh_get_triangle_vertices(msh, it, vtx);
-    SMDS_MeshFace* tri = meshDS->AddFace(nodes[vtx[0]], nodes[vtx[1]], nodes[vtx[2]]);
-    mesh_get_triangle_tag(msh, it, &tag);    
+    SMDS_MeshFace* tri = helper.AddFace(nodes[vtx[0]], nodes[vtx[1]], nodes[vtx[2]]);
+    mesh_get_triangle_tag(msh, it, &tag);
     meshDS->SetMeshElementOnShape(tri, TopoDS::Face(fmap(tag)));
     if (tags[vtx[0]]) {
       meshDS->SetNodeOnFace(nodes[vtx[0]], TopoDS::Face(fmap(tag)));
@@ -457,10 +1858,11 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
     };
   }
 
+  /* enumerate quadrangles */
   for(int it=1;it<=nq;it++) {
     mesh_get_quadrangle_vertices(msh, it, vtx);
-    SMDS_MeshFace* quad = meshDS->AddFace(nodes[vtx[0]], nodes[vtx[1]], nodes[vtx[2]], nodes[vtx[3]]);
-    mesh_get_quadrangle_tag(msh, it, &tag);    
+    SMDS_MeshFace* quad = helper.AddFace(nodes[vtx[0]], nodes[vtx[1]], nodes[vtx[2]], nodes[vtx[3]]);
+    mesh_get_quadrangle_tag(msh, it, &tag);
     meshDS->SetMeshElementOnShape(quad, TopoDS::Face(fmap(tag)));
     if (tags[vtx[0]]) {
       meshDS->SetNodeOnFace(nodes[vtx[0]], TopoDS::Face(fmap(tag)));
@@ -480,30 +1882,131 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape)
     };
   }
 
-  delete nodes;
+  // SetIsAlwaysComputed( true ) to sub-meshes of degenerated EDGEs
+  TopLoc_Location loc; double f,l;
+  for (int i = 1; i <= emap.Extent(); i++)
+    if ( BRep_Tool::Curve(TopoDS::Edge( emap( i )), loc, f,l).IsNull() )
+      if ( SMESH_subMesh* sm = aMesh.GetSubMeshContaining( emap( i )))
+        sm->SetIsAlwaysComputed( true );
+  for (int i = 1; i <= pmap.Extent(); i++)
+      if ( SMESH_subMesh* sm = aMesh.GetSubMeshContaining( pmap( i )))
+        if ( !sm->IsMeshComputed() )
+          sm->SetIsAlwaysComputed( true );
+
+  if ( needMerge )
+  {
+    set< SMESH_subMesh* >::iterator smIt = edgeSubmeshes.begin();
+    for ( ; smIt != edgeSubmeshes.end(); ++smIt )
+    {
+      SMESH_subMesh* sm = *smIt;
+      SMESH_subMeshIteratorPtr subsmIt = sm->getDependsOnIterator( /*includeSelf=*/true,
+                                                                   /*complexFirst=*/false);
+      TIDSortedNodeSet nodesOnEdge;
+      double mergeTolerance = 1e-7, tol;
+      while ( subsmIt->more() )
+      {
+        // get nodes from an edge
+        sm = subsmIt->next();
+        if ( SMESHDS_SubMesh* smDS = sm->GetSubMeshDS() )
+        {
+          SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
+          while ( nIt->more() )
+            nodesOnEdge.insert( nIt->next() );
+        }
+        // get max tolerance
+        TopoDS_Shape subShape = sm->GetSubShape();
+        if ( subShape.ShapeType() == TopAbs_EDGE )
+          tol = BRep_Tool::Tolerance( TopoDS::Edge( subShape ));
+        else
+          tol = BRep_Tool::Tolerance( TopoDS::Vertex( subShape ));
+        mergeTolerance = Max( tol, mergeTolerance );
+      }
+      // find nodes to merge
+      SMESH_MeshEditor::TListOfListOfNodes nodeGroupsToMerge;
+      SMESH_MeshEditor editor( &aMesh );
+      editor.FindCoincidentNodes( nodesOnEdge, mergeTolerance*2, nodeGroupsToMerge );
+      // merge
+      editor.MergeNodes( nodeGroupsToMerge );
+    }
+  }
+
+  delete [] nodes;
 
   /* release the mesh object */
   blsurf_data_regain_mesh(bls, msh);
 
-  /* clean up everything */
-  blsurf_session_delete(bls);
-  cad_delete(c);
-
-  context_delete(ctx);
-
   // Issue 0019864. On DebianSarge, FE signals do not obey to OSD::SetSignal(false)
 #ifndef WNT
-  if ( oldFEFlags > 0 )    
+  if ( oldFEFlags > 0 )
     feenableexcept( oldFEFlags );
   feclearexcept( FE_ALL_EXCEPT );
 #endif
 
+  /*
+  std::cout << "FacesWithSizeMap" << std::endl;
+  FacesWithSizeMap.Statistics(std::cout);
+  std::cout << "EdgesWithSizeMap" << std::endl;
+  EdgesWithSizeMap.Statistics(std::cout);
+  std::cout << "VerticesWithSizeMap" << std::endl;
+  VerticesWithSizeMap.Statistics(std::cout);
+  std::cout << "FacesWithEnforcedVertices" << std::endl;
+  FacesWithEnforcedVertices.Statistics(std::cout);
+  */
+
+  MESSAGE("END OF BLSURFPlugin_BLSURF::Compute()");
   return true;
 }
 
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+void BLSURFPlugin_BLSURF::CancelCompute()
+{
+  _compute_canceled = true;
+}
+#endif
+
+//=============================================================================
+/*!
+ *  SetNodeOnEdge
+ */
+//=============================================================================
+
+void BLSURFPlugin_BLSURF::Set_NodeOnEdge(SMESHDS_Mesh* meshDS, SMDS_MeshNode* node, const TopoDS_Shape& ed) {
+  const TopoDS_Edge edge = TopoDS::Edge(ed);
+
+  gp_Pnt pnt(node->X(), node->Y(), node->Z());
+
+  Standard_Real p0 = 0.0;
+  Standard_Real p1 = 1.0;
+  TopLoc_Location loc;
+  Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, loc, p0, p1);
+
+  if ( !loc.IsIdentity() ) pnt.Transform( loc.Transformation().Inverted() );
+  GeomAPI_ProjectPointOnCurve proj(pnt, curve, p0, p1);
+
+  double pa = 0.;
+  if ( proj.NbPoints() > 0 )
+  {
+    pa = (double)proj.LowerDistanceParameter();
+    // Issue 0020656. Move node if it is too far from edge
+    gp_Pnt curve_pnt = curve->Value( pa );
+    double dist2 = pnt.SquareDistance( curve_pnt );
+    double tol = BRep_Tool::Tolerance( edge );
+    if ( 1e-14 < dist2 && dist2 <= 1000*tol ) // large enough and within tolerance
+    {
+      curve_pnt.Transform( loc );
+      meshDS->MoveNode( node, curve_pnt.X(), curve_pnt.Y(), curve_pnt.Z() );
+    }
+  }
+//   GProp_GProps LProps;
+//   BRepGProp::LinearProperties(ed, LProps);
+//   double lg = (double)LProps.Mass();
+
+  meshDS->SetNodeOnEdge(node, edge, pa);
+}
+
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -514,7 +2017,7 @@ ostream & BLSURFPlugin_BLSURF::SaveTo(ostream & save)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -525,7 +2028,7 @@ istream & BLSURFPlugin_BLSURF::LoadFrom(istream & load)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -536,7 +2039,7 @@ ostream & operator << (ostream & save, BLSURFPlugin_BLSURF & hyp)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -545,34 +2048,61 @@ istream & operator >> (istream & load, BLSURFPlugin_BLSURF & hyp)
   return hyp.LoadFrom( load );
 }
 
+/* Curve definition function See cad_curv_t in file distene/cad.h for
+ * more information.
+ * NOTE : if when your CAD systems evaluates second
+ * order derivatives it also computes first order derivatives and
+ * function evaluation, you can optimize this example by making only
+ * one CAD call and filling the necessary uv, dt, dtt arrays.
+ */
 status_t curv_fun(real t, real *uv, real *dt, real *dtt, void *user_data)
 {
+  /* t is given. It contains the t (time) 1D parametric coordintaes
+     of the point PreCAD/BLSurf is querying on the curve */
+
+  /* user_data identifies the edge PreCAD/BLSurf is querying
+   * (see cad_edge_new later in this example) */
   const Geom2d_Curve*pargeo = (const Geom2d_Curve*) user_data;
 
   if (uv){
+   /* BLSurf is querying the function evaluation */
     gp_Pnt2d P;
     P=pargeo->Value(t);
     uv[0]=P.X(); uv[1]=P.Y();
   }
 
   if(dt) {
+   /* query for the first order derivatives */
     gp_Vec2d V1;
     V1=pargeo->DN(t,1);
     dt[0]=V1.X(); dt[1]=V1.Y();
   }
 
   if(dtt){
+    /* query for the second order derivatives */
     gp_Vec2d V2;
     V2=pargeo->DN(t,2);
     dtt[0]=V2.X(); dtt[1]=V2.Y();
   }
 
-  return 0;
+  return STATUS_OK;
 }
 
+/* Surface definition function.
+ * See cad_surf_t in file distene/cad.h for more information.
+ * NOTE : if when your CAD systems evaluates second order derivatives it also
+ * computes first order derivatives and function evaluation, you can optimize
+ * this example by making only one CAD call and filling the necessary xyz, du, dv, etc..
+ * arrays.
+ */
 status_t surf_fun(real *uv, real *xyz, real*du, real *dv,
-                 real *duu, real *duv, real *dvv, void *user_data)
+                  real *duu, real *duv, real *dvv, void *user_data)
 {
+  /* uv[2] is given. It contains the u,v coordinates of the point
+   * PreCAD/BLSurf is querying on the surface */
+
+  /* user_data identifies the face PreCAD/BLSurf is querying (see
+   * cad_face_new later in this example)*/
   const Geom_Surface* geometry = (const Geom_Surface*) user_data;
 
   if(xyz){
@@ -584,33 +2114,169 @@ status_t surf_fun(real *uv, real *xyz, real*du, real *dv,
   if(du && dv){
     gp_Pnt P;
     gp_Vec D1U,D1V;
-    
+
     geometry->D1(uv[0],uv[1],P,D1U,D1V);
     du[0]=D1U.X(); du[1]=D1U.Y(); du[2]=D1U.Z();
     dv[0]=D1V.X(); dv[1]=D1V.Y(); dv[2]=D1V.Z();
   }
 
   if(duu && duv && dvv){
+
     gp_Pnt P;
     gp_Vec D1U,D1V;
     gp_Vec D2U,D2V,D2UV;
-    
+
     geometry->D2(uv[0],uv[1],P,D1U,D1V,D2U,D2V,D2UV);
     duu[0]=D2U.X(); duu[1]=D2U.Y(); duu[2]=D2U.Z();
     duv[0]=D2UV.X(); duv[1]=D2UV.Y(); duv[2]=D2UV.Z();
-    dvv[0]=D2V.X(); dvv[1]=D2V.Y(); dvv[2]=D2V.Z();    
+    dvv[0]=D2V.X(); dvv[1]=D2V.Y(); dvv[2]=D2V.Z();
   }
 
-  return 0;
+  return STATUS_OK;
 }
 
-status_t message_callback(message_t *msg, void *user_data)
+
+status_t size_on_surface(integer face_id, real *uv, real *size, void *user_data)
+{
+  if (face_id == 1) {
+    if (my_u_min > uv[0]) {
+      my_u_min = uv[0];
+    }
+    if (my_v_min > uv[1]) {
+      my_v_min = uv[1];
+    }
+    if (my_u_max < uv[0]) {
+      my_u_max = uv[0];
+    }
+    if (my_v_max < uv[1]) {
+      my_v_max = uv[1];
+    }
+  }
+  //MESSAGE("size_on_surface")
+  if (FaceId2PythonSmp.count(face_id) != 0){
+    //MESSAGE("A size map is used to calculate size on face : "<<face_id)
+    PyObject * pyresult = NULL;
+    PyObject* new_stderr = NULL;
+    assert(Py_IsInitialized());
+    PyGILState_STATE gstate;
+    gstate = PyGILState_Ensure();
+    pyresult = PyObject_CallFunction(FaceId2PythonSmp[face_id],(char*)"(f,f)",uv[0],uv[1]);
+    double result;
+    if ( pyresult == NULL){
+      fflush(stderr);
+      string err_description="";
+      new_stderr = newPyStdOut(err_description);
+      PySys_SetObject((char*)"stderr", new_stderr);
+      PyErr_Print();
+      PySys_SetObject((char*)"stderr", PySys_GetObject((char*)"__stderr__"));
+      Py_DECREF(new_stderr);
+      MESSAGE("Can't evaluate f(" << uv[0] << "," << uv[1] << ")" << " error is " << err_description);
+      result = *((double*)user_data);
+      }
+    else {
+      result = PyFloat_AsDouble(pyresult);
+      Py_DECREF(pyresult);
+    }
+   // MESSAGE("f(" << uv[0] << "," << uv[1] << ")" << " = " << result);
+    *size = result;
+    PyGILState_Release(gstate);
+  }
+  else if (FaceIndex2ClassAttractor.count(face_id) !=0 && !FaceIndex2ClassAttractor[face_id]->Empty()){
+//    MESSAGE("attractor used on face :"<<face_id)
+    // MESSAGE("List of attractor is not empty")
+    // MESSAGE("Attractor empty : "<< FaceIndex2ClassAttractor[face_id]->Empty())
+    double result = FaceIndex2ClassAttractor[face_id]->GetSize(uv[0],uv[1]);
+    *size = result;
+   // MESSAGE("f(" << uv[0] << "," << uv[1] << ")" << " = " << result);
+  }
+  else {
+    // MESSAGE("List of attractor is empty !!!")
+    *size = *((double*)user_data);
+  }
+  return STATUS_OK;
+}
+
+status_t size_on_edge(integer edge_id, real t, real *size, void *user_data)
+{
+  if (EdgeId2PythonSmp.count(edge_id) != 0){
+    PyObject * pyresult = NULL;
+    PyObject* new_stderr = NULL;
+    assert(Py_IsInitialized());
+    PyGILState_STATE gstate;
+    gstate = PyGILState_Ensure();
+    pyresult = PyObject_CallFunction(EdgeId2PythonSmp[edge_id],(char*)"(f)",t);
+    double result;
+    if ( pyresult == NULL){
+      fflush(stderr);
+      string err_description="";
+      new_stderr = newPyStdOut(err_description);
+      PySys_SetObject((char*)"stderr", new_stderr);
+      PyErr_Print();
+      PySys_SetObject((char*)"stderr", PySys_GetObject((char*)"__stderr__"));
+      Py_DECREF(new_stderr);
+      MESSAGE("Can't evaluate f(" << t << ")" << " error is " << err_description);
+      result = *((double*)user_data);
+      }
+    else {
+      result = PyFloat_AsDouble(pyresult);
+      Py_DECREF(pyresult);
+    }
+    *size = result;
+    PyGILState_Release(gstate);
+  }
+  else {
+    *size = *((double*)user_data);
+  }
+  return STATUS_OK;
+}
+
+status_t size_on_vertex(integer point_id, real *size, void *user_data)
+{
+  if (VertexId2PythonSmp.count(point_id) != 0){
+    PyObject * pyresult = NULL;
+    PyObject* new_stderr = NULL;
+    assert(Py_IsInitialized());
+    PyGILState_STATE gstate;
+    gstate = PyGILState_Ensure();
+    pyresult = PyObject_CallFunction(VertexId2PythonSmp[point_id],(char*)"");
+    double result;
+    if ( pyresult == NULL){
+      fflush(stderr);
+      string err_description="";
+      new_stderr = newPyStdOut(err_description);
+      PySys_SetObject((char*)"stderr", new_stderr);
+      PyErr_Print();
+      PySys_SetObject((char*)"stderr", PySys_GetObject((char*)"__stderr__"));
+      Py_DECREF(new_stderr);
+      MESSAGE("Can't evaluate f()" << " error is " << err_description);
+      result = *((double*)user_data);
+      }
+    else {
+      result = PyFloat_AsDouble(pyresult);
+      Py_DECREF(pyresult);
+    }
+    *size = result;
+    PyGILState_Release(gstate);
+  }
+  else {
+    *size = *((double*)user_data);
+  }
+ return STATUS_OK;
+}
+
+/*
+ * The following function will be called for PreCAD/BLSurf message
+ * printing.  See context_set_message_callback (later in this
+ * template) for how to set user_data.
+ */
+status_t message_cb(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 err( desc );
+  if ( errnumber < 0 || err.find("license") != string::npos ) {
     string * error = (string*)user_data;
 //   if ( !error->empty() )
 //     *error += "\n";
@@ -621,7 +2287,234 @@ status_t message_callback(message_t *msg, void *user_data)
     error->append( desc, len );
   }
   else {
-    cout << desc;
+      std::cout << desc << std::endl;
   }
   return STATUS_OK;
 }
+
+/* This is the interrupt callback. PreCAD/BLSurf will call this
+ * function regularily. See the file distene/interrupt.h
+ */
+status_t interrupt_cb(integer *interrupt_status, void *user_data)
+{
+  integer you_want_to_continue = 1;
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+  BLSURFPlugin_BLSURF* tmp = (BLSURFPlugin_BLSURF*)user_data;
+  you_want_to_continue = !tmp->computeCanceled();
+#endif
+
+  if(you_want_to_continue)
+  {
+    *interrupt_status = INTERRUPT_CONTINUE;
+    return STATUS_OK;
+  }
+  else /* you want to stop BLSurf */
+  {
+    *interrupt_status = INTERRUPT_STOP;
+    return STATUS_ERROR;
+  }
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+bool BLSURFPlugin_BLSURF::Evaluate(SMESH_Mesh&         aMesh,
+                                   const TopoDS_Shape& aShape,
+                                   MapShapeNbElems&    aResMap)
+{
+  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();
+  bool   _quadAllowed   = BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed();
+  if(_hypothesis) {
+    _physicalMesh  = (int) _hypothesis->GetPhysicalMesh();
+    _phySize       = _hypothesis->GetPhySize();
+    //_geometricMesh = (int) hyp->GetGeometricMesh();
+    //_angleMeshS    = hyp->GetAngleMeshS();
+    _angleMeshC    = _hypothesis->GetAngleMeshC();
+    _quadAllowed   = _hypothesis->GetQuadAllowed();
+  }
+
+  bool IsQuadratic = false;
+
+  // ----------------
+  // evaluate 1D
+  // ----------------
+  TopTools_DataMapOfShapeInteger EdgesMap;
+  double fullLen = 0.0;
+  double fullNbSeg = 0;
+  for (TopExp_Explorer exp(aShape, TopAbs_EDGE); exp.More(); exp.Next()) {
+    TopoDS_Edge E = TopoDS::Edge( exp.Current() );
+    if( EdgesMap.IsBound(E) )
+      continue;
+    SMESH_subMesh *sm = aMesh.GetSubMesh(E);
+    double aLen = SMESH_Algo::EdgeLength(E);
+    fullLen += aLen;
+    int nb1d = 0;
+    if(_physicalMesh==1) {
+       nb1d = (int)( aLen/_phySize + 1 );
+    }
+    else {
+      // use geometry
+      double f,l;
+      Handle(Geom_Curve) C = BRep_Tool::Curve(E,f,l);
+      double fullAng = 0.0;
+      double dp = (l-f)/200;
+      gp_Pnt P1,P2,P3;
+      C->D0(f,P1);
+      C->D0(f+dp,P2);
+      gp_Vec V1(P1,P2);
+      for(int j=2; j<=200; j++) {
+        C->D0(f+dp*j,P3);
+        gp_Vec V2(P2,P3);
+        fullAng += fabs(V1.Angle(V2));
+        V1 = V2;
+        P2 = P3;
+      }
+      nb1d = (int)( fullAng/_angleMeshC + 1 );
+    }
+    fullNbSeg += nb1d;
+    std::vector<int> aVec(SMDSEntity_Last);
+    for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i]=0;
+    if( IsQuadratic > 0 ) {
+      aVec[SMDSEntity_Node] = 2*nb1d - 1;
+      aVec[SMDSEntity_Quad_Edge] = nb1d;
+    }
+    else {
+      aVec[SMDSEntity_Node] = nb1d - 1;
+      aVec[SMDSEntity_Edge] = nb1d;
+    }
+    aResMap.insert(std::make_pair(sm,aVec));
+    EdgesMap.Bind(E,nb1d);
+  }
+  double ELen = fullLen/fullNbSeg;
+  // ----------------
+  // evaluate 2D
+  // ----------------
+  // try to evaluate as in MEFISTO
+  for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next()) {
+    TopoDS_Face F = TopoDS::Face( exp.Current() );
+    SMESH_subMesh *sm = aMesh.GetSubMesh(F);
+    GProp_GProps G;
+    BRepGProp::SurfaceProperties(F,G);
+    double anArea = G.Mass();
+    int nb1d = 0;
+    std::vector<int> nb1dVec;
+    for (TopExp_Explorer exp1(F,TopAbs_EDGE); exp1.More(); exp1.Next()) {
+      int nbSeg = EdgesMap.Find(exp1.Current());
+      nb1d += nbSeg;
+      nb1dVec.push_back( nbSeg );
+    }
+    int nbQuad = 0;
+    int nbTria = (int) ( anArea/( ELen*ELen*sqrt(3.) / 4 ) );
+    int nbNodes = (int) ( ( nbTria*3 - (nb1d-1)*2 ) / 6 + 1 );
+    if ( _quadAllowed )
+    {
+      if ( nb1dVec.size() == 4 ) // quadrangle geom face
+      {
+        int n1 = nb1dVec[0], n2 = nb1dVec[ nb1dVec[1] == nb1dVec[0] ? 2 : 1 ];
+        nbQuad = n1 * n2;
+        nbNodes = (n1 + 1) * (n2 + 1);
+        nbTria = 0;
+      }
+      else
+      {
+        nbTria = nbQuad = nbTria / 3 + 1;
+      }
+    }
+    std::vector<int> aVec(SMDSEntity_Last,0);
+    if( IsQuadratic ) {
+      int nb1d_in = (nbTria*3 - nb1d) / 2;
+      aVec[SMDSEntity_Node] = nbNodes + nb1d_in;
+      aVec[SMDSEntity_Quad_Triangle] = nbTria;
+      aVec[SMDSEntity_Quad_Quadrangle] = nbQuad;
+    }
+    else {
+      aVec[SMDSEntity_Node] = nbNodes;
+      aVec[SMDSEntity_Triangle] = nbTria;
+      aVec[SMDSEntity_Quadrangle] = nbQuad;
+    }
+    aResMap.insert(std::make_pair(sm,aVec));
+  }
+
+  // ----------------
+  // evaluate 3D
+  // ----------------
+  GProp_GProps G;
+  BRepGProp::VolumeProperties(aShape,G);
+  double aVolume = G.Mass();
+  double tetrVol = 0.1179*ELen*ELen*ELen;
+  int nbVols  = int(aVolume/tetrVol);
+  int nb1d_in = int(( nbVols*6 - fullNbSeg ) / 6 );
+  std::vector<int> aVec(SMDSEntity_Last);
+  for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i]=0;
+  if( IsQuadratic ) {
+    aVec[SMDSEntity_Node] = nb1d_in/3 + 1 + nb1d_in;
+    aVec[SMDSEntity_Quad_Tetra] = nbVols;
+  }
+  else {
+    aVec[SMDSEntity_Node] = nb1d_in/3 + 1;
+    aVec[SMDSEntity_Tetra] = nbVols;
+  }
+  SMESH_subMesh *sm = aMesh.GetSubMesh(aShape);
+  aResMap.insert(std::make_pair(sm,aVec));
+
+  return true;
+}
+
+//=============================================================================
+/*!
+ *  Rewritting of the BRepClass_FaceClassifier::Perform function which is bugged (CAS 6.3sp6)
+ *  Following line was added:
+ *        myExtrem.Perform(P);
+ */
+//=============================================================================
+void  BLSURFPlugin_BLSURF::BRepClass_FaceClassifierPerform(BRepClass_FaceClassifier* fc,
+                    const TopoDS_Face& face,
+                    const gp_Pnt& P,
+                    const Standard_Real Tol)
+{
+  //-- Voir BRepExtrema_ExtPF.cxx
+  BRepAdaptor_Surface Surf(face);
+  Standard_Real U1, U2, V1, V2;
+  BRepTools::UVBounds(face, U1, U2, V1, V2);
+  Extrema_ExtPS myExtrem;
+  myExtrem.Initialize(Surf, U1, U2, V1, V2, Tol, Tol);
+  myExtrem.Perform(P);
+  //----------------------------------------------------------
+  //-- On cherche le point le plus proche , PUIS
+  //-- On le classifie.
+  Standard_Integer nbv    = 0; // xpu
+  Standard_Real MaxDist   =  RealLast();
+  Standard_Integer indice = 0;
+  if (myExtrem.IsDone()) {
+    nbv = myExtrem.NbExt();
+    for (Standard_Integer i = 1; i <= nbv; i++) {
+#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
+      Standard_Real d = myExtrem.SquareDistance(i);
+#else
+      Standard_Real d = myExtrem.Value(i);
+      d = Abs(d);
+#endif
+      if (d <= MaxDist) {
+        MaxDist = d;
+        indice = i;
+      }
+    }
+  }
+  if (indice) {
+    gp_Pnt2d Puv;
+    Standard_Real U1,U2;
+    myExtrem.Point(indice).Parameter(U1, U2);
+    Puv.SetCoord(U1, U2);
+    fc->Perform(face, Puv, Tol);
+  }
+  else {
+    fc->Perform(face, gp_Pnt2d(U1-1.0,V1 - 1.0), Tol); //-- NYI etc BUG PAS BEAU En attendant l acces a rejected
+    //-- le resultat est TopAbs_OUT;
+  }
+}
index 8dd022f1b982a01e3e19620e097bba2cb16c8296..3067dc447634ef19b2ec24729b0bc0b6c841b88b 100644 (file)
@@ -1,38 +1,77 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
+//           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
 //
 #ifndef _BLSURFPlugin_BLSURF_HXX_
 #define _BLSURFPlugin_BLSURF_HXX_
 
+#include <TopoDS.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+
+#ifdef HAVE_FINITE
+#undef HAVE_FINITE            // VSR: avoid compilation warning on Linux : "HAVE_FINITE" redefined
+#endif
+// rnv: avoid compilation warning on Linux : "_POSIX_C_SOURCE" and "_XOPEN_SOURCE" are redefined
+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
+#ifdef _XOPEN_SOURCE
+#undef _XOPEN_SOURCE
+#endif
+
+#include <Python.h>
 #include "SMESH_2D_Algo.hxx"
 #include "SMESH_Mesh.hxx"
+#include <SMESHDS_Mesh.hxx>
+#include <SMDS_MeshElement.hxx>
+#include <SMDS_MeshNode.hxx>
+#include <SMESH_Gen_i.hxx>
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOMEDS)
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
 #include "Utils_SALOME_Exception.hxx"
+
 extern "C"{
+#include "distene/blsurf.h"
 #include "distene/api.h"
+#include "distene/precad.h"
 }
 
-class BLSURFPlugin_Hypothesis;
+#include <BRepClass_FaceClassifier.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepTools.hxx>
+#include <BRepAdaptor_HSurface.hxx>
+
+#include "BLSURFPlugin_Hypothesis.hxx"
+
+class TopoDS_Shape;
 
 class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
   public:
@@ -44,10 +83,18 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
                                  const TopoDS_Shape&                  aShape,
                                  SMESH_Hypothesis::Hypothesis_Status& aStatus);
 
-    void SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls);
+    void SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls, precad_session_t *pcs, SMESH_Mesh& aMesh, bool *use_precad);
 
     virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
 
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+    virtual void CancelCompute();
+    bool computeCanceled() { return _compute_canceled;};
+#endif
+
+    virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
+                          MapShapeNbElems& aResMap);
+
     ostream & SaveTo(ostream & save);
     istream & LoadFrom(istream & load);
     friend ostream & operator << (ostream & save, BLSURFPlugin_BLSURF & hyp);
@@ -55,6 +102,22 @@ class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
 
   protected:
     const BLSURFPlugin_Hypothesis* _hypothesis;
+
+  private:
+    TopoDS_Shape entryToShape(std::string entry);
+    void createEnforcedVertexOnFace(TopoDS_Shape FaceShape, BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList);
+    void Set_NodeOnEdge(SMESHDS_Mesh* meshDS, SMDS_MeshNode* node, const TopoDS_Shape& ed);
+    void BRepClass_FaceClassifierPerform(BRepClass_FaceClassifier* fc, const TopoDS_Face& face, const gp_Pnt& P, const Standard_Real Tol);
+
+  private:
+      PyObject *          main_mod;
+      PyObject *          main_dict;
+      SALOMEDS::Study_var myStudy;
+      SMESH_Gen_i*        smeshGen_i;
+
+#ifdef WITH_SMESH_CANCEL_COMPUTE
+      volatile bool _compute_canceled;
+#endif
 };
 
 #endif
index 24fa3c2df7d1a740a951de8a0878e0d7f727afd2..68750c7787d44569f8db1a270e4a7c4557b6c8da 100644 (file)
@@ -1,21 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // ---
 // File    : BLSURFPlugin_BLSURF_i.cxx
 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA)
@@ -36,8 +37,8 @@
 //=============================================================================
 
 BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
-                                                    ::SMESH_Gen*            theGenImpl )
+                                              int                     theStudyId,
+                                              ::SMESH_Gen*            theGenImpl )
      : SALOME::GenericObj_i( thePOA ), 
        SMESH_Hypothesis_i( thePOA ), 
        SMESH_Algo_i( thePOA ),
@@ -45,8 +46,8 @@ BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA,
 {
   MESSAGE( "BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i" );
   myBaseImpl = new ::BLSURFPlugin_BLSURF( theGenImpl->GetANewId(),
-                                             theStudyId,
-                                             theGenImpl );
+                                          theStudyId,
+                                          theGenImpl );
 }
 
 //=============================================================================
index 85bb614e016aa1923015a615d36690129d3818d2..97885cf2e63aab8412d3ee4ccb8b1d9995469867 100644 (file)
@@ -1,21 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // ---
 // File    : BLSURFPlugin_BLSURF_i.hxx
 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA)
@@ -40,8 +41,8 @@ class BLSURFPlugin_BLSURF_i:
 public:
   // Constructor
   BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA,
-                            int                     theStudyId,
-                            ::SMESH_Gen*            theGenImpl );
+                         int                     theStudyId,
+                         ::SMESH_Gen*            theGenImpl );
   // Destructor
   virtual ~BLSURFPlugin_BLSURF_i();
  
index ad3536512a9449f37acabbefc7bf46ed1a794e7b..1856a70a94942991fd1c6b49d0a411bd2692a668 100644 (file)
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
+//           Size maps development: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
 //
-#include <BLSURFPlugin_Hypothesis.hxx>
+#include "BLSURFPlugin_Hypothesis.hxx"
+#include "BLSURFPlugin_Attractor.hxx"
+#include "SMESH_Gen_i.hxx"
 #include <utilities.h>
+#include <cstring>
+#include <iostream>
+#include <sstream>
+
+// cascade include
+#include "ShapeAnalysis.hxx"
+
+// CORBA includes
+#include CORBA_CLIENT_HEADER(SALOMEDS)
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
 
 //=============================================================================
-BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis (int hypId, int studyId,
-                                                  SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen),
-    _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()),
-    _verb( GetDefaultVerbosity() )
+BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen) :
+  SMESH_Hypothesis(hypId, studyId, gen), _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()),
+  _verb(GetDefaultVerbosity()),
+  _preCADMergeEdges(GetDefaultPreCADMergeEdges()),
+  _preCADRemoveNanoEdges(GetDefaultPreCADRemoveNanoEdges()),
+  _preCADDiscardInput(GetDefaultPreCADDiscardInput()),
+  _preCADEpsNano(GetDefaultPreCADEpsNano()),
+  _sizeMap(GetDefaultSizeMap()),
+  _attractors(GetDefaultSizeMap()),
+  _classAttractors(GetDefaultAttractorMap()),
+  _faceEntryEnfVertexListMap(GetDefaultFaceEntryEnfVertexListMap()),
+  _enfVertexList(GetDefaultEnfVertexList()),
+  _faceEntryCoordsListMap(GetDefaultFaceEntryCoordsListMap()),
+  _coordsEnfVertexMap(GetDefaultCoordsEnfVertexMap()),
+  _faceEntryEnfVertexEntryListMap(GetDefaultFaceEntryEnfVertexEntryListMap()),
+  _enfVertexEntryEnfVertexMap(GetDefaultEnfVertexEntryEnfVertexMap()),
+  _groupNameNodeIDMap(GetDefaultGroupNameNodeIDMap()),
+  _GMFFileName(GetDefaultGMFFile()),
+  _enforcedInternalVerticesAllFaces(GetDefaultInternalEnforcedVertex())
 {
   _name = "BLSURF_Parameters";
   _param_algo_dim = 2;
-
-  // to desable writing boundaries
-  //_phyMin = _phyMax = _hgeoMin = _hgeoMax = undefinedDouble();
   
+//   _GMFFileMode = false; // GMF ascii mode
+  
+  // to disable 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
-  };
+  const char* intOptionNames[] = { "addsurf_ivertex", "anisotropic", "background", "CheckAdjacentEdges", "CheckCloseEdges",
+      "CheckWellDefined", "coiter", "communication", "debug", "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",
+      "proximity", "prox_nb_layer", "prox_ratio", // detects the volumic proximity of surfaces
+      "" // mark of end
+      };
+  const char* doubleOptionNames[] = { "addsurf_angle", "addsurf_R", "addsurf_H", "addsurf_FG", "addsurf_r",
+      "addsurf_PA", "angle_compcurv", "angle_ridge", "anisotropic_ratio", "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
+      };
 
+  // PreCAD advanced options
+  const char* preCADintOptionNames[] = { "closed_geometry", "debug", "manifold_geometry", "create_tag_on_collision","" // mark of end
+      };
+  const char* preCADdoubleOptionNames[] = { "eps_nano_relative", "eps_sewing", "eps_sewing_relative", "periodic_tolerance",
+      "periodic_tolerance_relative", "periodic_split_tolerance", "periodic_split_tolerance_relative", "" // mark of end
+      };
+  
   int i = 0;
-  while ( intOptionNames[i][0] )
-    _option2value[ intOptionNames[i++] ].clear();
+  while (intOptionNames[i][0])
+    _option2value[intOptionNames[i++]].clear();
+  
+  i = 0;
+  while (preCADintOptionNames[i][0])
+    _preCADoption2value[preCADintOptionNames[i++]].clear();
 
   i = 0;
-  while ( doubleOptionNames[i][0] ) {
-    _doubleOptions.insert( doubleOptionNames[i] );
-    _option2value[ doubleOptionNames[i++] ].clear();
+  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();
+  while (preCADdoubleOptionNames[i][0]) {
+    _preCADdoubleOptions.insert(preCADdoubleOptionNames[i]);
+    _preCADoption2value[preCADdoubleOptionNames[i++]].clear();
+  }
+  i = 0;
+  while (charOptionNames[i][0]) {
+    _charOptions.insert(charOptionNames[i]);
+    _option2value[charOptionNames[i++]].clear();
+  }
+  
+
+      
+  _sizeMap.clear();
+  _attractors.clear();
+  _faceEntryEnfVertexListMap.clear();
+  _enfVertexList.clear();
+  _faceEntryCoordsListMap.clear();
+  _coordsEnfVertexMap.clear();
+  _faceEntryEnfVertexEntryListMap.clear();
+  _enfVertexEntryEnfVertexMap.clear();
+  _groupNameNodeIDMap.clear();
+
+  /* TODO GROUPS
+   _groupNameEnfVertexListMap.clear();
+   _enfVertexGroupNameMap.clear();
+   */
+}
+
+TopoDS_Shape BLSURFPlugin_Hypothesis::entryToShape(std::string entry)
+{
+  MESSAGE("BLSURFPlugin_Hypothesis::entryToShape "<<entry );
+  GEOM::GEOM_Object_var aGeomObj;
+  SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
+  SALOMEDS::Study_ptr myStudy = smeshGen_i->GetCurrentStudy();
+  
+  TopoDS_Shape S = TopoDS_Shape();
+  SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() );
+  SALOMEDS::GenericAttribute_var anAttr;
+
+  if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR")) {
+    SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+    CORBA::String_var aVal = anIOR->Value();
+    CORBA::Object_var obj = myStudy->ConvertIORToObject(aVal);
+    aGeomObj = GEOM::GEOM_Object::_narrow(obj);
   }
+  if ( !aGeomObj->_is_nil() )
+    S = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
+  return S;
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetTopology(Topology theTopology)
-{
+void BLSURFPlugin_Hypothesis::SetTopology(Topology theTopology) {
   if (theTopology != _topology) {
     _topology = theTopology;
     NotifySubMeshesHypothesisModification();
@@ -132,32 +175,28 @@ void BLSURFPlugin_Hypothesis::SetTopology(Topology theTopology)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetPhysicalMesh(PhysicalMesh thePhysicalMesh)
-{
+void BLSURFPlugin_Hypothesis::SetPhysicalMesh(PhysicalMesh thePhysicalMesh) {
   if (thePhysicalMesh != _physicalMesh) {
     _physicalMesh = thePhysicalMesh;
-    switch( _physicalMesh ) {
-      case DefaultSize:
-      default:
-        _phySize = GetDefaultPhySize();
-        break;
-      }
     NotifySubMeshesHypothesisModification();
   }
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetPhySize(double theVal)
-{
+void BLSURFPlugin_Hypothesis::SetPhySize(double theVal) {
   if (theVal != _phySize) {
-    _phySize = theVal;
+    if (theVal == 0) {
+      _phySize = GetPhyMax();
+      MESSAGE("Warning: nul physical size is not allowed");
+    }
+    else
+      _phySize = theVal;
     NotifySubMeshesHypothesisModification();
   }
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetPhyMin(double theMinSize)
-{
+void BLSURFPlugin_Hypothesis::SetPhyMin(double theMinSize) {
   if (theMinSize != _phyMin) {
     _phyMin = theMinSize;
     NotifySubMeshesHypothesisModification();
@@ -165,18 +204,15 @@ void BLSURFPlugin_Hypothesis::SetPhyMin(double theMinSize)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetPhyMax(double theMaxSize)
-{
+void BLSURFPlugin_Hypothesis::SetPhyMax(double theMaxSize) {
   if (theMaxSize != _phyMax) {
     _phyMax = theMaxSize;
     NotifySubMeshesHypothesisModification();
   }
 }
 
-
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetGeoMin(double theMinSize)
-{
+void BLSURFPlugin_Hypothesis::SetGeoMin(double theMinSize) {
   if (theMinSize != _hgeoMin) {
     _hgeoMin = theMinSize;
     NotifySubMeshesHypothesisModification();
@@ -184,8 +220,7 @@ void BLSURFPlugin_Hypothesis::SetGeoMin(double theMinSize)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetGeoMax(double theMaxSize)
-{
+void BLSURFPlugin_Hypothesis::SetGeoMax(double theMaxSize) {
   if (theMaxSize != _hgeoMax) {
     _hgeoMax = theMaxSize;
     NotifySubMeshesHypothesisModification();
@@ -193,24 +228,22 @@ void BLSURFPlugin_Hypothesis::SetGeoMax(double theMaxSize)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetGeometricMesh(GeometricMesh theGeometricMesh)
-{
+void BLSURFPlugin_Hypothesis::SetGeometricMesh(GeometricMesh theGeometricMesh) {
   if (theGeometricMesh != _geometricMesh) {
     _geometricMesh = theGeometricMesh;
-    switch( _geometricMesh ) {
+    switch (_geometricMesh) {
       case DefaultGeom:
       default:
         _angleMeshS = GetDefaultAngleMeshS();
-        _gradation  = GetDefaultGradation();
+        _gradation = GetDefaultGradation();
         break;
-      }
+    }
     NotifySubMeshesHypothesisModification();
   }
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetAngleMeshS(double theVal)
-{
+void BLSURFPlugin_Hypothesis::SetAngleMeshS(double theVal) {
   if (theVal != _angleMeshS) {
     _angleMeshS = theVal;
     NotifySubMeshesHypothesisModification();
@@ -218,8 +251,7 @@ void BLSURFPlugin_Hypothesis::SetAngleMeshS(double theVal)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetAngleMeshC(double theVal)
-{
+void BLSURFPlugin_Hypothesis::SetAngleMeshC(double theVal) {
   if (theVal != _angleMeshC) {
     _angleMeshC = theVal;
     NotifySubMeshesHypothesisModification();
@@ -227,8 +259,7 @@ void BLSURFPlugin_Hypothesis::SetAngleMeshC(double theVal)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetGradation(double theVal)
-{
+void BLSURFPlugin_Hypothesis::SetGradation(double theVal) {
   if (theVal != _gradation) {
     _gradation = theVal;
     NotifySubMeshesHypothesisModification();
@@ -236,8 +267,7 @@ void BLSURFPlugin_Hypothesis::SetGradation(double theVal)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetQuadAllowed(bool theVal)
-{
+void BLSURFPlugin_Hypothesis::SetQuadAllowed(bool theVal) {
   if (theVal != _quadAllowed) {
     _quadAllowed = theVal;
     NotifySubMeshesHypothesisModification();
@@ -245,8 +275,7 @@ void BLSURFPlugin_Hypothesis::SetQuadAllowed(bool theVal)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetDecimesh(bool theVal)
-{
+void BLSURFPlugin_Hypothesis::SetDecimesh(bool theVal) {
   if (theVal != _decimesh) {
     _decimesh = theVal;
     NotifySubMeshesHypothesisModification();
@@ -254,57 +283,139 @@ void BLSURFPlugin_Hypothesis::SetDecimesh(bool theVal)
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetVerbosity(int theVal)
-{
+void BLSURFPlugin_Hypothesis::SetVerbosity(int theVal) {
   if (theVal != _verb) {
     _verb = theVal;
     NotifySubMeshesHypothesisModification();
   }
 }
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis::SetPreCADMergeEdges(bool theVal) {
+  if (theVal != _preCADMergeEdges) {
+    SetTopology(PreCAD);
+    _preCADMergeEdges = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
 //=============================================================================
-void BLSURFPlugin_Hypothesis::SetOptionValue(const std::string& optionName,
-                                             const std::string& optionValue)
-  throw (std::invalid_argument)
+void BLSURFPlugin_Hypothesis::SetPreCADRemoveNanoEdges(bool theVal) {
+  if (theVal != _preCADRemoveNanoEdges) {
+    SetTopology(PreCAD);
+    _preCADRemoveNanoEdges = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis::SetPreCADDiscardInput(bool theVal) {
+  if (theVal != _preCADDiscardInput) {
+    SetTopology(PreCAD);
+    _preCADDiscardInput = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis::SetPreCADEpsNano(double theVal) {
+  if (theVal != _preCADEpsNano) {
+    SetTopology(PreCAD);
+    _preCADEpsNano = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=============================================================================
+// void BLSURFPlugin_Hypothesis::SetGMFFile(const std::string& theFileName, bool isBinary)
+void BLSURFPlugin_Hypothesis::SetGMFFile(const std::string& theFileName)
 {
-  TOptionValues::iterator op_val = _option2value.find( optionName );
-  if ( op_val == _option2value.end() ) {
+  _GMFFileName = theFileName;
+//   _GMFFileMode = isBinary;
+  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 ) {
+  if (op_val->second != optionValue) {
     const char* ptr = optionValue.c_str();
     // strip white spaces
-    while ( ptr[0] == ' ' )
+    while (ptr[0] == ' ')
       ptr++;
-    int i = strlen( ptr );
-    while ( i != 0 && ptr[i-1] == ' ')
+    int i = strlen(ptr);
+    while (i != 0 && ptr[i - 1] == ' ')
       i--;
     // check value type
     bool typeOk = true;
     std::string typeName;
-    if ( i == 0 ) {
+    if (i == 0) {
       // empty string
-    }
-    else if ( _charOptions.find( optionName ) != _charOptions.end() ) {
+    } else if (_charOptions.find(optionName) != _charOptions.end()) {
       // do not check strings
-    }
-    else if ( _doubleOptions.find( optionName ) != _doubleOptions.end() ) {
+    } else if (_doubleOptions.find(optionName) != _doubleOptions.end()) {
       // check if value is double
       char * endPtr;
       strtod(ptr, &endPtr);
-      typeOk = ( ptr != endPtr );
+      typeOk = (ptr != endPtr);
       typeName = "real";
+    } else {
+      // check if value is int
+      char * endPtr;
+      strtol(ptr, &endPtr, 10);
+      typeOk = (ptr != endPtr);
+      typeName = "integer";
     }
-    else {
+    if (!typeOk) {
+      std::string msg = "Advanced option '" + optionName + "' = '" + optionValue + "' but must be " + typeName;
+      throw std::invalid_argument(msg);
+    }
+    op_val->second = optionValue;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis::SetPreCADOptionValue(const std::string& optionName, const std::string& optionValue)
+    throw (std::invalid_argument) {
+  TOptionValues::iterator op_val = _preCADoption2value.find(optionName);
+  if (op_val == _preCADoption2value.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 (_preCADdoubleOptions.find(optionName) != _preCADdoubleOptions.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 );
+      strtol(ptr, &endPtr, 10);
+      typeOk = (ptr != endPtr);
       typeName = "integer";
     }
-    if ( !typeOk ) {
-      std::string msg = "Advanced option '" + optionName + "' = '" + optionValue +
-        "' but must be " + typeName;
+    if (!typeOk) {
+      std::string msg = "PreCAD advanced option '" + optionName + "' = '" + optionValue + "' but must be " + typeName;
       throw std::invalid_argument(msg);
     }
     op_val->second = optionValue;
@@ -313,11 +424,9 @@ void BLSURFPlugin_Hypothesis::SetOptionValue(const std::string& optionName,
 }
 
 //=============================================================================
-std::string BLSURFPlugin_Hypothesis::GetOptionValue(const std::string& optionName)
-  throw (std::invalid_argument)
-{
-  TOptionValues::iterator op_val = _option2value.find( optionName );
-  if ( op_val == _option2value.end() ) {
+std::string BLSURFPlugin_Hypothesis::GetOptionValue(const std::string& optionName) throw (std::invalid_argument) {
+  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);
@@ -326,44 +435,814 @@ std::string BLSURFPlugin_Hypothesis::GetOptionValue(const std::string& optionNam
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis::ClearOption(const std::string& optionName)
-{
-  TOptionValues::iterator op_val = _option2value.find( optionName );
-  if ( op_val != _option2value.end() )
+std::string BLSURFPlugin_Hypothesis::GetPreCADOptionValue(const std::string& optionName) throw (std::invalid_argument) {
+  TOptionValues::iterator op_val = _preCADoption2value.find(optionName);
+  if (op_val == _preCADoption2value.end()) {
+    std::string msg = "Unknown PRECAD option: <";
+    msg += optionName + ">";
+    throw std::invalid_argument(msg);
+  }
+  return op_val->second;
+}
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis::ClearOption(const std::string& optionName) {
+  TOptionValues::iterator op_val = _option2value.find(optionName);
+  if (op_val != _option2value.end())
     op_val->second.clear();
 }
 
 //=============================================================================
-std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save)
+void BLSURFPlugin_Hypothesis::ClearPreCADOption(const std::string& optionName) {
+  TOptionValues::iterator op_val = _preCADoption2value.find(optionName);
+  if (op_val != _preCADoption2value.end())
+    op_val->second.clear();
+}
+
+//=======================================================================
+//function : SetSizeMapEntry
+//=======================================================================
+void BLSURFPlugin_Hypothesis::SetSizeMapEntry(const std::string& entry, const std::string& sizeMap) {
+  if (_sizeMap[entry].compare(sizeMap) != 0) {
+    SetPhysicalMesh(SizeMap);
+    _sizeMap[entry] = sizeMap;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=======================================================================
+//function : GetSizeMapEntry
+//=======================================================================
+std::string BLSURFPlugin_Hypothesis::GetSizeMapEntry(const std::string& entry) {
+  TSizeMap::iterator it = _sizeMap.find(entry);
+  if (it != _sizeMap.end())
+    return it->second;
+  else
+    return "No_Such_Entry";
+}
+
+/*!
+ * \brief Return the size maps
+ */
+BLSURFPlugin_Hypothesis::TSizeMap BLSURFPlugin_Hypothesis::GetSizeMapEntries(const BLSURFPlugin_Hypothesis* hyp) {
+  return hyp ? hyp->_GetSizeMapEntries() : GetDefaultSizeMap();
+}
+
+//=======================================================================
+//function : SetAttractorEntry
+//=======================================================================
+void BLSURFPlugin_Hypothesis::SetAttractorEntry(const std::string& entry, const std::string& attractor) {
+  if (_attractors[entry].compare(attractor) != 0) {
+    SetPhysicalMesh(SizeMap);
+    _attractors[entry] = attractor;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=======================================================================
+//function : GetAttractorEntry
+//=======================================================================
+std::string BLSURFPlugin_Hypothesis::GetAttractorEntry(const std::string& entry) {
+  TSizeMap::iterator it = _attractors.find(entry);
+  if (it != _attractors.end())
+    return it->second;
+  else
+    return "No_Such_Entry";
+}
+
+/*!
+ * \brief Return the attractors
+ */
+BLSURFPlugin_Hypothesis::TSizeMap BLSURFPlugin_Hypothesis::GetAttractorEntries(const BLSURFPlugin_Hypothesis* hyp) {
+  return hyp ? hyp->_GetAttractorEntries() : GetDefaultSizeMap();
+}
+
+//=======================================================================
+//function : SetClassAttractorEntry
+//=======================================================================
+void BLSURFPlugin_Hypothesis::SetClassAttractorEntry(const std::string& entry, const std::string& attEntry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius)
 {
-  save << " " << (int)_topology
-       << " " << (int)_physicalMesh
-       << " " << (int)_geometricMesh
-       << " " << _phySize
-       << " " << _angleMeshS   
-       << " " << _gradation     
-       << " " << (int)_quadAllowed 
-       << " " << (int)_decimesh;
-  save << " " << _phyMin
-       << " " << _phyMax
-       << " " << _angleMeshC
-       << " " << _hgeoMin
-       << " " << _hgeoMax
-       << " " << _verb;
+  SetPhysicalMesh(SizeMap);
+
+  // The new attractor can't be defined on the same face as another sizemap
+  TSizeMap::iterator it  = _sizeMap.find( entry );
+  if ( it != _sizeMap.end() ) {
+    _sizeMap.erase(it);
+    NotifySubMeshesHypothesisModification();
+  }
+  else {
+    TSizeMap::iterator itAt  = _attractors.find( entry );
+    if ( itAt != _attractors.end() ) {
+      _attractors.erase(itAt);
+      NotifySubMeshesHypothesisModification();
+    }
+  }
+  
+  const TopoDS_Shape AttractorShape = BLSURFPlugin_Hypothesis::entryToShape(attEntry);
+  const TopoDS_Face FaceShape = TopoDS::Face(BLSURFPlugin_Hypothesis::entryToShape(entry));
+  bool attExists = (_classAttractors.find(entry) != _classAttractors.end());
+  double u1,u2,v1,v2, diag;
+  
+  if ( !attExists || (attExists && _classAttractors[entry]->GetAttractorEntry().compare(attEntry) != 0)){ 
+    ShapeAnalysis::GetFaceUVBounds(FaceShape,u1,u2,v1,v2);
+//     diag = sqrt((u2 - u1) * (u2 - u1) + (v2 - v1) * (v2 - v1));  
+    BLSURFPlugin_Attractor* myAttractor = new BLSURFPlugin_Attractor(FaceShape, AttractorShape, attEntry);//, 0.1 ); // test 0.002 * diag); 
+    myAttractor->BuildMap();
+    myAttractor->SetParameters(StartSize, EndSize, ActionRadius, ConstantRadius);
+    _classAttractors[entry] = myAttractor;
+    NotifySubMeshesHypothesisModification();
+  }
+  else {
+    _classAttractors[entry]->SetParameters(StartSize, EndSize, ActionRadius, ConstantRadius);
+    if (!_classAttractors[entry]->IsMapBuilt()){
+      _classAttractors[entry]->BuildMap();
+    }
+    NotifySubMeshesHypothesisModification();
+  }
+    
+}
+
+//=======================================================================
+//function : SetConstantSizeOnAdjacentFaces
+//=======================================================================
+// TODO uncomment and test (include the needed .hxx)
+// SetConstantSizeOnAdjacentFaces(myShape, att_entry, startSize, endSize = user_size, const_dist  ) {
+//   TopTools_IndexedMapOfShapListOdShape anEdge2FaceMap;
+//   TopExp::MapShapesAnAncestors(myShape,TopAbs_EDGE, TopAbs_FACE, anEdge2FaceMap);
+//   TopTools_IndexedMapOfShapListOdShape::iterator it;
+//   for (it = anEdge2FaceMap.begin();it != anEdge2FaceMap.end();it++){
+//       SetClassAttractorEntry((*it).first, att_entry, startSize, endSize, 0, const_dist)
+//   }
+
+
+
+
+
+
+//=======================================================================
+//function : GetClassAttractorEntry
+//=======================================================================
+// BLSURFPlugin_Attractor&  BLSURFPlugin_Hypothesis::GetClassAttractorEntry(const std::string& entry)
+// {
+//  TAttractorMap::iterator it  = _classAttractors.find( entry );
+//  if ( it != _classAttractors.end() )
+//    return it->second;
+//  else
+//    return "No_Such_Entry";
+// }
+// 
+  /*!
+   * \brief Return the map of attractor instances
+   */
+BLSURFPlugin_Hypothesis::TAttractorMap BLSURFPlugin_Hypothesis::GetClassAttractorEntries(const BLSURFPlugin_Hypothesis* hyp)
+{
+    return hyp ? hyp->_GetClassAttractorEntries():GetDefaultAttractorMap();
+}
+
+//=======================================================================
+//function : ClearEntry
+//=======================================================================
+void BLSURFPlugin_Hypothesis::ClearEntry(const std::string& entry)
+{
+ TSizeMap::iterator it  = _sizeMap.find( entry );
+ if ( it != _sizeMap.end() ) {
+   _sizeMap.erase(it);
+   NotifySubMeshesHypothesisModification();
+ }
+ else {
+   TSizeMap::iterator itAt  = _attractors.find( entry );
+   if ( itAt != _attractors.end() ) {
+     _attractors.erase(itAt);
+     NotifySubMeshesHypothesisModification();
+   }
+   else {
+     TAttractorMap::iterator it_clAt = _classAttractors.find( entry );
+     if ( it_clAt != _classAttractors.end() ) {
+       _classAttractors.erase(it_clAt);
+       MESSAGE("_classAttractors.size() = "<<_classAttractors.size())
+       NotifySubMeshesHypothesisModification();
+     }
+     else
+       std::cout<<"No_Such_Entry"<<std::endl;
+   }
+ }
+}
+
+//=======================================================================
+//function : ClearSizeMaps
+//=======================================================================
+void BLSURFPlugin_Hypothesis::ClearSizeMaps() {
+  _sizeMap.clear();
+  _attractors.clear();
+  _classAttractors.clear();
+}
+
+// Enable internal enforced vertices on specific face if requested by user
+
+////=======================================================================
+////function : SetInternalEnforcedVertex
+////=======================================================================
+//void BLSURFPlugin_Hypothesis::SetInternalEnforcedVertex(TEntry theFaceEntry,
+//                                                        bool toEnforceInternalVertices,
+//                                                        TEnfGroupName theGroupName) {
+
+//  MESSAGE("BLSURFPlugin_Hypothesis::SetInternalEnforcedVertex("<< theFaceEntry << ", "
+//      << toEnforceInternalVertices << ", " << theGroupName << ")");
+  
+//  TFaceEntryInternalVerticesList::iterator it = _faceEntryInternalVerticesList.find(theFaceEntry);
+//  if (it != _faceEntryInternalVerticesList.end()) {
+//    if (!toEnforceInternalVertices) {
+//      _faceEntryInternalVerticesList.erase(it);
+//    }
+//  }
+//  else {
+//    if (toEnforceInternalVertices) {
+//      _faceEntryInternalVerticesList.insert(theFaceEntry);
+//    }
+//  }
+  
+//  // TODO
+//  // Take care of groups
+//}
+
+
+//=======================================================================
+//function : SetEnforcedVertex
+//=======================================================================
+bool BLSURFPlugin_Hypothesis::SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry,
+                                                TEnfGroupName theGroupName, double x, double y, double z) {
+
+  MESSAGE("BLSURFPlugin_Hypothesis::SetEnforcedVertex("<< theFaceEntry << ", "
+      << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theVertexEntry << ", " << theGroupName << ")");
+
+  SetPhysicalMesh(SizeMap);
+
+  //  TEnfVertexList::iterator it;
+  bool toNotify = false;
+  bool toCreate = true;
+
+  TEnfVertex *oldEnVertex;
+  TEnfVertex *newEnfVertex = new TEnfVertex();
+  newEnfVertex->name = theVertexName;
+  newEnfVertex->geomEntry = theVertexEntry;
+  newEnfVertex->coords.clear();
+  if (theVertexEntry == "") {
+    newEnfVertex->coords.push_back(x);
+    newEnfVertex->coords.push_back(y);
+    newEnfVertex->coords.push_back(z);
+  }
+  newEnfVertex->grpName = theGroupName;
+  newEnfVertex->faceEntries.clear();
+  newEnfVertex->faceEntries.insert(theFaceEntry);
+  
+  
+  // update _enfVertexList
+  TEnfVertexList::iterator it = _enfVertexList.find(newEnfVertex);
+  if (it != _enfVertexList.end()) {
+    toCreate = false;
+    oldEnVertex = (*it);
+    MESSAGE("Enforced Vertex was found => Update");
+    if (oldEnVertex->name != theVertexName) {
+      MESSAGE("Update name from \"" << oldEnVertex->name << "\" to \"" << theVertexName << "\"");
+      oldEnVertex->name = theVertexName;
+      toNotify = true;
+    }
+    if (oldEnVertex->grpName != theGroupName) {
+      MESSAGE("Update group name from \"" << oldEnVertex->grpName << "\" to \"" << theGroupName << "\"");
+      oldEnVertex->grpName = theGroupName;
+      toNotify = true;
+    }
+    TEntryList::iterator it_faceEntries = oldEnVertex->faceEntries.find(theFaceEntry);
+    if (it_faceEntries == oldEnVertex->faceEntries.end()) {
+      MESSAGE("Update face list by adding \"" << theFaceEntry << "\"");
+      oldEnVertex->faceEntries.insert(theFaceEntry);
+      _faceEntryEnfVertexListMap[theFaceEntry].insert(oldEnVertex);
+      toNotify = true;
+    }
+    if (toNotify) {
+      // update map coords / enf vertex if needed
+      if (oldEnVertex->coords.size()) {
+        _coordsEnfVertexMap[oldEnVertex->coords] = oldEnVertex;
+        _faceEntryCoordsListMap[theFaceEntry].insert(oldEnVertex->coords);
+      }
+
+      // update map geom entry / enf vertex if needed
+      if (oldEnVertex->geomEntry != "") {
+        _enfVertexEntryEnfVertexMap[oldEnVertex->geomEntry] = oldEnVertex;
+        _faceEntryEnfVertexEntryListMap[theFaceEntry].insert(oldEnVertex->geomEntry);
+      }
+    }
+  }
+
+//   //////// CREATE ////////////
+  if (toCreate) {
+    toNotify = true;
+    MESSAGE("Creating new enforced vertex");
+    _faceEntryEnfVertexListMap[theFaceEntry].insert(newEnfVertex);
+    _enfVertexList.insert(newEnfVertex);
+    if (theVertexEntry == "") {
+      _faceEntryCoordsListMap[theFaceEntry].insert(newEnfVertex->coords);
+      _coordsEnfVertexMap[newEnfVertex->coords] = newEnfVertex;
+    }
+    else {
+      _faceEntryEnfVertexEntryListMap[theFaceEntry].insert(newEnfVertex->geomEntry);
+      _enfVertexEntryEnfVertexMap[newEnfVertex->geomEntry] = newEnfVertex;
+    }
+  }
+
+  if (toNotify)
+    NotifySubMeshesHypothesisModification();
+
+  MESSAGE("BLSURFPlugin_Hypothesis::SetEnforcedVertex END");
+  return toNotify;
+}
+
+
+//=======================================================================
+//function : GetEnforcedVertices
+//=======================================================================
+
+BLSURFPlugin_Hypothesis::TEnfVertexList BLSURFPlugin_Hypothesis::GetEnfVertexList(const TEntry& theFaceEntry)
+    throw (std::invalid_argument) {
+
+  if (_faceEntryEnfVertexListMap.count(theFaceEntry) > 0)
+    return _faceEntryEnfVertexListMap[theFaceEntry];
+  else
+    return GetDefaultEnfVertexList();
+
+  std::ostringstream msg;
+  msg << "No enforced vertex for face entry " << theFaceEntry;
+  throw std::invalid_argument(msg.str());
+}
+
+//=======================================================================
+//function : GetEnfVertexCoordsList
+//=======================================================================
+
+BLSURFPlugin_Hypothesis::TEnfVertexCoordsList BLSURFPlugin_Hypothesis::GetEnfVertexCoordsList(
+    const TEntry& theFaceEntry) throw (std::invalid_argument) {
+
+  if (_faceEntryCoordsListMap.count(theFaceEntry) > 0)
+    return _faceEntryCoordsListMap[theFaceEntry];
+
+  std::ostringstream msg;
+  msg << "No enforced vertex coords for face entry " << theFaceEntry;
+  throw std::invalid_argument(msg.str());
+}
+
+//=======================================================================
+//function : GetEnfVertexEntryList
+//=======================================================================
+
+BLSURFPlugin_Hypothesis::TEntryList BLSURFPlugin_Hypothesis::GetEnfVertexEntryList(const TEntry& theFaceEntry)
+    throw (std::invalid_argument) {
+
+  if (_faceEntryEnfVertexEntryListMap.count(theFaceEntry) > 0)
+    return _faceEntryEnfVertexEntryListMap[theFaceEntry];
+
+  std::ostringstream msg;
+  msg << "No enforced vertex entry for face entry " << theFaceEntry;
+  throw std::invalid_argument(msg.str());
+}
+
+//=======================================================================
+//function : GetEnfVertex(TEnfVertexCoords coords)
+//=======================================================================
+
+BLSURFPlugin_Hypothesis::TEnfVertex* BLSURFPlugin_Hypothesis::GetEnfVertex(TEnfVertexCoords coords)
+    throw (std::invalid_argument) {
+
+  if (_coordsEnfVertexMap.count(coords) > 0)
+    return _coordsEnfVertexMap[coords];
+
+  std::ostringstream msg;
+  msg << "No enforced vertex with coords (" << coords[0] << ", " << coords[1] << ", " << coords[2] << ")";
+  throw std::invalid_argument(msg.str());
+}
+
+//=======================================================================
+//function : GetEnfVertex(const TEntry& theEnfVertexEntry)
+//=======================================================================
+
+BLSURFPlugin_Hypothesis::TEnfVertex* BLSURFPlugin_Hypothesis::GetEnfVertex(const TEntry& theEnfVertexEntry)
+    throw (std::invalid_argument) {
+
+  if (_enfVertexEntryEnfVertexMap.count(theEnfVertexEntry) > 0)
+    return _enfVertexEntryEnfVertexMap[theEnfVertexEntry];
+
+  std::ostringstream msg;
+  msg << "No enforced vertex with entry " << theEnfVertexEntry;
+  throw std::invalid_argument(msg.str());
+}
+
+//Enable internal enforced vertices on specific face if requested by user
+////=======================================================================
+////function : GetInternalEnforcedVertex
+////=======================================================================
+
+//bool BLSURFPlugin_Hypothesis::GetInternalEnforcedVertex(const TEntry& theFaceEntry)
+//{
+//  if (_faceEntryInternalVerticesList.count(theFaceEntry) > 0)
+//    return true;
+//  return false;
+//}
+
+//=======================================================================
+//function : ClearEnforcedVertex
+//=======================================================================
+
+bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, double x, double y, double z,
+    const TEntry& theVertexEntry) throw (std::invalid_argument) {
+
+  bool toNotify = false;
+  std::ostringstream msg;
+  TEnfVertex *oldEnfVertex;
+  TEnfVertexCoords coords;
+  coords.clear();
+  coords.push_back(x);
+  coords.push_back(y);
+  coords.push_back(z);
+
+  // check that enf vertex with given enf vertex entry exists
+  TEnfVertexEntryEnfVertexMap::iterator it_enfVertexEntry = _enfVertexEntryEnfVertexMap.find(theVertexEntry);
+  if (it_enfVertexEntry != _enfVertexEntryEnfVertexMap.end()) {
+    // Success
+    MESSAGE("Found enforced vertex with geom entry " << theVertexEntry);
+    oldEnfVertex = it_enfVertexEntry->second;
+
+    _enfVertexEntryEnfVertexMap.erase(it_enfVertexEntry);
+
+    TEntryList& enfVertexEntryList = _faceEntryEnfVertexEntryListMap[theFaceEntry];
+    enfVertexEntryList.erase(theVertexEntry);
+    if (enfVertexEntryList.size() == 0)
+      _faceEntryEnfVertexEntryListMap.erase(theFaceEntry);
+    //    TFaceEntryEnfVertexEntryListMap::iterator it_entry_entry = _faceEntryEnfVertexEntryListMap.find(theFaceEntry);
+    //    TEntryList::iterator it_entryList = it_entry_entry->second.find(theVertexEntry);
+    //    it_entry_entry->second.erase(it_entryList);
+    //    if (it_entry_entry->second.size() == 0)
+    //      _faceEntryEnfVertexEntryListMap.erase(it_entry_entry);
+  } else {
+    // Fail
+    MESSAGE("Enforced vertex with geom entry " << theVertexEntry << " not found");
+    msg << "No enforced vertex with geom entry " << theVertexEntry;
+    // check that enf vertex with given coords exists
+    TCoordsEnfVertexMap::iterator it_coords_enf = _coordsEnfVertexMap.find(coords);
+    if (it_coords_enf != _coordsEnfVertexMap.end()) {
+      // Success
+      MESSAGE("Found enforced vertex with coords " << x << ", " << y << ", " << z);
+      oldEnfVertex = it_coords_enf->second;
+
+      _coordsEnfVertexMap.erase(it_coords_enf);
+
+      TEnfVertexCoordsList& enfVertexCoordsList = _faceEntryCoordsListMap[theFaceEntry];
+      enfVertexCoordsList.erase(coords);
+      if (enfVertexCoordsList.size() == 0)
+        _faceEntryCoordsListMap.erase(theFaceEntry);
+      //      TFaceEntryCoordsListMap::iterator it_entry_coords = _faceEntryCoordsListMap.find(theFaceEntry);
+      //      TEnfVertexCoordsList::iterator it_coordsList = it_entry_coords->second.find(coords);
+      //      it_entry_coords->second.erase(it_coordsList);
+      //      if (it_entry_coords->second.size() == 0)
+      //        _faceEntryCoordsListMap.erase(it_entry_coords);
+    } else {
+      // Fail
+      MESSAGE("Enforced vertex with coords " << x << ", " << y << ", " << z << " not found");
+      msg << std::endl;
+      msg << "No enforced vertex at " << x << ", " << y << ", " << z;
+      throw std::invalid_argument(msg.str());
+    }
+  }
+
+  MESSAGE("Remove enf vertex from _enfVertexList");
+
+  // update _enfVertexList
+  TEnfVertexList::iterator it = _enfVertexList.find(oldEnfVertex);
+  if (it != _enfVertexList.end()) {
+    (*it)->faceEntries.erase(theFaceEntry);
+    if ((*it)->faceEntries.size() == 0){
+      _enfVertexList.erase(it);
+      toNotify = true;
+    }
+    MESSAGE("Done");
+  }
+
+  // update _faceEntryEnfVertexListMap
+  TEnfVertexList& currentEnfVertexList = _faceEntryEnfVertexListMap[theFaceEntry];
+  currentEnfVertexList.erase(oldEnfVertex);
+
+  if (currentEnfVertexList.size() == 0) {
+    MESSAGE("Remove _faceEntryEnfVertexListMap[" << theFaceEntry <<"]");
+    _faceEntryEnfVertexListMap.erase(theFaceEntry);
+    MESSAGE("Done");
+  }
+
+  if (toNotify)
+    NotifySubMeshesHypothesisModification();
+
+  return toNotify;
+}
+
+//=======================================================================
+//function : ClearEnforcedVertices
+//=======================================================================
+
+bool BLSURFPlugin_Hypothesis::ClearEnforcedVertices(const TEntry& theFaceEntry) throw (std::invalid_argument) {
+
+  bool toNotify = false;
+  TEnfVertex *oldEnfVertex;
+
+  TFaceEntryCoordsListMap::iterator it_entry_coords = _faceEntryCoordsListMap.find(theFaceEntry);
+  if (it_entry_coords != _faceEntryCoordsListMap.end()) {
+    toNotify = true;
+    TEnfVertexCoordsList coordsList = it_entry_coords->second;
+    TEnfVertexCoordsList::iterator it_coordsList = coordsList.begin();
+    for (; it_coordsList != coordsList.end(); ++it_coordsList) {
+      TEnfVertexCoords coords = (*it_coordsList);
+      oldEnfVertex = _coordsEnfVertexMap[coords];
+      _coordsEnfVertexMap.erase(coords);
+      // update _enfVertexList
+      TEnfVertexList::iterator it = _enfVertexList.find(oldEnfVertex);
+      if (it != _enfVertexList.end()) {
+        (*it)->faceEntries.erase(theFaceEntry);
+        if ((*it)->faceEntries.size() == 0){
+          _enfVertexList.erase(it);
+          toNotify = true;
+        }
+        MESSAGE("Done");
+      }
+    }
+    _faceEntryCoordsListMap.erase(it_entry_coords);
+    _faceEntryEnfVertexListMap.erase(theFaceEntry);
+  }
+
+  TFaceEntryEnfVertexEntryListMap::iterator it_entry_entry = _faceEntryEnfVertexEntryListMap.find(theFaceEntry);
+  if (it_entry_entry != _faceEntryEnfVertexEntryListMap.end()) {
+    toNotify = true;
+    TEntryList enfVertexEntryList = it_entry_entry->second;
+    TEntryList::iterator it_enfVertexEntryList = enfVertexEntryList.begin();
+    for (; it_enfVertexEntryList != enfVertexEntryList.end(); ++it_enfVertexEntryList) {
+      TEntry enfVertexEntry = (*it_enfVertexEntryList);
+      oldEnfVertex = _enfVertexEntryEnfVertexMap[enfVertexEntry];
+      _enfVertexEntryEnfVertexMap.erase(enfVertexEntry);
+      // update _enfVertexList
+      TEnfVertexList::iterator it = _enfVertexList.find(oldEnfVertex);
+      if (it != _enfVertexList.end()) {
+        (*it)->faceEntries.erase(theFaceEntry);
+        if ((*it)->faceEntries.size() == 0){
+          _enfVertexList.erase(it);
+          toNotify = true;
+        }
+        MESSAGE("Done");
+      }
+    }
+    _faceEntryEnfVertexEntryListMap.erase(it_entry_entry);
+    _faceEntryEnfVertexListMap.erase(theFaceEntry);
+  }
+
+  if (toNotify)
+    NotifySubMeshesHypothesisModification();
+
+  return toNotify;
+  //  std::ostringstream msg;
+  //  msg << "No enforced vertex for " << theFaceEntry;
+  //  throw std::invalid_argument(msg.str());
+}
+
+//=======================================================================
+//function : ClearAllEnforcedVertices
+//=======================================================================
+void BLSURFPlugin_Hypothesis::ClearAllEnforcedVertices() {
+  _faceEntryEnfVertexListMap.clear();
+  _enfVertexList.clear();
+  _faceEntryCoordsListMap.clear();
+  _coordsEnfVertexMap.clear();
+  _faceEntryEnfVertexEntryListMap.clear();
+  _enfVertexEntryEnfVertexMap.clear();
+//  Enable internal enforced vertices on specific face if requested by user
+//  _faceEntryInternalVerticesList.clear();
+  NotifySubMeshesHypothesisModification();
+}
+
+//================================================================================
+/*!
+ * \brief Return the enforced vertices
+ */
+//================================================================================
+
+
+BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap BLSURFPlugin_Hypothesis::GetAllEnforcedVerticesByFace(
+    const BLSURFPlugin_Hypothesis* hyp) {
+  return hyp ? hyp->_GetAllEnforcedVerticesByFace() : GetDefaultFaceEntryEnfVertexListMap();
+}
+
+//Enable internal enforced vertices on specific face if requested by user
+//BLSURFPlugin_Hypothesis::TFaceEntryInternalVerticesList BLSURFPlugin_Hypothesis::GetAllInternalEnforcedVerticesByFace(
+//    const BLSURFPlugin_Hypothesis* hyp) {
+//  return hyp ? hyp->_GetAllInternalEnforcedVerticesByFace() : GetDefaultFaceEntryInternalVerticesMap();
+//}
+
+bool BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFaces(const BLSURFPlugin_Hypothesis* hyp)
+{
+  return hyp ? hyp->_GetInternalEnforcedVertexAllFaces() : GetDefaultInternalEnforcedVertex();
+}
+
+BLSURFPlugin_Hypothesis::TEnfGroupName BLSURFPlugin_Hypothesis::GetInternalEnforcedVertexAllFacesGroup(const BLSURFPlugin_Hypothesis* hyp)
+{
+  return hyp ? hyp->_GetInternalEnforcedVertexAllFacesGroup() : BLSURFPlugin_Hypothesis::TEnfGroupName();
+}
+
+BLSURFPlugin_Hypothesis::TEnfVertexList BLSURFPlugin_Hypothesis::GetAllEnforcedVertices(
+    const BLSURFPlugin_Hypothesis* hyp) {
+  return hyp ? hyp->_GetAllEnforcedVertices() : GetDefaultEnfVertexList();
+}
+
+BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap BLSURFPlugin_Hypothesis::GetAllCoordsByFace(
+    const BLSURFPlugin_Hypothesis* hyp) {
+  return hyp ? hyp->_GetAllCoordsByFace() : GetDefaultFaceEntryCoordsListMap();
+}
+
+BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap BLSURFPlugin_Hypothesis::GetAllEnforcedVerticesByCoords(
+    const BLSURFPlugin_Hypothesis* hyp) {
+  return hyp ? hyp->_GetAllEnforcedVerticesByCoords() : GetDefaultCoordsEnfVertexMap();
+}
+
+BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap BLSURFPlugin_Hypothesis::GetAllEnfVertexEntriesByFace(
+    const BLSURFPlugin_Hypothesis* hyp) {
+  return hyp ? hyp->_GetAllEnfVertexEntriesByFace() : GetDefaultFaceEntryEnfVertexEntryListMap();
+}
+
+BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap BLSURFPlugin_Hypothesis::GetAllEnforcedVerticesByEnfVertexEntry(
+    const BLSURFPlugin_Hypothesis* hyp) {
+  return hyp ? hyp->_GetAllEnforcedVerticesByEnfVertexEntry() : GetDefaultEnfVertexEntryEnfVertexMap();
+}
+
+std::set<int> BLSURFPlugin_Hypothesis::GetEnfVertexNodeIDs(TEnfGroupName theGroupName) throw (std::invalid_argument)
+{
+  TGroupNameNodeIDMap::const_iterator it = _groupNameNodeIDMap.find(theGroupName);
+  if (it != _groupNameNodeIDMap.end()) {
+    return it->second;
+  }
+  std::ostringstream msg;
+  msg << "No group " << theGroupName;
+  throw std::invalid_argument(msg.str());
+}
+
+void BLSURFPlugin_Hypothesis::AddEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID)
+{
+  _groupNameNodeIDMap[theGroupName].insert(theNodeID);
+}
+
+void BLSURFPlugin_Hypothesis::RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) throw (std::invalid_argument)
+{
+  TGroupNameNodeIDMap::iterator it = _groupNameNodeIDMap.find(theGroupName);
+  if (it != _groupNameNodeIDMap.end()) {
+    std::set<int>::iterator IDit = it->second.find(theNodeID);
+    if (IDit != it->second.end())
+      it->second.erase(IDit);
+    std::ostringstream msg;
+    msg << "No node IDs " << theNodeID << " for group " << theGroupName;
+    throw std::invalid_argument(msg.str());
+  }
+  std::ostringstream msg;
+  msg << "No group " << theGroupName;
+  throw std::invalid_argument(msg.str());
+}
+
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis::SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices) {
+  if (toEnforceInternalVertices != _enforcedInternalVerticesAllFaces) {
+    _enforcedInternalVerticesAllFaces = toEnforceInternalVertices;
+    if (toEnforceInternalVertices)
+      SetPhysicalMesh(SizeMap);
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis::SetInternalEnforcedVertexAllFacesGroup(BLSURFPlugin_Hypothesis::TEnfGroupName theGroupName) {
+  if (string(theGroupName) != string(_enforcedInternalVerticesAllFacesGroup)) {
+    _enforcedInternalVerticesAllFacesGroup = theGroupName;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=============================================================================
+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;
+  save << " " << (int) _preCADMergeEdges << " " << (int) _preCADRemoveNanoEdges << " " << (int) _preCADDiscardInput << " " << _preCADEpsNano ;
 
   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
+  if (op_val != _option2value.end()) {
+    save << " " << "__OPTIONS_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
+    }
+    save << " " << "__OPTIONS_END__";
+  }
+  
+  op_val = _preCADoption2value.begin();
+  if (op_val != _preCADoption2value.end()) {
+    save << " " << "__PRECAD_OPTIONS_BEGIN__";
+    for (; op_val != _preCADoption2value.end(); ++op_val) {
+      if (!op_val->second.empty())
+        save << " " << op_val->first << " " << op_val->second << "%#"; // "%#" is a mark of value end
+    }
+    save << " " << "__PRECAD_OPTIONS_END__";
+  }
+
+  TSizeMap::iterator it_sm = _sizeMap.begin();
+  if (it_sm != _sizeMap.end()) {
+    save << " " << "__SIZEMAP_BEGIN__";
+    for (; it_sm != _sizeMap.end(); ++it_sm) {
+      save << " " << it_sm->first << " " << it_sm->second << "%#"; // "%#" is a mark of value end
+    }
+    save << " " << "__SIZEMAP_END__";
+  }
+
+  TSizeMap::iterator it_at = _attractors.begin();
+  if (it_at != _attractors.end()) {
+    save << " " << "__ATTRACTORS_BEGIN__";
+    for (; it_at != _attractors.end(); ++it_at) {
+      save << " " << it_at->first << " " << it_at->second << "%#"; // "%#" is a mark of value end
+    }
+    save << " " << "__ATTRACTORS_END__";
+  }
+  
+  TAttractorMap::iterator it_At = _classAttractors.begin();
+  if (it_At != _classAttractors.end()) {
+    std::ostringstream test;
+    save << " " << "__NEW_ATTRACTORS_BEGIN__";
+    test << " " << "__NEW_ATTRACTORS_BEGIN__";
+    for (; it_At != _classAttractors.end(); ++it_At) {
+      std::vector<double> attParams;
+      attParams   = it_At->second->GetParameters();
+//       double step = it_At->second->GetStep();
+      save << " " << it_At->first;
+      save << " " << it_At->second->GetAttractorEntry();
+      save << " " << attParams[0]  << " " <<  attParams[1] << " " <<  attParams[2] << " " <<  attParams[3];
+//       save << " " << step;
+      test << " " << it_At->first;
+      test << " " << it_At->second->GetAttractorEntry();
+      test << " " << attParams[0]  << " " <<  attParams[1] << " " <<  attParams[2] << " " <<  attParams[3];
+//       test << " " << step;
+    }
+    save << " " << "__NEW_ATTRACTORS_END__";
+    test << " " << "__NEW_ATTRACTORS_END__";
+    MESSAGE(" Attractor hypothesis saved as "<<test.str())
+  }
+
+  TEnfVertexList::const_iterator it_enf = _enfVertexList.begin();
+  if (it_enf != _enfVertexList.end()) {
+    save << " " << "__ENFORCED_VERTICES_BEGIN__";
+    for (; it_enf != _enfVertexList.end(); ++it_enf) {
+      TEnfVertex *enfVertex = (*it_enf);
+      save << " " << "__BEGIN_VERTEX__";
+      if (!enfVertex->name.empty()) {
+        save << " " << "__BEGIN_NAME__";
+        save << " " << enfVertex->name;
+        save << " " << "__END_NAME__";
+      }
+      if (!enfVertex->geomEntry.empty()) {
+        save << " " << "__BEGIN_ENTRY__";
+        save << " " << enfVertex->geomEntry;
+        save << " " << "__END_ENTRY__";
+      }
+      if (!enfVertex->grpName.empty()) {
+        save << " " << "__BEGIN_GROUP__";
+        save << " " << enfVertex->grpName;
+        save << " " << "__END_GROUP__";
+      }
+      if (enfVertex->coords.size()) {
+        save << " " << "__BEGIN_COORDS__";
+        for (int i=0;i<enfVertex->coords.size();i++)
+          save << " " << enfVertex->coords[i];
+        save << " " << "__END_COORDS__";
+      }
+      TEntryList::const_iterator faceEntriesIt = enfVertex->faceEntries.begin();
+      bool hasFaces = false;
+      if (faceEntriesIt != enfVertex->faceEntries.end()) {
+        hasFaces = true;
+        save << " " << "__BEGIN_FACELIST__";
+      }
+      for (; faceEntriesIt != enfVertex->faceEntries.end(); ++faceEntriesIt)
+        save << " " << (*faceEntriesIt);
+      if (hasFaces)
+        save << " " << "__END_FACELIST__";
+      save << " " << "__END_VERTEX__";
+    }
+    save << " " << "__ENFORCED_VERTICES_END__";
   }
 
   return save;
 }
 
 //=============================================================================
-std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
-{
+std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
   bool isOK = true;
   int i;
   double val;
@@ -421,60 +1300,404 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
     _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());
 
+  isOK = (load >> i);
+  if (isOK)
+    _preCADMergeEdges = (bool) i;
+  else
+    load.clear(std::ios::badbit | load.rdstate());
+
+  isOK = (load >> i);
+  if (isOK)
+    _preCADRemoveNanoEdges = (bool) i;
+  else
+    load.clear(std::ios::badbit | load.rdstate());
+
+  isOK = (load >> i);
+  if (isOK)
+    _preCADDiscardInput = (bool) i;
+  else
+    load.clear(std::ios::badbit | load.rdstate());
+
+  isOK = (load >> val);
+  if (isOK)
+    _preCADEpsNano = val;
+  else
+    load.clear(std::ios::badbit | load.rdstate());
+
+  std::string option_or_sm;
+  bool hasOptions = false;
+  bool hasPreCADOptions = false;
+  bool hasSizeMap = false;
+  bool hasAttractor = false;
+  bool hasNewAttractor = false;
+  bool hasEnforcedVertex = false;
+
+  isOK = (load >> option_or_sm);
+  if (isOK)
+    if (option_or_sm == "__OPTIONS_BEGIN__")
+      hasOptions = true;
+    else if (option_or_sm == "__PRECAD_OPTIONS_BEGIN__")
+      hasPreCADOptions = true;
+    else if (option_or_sm == "__SIZEMAP_BEGIN__")
+      hasSizeMap = true;
+    else if (option_or_sm == "__ATTRACTORS_BEGIN__")
+      hasAttractor = true;
+    else if (option_or_sm == "__NEW_ATTRACTORS_BEGIN__")
+      hasNewAttractor = true;
+    else if (option_or_sm == "__ENFORCED_VERTICES_BEGIN__")
+      hasEnforcedVertex = true;
+
   std::string optName, optValue;
-  while (isOK) {
+  while (isOK && hasOptions) {
     isOK = (load >> optName);
+    if (isOK) {
+      if (optName == "__OPTIONS_END__")
+        break;
+      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 "%#"
+    }
+  }
+
+  if (hasOptions) {
+    isOK = (load >> option_or_sm);
     if (isOK)
+      if (option_or_sm == "__PRECAD_OPTIONS_BEGIN__")
+        hasPreCADOptions = true;
+      else if (option_or_sm == "__SIZEMAP_BEGIN__")
+        hasSizeMap = true;
+      else if (option_or_sm == "__ATTRACTORS_BEGIN__")
+        hasAttractor = true;
+      else if (option_or_sm == "__NEW_ATTRACTORS_BEGIN__")
+        hasNewAttractor = true;
+      else if (option_or_sm == "__ENFORCED_VERTICES_BEGIN__")
+        hasEnforcedVertex = true;
+  }
+
+  while (isOK && hasPreCADOptions) {
+    isOK = (load >> optName);
+    if (isOK) {
+      if (optName == "__PRECAD_OPTIONS_END__")
+        break;
       isOK = (load >> optValue);
+    }
     if (isOK) {
-      std::string & value = _option2value[ optName ];
+      std::string & value = _preCADoption2value[optName];
       value = optValue;
       int len = value.size();
       // continue reading until "%#" encountered
-      while ( value[len-1] != '#' || value[len-2] != '%' )
-      {
+      while (value[len - 1] != '#' || value[len - 2] != '%') {
         isOK = (load >> optValue);
         if (isOK) {
           value += " ";
           value += optValue;
           len = value.size();
+        } else {
+          break;
         }
-        else {
+      }
+      value[len - 2] = '\0'; //cut off "%#"
+    }
+  }
+
+  if (hasPreCADOptions) {
+    isOK = (load >> option_or_sm);
+    if (isOK)
+      if (option_or_sm == "__SIZEMAP_BEGIN__")
+        hasSizeMap = true;
+      else if (option_or_sm == "__ATTRACTORS_BEGIN__")
+        hasAttractor = true;
+      else if (option_or_sm == "__NEW_ATTRACTORS_BEGIN__")
+        hasNewAttractor = true;
+      else if (option_or_sm == "__ENFORCED_VERTICES_BEGIN__")
+        hasEnforcedVertex = true;
+  }
+  
+  std::string smEntry, smValue;
+  while (isOK && hasSizeMap) {
+    isOK = (load >> smEntry);
+    if (isOK) {
+      if (smEntry == "__SIZEMAP_END__")
+        break;
+      isOK = (load >> smValue);
+    }
+    if (isOK) {
+      std::string & value2 = _sizeMap[smEntry];
+      value2 = smValue;
+      int len2 = value2.size();
+      // continue reading until "%#" encountered
+      while (value2[len2 - 1] != '#' || value2[len2 - 2] != '%') {
+        isOK = (load >> smValue);
+        if (isOK) {
+          value2 += " ";
+          value2 += smValue;
+          len2 = value2.size();
+        } else {
+          break;
+        }
+      }
+      value2[len2 - 2] = '\0'; //cut off "%#"
+    }
+  }
+
+  if (hasSizeMap) {
+    isOK = (load >> option_or_sm);
+    if (isOK)
+      if (option_or_sm == "__ATTRACTORS_BEGIN__")
+        hasAttractor = true;
+      if (option_or_sm == "__NEW_ATTRACTORS_BEGIN__")
+        hasNewAttractor = true;
+      else if (option_or_sm == "__ENFORCED_VERTICES_BEGIN__")
+        hasEnforcedVertex = true;
+  }
+
+  std::string atEntry, atValue;
+  while (isOK && hasAttractor) {
+    isOK = (load >> atEntry);
+    if (isOK) {
+      if (atEntry == "__ATTRACTORS_END__")
+        break;
+      isOK = (load >> atValue);
+    }
+    if (isOK) {
+      std::string & value3 = _attractors[atEntry];
+      value3 = atValue;
+      int len3 = value3.size();
+      // continue reading until "%#" encountered
+      while (value3[len3 - 1] != '#' || value3[len3 - 2] != '%') {
+        isOK = (load >> atValue);
+        if (isOK) {
+          value3 += " ";
+          value3 += atValue;
+          len3 = value3.size();
+        } else {
           break;
         }
       }
-      value[ len-2 ] = '\0'; //cut off "%#"
+      value3[len3 - 2] = '\0'; //cut off "%#"
+    }
+  }
+
+  if (hasAttractor) {
+    isOK = (load >> option_or_sm);
+    if (isOK)
+      if (option_or_sm == "__NEW_ATTRACTORS_BEGIN__")
+        hasNewAttractor = true;
+      else if (option_or_sm == "__ENFORCED_VERTICES_BEGIN__")
+        hasEnforcedVertex = true;
+  }
+
+  std::string newAtFaceEntry, atTestString;
+  std::string newAtShapeEntry;
+  double attParams[4];
+  double step;
+  while (isOK && hasNewAttractor) {
+    std::cout<<"Load new attractor"<<std::endl;
+    isOK = (load >> newAtFaceEntry);
+    if (isOK) {
+      if (newAtFaceEntry == "__NEW_ATTRACTORS_END__")
+        break;
+      isOK = (load >> newAtShapeEntry);
+      if (!isOK)
+    break;
+      isOK = (load >> attParams[0]>>attParams[1]>>attParams[2]>>attParams[3]); //>>step);
+    }
+    if (isOK) {
+      MESSAGE(" LOADING ATTRACTOR HYPOTHESIS ")
+      const TopoDS_Shape attractorShape = BLSURFPlugin_Hypothesis::entryToShape(newAtShapeEntry);
+      const TopoDS_Face faceShape = TopoDS::Face(BLSURFPlugin_Hypothesis::entryToShape(newAtFaceEntry));
+      BLSURFPlugin_Attractor* attractor = new BLSURFPlugin_Attractor(faceShape, attractorShape, newAtShapeEntry);//, step);
+      attractor->SetParameters(attParams[0], attParams[1], attParams[2], attParams[3]);
+      attractor->BuildMap();                     
+      _classAttractors[newAtFaceEntry]=attractor;
+    }
+  }
+  
+  
+  if (hasNewAttractor) {
+    isOK = (load >> option_or_sm);
+    if (isOK)
+      if (option_or_sm == "__ENFORCED_VERTICES_BEGIN__")
+        hasEnforcedVertex = true;
+  }
+
+
+// 
+// Here is a example of the saved stream:
+// __ENFORCED_VERTICES_BEGIN__ 
+// __BEGIN_VERTEX__  => no name, no entry
+// __BEGIN_GROUP__ mon groupe __END_GROUP__
+// __BEGIN_COORDS__ 10 10 10 __END_COORDS__ 
+// __BEGIN_FACELIST__ 0:1:1:1:1 __END_FACELIST__ 
+// __END_VERTEX__ 
+// __BEGIN_VERTEX__ => no coords
+// __BEGIN_NAME__ mes points __END_NAME__ 
+// __BEGIN_ENTRY__ 0:1:1:4 __END_ENTRY__
+// __BEGIN_GROUP__ mon groupe __END_GROUP__
+// __BEGIN_FACELIST__ 0:1:1:1:3 __END_FACELIST__
+// __END_VERTEX__ 
+// __ENFORCED_VERTICES_END__
+// 
+
+  std::string enfSeparator;
+  std::string enfName;
+  std::string enfGeomEntry;
+  std::string enfGroup;
+  TEntryList enfFaceEntryList;
+  double enfCoords[3];
+  bool hasCoords = false;
+  
+  _faceEntryEnfVertexListMap.clear();
+  _enfVertexList.clear();
+  _faceEntryCoordsListMap.clear();
+  _coordsEnfVertexMap.clear();
+  _faceEntryEnfVertexEntryListMap.clear();
+  _enfVertexEntryEnfVertexMap.clear();
+  
+  
+  while (isOK && hasEnforcedVertex) {
+    isOK = (load >> enfSeparator); // __BEGIN_VERTEX__
+    TEnfVertex *enfVertex = new TEnfVertex();
+//     MESSAGE("enfSeparator: " <<enfSeparator);
+    if (enfSeparator == "__ENFORCED_VERTICES_END__")
+      break; // __ENFORCED_VERTICES_END__
+    if (enfSeparator != "__BEGIN_VERTEX__")
+      throw std::exception();
+    
+    while (isOK) {
+      isOK = (load >> enfSeparator);
+      MESSAGE("enfSeparator: " <<enfSeparator);
+      if (enfSeparator == "__END_VERTEX__") {
+        
+        enfVertex->name = enfName;
+        enfVertex->geomEntry = enfGeomEntry;
+        enfVertex->grpName = enfGroup;
+        enfVertex->coords.clear();
+        if (hasCoords)
+          enfVertex->coords.assign(enfCoords,enfCoords+3);
+        enfVertex->faceEntries = enfFaceEntryList;
+        
+        _enfVertexList.insert(enfVertex);
+        
+        if (enfVertex->coords.size()) {
+          _coordsEnfVertexMap[enfVertex->coords] = enfVertex;
+          for (TEntryList::const_iterator it = enfVertex->faceEntries.begin() ; it != enfVertex->faceEntries.end(); ++it) {
+            _faceEntryCoordsListMap[(*it)].insert(enfVertex->coords);
+            _faceEntryEnfVertexListMap[(*it)].insert(enfVertex);
+          }
+        }
+        if (!enfVertex->geomEntry.empty()) {
+          _enfVertexEntryEnfVertexMap[enfVertex->geomEntry] = enfVertex;
+          for (TEntryList::const_iterator it = enfVertex->faceEntries.begin() ; it != enfVertex->faceEntries.end(); ++it) {
+            _faceEntryEnfVertexEntryListMap[(*it)].insert(enfVertex->geomEntry);
+            _faceEntryEnfVertexListMap[(*it)].insert(enfVertex);
+          }
+        }
+        
+        enfName.clear();
+        enfGeomEntry.clear();
+        enfGroup.clear();
+        enfFaceEntryList.clear();
+        hasCoords = false;
+        break; // __END_VERTEX__
+      }
+        
+      if (enfSeparator == "__BEGIN_NAME__") {  // __BEGIN_NAME__
+        while (isOK && (enfSeparator != "__END_NAME__")) {
+          isOK = (load >> enfSeparator);
+          if (enfSeparator != "__END_NAME__") {
+            if (!enfName.empty())
+              enfName += " ";
+            enfName += enfSeparator;
+          }
+        }
+        MESSAGE("enfName: " <<enfName);
+      }
+        
+      if (enfSeparator == "__BEGIN_ENTRY__") {  // __BEGIN_ENTRY__
+        isOK = (load >> enfGeomEntry);
+        isOK = (load >> enfSeparator); // __END_ENTRY__
+        if (enfSeparator != "__END_ENTRY__")
+          throw std::exception();
+        MESSAGE("enfGeomEntry: " <<enfGeomEntry);
+      }
+        
+      if (enfSeparator == "__BEGIN_GROUP__") {  // __BEGIN_GROUP__
+        while (isOK && (enfSeparator != "__END_GROUP__")) {
+          isOK = (load >> enfSeparator);
+          if (enfSeparator != "__END_GROUP__") {
+            if (!enfGroup.empty())
+              enfGroup += " ";
+            enfGroup += enfSeparator;
+          }
+        }
+        MESSAGE("enfGroup: " <<enfGroup);
+      }
+        
+      if (enfSeparator == "__BEGIN_COORDS__") {  // __BEGIN_COORDS__
+        hasCoords = true;
+        isOK = (load >> enfCoords[0] >> enfCoords[1] >> enfCoords[2]);
+        isOK = (load >> enfSeparator); // __END_COORDS__
+        if (enfSeparator != "__END_COORDS__")
+          throw std::exception();
+        MESSAGE("enfCoords: " << enfCoords[0] <<","<< enfCoords[1] <<","<< enfCoords[2]);
+      } 
+        
+      if (enfSeparator == "__BEGIN_FACELIST__") {  // __BEGIN_FACELIST__
+        while (isOK && (enfSeparator != "__END_FACELIST__")) {
+          isOK = (load >> enfSeparator);
+          if (enfSeparator != "__END_FACELIST__") {
+            enfFaceEntryList.insert(enfSeparator);
+            MESSAGE(enfSeparator << " was inserted into enfFaceEntryList");
+          }
+        }
+      } 
     }
   }
 
@@ -482,15 +1705,13 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load)
 }
 
 //=============================================================================
-std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp)
-{
-  return hyp.SaveTo( save );
+std::ostream & operator <<(std::ostream & save, BLSURFPlugin_Hypothesis & hyp) {
+  return hyp.SaveTo(save);
 }
 
 //=============================================================================
-std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp)
-{
-  return hyp.LoadFrom( load );
+std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp) {
+  return hyp.LoadFrom(load);
 }
 
 //================================================================================
@@ -499,9 +1720,7 @@ std::istream & operator >>(std::istream & load, BLSURFPlugin_Hypothesis & hyp)
  */
 //================================================================================
 
-bool BLSURFPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   theMesh,
-                                                      const TopoDS_Shape& theShape)
-{
+bool BLSURFPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape) {
   return false;
 }
 
@@ -512,68 +1731,72 @@ bool BLSURFPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   theMesh,
  */
 //=============================================================================
 
-bool BLSURFPlugin_Hypothesis::SetParametersByDefaults(const TDefaults&   dflts,
-                                                      const SMESH_Mesh* theMesh)
-{
-  return bool( _phySize = dflts._elemLength );
+bool BLSURFPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh) {
+  return bool(_phySize = dflts._elemLength);
 }
 
 //=============================================================================
-BLSURFPlugin_Hypothesis::Topology BLSURFPlugin_Hypothesis::GetDefaultTopology()
-{
+BLSURFPlugin_Hypothesis::Topology BLSURFPlugin_Hypothesis::GetDefaultTopology() {
   return FromCAD;
 }
 
 //=============================================================================
-BLSURFPlugin_Hypothesis::PhysicalMesh BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh()
-{
+BLSURFPlugin_Hypothesis::PhysicalMesh BLSURFPlugin_Hypothesis::GetDefaultPhysicalMesh() {
   return PhysicalUserDefined;
 }
 
 //=============================================================================
-double BLSURFPlugin_Hypothesis::GetDefaultPhySize()
-{
+double BLSURFPlugin_Hypothesis::GetDefaultPhySize() {
   return 10;
 }
 
 //======================================================================
-double BLSURFPlugin_Hypothesis::GetDefaultMaxSize()
-{
+double BLSURFPlugin_Hypothesis::GetDefaultMaxSize() {
   return undefinedDouble(); // 1e+4;
 }
 
 //======================================================================
-double BLSURFPlugin_Hypothesis::GetDefaultMinSize()
-{
+double BLSURFPlugin_Hypothesis::GetDefaultMinSize() {
   return undefinedDouble(); //1e-4;
 }
 
 //======================================================================
-BLSURFPlugin_Hypothesis::GeometricMesh BLSURFPlugin_Hypothesis::GetDefaultGeometricMesh()
-{
+BLSURFPlugin_Hypothesis::GeometricMesh BLSURFPlugin_Hypothesis::GetDefaultGeometricMesh() {
   return DefaultGeom;
 }
 
 //=============================================================================
-double BLSURFPlugin_Hypothesis::GetDefaultAngleMeshS()
-{
+double BLSURFPlugin_Hypothesis::GetDefaultAngleMeshS() {
   return 8;
 }
 
 //=============================================================================
-double BLSURFPlugin_Hypothesis::GetDefaultGradation()
-{
+double BLSURFPlugin_Hypothesis::GetDefaultGradation() {
   return 1.1;
 }
 
 //=============================================================================
-bool BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed()
-{
+bool BLSURFPlugin_Hypothesis::GetDefaultQuadAllowed() {
   return false;
 }
 
 //=============================================================================
-bool BLSURFPlugin_Hypothesis::GetDefaultDecimesh()
-{
+bool BLSURFPlugin_Hypothesis::GetDefaultDecimesh() {
+  return false;
+}
+
+//======================================================================
+double BLSURFPlugin_Hypothesis::GetDefaultPreCADEpsNano() {
+  return undefinedDouble(); //1e-4;
+}
+
+//======================================================================
+std::string BLSURFPlugin_Hypothesis::GetDefaultGMFFile() {
+  return "";
+}
+
+//=============================================================================
+bool BLSURFPlugin_Hypothesis::GetDefaultInternalEnforcedVertex() {
   return false;
 }
+
index a8fb7d2841f585c1287f5b9d6e78dabde3014d1a..f6167a52fcad19b57d73ec13baa082d432d81746 100644 (file)
@@ -1,35 +1,42 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
+//           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
 //
 #ifndef _BLSURFPlugin_Hypothesis_HXX_
 #define _BLSURFPlugin_Hypothesis_HXX_
 
 #include "SMESH_Hypothesis.hxx"
+#include <vector>
 #include <map>
 #include <set>
 #include <stdexcept>
 #include <string>
+#include <cstring>
+#include <sstream>
+#include <utilities.h>
+#include "BLSURFPlugin_Attractor.hxx"
 
 //  Parameters for work of BLSURF
 
@@ -41,12 +48,14 @@ public:
   enum Topology {
     FromCAD,
     Process,
-    Process2
+    Process2,
+    PreCAD
   };
 
   enum PhysicalMesh {
     DefaultSize,
-    PhysicalUserDefined
+    PhysicalUserDefined,
+    SizeMap
   };
 
   enum GeometricMesh {
@@ -54,6 +63,10 @@ public:
     UserDefined
   };
 
+  static const char* GetHypType() { return "BLSURF_Parameters"; }
+  
+  TopoDS_Shape entryToShape(std::string entry);
+
   void SetTopology(Topology theTopology);
   Topology GetTopology() const { return _topology; }
 
@@ -95,19 +108,218 @@ public:
 
   void SetVerbosity(int theVal);
   int GetVerbosity() const { return _verb; }
+  
+  void ClearEntry(const std::string& entry);
+  void ClearSizeMaps();
+
+  void SetPreCADMergeEdges(bool theVal);
+  bool GetPreCADMergeEdges() const { return _preCADMergeEdges; }
+
+  void SetPreCADRemoveNanoEdges(bool theVal);
+  bool GetPreCADRemoveNanoEdges() const { return _preCADRemoveNanoEdges; }
+
+  void SetPreCADDiscardInput(bool theVal);
+  bool GetPreCADDiscardInput() const { return _preCADDiscardInput; }
+
+  void SetPreCADEpsNano(double theVal);
+  double GetPreCADEpsNano() const { return _preCADEpsNano; }
+    
+  typedef std::map<std::string,std::string> TSizeMap;
+
+  void SetSizeMapEntry(const std::string& entry,const std::string& sizeMap );
+  std::string  GetSizeMapEntry(const std::string& entry);
+  const TSizeMap& _GetSizeMapEntries() const { return _sizeMap; }
+  /*!
+   * \brief Return the size maps
+   */
+  static TSizeMap GetSizeMapEntries(const BLSURFPlugin_Hypothesis* hyp);
+
+
+  void SetAttractorEntry(const std::string& entry,const std::string& attractor );
+  std::string GetAttractorEntry(const std::string& entry);
+  const TSizeMap& _GetAttractorEntries() const { return _attractors; };
+  /*!
+   * \brief Return the attractors
+   */
+  static TSizeMap GetAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
+
+
+/*
+  void SetCustomSizeMapEntry(const std::string& entry,const std::string& sizeMap );
+  std::string  GetCustomSizeMapEntry(const std::string& entry);
+  void UnsetCustomSizeMap(const std::string& entry);
+  const TSizeMap& GetCustomSizeMapEntries() const { return _customSizeMap; }
+ */
+  
+  typedef std::map< std::string, BLSURFPlugin_Attractor* > TAttractorMap;
+  typedef std::map< std::string, std::vector<double> > TParamsMap; //TODO à finir 
+  
+  void SetClassAttractorEntry(const std::string& entry, const std::string& att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius);
+  std::string  GetClassAttractorEntry(const std::string& entry);
+  const TAttractorMap& _GetClassAttractorEntries() const { return _classAttractors; }
+  /*!
+   * \brief Return the attractors entries
+   */
+  static TAttractorMap GetClassAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
+
+  /*!
+   * To set/get/unset an enforced vertex
+   */
+  // Name
+  typedef std::string TEnfName;
+  // Entry
+  typedef std::string TEntry;
+  // List of entries
+  typedef std::set<TEntry> TEntryList;
+  // Group name
+  typedef std::string TEnfGroupName;
+  // Coordinates
+  typedef std::vector<double> TEnfVertexCoords;
+  typedef std::set< TEnfVertexCoords > TEnfVertexCoordsList;
+
+  // Enforced vertex
+  struct TEnfVertex {
+    TEnfName name;
+    TEntry geomEntry;
+    TEnfVertexCoords coords;
+    TEnfGroupName grpName;
+    TEntryList faceEntries;
+  };
+    
+  struct CompareEnfVertices
+  {
+    bool operator () (const TEnfVertex* e1, const TEnfVertex* e2) const {
+      if (e1 && e2) {
+        if (e1->coords.size() && e2->coords.size())
+          return (e1->coords < e2->coords);
+        else
+          return (e1->geomEntry < e2->geomEntry);
+      }
+      return false;
+    }
+  };
+
+  // List of enforced vertices
+  typedef std::set< TEnfVertex*, CompareEnfVertices > TEnfVertexList;
+
+  // Map Face Entry / List of enforced vertices
+  typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap;
+
+  // List of Face Entry with internal enforced vertices activated
+  typedef std::set< TEntry > TFaceEntryInternalVerticesList;
 
-  static Topology      GetDefaultTopology();
-  static PhysicalMesh  GetDefaultPhysicalMesh();
-  static double        GetDefaultPhySize();
-  static double        GetDefaultMaxSize();
-  static double        GetDefaultMinSize();
-  static GeometricMesh GetDefaultGeometricMesh();
-  static double        GetDefaultAngleMeshS();
-  static double        GetDefaultAngleMeshC() { return GetDefaultAngleMeshS(); }
-  static double        GetDefaultGradation();
-  static bool          GetDefaultQuadAllowed();
-  static bool          GetDefaultDecimesh();
-  static int           GetDefaultVerbosity() { return 10; }
+  // Map Face Entry / List of coords
+  typedef std::map< TEntry, TEnfVertexCoordsList > TFaceEntryCoordsListMap;
+
+  // Map Face Entry / List of Vertex entry
+  typedef std::map< TEntry, TEntryList > TFaceEntryEnfVertexEntryListMap;
+  
+  // Map Coords / Enforced vertex
+  typedef std::map< TEnfVertexCoords, TEnfVertex* > TCoordsEnfVertexMap;
+
+  // Map Vertex entry / Enforced vertex
+  typedef std::map< TEntry, TEnfVertex* > TEnfVertexEntryEnfVertexMap;
+
+  typedef std::map< TEnfGroupName, std::set<int> > TGroupNameNodeIDMap;
+  /* TODO GROUPS
+  // Map Group Name / List of enforced vertices
+  typedef std::map< TEnfGroupName , TEnfVertexList > TGroupNameEnfVertexListMap;
+  */
+
+  
+  bool                  SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry, TEnfGroupName theGroupName,
+                                          double x = 0.0, double y = 0.0, double z = 0.0);
+  TEnfVertexList        GetEnfVertexList(const TEntry& theFaceEntry) throw (std::invalid_argument);
+  TEnfVertexCoordsList  GetEnfVertexCoordsList(const TEntry& theFaceEntry) throw (std::invalid_argument);
+  TEntryList            GetEnfVertexEntryList (const TEntry& theFaceEntry) throw (std::invalid_argument);
+  TEnfVertex*           GetEnfVertex(TEnfVertexCoords coords) throw (std::invalid_argument);
+  TEnfVertex*           GetEnfVertex(const TEntry& theEnfVertexEntry) throw (std::invalid_argument);
+  void                  AddEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID);
+  std::set<int>         GetEnfVertexNodeIDs(TEnfGroupName theGroupName) throw (std::invalid_argument);
+  void                  RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) throw (std::invalid_argument);
+  
+  bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry="") throw (std::invalid_argument);
+  bool ClearEnforcedVertices(const TEntry& theFaceEntry) throw (std::invalid_argument);
+
+  void ClearAllEnforcedVertices();
+
+  const TFaceEntryEnfVertexListMap  _GetAllEnforcedVerticesByFace() const { return _faceEntryEnfVertexListMap; }
+  const TEnfVertexList              _GetAllEnforcedVertices() const { return _enfVertexList; }
+
+  const TFaceEntryCoordsListMap     _GetAllCoordsByFace() const { return _faceEntryCoordsListMap; }
+  const TCoordsEnfVertexMap         _GetAllEnforcedVerticesByCoords() const { return _coordsEnfVertexMap; }
+
+  const TFaceEntryEnfVertexEntryListMap _GetAllEnfVertexEntriesByFace() const { return _faceEntryEnfVertexEntryListMap; }
+  const TEnfVertexEntryEnfVertexMap     _GetAllEnforcedVerticesByEnfVertexEntry() const { return _enfVertexEntryEnfVertexMap; }
+
+//   TODO GROUPS
+//   const TEnfVertexGroupNameMap _GetEnforcedVertexGroupNameMap() const { return _enfVertexGroupNameMap; }
+  
+
+  /*!
+   * \brief Return the enforced vertices
+   */
+  static TFaceEntryEnfVertexListMap       GetAllEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
+  static TEnfVertexList                   GetAllEnforcedVertices(const BLSURFPlugin_Hypothesis* hyp);
+
+  static TFaceEntryCoordsListMap          GetAllCoordsByFace(const BLSURFPlugin_Hypothesis* hyp);
+  static TCoordsEnfVertexMap              GetAllEnforcedVerticesByCoords(const BLSURFPlugin_Hypothesis* hyp);
+
+  static TFaceEntryEnfVertexEntryListMap  GetAllEnfVertexEntriesByFace(const BLSURFPlugin_Hypothesis* hyp);
+  static TEnfVertexEntryEnfVertexMap      GetAllEnforcedVerticesByEnfVertexEntry(const BLSURFPlugin_Hypothesis* hyp);
+
+  /*!
+   * \brief Internal enforced vertices
+   */
+  void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices);
+  const bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; }
+  static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp );
+  void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName);
+  const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; }
+  static TEnfGroupName GetInternalEnforcedVertexAllFacesGroup( const BLSURFPlugin_Hypothesis* hyp );
+
+//  Enable internal enforced vertices on specific face if requested by user
+//  static TFaceEntryInternalVerticesList GetDefaultFaceEntryInternalVerticesMap() { return TFaceEntryInternalVerticesList(); }
+//  const TFaceEntryInternalVerticesList  _GetAllInternalEnforcedVerticesByFace() const { return _faceEntryInternalVerticesList; }
+//  static TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
+//  void SetInternalEnforcedVertex(TEntry theFaceEntry, bool toEnforceInternalVertices, TEnfGroupName theGroupName);
+//  bool GetInternalEnforcedVertex(const TEntry& theFaceEntry);
+
+  static Topology        GetDefaultTopology();
+  static PhysicalMesh    GetDefaultPhysicalMesh();
+  static double          GetDefaultPhySize();
+  static double          GetDefaultMaxSize();
+  static double          GetDefaultMinSize();
+  static GeometricMesh   GetDefaultGeometricMesh();
+  static double          GetDefaultAngleMeshS();
+  static double          GetDefaultAngleMeshC() { return GetDefaultAngleMeshS(); }
+  static double          GetDefaultGradation();
+  static bool            GetDefaultQuadAllowed();
+  static bool            GetDefaultDecimesh();
+  static int             GetDefaultVerbosity() { return 10; }
+  // PreCAD
+  static bool            GetDefaultPreCADMergeEdges() { return false; }
+  static bool            GetDefaultPreCADRemoveNanoEdges() { return false; }
+  static bool            GetDefaultPreCADDiscardInput() { return false; }
+  static double          GetDefaultPreCADEpsNano();
+  
+  static TSizeMap        GetDefaultSizeMap() { return TSizeMap();}
+  static TAttractorMap   GetDefaultAttractorMap() { return TAttractorMap(); }
+
+  static TFaceEntryEnfVertexListMap       GetDefaultFaceEntryEnfVertexListMap() { return TFaceEntryEnfVertexListMap(); }
+  static TEnfVertexList                   GetDefaultEnfVertexList() { return TEnfVertexList(); }
+  static TFaceEntryCoordsListMap          GetDefaultFaceEntryCoordsListMap() { return TFaceEntryCoordsListMap(); }
+  static TCoordsEnfVertexMap              GetDefaultCoordsEnfVertexMap() { return TCoordsEnfVertexMap(); }
+  static TFaceEntryEnfVertexEntryListMap  GetDefaultFaceEntryEnfVertexEntryListMap() { return TFaceEntryEnfVertexEntryListMap(); }
+  static TEnfVertexEntryEnfVertexMap      GetDefaultEnfVertexEntryEnfVertexMap() { return TEnfVertexEntryEnfVertexMap(); }
+  static TGroupNameNodeIDMap              GetDefaultGroupNameNodeIDMap() { return TGroupNameNodeIDMap(); }
+
+  static bool            GetDefaultInternalEnforcedVertex();
+
+  /* TODO GROUPS
+  static TGroupNameEnfVertexListMap GetDefaultGroupNameEnfVertexListMap() { return TGroupNameEnfVertexListMap(); }
+  static TEnfVertexGroupNameMap     GetDefaultEnfVertexGroupNameMap() { return TEnfVertexGroupNameMap(); }
+  */
 
   static double undefinedDouble() { return -1.0; }
 
@@ -116,10 +328,24 @@ public:
 
   void SetOptionValue(const std::string& optionName,
                       const std::string& optionValue) throw (std::invalid_argument);
+  void SetPreCADOptionValue(const std::string& optionName,
+                            const std::string& optionValue) throw (std::invalid_argument);
   std::string GetOptionValue(const std::string& optionName) throw (std::invalid_argument);
+  std::string GetPreCADOptionValue(const std::string& optionName) throw (std::invalid_argument);
   void ClearOption(const std::string& optionName);
+  void ClearPreCADOption(const std::string& optionName);
   const TOptionValues& GetOptionValues() const { return _option2value; }
+  const TOptionValues& GetPreCADOptionValues() const { return _preCADoption2value; }
 
+  /*!
+    * Sets the file for export resulting mesh in GMF format
+    */
+//   void SetGMFFile(const std::string& theFileName, bool isBinary);
+  void SetGMFFile(const std::string& theFileName);
+  std::string GetGMFFile() const { return _GMFFileName; }
+  static std::string GetDefaultGMFFile();
+//   bool GetGMFFileMode() const { return _GMFFileMode; }
+  
   // Persistence
   virtual std::ostream & SaveTo(std::ostream & save);
   virtual std::istream & LoadFrom(std::istream & load);
@@ -140,18 +366,50 @@ public:
    */
   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
 
+
 private:
-  Topology      _topology;
-  PhysicalMesh  _physicalMesh;
-  double        _phySize, _phyMin, _phyMax;
-  GeometricMesh _geometricMesh;
-  double        _angleMeshS, _angleMeshC, _hgeoMin, _hgeoMax;
-  double        _gradation;
-  bool          _quadAllowed;
-  bool          _decimesh;
-  int           _verb;
-  TOptionValues _option2value;
-  TOptionNames  _doubleOptions, _charOptions;
+  Topology        _topology;
+  PhysicalMesh    _physicalMesh;
+  double          _phySize, _phyMin, _phyMax;
+  GeometricMesh   _geometricMesh;
+  double          _angleMeshS, _angleMeshC, _hgeoMin, _hgeoMax;
+  double          _gradation;
+  bool            _quadAllowed;
+  bool            _decimesh;
+  int             _verb;
+  
+  bool            _preCADMergeEdges;
+  bool            _preCADRemoveNanoEdges;
+  bool            _preCADDiscardInput;
+  double          _preCADEpsNano;
+  
+  TOptionValues   _option2value, _preCADoption2value;
+  TOptionNames    _doubleOptions, _charOptions, _preCADdoubleOptions, _preCADcharOptions;
+  TSizeMap        _sizeMap;
+  TSizeMap        _attractors;
+  TAttractorMap   _classAttractors;
+  TSizeMap        _attEntry;
+  TParamsMap      _attParams;
+
+  TFaceEntryEnfVertexListMap  _faceEntryEnfVertexListMap;
+  TEnfVertexList              _enfVertexList;
+  // maps to get "manual" enf vertex (through their coordinates)
+  TFaceEntryCoordsListMap     _faceEntryCoordsListMap;
+  TCoordsEnfVertexMap         _coordsEnfVertexMap;
+  // maps to get "geom" enf vertex (through their geom entries)
+  TFaceEntryEnfVertexEntryListMap _faceEntryEnfVertexEntryListMap;
+  TEnfVertexEntryEnfVertexMap     _enfVertexEntryEnfVertexMap;
+  TGroupNameNodeIDMap             _groupNameNodeIDMap;
+  
+//  Enable internal enforced vertices on specific face if requested by user
+//  TFaceEntryInternalVerticesList  _faceEntryInternalVerticesList;
+  bool            _enforcedInternalVerticesAllFaces;
+  TEnfGroupName   _enforcedInternalVerticesAllFacesGroup;
+  
+  std::string     _GMFFileName;
+//   bool            _GMFFileMode;
+
+//   TSizeMap      _customSizeMap;
 };
 
 #endif
index 55ca0d8a398b66edf2b1b5f79c498c3b5f68c9d5..0190ed06f12ed1c567e78e45df96b806bd3a04f8 100644 (file)
@@ -1,34 +1,40 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
+//           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
 //
 #include "BLSURFPlugin_Hypothesis_i.hxx"
 #include "SMESH_Gen.hxx"
+#include "SMESH_Gen_i.hxx"
 #include "SMESH_PythonDump.hxx"
+#include "GEOM_Object.hxx"
 
 #include "Utils_CorbaException.hxx"
 #include "utilities.h"
 
 #include <stdexcept>
+#include <cstring>
+#include "boost/regex.hpp"
 
 //=============================================================================
 /*!
  *  Constructor
  */
 //=============================================================================
-BLSURFPlugin_Hypothesis_i::
-BLSURFPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                           int                     theStudyId,
-                           ::SMESH_Gen*            theGenImpl)
-  : SALOME::GenericObj_i( thePOA ), 
-    SMESH_Hypothesis_i( thePOA )
-{
+BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId,
+    ::SMESH_Gen* theGenImpl) :
+  SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA) {
   MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
-  myBaseImpl = new ::BLSURFPlugin_Hypothesis (theGenImpl->GetANewId(),
-                                              theStudyId,
-                                              theGenImpl);
+  myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theStudyId, theGenImpl);
 }
 
 //=============================================================================
@@ -57,8 +57,7 @@ BLSURFPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
  *  Destructor
  */
 //=============================================================================
-BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i()
-{
+BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
   MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
 }
 
@@ -69,11 +68,10 @@ BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i()
  */
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetTopology (CORBA::Long theValue)
-{
+void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
   ASSERT(myBaseImpl);
-  this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology)theValue);
+  this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology) theValue);
   SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
 }
 
@@ -84,8 +82,7 @@ void BLSURFPlugin_Hypothesis_i::SetTopology (CORBA::Long theValue)
  *  Get Topology
  */
 //=============================================================================
-CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology()
-{
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology() {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetTopology();
@@ -101,11 +98,10 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology()
  */
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh (CORBA::Long theValue)
-{
+void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
   ASSERT(myBaseImpl);
-  this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh)theValue);
+  this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh) theValue);
   SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
 }
 
@@ -116,8 +112,7 @@ void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh (CORBA::Long theValue)
  *  Get PhysicalMesh
  */
 //=============================================================================
-CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh()
-{
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhysicalMesh();
@@ -130,9 +125,8 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh()
  *  Set PhySize
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhySize (CORBA::Double theValue)
-{
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
+void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
+//   MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetPhySize(theValue);
   SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
@@ -145,49 +139,42 @@ void BLSURFPlugin_Hypothesis_i::SetPhySize (CORBA::Double theValue)
  *  Get PhySize
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize()
-{
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
+//   MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhySize();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize)
-{
+void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize) {
   ASSERT(myBaseImpl);
-  if ( GetPhyMin() != theMinSize ) {
+  if (GetPhyMin() != theMinSize) {
     this->GetImpl()->SetPhyMin(theMinSize);
     SMESH::TPythonDump() << _this() << ".SetPhyMin( " << theMinSize << " )";
   }
 }
 
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin()
-{
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin() {
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhyMin();
 }
 
-
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize)
-{
+void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize) {
   ASSERT(myBaseImpl);
-  if ( GetPhyMax() != theMaxSize ) {
+  if (GetPhyMax() != theMaxSize) {
     this->GetImpl()->SetPhyMax(theMaxSize);
     SMESH::TPythonDump() << _this() << ".SetPhyMax( " << theMaxSize << " )";
   }
 }
 
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax()
-{
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax() {
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetPhyMax();
 }
 
-
 //=============================================================================
 /*!
  *  BLSURFPlugin_Hypothesis_i::SetGeometricMesh
@@ -196,11 +183,10 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax()
  */
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetGeometricMesh (CORBA::Long theValue)
-{
+void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
   ASSERT(myBaseImpl);
-  this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh)theValue);
+  this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh) theValue);
   SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
 }
 
@@ -211,8 +197,7 @@ void BLSURFPlugin_Hypothesis_i::SetGeometricMesh (CORBA::Long theValue)
  *  Get GeometricMesh
  */
 //=============================================================================
-CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh()
-{
+CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetGeometricMesh();
@@ -225,8 +210,7 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh()
  *  Set AngleMeshS
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetAngleMeshS (CORBA::Double theValue)
-{
+void BLSURFPlugin_Hypothesis_i::SetAngleMeshS(CORBA::Double theValue) {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMeshS");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetAngleMeshS(theValue);
@@ -240,58 +224,51 @@ void BLSURFPlugin_Hypothesis_i::SetAngleMeshS (CORBA::Double theValue)
  *  Get AngleMeshS
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS()
-{
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS() {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMeshS");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetAngleMeshS();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double angle)
-{
+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()
-{
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC() {
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetAngleMeshC();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize)
-{
+void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize) {
   ASSERT(myBaseImpl);
-  if ( GetGeoMin() != theMinSize ) {
+  if (GetGeoMin() != theMinSize) {
     this->GetImpl()->SetGeoMin(theMinSize);
     SMESH::TPythonDump() << _this() << ".SetGeoMin( " << theMinSize << " )";
   }
 }
 
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin()
-{
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin() {
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetGeoMin();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize)
-{
+void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize) {
   ASSERT(myBaseImpl);
-  if ( GetGeoMax() != theMaxSize ) {
+  if (GetGeoMax() != theMaxSize) {
     this->GetImpl()->SetGeoMax(theMaxSize);
     SMESH::TPythonDump() << _this() << ".SetGeoMax( " << theMaxSize << " )";
   }
 }
 
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax()
-{
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax() {
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetGeoMax();
 }
@@ -303,8 +280,7 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax()
  *  Set Gradation
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetGradation (CORBA::Double theValue)
-{
+void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetGradation(theValue);
@@ -318,8 +294,7 @@ void BLSURFPlugin_Hypothesis_i::SetGradation (CORBA::Double theValue)
  *  Get Gradation
  */
 //=============================================================================
-CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation()
-{
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetGradation();
@@ -332,12 +307,12 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation()
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetQuadAllowed (CORBA::Boolean theValue)
-{
+void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetQuadAllowed(theValue);
-  SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValue << " )";
+  std::string theValueStr = theValue ? "True" : "False";
+  SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )";
 }
 
 //=============================================================================
@@ -347,8 +322,7 @@ void BLSURFPlugin_Hypothesis_i::SetQuadAllowed (CORBA::Boolean theValue)
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed()
-{
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetQuadAllowed();
@@ -361,12 +335,12 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed()
  *  Set true or false
  */
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetDecimesh (CORBA::Boolean theValue)
-{
+void BLSURFPlugin_Hypothesis_i::SetDecimesh(CORBA::Boolean theValue) {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::SetDecimesh");
   ASSERT(myBaseImpl);
   this->GetImpl()->SetDecimesh(theValue);
-  SMESH::TPythonDump() << _this() << ".SetDecimesh( " << theValue << " )";
+  std::string theValueStr = theValue ? "True" : "False";
+  SMESH::TPythonDump() << _this() << ".SetDecimesh( " << theValueStr.c_str() << " )";
 }
 
 //=============================================================================
@@ -376,19 +350,16 @@ void BLSURFPlugin_Hypothesis_i::SetDecimesh (CORBA::Boolean theValue)
  *  Get true or false
  */
 //=============================================================================
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh()
-{
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh() {
   // MESSAGE("BLSURFPlugin_Hypothesis_i::GetDecimesh");
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetDecimesh();
 }
 
 //=============================================================================
-void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal)
-  throw (SALOME::SALOME_Exception)
-{
+void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
-  if ( theVal < 0 || theVal > 100 )
+  if (theVal < 0 || theVal > 100)
     THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM );
   this->GetImpl()->SetVerbosity(theVal);
   SMESH::TPythonDump() << _this() << ".SetVerbosity( " << theVal << " )";
@@ -396,59 +367,203 @@ void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal)
 
 //=============================================================================
 
-CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity()
-{
+CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity() {
   ASSERT(myBaseImpl);
   return (CORBA::Short) this->GetImpl()->GetVerbosity();
 }
 
 //=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges
+ *
+ *  Set true or false
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges");
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetPreCADMergeEdges(theValue);
+  std::string theValueStr = theValue ? "True" : "False";
+  SMESH::TPythonDump() << _this() << ".SetPreCADMergeEdges( " << theValueStr.c_str() << " )";
+}
 
-void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName,
-                                               const char* optionValue)
-  throw (SALOME::SALOME_Exception)
-{
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges
+ *
+ *  Get true or false
+ */
+//=============================================================================
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetPreCADMergeEdges();
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges
+ *
+ *  Set true or false
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue) {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges");
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetPreCADRemoveNanoEdges(theValue);
+  std::string theValueStr = theValue ? "True" : "False";
+  SMESH::TPythonDump() << _this() << ".SetPreCADRemoveNanoEdges( " << theValueStr.c_str() << " )";
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges
+ *
+ *  Get true or false
+ */
+//=============================================================================
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges() {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetPreCADRemoveNanoEdges();
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput
+ *
+ *  Set true or false
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput");
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetPreCADDiscardInput(theValue);
+  std::string theValueStr = theValue ? "True" : "False";
+  SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValueStr.c_str() << " )";
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput
+ *
+ *  Get true or false
+ */
+//=============================================================================
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetPreCADDiscardInput();
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano
+ *
+ *  Set length for nano edges
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano(CORBA::Double theValue) {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano");
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetPreCADEpsNano(theValue);
+  SMESH::TPythonDump() << _this() << ".SetPreCADEpsNano( " << theValue << " )";
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano
+ *
+ *  Get length of nano edges
+ */
+//=============================================================================
+CORBA::Double BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano() {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetPreCADEpsNano();
+}
+
+//=============================================================================
+
+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 )
+    valueChanged = (this->GetImpl()->GetOptionValue(optionName) != optionValue);
+    if (valueChanged)
       this->GetImpl()->SetOptionValue(optionName, optionValue);
-  }
-  catch (const std::invalid_argument& ex) {
+  } 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) {
+  } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  if ( valueChanged )
-    SMESH::TPythonDump() << _this() << ".SetOptionValue( '"
-                         << optionName << "', '" << optionValue << "' )";
+  if (valueChanged)
+    SMESH::TPythonDump() << _this() << ".SetOptionValue( '" << optionName << "', '" << optionValue << "' )";
 }
 
 //=============================================================================
 
-char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName)
-  throw (SALOME::SALOME_Exception)
-{
+void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, const char* optionValue)
+    throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
+  bool valueChanged = false;
   try {
-    return CORBA::string_dup( this->GetImpl()->GetOptionValue(optionName).c_str() );
+    valueChanged = (this->GetImpl()->GetPreCADOptionValue(optionName) != optionValue);
+    if (valueChanged)
+      this->GetImpl()->SetPreCADOptionValue(optionName, optionValue);
+  } catch (const std::invalid_argument& ex) {
+    SALOME::ExceptionStruct ExDescription;
+    ExDescription.text = ex.what();
+    ExDescription.type = SALOME::BAD_PARAM;
+    ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetPreCADOptionValue(name,value)";
+    ExDescription.lineNumber = 0;
+    throw SALOME::SALOME_Exception(ExDescription);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
-  catch (const std::invalid_argument& ex) {
+  if (valueChanged)
+    SMESH::TPythonDump() << _this() << ".SetPreCADOptionValue( '" << 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 );
   }
-  catch (SALOME_Exception& ex) {
+  return 0;
+}
+
+//=============================================================================
+
+char* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  try {
+    return CORBA::string_dup(this->GetImpl()->GetPreCADOptionValue(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::GetPreCADOptionValue(name)";
+    ExDescription.lineNumber = 0;
+    throw SALOME::SALOME_Exception(ExDescription);
+  } catch (SALOME_Exception& ex) {
     THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
   }
   return 0;
@@ -456,8 +571,7 @@ char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName)
 
 //=============================================================================
 
-void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName)
-{
+void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName) {
   ASSERT(myBaseImpl);
   this->GetImpl()->ClearOption(optionName);
   SMESH::TPythonDump() << _this() << ".UnsetOption( '" << optionName << "' )";
@@ -465,18 +579,46 @@ void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName)
 
 //=============================================================================
 
-BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues()
-{
+void BLSURFPlugin_Hypothesis_i::UnsetPreCADOption(const char* optionName) {
+  ASSERT(myBaseImpl);
+  this->GetImpl()->ClearPreCADOption(optionName);
+  SMESH::TPythonDump() << _this() << ".UnsetPreCADOption( '" << 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() );
+  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();
+}
+
+//=============================================================================
+
+BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValues() {
+  ASSERT(myBaseImpl);
+  BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
+
+  const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetPreCADOptionValues();
+  result->length(opts.size());
 
   ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
-  for ( int i = 0 ; opIt != opts.end(); ++opIt, ++i ) {
+  for (int i = 0; opIt != opts.end(); ++opIt, ++i) {
     string name_value = opIt->first;
-    if ( !opIt->second.empty() ) {
+    if (!opIt->second.empty()) {
       name_value += ":";
       name_value += opIt->second;
     }
@@ -488,48 +630,1773 @@ BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues()
 //=============================================================================
 
 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
-  throw (SALOME::SALOME_Exception)
-{
+    throw (SALOME::SALOME_Exception) {
   ASSERT(myBaseImpl);
-  for (int i = 0; i < options.length(); ++i)
-  {
+  for (int i = 0; i < options.length(); ++i) {
     string name_value = options[i].in();
-    int colonPos = name_value.find( ':' );
+    int colonPos = name_value.find(':');
     string name, value;
-    if ( colonPos == string::npos ) // ':' not found
+    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 );
+      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() );
+    SetOptionValue(name.c_str(), value.c_str());
   }
 }
 
 //=============================================================================
-/*!
- *  BLSURFPlugin_Hypothesis_i::GetImpl
- *
- *  Get implementation
- */
+
+void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(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);
+    }
+    SetPreCADOptionValue(name.c_str(), value.c_str());
+  }
+}
+
 //=============================================================================
-::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl()
-{
-  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
-  return (::BLSURFPlugin_Hypothesis*)myBaseImpl;
+
+void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* sizeMap)
+    throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
+  bool valueChanged = false;
+  try {
+    valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMap);
+    if (valueChanged)
+      this->GetImpl()->SetSizeMapEntry(entry, sizeMap);
+  } catch (const std::invalid_argument& ex) {
+    SALOME::ExceptionStruct ExDescription;
+    ExDescription.text = ex.what();
+    ExDescription.type = SALOME::BAD_PARAM;
+    ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
+    ExDescription.lineNumber = 0;
+    throw SALOME::SALOME_Exception(ExDescription);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+  MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
+  if (valueChanged)
+    SMESH::TPythonDump() << _this() << ".SetSizeMap(" << entry << ", '" << sizeMap << "' )";
 }
 
-//================================================================================
-/*!
- * \brief Verify whether hypothesis supports given entity type 
-  * \param type - dimension (see SMESH::Dimension enumeration)
-  * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
- * 
- * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
- */
-//================================================================================  
-CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
+//=============================================================================
+
+void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* attractor)
+    throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
+  bool valueChanged = false;
+  try {
+    valueChanged = ( this->GetImpl()->GetAttractorEntry(entry) != attractor );
+    if ( valueChanged ) {
+      boost::regex re("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)(?:;(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+))?\\)$");
+      if (!boost::regex_match(string(attractor), re))
+        throw std::invalid_argument("Error: an attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False;d(opt.))");
+      this->GetImpl()->SetAttractorEntry(entry, attractor);
+    }
+  } catch (const std::invalid_argument& ex) {
+    SALOME::ExceptionStruct ExDescription;
+    ExDescription.text = ex.what();
+    ExDescription.type = SALOME::BAD_PARAM;
+    ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetAttractorEntry(entry,attractor)";
+    ExDescription.lineNumber = 0;
+    throw SALOME::SALOME_Exception(ExDescription);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+  MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
+  if (valueChanged)
+    SMESH::TPythonDump() << _this() << ".SetAttractor(" << entry << ", '" << attractor << "' )";
+}
+
+//=============================================================================
+
+void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const char* att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius) //TODO à finir
+  throw (SALOME::SALOME_Exception)
 {
+  ASSERT(myBaseImpl);
+  MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
+  bool valueChanged = false;
+  try {
+    this->GetImpl()->SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius);
+  }
+  catch (const std::invalid_argument& ex) {
+    SALOME::ExceptionStruct ExDescription;
+    ExDescription.text = ex.what();
+    ExDescription.type = SALOME::BAD_PARAM;
+    ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius)";
+    ExDescription.lineNumber = 0;
+    throw SALOME::SALOME_Exception(ExDescription);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+  MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
+  //if ( valueChanged )
+  SMESH::TPythonDump() << _this() << ".SetAttractorGeom("
+                       << entry << ", " << att_entry << ", "<<StartSize<<", "<<EndSize<<", "<<ActionRadius<<", "<<ConstantRadius<<" )";
+}
+
+//=============================================================================
+
+char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  try {
+    return CORBA::string_dup(this->GetImpl()->GetSizeMapEntry(entry).c_str());
+  } catch (const std::invalid_argument& ex) {
+    SALOME::ExceptionStruct ExDescription;
+    ExDescription.text = ex.what();
+    ExDescription.type = SALOME::BAD_PARAM;
+    ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetSizeMapEntry(name)";
+    ExDescription.lineNumber = 0;
+    throw SALOME::SALOME_Exception(ExDescription);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+  return 0;
+}
+
+//=============================================================================
+
+char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  try {
+    return CORBA::string_dup(this->GetImpl()->GetAttractorEntry(entry).c_str());
+  } catch (const std::invalid_argument& ex) {
+    SALOME::ExceptionStruct ExDescription;
+    ExDescription.text = ex.what();
+    ExDescription.type = SALOME::BAD_PARAM;
+    ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetAttractorEntry(name)";
+    ExDescription.lineNumber = 0;
+    throw SALOME::SALOME_Exception(ExDescription);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+  return 0;
+}
+
+// //=============================================================================
+// 
+// // TODO coder cette fonction (utilisée pour savoir si la valeur a changé
+// // A finir pour le dump
+// char* BLSURFPlugin_Hypothesis_i::GetClassAttractorEntry(const char* entry)
+//   throw (SALOME::SALOME_Exception)
+// {
+//   ASSERT(myBaseImpl);
+//   try {
+//     return CORBA::string_dup( this->GetImpl()->GetClassAttractorEntry(entry).c_str());
+//   }
+//   catch (const std::invalid_argument& ex) {
+//     SALOME::ExceptionStruct ExDescription;
+//     ExDescription.text = ex.what();
+//     ExDescription.type = SALOME::BAD_PARAM;
+//     ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetClassAttractorEntry(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::UnsetEntry(const char* entry) {
+  ASSERT(myBaseImpl);
+  this->GetImpl()->ClearEntry(entry);
+  //  SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry << " )";
+}
+
+//=============================================================================
+
+BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetSizeMapEntries() {
+  ASSERT(myBaseImpl);
+  BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
+
+  const ::BLSURFPlugin_Hypothesis::TSizeMap sizeMaps = this->GetImpl()->_GetSizeMapEntries();
+  result->length(sizeMaps.size());
+
+  ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
+  for (int i = 0; smIt != sizeMaps.end(); ++smIt, ++i) {
+    string entry_sizemap = smIt->first;
+    if (!smIt->second.empty()) {
+      entry_sizemap += "|";
+      entry_sizemap += smIt->second;
+    }
+    result[i] = CORBA::string_dup(entry_sizemap.c_str());
+  }
+  return result._retn();
+}
+
+//=============================================================================
+
+BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAttractorEntries() {
+  ASSERT(myBaseImpl);
+  BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
+
+  const ::BLSURFPlugin_Hypothesis::TSizeMap attractors = this->GetImpl()->_GetAttractorEntries();
+  result->length(attractors.size());
+
+  ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
+  for (int i = 0; atIt != attractors.end(); ++atIt, ++i) {
+    string entry_attractor = atIt->first;
+    if (!atIt->second.empty()) {
+      entry_attractor += "|";
+      entry_attractor += atIt->second;
+    }
+    result[i] = CORBA::string_dup(entry_attractor.c_str());
+  }
+  return result._retn();
+}
+
+//=============================================================================
+
+BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
+{
+  ASSERT(myBaseImpl);
+  BLSURFPlugin::TAttParamsMap_var result = new BLSURFPlugin::TAttParamsMap();
+
+  const ::BLSURFPlugin_Hypothesis::TAttractorMap attractors= this->GetImpl()->_GetClassAttractorEntries();
+  result->length( attractors.size() );
+
+  ::BLSURFPlugin_Hypothesis::TAttractorMap::const_iterator atIt = attractors.begin();
+  for ( int i = 0 ; atIt != attractors.end(); ++atIt, ++i ) {
+    string faceEntry = atIt->first;
+    string attEntry;
+    double startSize, endSize, infDist, constDist;
+    if ( !atIt->second->Empty() ) {
+      attEntry = atIt->second->GetAttractorEntry();
+      MESSAGE("GetAttractorParams : attEntry ="<<attEntry)
+      std::vector<double> params = atIt->second->GetParameters();
+      startSize = params[0];
+      endSize = params[1];
+      infDist = params[2];
+      constDist = params[3];
+    }
+    result[i].faceEntry = CORBA::string_dup(faceEntry.c_str());
+    result[i].attEntry = CORBA::string_dup(attEntry.c_str());
+    result[i].startSize = startSize;
+    result[i].endSize = endSize;
+    result[i].infDist = infDist;
+    result[i].constDist = constDist;
+    MESSAGE("GetAttractorParams : result[i].attEntry ="<<result[i].attEntry)
+    MESSAGE("GetAttractorParams : result[i].faceEntry ="<<result[i].faceEntry)
+  }
+  return result._retn();
+}
+
+//=============================================================================
+
+void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
+    throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  for (int i = 0; i < sizeMaps.length(); ++i) {
+    string entry_sizemap = sizeMaps[i].in();
+    int colonPos = entry_sizemap.find('|');
+    string entry, sizemap;
+    if (colonPos == string::npos) // '|' separator not found
+      entry = entry_sizemap;
+    else {
+      entry = entry_sizemap.substr(0, colonPos);
+      if (colonPos < entry_sizemap.size() - 1 && entry_sizemap[colonPos] != ' ')
+        sizemap = entry_sizemap.substr(colonPos + 1);
+    }
+    this->GetImpl()->SetSizeMapEntry(entry.c_str(), sizemap.c_str());
+  }
+}
+
+//=============================================================================
+
+void BLSURFPlugin_Hypothesis_i::ClearSizeMaps() {
+  ASSERT(myBaseImpl);
+  this->GetImpl()->ClearSizeMaps();
+}
+
+//=============================================================================
+
+void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) {
+  ASSERT(myBaseImpl);
+  string entry;
+  entry = GeomObj->GetStudyEntry();
+  MESSAGE("IDL : GetName : " << GeomObj->GetName());
+  MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
+  SetSizeMapEntry(entry.c_str(), sizeMap);
+}
+
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj) {
+  ASSERT(myBaseImpl);
+  string entry;
+  entry = GeomObj->GetStudyEntry();
+  MESSAGE("IDL : GetName : " << GeomObj->GetName());
+  MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
+  UnsetEntry(entry.c_str());
+  SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
+}
+
+void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor) {
+  ASSERT(myBaseImpl);
+  string entry;
+  entry = GeomObj->GetStudyEntry();
+  MESSAGE("IDL : GetName : " << GeomObj->GetName());
+  MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
+  SetAttractorEntry(entry.c_str(), attractor);
+}
+
+void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj) {
+  ASSERT(myBaseImpl);
+  string entry;
+  entry = GeomObj->GetStudyEntry();
+  MESSAGE("IDL : GetName : " << GeomObj->GetName());
+  MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
+  UnsetEntry(entry.c_str());
+  SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
+}
+
+void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theAttractor, double StartSize, double EndSize, double ActionRadius, double ConstantRadius)
+{
+  ASSERT(myBaseImpl);
+  string theFaceEntry;
+  string theAttEntry;
+  theFaceEntry = theFace->GetStudyEntry();
+  theAttEntry  = theAttractor->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+  string aName;
+  
+  if (theFaceEntry.empty()) {
+    aName = "Face_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  if (theAttEntry.empty()) {
+    if (theAttractor->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theAttractor->GetShapeType() == GEOM::EDGE)
+      aName = "Edge_";
+    if (theAttractor->GetShapeType() == GEOM::WIRE)
+      aName = "Wire_";
+    if (theAttractor->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theAttractor->GetEntry();
+    SALOMEDS::SObject_ptr theSAtt = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theAttractor, aName.c_str());
+    if (!theSAtt->_is_nil())
+      theAttEntry = theSAtt->GetID();
+  }
+  if (theAttEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  TopoDS_Face FaceShape = TopoDS::Face(SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theFace ));
+  TopoDS_Shape AttractorShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theAttractor );
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : SETATTRACTOR () ");//<< entry << " , " << att_entry << ")");
+  SetClassAttractorEntry( theFaceEntry.c_str(), theAttEntry.c_str(), StartSize, EndSize, ActionRadius, ConstantRadius);
+}
+
+void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace)
+{
+  ASSERT(myBaseImpl);
+  string theFaceEntry;
+  theFaceEntry = theFace->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+  string aName;
+  
+  if (theFaceEntry.empty()) {
+    aName = "Face_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : UNSETATTRACTOR ( "<< theFaceEntry << ")");
+  UnsetEntry( theFaceEntry.c_str());
+  SMESH::TPythonDump() << _this() << ".UnsetAttractorGeom( " << theFaceEntry.c_str() << " )";
+}
+
+/*
+ void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
+ {}
+
+ void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
+ {}
+
+ void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception)
+ {}
+
+ char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception)
+ {}
+
+ void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
+ {
+ ASSERT(myBaseImpl);
+ this->GetImpl()->UnsetCustomSizeMap(entry);
+ SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
+ }
+
+
+ BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
+ {}
+
+ */
+
+// ///////////////////////
+// // ENFORCED VERTICES //
+// ///////////////////////
+
+
+/**
+ * Returns the list of enforced vertices for a given Face entry
+ * @return A map of Face entry / List of enforced vertices
+ *
+ */
+BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByFace() {
+  MESSAGE("IDL: GetAllEnforcedVerticesByFace()");
+  ASSERT(myBaseImpl);
+
+  BLSURFPlugin::TFaceEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexListMap();
+
+  const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap =
+      this->GetImpl()->_GetAllEnforcedVerticesByFace();
+  resultMap->length(faceEntryEnfVertexListMap.size());
+  MESSAGE("Face entry to Enforced Vertex map size is " << resultMap->length());
+
+  ::BLSURFPlugin_Hypothesis::TEnfVertexList _enfVertexList;
+  ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator it_entry = faceEntryEnfVertexListMap.begin();
+  for (int i = 0; it_entry != faceEntryEnfVertexListMap.end(); ++it_entry, ++i) {
+    BLSURFPlugin::TFaceEntryEnfVertexListMapElement_var mapElement =
+        new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
+    mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
+    MESSAGE("Face Entry: " << mapElement->faceEntry);
+
+    _enfVertexList = it_entry->second;
+    BLSURFPlugin::TEnfVertexList_var enfVertexList = new BLSURFPlugin::TEnfVertexList();
+    enfVertexList->length(_enfVertexList.size());
+    MESSAGE("Number of enf vertex: " << enfVertexList->length());
+
+    ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator it_enfVertex = _enfVertexList.begin();
+    ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
+    for (int j = 0; it_enfVertex != _enfVertexList.end(); ++it_enfVertex, ++j) {
+      currentEnfVertex = (*it_enfVertex);
+
+      BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
+
+      // Name
+      enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
+
+      // Geom entry
+      enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
+
+      // Coords
+      BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
+      coords->length(currentEnfVertex->coords.size());
+      for (int i=0;i<coords->length();i++)
+        coords[i] = currentEnfVertex->coords[i];
+      enfVertex->coords = coords;
+
+      // Group name
+      enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
+      
+      // Face entry list
+      BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
+      faceEntryList->length(currentEnfVertex->faceEntries.size());
+      ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
+      for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
+        faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
+      enfVertex->faceEntries = faceEntryList;
+
+      ostringstream msg;
+      msg << "Enforced vertex: \n"
+          << "Name: " << enfVertex->name << "\n";
+      if (coords->length())
+          msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+      msg << "Geom entry: " << enfVertex->geomEntry << "\n"
+          << "Group Name: " << enfVertex->grpName;
+      MESSAGE(msg.str());
+
+      enfVertexList[j] = enfVertex;
+    }
+    mapElement->enfVertexList = enfVertexList;
+
+    resultMap[i] = mapElement;
+
+  }
+  return resultMap._retn();
+}
+
+/**
+ * Returns the list of all enforced vertices
+ * @return a list of enforced vertices
+ *
+ */
+BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices() {
+  MESSAGE("IDL: GetAllEnforcedVertices()");
+  ASSERT(myBaseImpl);
+  BLSURFPlugin::TEnfVertexList_var resultMap = new BLSURFPlugin::TEnfVertexList();
+  const ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList = this->GetImpl()->_GetAllEnforcedVertices();
+  resultMap->length(enfVertexList.size());
+  MESSAGE("Enforced Vertex map size is " << resultMap->length());
+
+  ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
+  ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
+  for (int i = 0; evlIt != enfVertexList.end(); ++evlIt, ++i) {
+    MESSAGE("Enforced Vertex #" << i);
+    currentEnfVertex = (*evlIt);
+    BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
+    // Name
+    enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
+    // Geom entry
+    enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
+    // Coords
+    BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
+    coords->length(currentEnfVertex->coords.size());
+    for (int ind = 0; ind < coords->length(); ind++)
+      coords[ind] = currentEnfVertex->coords[ind];
+    enfVertex->coords = coords;
+    // Group name
+    enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());  
+    // Face entry list
+    BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
+    faceEntryList->length(currentEnfVertex->faceEntries.size());
+    ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
+    for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
+      faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
+    enfVertex->faceEntries = faceEntryList;
+
+    ostringstream msg;
+    msg << "Enforced vertex: \n"
+        << "Name: " << enfVertex->name << "\n";
+    if (coords->length())
+        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+    msg << "Geom entry: " << enfVertex->geomEntry << "\n"
+        << "Group Name: " << enfVertex->grpName;
+    MESSAGE(msg.str());
+
+    resultMap[i] = enfVertex;
+  }
+  return resultMap._retn();
+
+}
+
+/**
+ * Returns the list of enforced vertices coords for a given Face entry.
+ * They are the coords of the "manual" enforced vertices.
+ * @return A map of Face entry / List of enforced vertices coords
+ *
+ */
+BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsByFace() {
+  MESSAGE("IDL: GetAllCoordsByFace()");
+  ASSERT(myBaseImpl);
+
+  BLSURFPlugin::TFaceEntryCoordsListMap_var resultMap = new BLSURFPlugin::TFaceEntryCoordsListMap();
+
+  const ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap entryCoordsListMap = this->GetImpl()->_GetAllCoordsByFace();
+  resultMap->length(entryCoordsListMap.size());
+  MESSAGE("Enforced Vertex map size is " << resultMap->length());
+
+  ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList _coordsList;
+  ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap::const_iterator it_entry = entryCoordsListMap.begin();
+  for (int i = 0; it_entry != entryCoordsListMap.end(); ++it_entry, ++i) {
+    BLSURFPlugin::TFaceEntryCoordsListMapElement_var mapElement = new BLSURFPlugin::TFaceEntryCoordsListMapElement();
+    mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
+    MESSAGE("Face Entry: " << mapElement->faceEntry);
+
+    _coordsList = it_entry->second;
+    BLSURFPlugin::TEnfVertexCoordsList_var coordsList = new BLSURFPlugin::TEnfVertexCoordsList();
+    coordsList->length(_coordsList.size());
+    MESSAGE("Number of coords: " << coordsList->length());
+
+    ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator it_coords = _coordsList.begin();
+    for (int j = 0; it_coords != _coordsList.end(); ++it_coords, ++j) {
+      BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
+      coords->length((*it_coords).size());
+      for (int i=0;i<coords->length();i++)
+        coords[i] = (*it_coords)[i];
+      coordsList[j] = coords;
+      MESSAGE("Coords #" << j << ": " << coords[0] << ", " << coords[1] << ", " << coords[2]);
+    }
+    mapElement->coordsList = coordsList;
+
+    resultMap[i] = mapElement;
+
+  }
+  return resultMap._retn();
+}
+
+/**
+ * Returns a map of enforced vertices coords / enforced vertex.
+ * They are the coords of the "manual" enforced vertices.
+ */
+BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByCoords() {
+  MESSAGE("IDL: GetAllEnforcedVerticesByCoords()");
+  ASSERT(myBaseImpl);
+
+  BLSURFPlugin::TCoordsEnfVertexMap_var resultMap = new BLSURFPlugin::TCoordsEnfVertexMap();
+  const ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap coordsEnfVertexMap =
+      this->GetImpl()->_GetAllEnforcedVerticesByCoords();
+  resultMap->length(coordsEnfVertexMap.size());
+  MESSAGE("Enforced Vertex map size is " << resultMap->length());
+
+  ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap::const_iterator it_coords = coordsEnfVertexMap.begin();
+  ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
+  for (int i = 0; it_coords != coordsEnfVertexMap.end(); ++it_coords, ++i) {
+    MESSAGE("Enforced Vertex #" << i);
+    currentEnfVertex = (it_coords->second);
+    BLSURFPlugin::TCoordsEnfVertexElement_var mapElement = new BLSURFPlugin::TCoordsEnfVertexElement();
+    BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
+    coords->length(it_coords->first.size());
+    for (int ind=0;ind<coords->length();ind++)
+      coords[ind] = it_coords->first[ind];
+    mapElement->coords = coords;
+    MESSAGE("Coords: " << mapElement->coords[0] << ", " << mapElement->coords[1] << ", " << mapElement->coords[2]);
+
+    BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
+    // Name
+    enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
+    // Geom entry
+    enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
+    // Coords
+    BLSURFPlugin::TEnfVertexCoords_var coords2 = new BLSURFPlugin::TEnfVertexCoords();
+    coords2->length(currentEnfVertex->coords.size());
+    for (int ind=0;ind<coords2->length();ind++)
+      coords2[ind] = currentEnfVertex->coords[ind];
+    enfVertex->coords = coords2;
+    // Group name
+    enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());  
+    // Face entry list
+    BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
+    faceEntryList->length(currentEnfVertex->faceEntries.size());
+    ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
+    for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
+      faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
+    enfVertex->faceEntries = faceEntryList;
+      
+    mapElement->enfVertex = enfVertex;
+    ostringstream msg;
+    msg << "Enforced vertex: \n"
+        << "Name: " << enfVertex->name << "\n";
+    if (coords->length())
+        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+    msg << "Geom entry: " << enfVertex->geomEntry << "\n"
+        << "Group Name: " << enfVertex->grpName;
+    MESSAGE(msg.str());
+
+    resultMap[i] = mapElement;
+  }
+  return resultMap._retn();
+}
+
+/**
+ * Returns the list of enforced vertices entries for a given Face entry.
+ * They are the geom entries of the enforced vertices based on geom shape (vertex, compound, group).
+ * @return A map of Face entry / List of enforced vertices geom entries
+ *
+ */
+BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfVertexEntriesByFace() {
+  MESSAGE("IDL: GetAllEnfVertexEntriesByFace()");
+  ASSERT(myBaseImpl);
+
+  BLSURFPlugin::TFaceEntryEnfVertexEntryListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexEntryListMap();
+
+  const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap entryEnfVertexEntryListMap =
+      this->GetImpl()->_GetAllEnfVertexEntriesByFace();
+  resultMap->length(entryEnfVertexEntryListMap.size());
+  MESSAGE("Enforced Vertex map size is " << resultMap->length());
+
+  ::BLSURFPlugin_Hypothesis::TEntryList _enfVertexEntryList;
+  ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap::const_iterator it_entry =
+      entryEnfVertexEntryListMap.begin();
+  for (int i = 0; it_entry != entryEnfVertexEntryListMap.end(); ++it_entry, ++i) {
+    BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement_var mapElement =
+        new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
+    mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
+    MESSAGE("Face Entry: " << mapElement->faceEntry);
+
+    _enfVertexEntryList = it_entry->second;
+    BLSURFPlugin::TEntryList_var enfVertexEntryList = new BLSURFPlugin::TEntryList();
+    enfVertexEntryList->length(_enfVertexEntryList.size());
+    MESSAGE("Number of enf vertex entries: " << enfVertexEntryList->length());
+
+    ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_enfVertexEntry = _enfVertexEntryList.begin();
+    for (int j = 0; it_enfVertexEntry != _enfVertexEntryList.end(); ++it_enfVertexEntry, ++j) {
+      enfVertexEntryList[j] = CORBA::string_dup((*it_enfVertexEntry).c_str());
+      MESSAGE("Enf Vertex Entry #" << j << ": " << enfVertexEntryList[j]);
+    }
+    mapElement->enfVertexEntryList = enfVertexEntryList;
+
+    resultMap[i] = mapElement;
+
+  }
+  return resultMap._retn();
+}
+
+/**
+ * Returns a map of enforced vertices geom entry / enforced vertex.
+ * They are the geom entries of the enforced vertices defined with geom shape (vertex, compound, group).
+ */
+BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByEnfVertexEntry() {
+  MESSAGE("IDL: GetAllEnforcedVerticesByEnfVertexEntry()");
+  ASSERT(myBaseImpl);
+
+  BLSURFPlugin::TEnfVertexEntryEnfVertexMap_var resultMap = new BLSURFPlugin::TEnfVertexEntryEnfVertexMap();
+  const ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap enfVertexEntryEnfVertexMap =
+      this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
+  resultMap->length(enfVertexEntryEnfVertexMap.size());
+  MESSAGE("Enforced Vertex map size is " << resultMap->length());
+
+  ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap::const_iterator it_enfVertexEntry = enfVertexEntryEnfVertexMap.begin();
+  ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
+  for (int i = 0; it_enfVertexEntry != enfVertexEntryEnfVertexMap.end(); ++it_enfVertexEntry, ++i) {
+    MESSAGE("Enforced Vertex #" << i);
+    currentEnfVertex = it_enfVertexEntry->second;
+    BLSURFPlugin::TEnfVertexEntryEnfVertexElement_var mapElement = new BLSURFPlugin::TEnfVertexEntryEnfVertexElement();
+    mapElement->enfVertexEntry = CORBA::string_dup(it_enfVertexEntry->first.c_str());;
+    MESSAGE("Enf Vertex Entry #" << i << ": " << mapElement->enfVertexEntry);
+
+    BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
+    // Name
+    enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
+    // Geom entry
+    enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
+    // Coords
+    BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
+    coords->length(currentEnfVertex->coords.size());
+    for (int ind=0;ind<coords->length();ind++)
+      coords[ind] = currentEnfVertex->coords[ind];
+    enfVertex->coords = coords;
+    // Group name
+    enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());  
+    // Face entry list
+    BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
+    faceEntryList->length(currentEnfVertex->faceEntries.size());
+    ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
+    for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
+      faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
+    enfVertex->faceEntries = faceEntryList;
+
+    ostringstream msg;
+    msg << "Enforced vertex: \n"
+        << "Name: " << enfVertex->name << "\n";
+    if (coords->length())
+        msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
+    msg << "Geom entry: " << enfVertex->geomEntry << "\n"
+        << "Group Name: " << enfVertex->grpName;
+    MESSAGE(msg.str());
+
+    mapElement->enfVertex = enfVertex;
+    resultMap[i] = mapElement;
+  }
+  return resultMap._retn();
+}
+
+/**
+ * Erase all enforced vertices
+ */
+void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices() {
+  ASSERT(myBaseImpl);
+  this->GetImpl()->ClearAllEnforcedVertices();
+  SMESH::TPythonDump() << _this() << ".ClearAllEnforcedVertices()";
+}
+
+/*!
+ * Set/get/unset an enforced vertex on face
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
+    CORBA::Double z) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  
+  if (theFaceEntry.empty()) {
+    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+    string aName;
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : SetEnforcedVertex( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
+  try {
+    return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set/get/unset an enforced vertex with name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
+    CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  
+  if (theFaceEntry.empty()) {
+    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+    string aName;
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : SetEnforcedVertexNamed( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ")");
+  try {
+    return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set/get/unset an enforced vertex with geom object on face
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
+    throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  //  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  //  GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
+  //  if (CORBA::is_nil(measureOp))
+  //    return false;
+  //
+  //  CORBA::Double x, y, z;
+  //  x = y = z = 0.;
+  //  measureOp->PointCoordinates(theVertex, x, y, z);
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+  string aName;
+  
+  if (theFaceEntry.empty()) {
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+  string theVertexName = theVertex->GetName();
+  MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
+  MESSAGE("IDL : theVertex->GetName : " << theVertexName);
+  MESSAGE("IDL : SetEnforcedVertexGeom( "<< theFaceEntry << ", " << theVertexEntry<< ")");
+  try {
+    return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with group name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
+ throw (SALOME::SALOME_Exception)
+{
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  
+  if (theFaceEntry.empty()) {
+    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+    string aName;
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theGroupName << ")");
+  try {
+    return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, "", "", theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with name and group name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, 
+                                                                const char* theVertexName, const char* theGroupName)
+ throw (SALOME::SALOME_Exception)
+{
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  
+  if (theFaceEntry.empty()) {
+    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+    string aName;
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theGroupName << ")");
+  try {
+    return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName, "", theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set an enforced vertex with geom entry and group name on face
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
+ throw (SALOME::SALOME_Exception)
+{
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+  string aName;
+  
+  if (theFaceEntry.empty()) {
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+  string theVertexName = theVertex->GetName();
+  MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
+  MESSAGE("IDL : theVertex->GetName : " << theVertexName);
+  MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theFaceEntry << ", " << theVertexEntry<< ", " << theGroupName<< ")");
+  try {
+    return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+//Enable internal enforced vertices on specific face if requested by user
+///*!
+// * Are internal enforced vertices used for a face ?
+// */
+//CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace)
+//    throw (SALOME::SALOME_Exception) {
+//  ASSERT(myBaseImpl);
+
+//  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+//    MESSAGE("theFace shape type is not FACE or COMPOUND");
+//    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+//  }
+
+//  string theFaceEntry = theFace->GetStudyEntry();
+  
+//  if (theFaceEntry.empty()) {
+//    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+//    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+//    string aName;
+//    if (theFace->GetShapeType() == GEOM::FACE)
+//      aName = "Face_";
+//    if (theFace->GetShapeType() == GEOM::COMPOUND)
+//      aName = "Compound_";
+//    aName += theFace->GetEntry();
+//    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+//    if (!theSFace->_is_nil())
+//      theFaceEntry = theSFace->GetID();
+//  }
+//  if (theFaceEntry.empty())
+//    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+//  MESSAGE("IDL : GetName : " << theFace->GetName());
+//  MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
+//  try {
+//    return GetInternalEnforcedVertexEntry(theFaceEntry.c_str());
+//  } catch (SALOME_Exception& ex) {
+//    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+//  }
+//}
+
+/*!
+ * Get the list of all enforced vertices
+ */
+BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace)
+    throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  
+  if (theFaceEntry.empty()) {
+    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+    string aName;
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : GetEnforcedVerticesEntry ( "<< theFaceEntry << ")");
+  try {
+    return GetEnforcedVerticesEntry(theFaceEntry.c_str());
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
+    CORBA::Double z) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  
+  if (theFaceEntry.empty()) {
+    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+    string aName;
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : UnsetEnforcedVertex ( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
+
+  try {
+    return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
+    throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+  if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  //  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  //  GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
+  //  if (CORBA::is_nil(measureOp))
+  //    return false;
+  //
+  //  CORBA::Double x, y, z;
+  //  x = y = z = 0.;
+  //  measureOp->PointCoordinates(theVertex, x, y, z);
+
+  std::string theFaceEntry = theFace->GetStudyEntry();
+  std::string theVertexEntry = theVertex->GetStudyEntry();
+  
+  GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+  SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+  string aName;
+  
+  if (theFaceEntry.empty()) {
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  if (theVertexEntry.empty()) {
+    if (theVertex->GetShapeType() == GEOM::VERTEX)
+      aName = "Vertex_";
+    if (theVertex->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theVertex->GetEntry();
+    SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
+    if (!theSVertex->_is_nil())
+      theVertexEntry = theSVertex->GetID();
+  }
+  if (theVertexEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  MESSAGE("IDL : UnsetEnforcedVertexGeom ( "<< theFaceEntry << ", " << theVertexEntry << ")");
+
+  try {
+    return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexEntry.c_str());
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+  
+  if (theFaceEntry.empty()) {
+    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+    string aName;
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+  
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : UnsetEnforcedVertices ( "<< theFaceEntry << ")");
+
+  try {
+    return UnsetEnforcedVerticesEntry(theFaceEntry.c_str());
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+/*!
+ * Set/get/unset an enforced vertex on geom object given by entry
+ */
+bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
+    CORBA::Double z, const char* theVertexName, const char* theVertexEntry, const char* theGroupName)
+    throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  MESSAGE("IDL : SetEnforcedVertexEntry(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\")");
+  bool newValue = false;
+  if (string(theVertexEntry).empty()) {
+    try {
+      ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList coordsList =
+          this->GetImpl()->GetEnfVertexCoordsList(theFaceEntry);
+      ::BLSURFPlugin_Hypothesis::TEnfVertexCoords coords;
+      coords.push_back(x);
+      coords.push_back(y);
+      coords.push_back(z);
+      if (coordsList.find(coords) == coordsList.end()) {
+        MESSAGE("Coords not found: add it in coordsList");
+        newValue = true;
+      } else {
+        MESSAGE("Coords already found, compare names");
+        ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex(coords);
+        if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
+          MESSAGE("The names are different: update");
+//          this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
+          newValue = true;
+        }
+        else {
+          MESSAGE("The names are identical");
+        }
+      }
+    } catch (const std::invalid_argument& ex) {
+      // no enforced vertex for entry
+      MESSAGE("Face entry not found : add it to the list");
+      newValue = true;
+    }
+    if (newValue)
+      if (string(theVertexName).empty())
+        if (string(theGroupName).empty())
+          SMESH::TPythonDump() << _this() << ".SetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ")";
+        else
+          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
+      else
+        if (string(theGroupName).empty())
+          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamed(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
+        else
+          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamedWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" 
+                                          << theVertexName << "\", \"" << theGroupName << "\")";
+  } else {
+    try {
+      ::BLSURFPlugin_Hypothesis::TEntryList enfVertexEntryList = this->GetImpl()->GetEnfVertexEntryList(theFaceEntry);
+      ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it = enfVertexEntryList.find(theVertexEntry);
+      if ( it == enfVertexEntryList.end()) {
+        MESSAGE("Geom entry not found: add it in enfVertexEntryList");
+        newValue = true;
+      }
+      else {
+        MESSAGE("Geom entry already found, compare names");
+        ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex((*it));
+        if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
+          MESSAGE("The names are different: update");
+//          this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
+          newValue = true;
+        }
+        else {
+          MESSAGE("The names are identical");
+        }
+      }
+    } catch (const std::invalid_argument& ex) {
+      // no enforced vertex for entry
+      MESSAGE("Face entry not found : add it to the list");
+      newValue = true;
+    }
+    if (newValue)
+        if (string(theGroupName).empty())
+          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
+        else
+          SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeomWithGroup(" << theFaceEntry << ", " << theVertexEntry << ", \"" << theGroupName << "\")";
+  }
+
+  if (newValue)
+    this->GetImpl()->SetEnforcedVertex(theFaceEntry, theVertexName, theVertexEntry, theGroupName, x, y, z);
+
+  MESSAGE("IDL : SetEnforcedVertexEntry END");
+  return newValue;
+}
+
+//Enable internal enforced vertices on specific face if requested by user
+//CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexEntry(const char* theFaceEntry)
+//    throw (SALOME::SALOME_Exception) {
+//  ASSERT(myBaseImpl);
+//  try {
+//    return this->GetImpl()->GetInternalEnforcedVertex(theFaceEntry);
+//  } catch (const std::exception& ex) {
+//    std::cout << "Exception: " << ex.what() << std::endl;
+//    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+//  }
+//}
+  
+BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
+    throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  MESSAGE("ENGINE : GetEnforcedVerticesEntry START ENTRY : " << entry);
+
+  try {
+    BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
+    ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnfVertexList(entry);
+    vertexList->length(_vList.size());
+    MESSAGE("Number of enforced vertices: " << vertexList->length());
+    ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
+    for (int i = 0; evlIt != _vList.end(); ++evlIt, ++i) {
+      ::BLSURFPlugin_Hypothesis::TEnfVertex *_enfVertex = (*evlIt);
+
+      BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
+
+      // Name
+      enfVertex->name = CORBA::string_dup(_enfVertex->name.c_str());
+      // Geom Vertex Entry
+      enfVertex->geomEntry = CORBA::string_dup(_enfVertex->geomEntry.c_str());
+      // Coords
+      BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
+      coords->length(_enfVertex->coords.size());
+      for (int ind=0;ind<coords->length();ind++)
+        coords[ind] = _enfVertex->coords[ind];
+      enfVertex->coords = coords;
+      // Group Name
+      enfVertex->grpName = CORBA::string_dup(_enfVertex->grpName.c_str());
+      // Face entry list
+      BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
+      faceEntryList->length(_enfVertex->faceEntries.size());
+      ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = _enfVertex->faceEntries.begin();
+      for (int ind = 0; it_entry != _enfVertex->faceEntries.end();++it_entry, ++ind)
+        faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
+      enfVertex->faceEntries = faceEntryList;
+
+      vertexList[i] = enfVertex;
+    }
+    MESSAGE("ENGINE : GetEnforcedVerticesEntry END ENTRY : " << entry);
+    return vertexList._retn();
+  } catch (const std::invalid_argument& ex) {
+    SALOME::ExceptionStruct ExDescription;
+    ExDescription.text = ex.what();
+    ExDescription.type = SALOME::BAD_PARAM;
+    ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(entry)";
+    ExDescription.lineNumber = 1385;
+    throw SALOME::SALOME_Exception(ExDescription);
+  } catch (const std::exception& ex) {
+    std::cout << "Exception: " << ex.what() << std::endl;
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
+    CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  MESSAGE("IDL : UnsetEnforcedVertexEntry(" << theFaceEntry << "," << x << "," << y << "," << z << ", " << theVertexEntry << ")");
+
+  bool res = false;
+  try {
+    res = this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z, theVertexEntry);
+
+    if (string(theVertexEntry).empty())
+      SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z
+          << ")";
+    else
+      SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
+
+  } catch (const std::invalid_argument& ex) {
+    return false;
+  } catch (const std::exception& ex) {
+    std::cout << "Exception: " << ex.what() << std::endl;
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+
+  MESSAGE("ENGINE : UnsetEnforcedVertexEntry END ENTRY : " << theFaceEntry);
+  return res;
+}
+
+//bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntryWithPoint(const char* theFaceEntry, const char* theVertexEntry,
+//    CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception) {
+//  MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint START theFaceEntry=" << theFaceEntry << ", theVertexEntry=" << theVertexEntry);
+//
+//  bool ret = false;
+//
+//  try {
+//    ret = _unsetEnfVertex(theFaceEntry, x, y, z);
+//  } catch (SALOME_Exception& ex) {
+//    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+//  }
+//
+//  if (ret)
+//    SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertexWithPoint(" << theFaceEntry << ", " << theVertexEntry
+//        << ")";
+//
+//  MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint END ENTRY : " << theFaceEntry);
+//  return ret;
+//}
+
+bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception) {
+  ASSERT(myBaseImpl);
+  MESSAGE("IDL : UnsetEnforcedVerticesEntry(" << theFaceEntry << ")");
+
+  try {
+    this->GetImpl()->ClearEnforcedVertices(theFaceEntry);
+    SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << theFaceEntry << ")";
+  } catch (const std::invalid_argument& ex) {
+    return false;
+  } catch (const std::exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+
+  MESSAGE("IDL : UnsetEnforcedVerticesEntry END ENTRY : " << theFaceEntry);
+  return true;
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces
+ *
+ *  Set true or false
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue) {
+  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces");
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetInternalEnforcedVertexAllFaces(theValue);
+  std::string theValueStr = theValue ? "True" : "False";
+  SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFaces( " << theValueStr.c_str() << " )";
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces
+ *
+ *  Get true or false
+ */
+//=============================================================================
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
+  MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->_GetInternalEnforcedVertexAllFaces();
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup
+ *
+ *  Set group name
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char*  groupName) {
+  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup");
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetInternalEnforcedVertexAllFacesGroup(groupName);
+  SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFacesGroup( \"" << groupName << "\" )";
+}
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup
+ *
+ *  Get group name
+ */
+//=============================================================================
+char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
+  MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup");
+  ASSERT(myBaseImpl);
+  return CORBA::string_dup(this->GetImpl()->_GetInternalEnforcedVertexAllFacesGroup().c_str());
+}
+
+/*
+ * Enable internal enforced vertices on specific face if requested by user
+ *
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
+ throw (SALOME::SALOME_Exception)
+{
+  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFace");
+  try {
+    SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
+ throw (SALOME::SALOME_Exception)
+{
+  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceWithGroup");
+
+  if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
+    MESSAGE("theFace shape type is not FACE or COMPOUND");
+    THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
+  }
+
+  string theFaceEntry = theFace->GetStudyEntry();
+
+  if (theFaceEntry.empty()) {
+    GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
+    SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
+    string aName;
+    if (theFace->GetShapeType() == GEOM::FACE)
+      aName = "Face_";
+    if (theFace->GetShapeType() == GEOM::COMPOUND)
+      aName = "Compound_";
+    aName += theFace->GetEntry();
+    SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
+    if (!theSFace->_is_nil())
+      theFaceEntry = theSFace->GetID();
+  }
+  if (theFaceEntry.empty())
+    THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
+
+  MESSAGE("IDL : GetName : " << theFace->GetName());
+  MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
+  try {
+    SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
+  } catch (SALOME_Exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
+    throw (SALOME::SALOME_Exception)
+{
+  MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceEntry");
+  ASSERT(myBaseImpl);
+  try {
+    this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
+    std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
+    if (string(theGroupName).empty())
+      SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
+    else
+      SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
+  } catch (const std::exception& ex) {
+    std::cout << "Exception: " << ex.what() << std::endl;
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+}
+
+*/
+
+/* TODO GROUPS
+ char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
+ throw (SALOME::SALOME_Exception)
+ {
+ ASSERT(myBaseImpl);
+ MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
+ try {
+ return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
+ }
+ catch (const std::invalid_argument& ex) {
+ SALOME::ExceptionStruct ExDescription;
+ ExDescription.text = ex.what();
+ ExDescription.type = SALOME::BAD_PARAM;
+ ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
+ ExDescription.lineNumber = 1146;
+ throw SALOME::SALOME_Exception(ExDescription);
+ }
+ catch (SALOME_Exception& ex) {
+ THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+ }
+ MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
+ return 0;
+ }
+
+
+ void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
+ throw (SALOME::SALOME_Exception)
+ {
+ ASSERT(myBaseImpl);
+ MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
+ try {
+ this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
+ }
+ catch (const std::invalid_argument& ex) {
+ SALOME::ExceptionStruct ExDescription;
+ ExDescription.text = ex.what();
+ ExDescription.type = SALOME::BAD_PARAM;
+ ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
+ ExDescription.lineNumber = 1170;
+ throw SALOME::SALOME_Exception(ExDescription);
+ }
+ catch (SALOME_Exception& ex) {
+ THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+ }
+
+ SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
+ << x << ", " << y << ", " << z << ", '" << groupName << "' )";
+
+ MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
+ }
+ */
+///////////////////////
+
+
+//================================================================================
+/*!
+ * \brief Sets the file for export resulting mesh in GMF format
+ * \param theFileName - full name of the file (.mesh, .meshb)
+ * 
+ * After compute, export the resulting mesh in the given file with the GMF format (.mesh)
+ */
+//================================================================================  
+// void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName, CORBA::Boolean isBinary) {
+void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
+  ASSERT(myBaseImpl);
+  MESSAGE("IDL : SetGMFFile(" << theFileName << ")");
+  bool valueChanged/*, modeChanged*/ = false;
+  try {
+    valueChanged = (this->GetImpl()->GetGMFFile() != theFileName);
+//     modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
+    if (valueChanged)// or (!valueChanged && modeChanged))
+      this->GetImpl()->SetGMFFile(theFileName);// ,isBinary);
+  } catch (const std::exception& ex) {
+    THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
+  }
+  if (valueChanged)// or (!valueChanged && modeChanged))
+    SMESH::TPythonDump() << _this() << ".SetGMFFile(\"" << theFileName << "\")"; //", " << isBinary << ")";
+  MESSAGE("IDL : SetGMFFile END ");
+}
+
+//================================================================================
+/*!
+ * \brief Gets the file name for export resulting mesh in GMF format
+ * \retval char* - The file name
+ * 
+ * Returns the GMF file name
+ */
+//================================================================================  
+char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
+  ASSERT(myBaseImpl);
+//   MESSAGE("IDL : GetGMFFile()");
+  return CORBA::string_dup(this->GetImpl()->GetGMFFile().c_str());
+}
+
+// //================================================================================
+// /*!
+//  * \brief Gets the file mode for export resulting mesh in GMF format
+//  * \retval CORBA::Boolean - TRUE if binary mode, FALSE if ascii mode
+//  * 
+//  * Returns the GMF file mode
+//  */
+// //================================================================================  
+// CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetGMFFileMode() {
+//   ASSERT(myBaseImpl);
+//   MESSAGE("IDL : GetGMFFileMode()");
+//   return this->GetImpl()->GetGMFFileMode();
+// }
+
+//=============================================================================
+/*!
+ *  BLSURFPlugin_Hypothesis_i::GetImpl
+ *
+ *  Get implementation
+ */
+//=============================================================================
+::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl() {
+  // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
+  return (::BLSURFPlugin_Hypothesis*) myBaseImpl;
+}
+
+//================================================================================
+/*!
+ * \brief Verify whether hypothesis supports given entity type 
+ * \param type - dimension (see SMESH::Dimension enumeration)
+ * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
+ * 
+ * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
+ */
+//================================================================================  
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported(SMESH::Dimension type) {
   return type == SMESH::DIM_2D;
 }
index 76b826ff48e2c89dc317d5dc435079ab467843c7..2c96546003e219ea00144b3115b41829cccdb243 100644 (file)
@@ -1,24 +1,26 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
+//           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
 //
 #ifndef _BLSURFPlugin_Hypothesis_i_HXX_
 #include "BLSURFPlugin_Hypothesis.hxx"
 
 class SMESH_Gen;
+class GEOM_Object;
 
 // BLSURFPlugin parameters hypothesis
 
-class BLSURFPlugin_Hypothesis_i:
-  public virtual POA_BLSURFPlugin::BLSURFPlugin_Hypothesis,
-  public virtual SMESH_Hypothesis_i
-{
- public:
+class BLSURFPlugin_Hypothesis_i: public virtual POA_BLSURFPlugin::BLSURFPlugin_Hypothesis,
+    public virtual SMESH_Hypothesis_i {
+public:
   // Constructor
-  BLSURFPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                             int                     theStudyId,
-                             ::SMESH_Gen*            theGenImpl);
+  BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId, ::SMESH_Gen* theGenImpl);
   // Destructor
   virtual ~BLSURFPlugin_Hypothesis_i();
 
@@ -88,21 +87,166 @@ class BLSURFPlugin_Hypothesis_i:
   void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception);
   CORBA::Short GetVerbosity();
 
-  void SetOptionValue(const char* optionName,
-                      const char* optionValue) throw (SALOME::SALOME_Exception);
+  void SetPreCADMergeEdges(CORBA::Boolean theValue);
+  CORBA::Boolean GetPreCADMergeEdges();
+
+  void SetPreCADRemoveNanoEdges(CORBA::Boolean theValue);
+  CORBA::Boolean GetPreCADRemoveNanoEdges();
+
+  void SetPreCADDiscardInput(CORBA::Boolean theValue);
+  CORBA::Boolean GetPreCADDiscardInput();
+
+  void SetPreCADEpsNano(CORBA::Double theValue);
+  CORBA::Double GetPreCADEpsNano();
+
+  void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
+  void SetPreCADOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
   char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
+  char* GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
 
   void UnsetOption(const char* optionName);
+  void UnsetPreCADOption(const char* optionName);
 
   BLSURFPlugin::string_array* GetOptionValues();
+  BLSURFPlugin::string_array* GetPreCADOptionValues();
 
   void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
+  void SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
+
+  void SetSizeMapEntry(const char* entry, const char* sizeMap) throw (SALOME::SALOME_Exception);
+
+  char* GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
+
+  void UnsetEntry(const char* entry);
+
+  BLSURFPlugin::string_array* GetSizeMapEntries();
+
+  void SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception);
+
+  void SetSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
+
+  void UnsetSizeMap(GEOM::GEOM_Object_ptr GeomObj);
+
+  void ClearSizeMaps();
+
+  void SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor);
+
+  void UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj);
+
+  void SetAttractorEntry(const char* entry, const char* attractor) throw (SALOME::SALOME_Exception);
+
+  char* GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception);
+
+  BLSURFPlugin::string_array* GetAttractorEntries();
+  
+  
+  /*!
+    * Set/get/unset an attractor on a face 
+    */
+  
+  void SetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj, GEOM::GEOM_Object_ptr Attractor, double StartSize, double EndSize, double ActionRadius, double ConstantRadius );
+
+  void UnsetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj);
+
+  void SetClassAttractorEntry(const char* entry, const char* att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius)  throw (SALOME::SALOME_Exception);
+
+  BLSURFPlugin::TAttParamsMap* GetAttractorParams();
+  
+
+  /*
+   void SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
+
+   void UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj);
+
+   void SetCustomSizeMapEntry(const char* entry,const char* sizeMap )  throw (SALOME::SALOME_Exception);
+
+   char* GetCustomSizeMapEntry(const char* entry)  throw (SALOME::SALOME_Exception);
+
+   BLSURFPlugin::string_array* GetCustomSizeMapEntries();
+   */
+
+  ///////////////////////
+  // ENFORCED VERTEXES //
+  ///////////////////////
+
+  BLSURFPlugin::TFaceEntryEnfVertexListMap* GetAllEnforcedVerticesByFace();
+  BLSURFPlugin::TEnfVertexList* GetAllEnforcedVertices();
+
+  BLSURFPlugin::TFaceEntryCoordsListMap* GetAllCoordsByFace();
+  BLSURFPlugin::TCoordsEnfVertexMap* GetAllEnforcedVerticesByCoords();
+
+  BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* GetAllEnfVertexEntriesByFace();
+  BLSURFPlugin::TEnfVertexEntryEnfVertexMap* GetAllEnforcedVerticesByEnfVertexEntry();
+
+  void ClearAllEnforcedVertices();
+
+  /*!
+   * Set/get/unset an enforced vertex on geom object
+   */
+  bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
+      throw (SALOME::SALOME_Exception);
+  bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
+      throw (SALOME::SALOME_Exception);
+  bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
+      throw (SALOME::SALOME_Exception);
+  bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
+      throw (SALOME::SALOME_Exception);
+  bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
+      throw (SALOME::SALOME_Exception);
+  bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
+      throw (SALOME::SALOME_Exception);
+
+  BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
+
+  bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
+      throw (SALOME::SALOME_Exception);
+  bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
+      throw (SALOME::SALOME_Exception);
+  bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
+
+  /*!
+   * Set/get/unset an enforced vertex on geom object given by entry
+   */
+  bool SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
+      const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "")
+      throw (SALOME::SALOME_Exception);
+
+  BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
+
+  bool UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z,
+      const char* theVertexEntry = "") throw (SALOME::SALOME_Exception);
+  bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
+
+  /*!
+   * To add internal vertices as enforced vertices
+   */
+  void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices);
+  CORBA::Boolean GetInternalEnforcedVertexAllFaces();
+  void SetInternalEnforcedVertexAllFacesGroup(const char*  groupName = "");
+  char* GetInternalEnforcedVertexAllFacesGroup();
+
+// Enable internal enforced vertices on specific face if requested by user
+//  void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) throw (SALOME::SALOME_Exception);
+//  void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
+//  void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
+//  CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
+//  CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
+  
+  ///////////////////////
+  
+  /*!
+    * Sets the file for export resulting mesh in GMF format
+    */
+//   void SetGMFFile(const char* theFileName, CORBA::Boolean isBinary);
+  void SetGMFFile(const char* theFileName);
+  char* GetGMFFile();
+//   CORBA::Boolean GetGMFFileMode();
 
   // Get implementation
   ::BLSURFPlugin_Hypothesis* GetImpl();
-  
+
   // Verify whether hypothesis supports given entity type 
-  CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+  CORBA::Boolean IsDimSupported(SMESH::Dimension type);
 };
 
 #endif
index 6eceece2b93694bc06bbe4264a7905e7090100e5..2ca0fa96271b0755f943296159e14a6f62d364ac 100644 (file)
@@ -1,21 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // ---
 // File    : BLSURFPlugin_i.cxx
 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA)
 //
 #include "utilities.h"
 
+#ifdef WIN32
+  #if defined BLSURFPLUGIN_EXPORTS || defined BLSURFEngine_EXPORTS
+    #define BLSURFPLUGIN_EXPORT __declspec( dllexport )
+  #else
+    #define BLSURFPLUGIN_EXPORT __declspec( dllimport )
+  #endif
+#else
+  #define BLSURFPLUGIN_EXPORT
+#endif
+
 #include "BLSURFPlugin_BLSURF_i.hxx"
 #include "BLSURFPlugin_Hypothesis_i.hxx"
 
@@ -40,6 +51,7 @@ template <class T> class BLSURFPlugin_Creator_i:public HypothesisCreator_i<T>
 
 extern "C"
 {
+  BLSURFPLUGIN_EXPORT
   GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
   {
     MESSAGE("GetHypothesisCreator " << aHypName);
index e78b0605627533440ec2beaa70858ea3c3e879ae..2d9cab3b7c43a032be8ac04f7fa5f25c71ca7b7a 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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 =
+# header files
+salomeinclude_HEADERS =        \
+       BLSURFPlugin_BLSURF.hxx \
+       BLSURFPlugin_BLSURF_i.hxx       \
+       BLSURFPlugin_Hypothesis.hxx     \
+       BLSURFPlugin_Hypothesis_i.hxx   \
+       BLSURFPlugin_Attractor.hxx
 
 # 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
+       BLSURFPlugin_i.cxx              \
+       BLSURFPlugin_Attractor.cxx
 
 libBLSURFEngine_la_CPPFLAGS =  \
-        $(KERNEL_CXXFLAGS)     \
-        $(GUI_CXXFLAGS)                \
+       $(QT_INCLUDES)          \
+       $(PYTHON_INCLUDES)      \
+       $(KERNEL_CXXFLAGS)      \
+       $(GUI_CXXFLAGS)         \
        $(MED_CXXFLAGS)         \
        $(GEOM_CXXFLAGS)        \
        $(CAS_CPPFLAGS)         \
+       $(VTK_INCLUDES) \
        $(BLSURF_INCLUDES)      \
        $(SMESH_CXXFLAGS)       \
        $(CORBA_CXXFLAGS)       \
        $(CORBA_INCLUDES)       \
        $(BOOST_CPPFLAGS)       \
-       -I$(top_builddir)/idl   \
-       -I$(top_builddir)/salome_adm/unix
+       -I$(top_builddir)/idl
+
+#Qt uniquement necessaire pour le getActiveStudyDocument de SMeshGuiUtils.h
 
 libBLSURFEngine_la_LDFLAGS  =                  \
        ../../idl/libSalomeIDLBLSURFPLUGIN.la   \
-       $(BLSURF_LIBS)                          \
-       $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine   \
-       $(KERNEL_LDFLAGS) -lSalomeGenericObj
+       $(PYTHON_LIBS) \
+       $(CAS_KERNEL) -lTKBRep -lTKGeomBase -lTKGeomAlgo -lTKTopAlgo -lTKLCAF -lTKXSBase -lTKG2d -lTKG3d -lTKShHealing \
+       $(BLSURF_LIBS) \
+       $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -lSMDS -lSMESHDS \
+       $(GEOM_LDFLAGS) -lGEOMbasic \
+       $(MED_LDFLAGS) -lSalomeIDLMED \
+       $(KERNEL_LDFLAGS) -lOpUtil -lSalomeGenericObj -lSalomeNS -lSALOMELocalTrace -lSALOMEBasics \
+       $(BOOST_LIB_REGEX)
+
+# Scripts to be installed.
+dist_salomescript_DATA= BLSURFPluginDC.py
index 9414ad1a8aeaa69510ad2a74c8a9029519034c16..bb25855f5a17783e947c313c5ca08e289123efb0 100755 (executable)
@@ -1,26 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // ---
 // File    : BLSURFPluginGUI.cxx
 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA)
 // ---
 //
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+#include <Standard_math.hxx>
+#include <pymath.h>
+#endif
+
 #include "BLSURFPluginGUI_HypothesisCreator.h"
 
 //=============================================================================
index ba14fc85c7472e3b8a1968e3ef49beb6a0a12db1..3c6fd0384fffecc81d1b2c6793d2e4a36ac45212 100644 (file)
@@ -1,43 +1,52 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
 //           & Aurelien ALLEAUME (DISTENE)
+//           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
 //
 #include "BLSURFPluginGUI_HypothesisCreator.h"
+// #include <DlgBlSurfHyp_Enforced.h>
+
+#include "GeometryGUI.h"
 
 #include <SMESHGUI_Utils.h>
 #include <SMESHGUI_HypothesesUtils.h>
+#include <SMESHGUI_Dialog.h>
+#include "SMESHGUI_SpinBox.h"
+#include "SMESH_NumberFilter.hxx"
 
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <SalomeApp_Tools.h>
-#include <QtxDoubleSpinBox.h>
 
+#include <QObject>
 #include <QComboBox>
 #include <QLabel>
 #include <QGroupBox>
 #include <QFrame>
 #include <QVBoxLayout>
+#include <QHBoxLayout>
 #include <QGridLayout>
 #include <QLineEdit>
 #include <QCheckBox>
 #include <QTableWidget>
 #include <QHeaderView>
 #include <QApplication>
+#include <QRadioButton>
+#include <QFileDialog>
+
+#include <QStandardItemModel>
+#include <QStandardItem>
+#include <QTreeWidget>
+#include <QTreeWidgetItem>
+#include <QModelIndexList>
+
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+#include "SALOME_LifeCycleCORBA.hxx"
+
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <SMESH_Gen_i.hxx>
+#include <boost/shared_ptr.hpp>
+#include <boost/algorithm/string.hpp>
+#include <structmember.h>
+#include <stdexcept>
+#include <algorithm>
 
 #define WITH_SIZE_BOUNDARIES
 
 enum Topology {
     FromCAD,
     Process,
-    Process2
-  };
+    Process2,
+    PreCAD
+  } ;
 
 enum PhysicalMesh
   {
     DefaultSize = 0,
-    PhysicalUserDefined
+    PhysicalUserDefined,
+    SizeMap
   };
 
 enum GeometricMesh
@@ -72,66 +106,465 @@ enum GeometricMesh
 enum {
   STD_TAB = 0,
   ADV_TAB,
+  SMP_TAB,
+  ENF_TAB,
   OPTION_ID_COLUMN = 0,
+  OPTION_TYPE_COLUMN,
   OPTION_NAME_COLUMN,
   OPTION_VALUE_COLUMN,
-  NB_COLUMNS
+  NB_COLUMNS,
+  SMP_NAME_COLUMN =0,
+  SMP_SIZEMAP_COLUMN,
+  SMP_ENTRY_COLUMN,
+//  SMP_DIST_COLUMN,
+  SMP_NB_COLUMNS,
+// Enforced vertices array columns
+  ENF_VER_NAME_COLUMN = 0,
+  ENF_VER_FACE_ENTRY_COLUMN,
+  ENF_VER_X_COLUMN,
+  ENF_VER_Y_COLUMN,
+  ENF_VER_Z_COLUMN,
+  ENF_VER_ENTRY_COLUMN,
+  ENF_VER_GROUP_COLUMN,
+  ENF_VER_NB_COLUMNS
 };
 
-BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator( const QString& theHypType )
-  : SMESHGUI_GenericHypothesisCreator( theHypType )
+enum {
+  SMP_TAB_WDG,
+  SMP_ADD_BTN,
+  SMP_NB_LINES,
+  SMP_STD_TAB = 0,
+  ATT_TAB,
+  SMP_GEOM_BTN_2 = 0,
+  ATT_CHECK,
+  CONST_SIZE_CHECK,
+  SMP_SPACE,
+//   SMP_PARAMS,
+  SMP_ATT_SHAPE, 
+  SMP_ATT_SIZE,
+  SMP_ATT_DIST,
+  SMP_ATT_RAD
+};
+  
+enum {
+  SMP_GEOM_BTN_1,
+  SMP_SIZE,
+  SMP_SPACE2,
+};
+
+// Enforced vertices inputs
+enum {
+  ENF_VER_FACE = 0,
+  ENF_VER_VERTEX,
+  ENF_VER_X_COORD,
+  ENF_VER_Y_COORD,
+  ENF_VER_Z_COORD,
+  ENF_VER_GROUP,
+//   ENF_VER_GROUP_CHECK,
+//   ENF_VER_SPACE,
+  ENF_VER_BTN,
+  ENF_VER_SEPARATOR,
+  ENF_VER_INTERNAL_ALL_FACES,
+  ENF_VER_INTERNAL_ALL_FACES_GROUP,
+//   ENF_VER_VERTEX_BTN,
+//   ENF_VER_REMOVE_BTN,
+//   ENF_VER_SEPARATOR,
+  ENF_VER_NB_LINES
+};
+
+
+/**************************************************
+ Begin initialization Python structures and objects
+***************************************************/
+
+typedef struct {
+  PyObject_HEAD
+  int softspace;
+  std::string *out;
+  } PyStdOut;
+
+static void
+PyStdOut_dealloc(PyStdOut *self)
 {
+  PyObject_Del(self);
 }
 
-BLSURFPluginGUI_HypothesisCreator::~BLSURFPluginGUI_HypothesisCreator()
+static PyObject *
+PyStdOut_write(PyStdOut *self, PyObject *args)
 {
+  char *c;
+  int l;
+  if (!PyArg_ParseTuple(args, "t#:write",&c, &l))
+    return NULL;
+
+  //std::cerr << c ;
+  *(self->out)=*(self->out)+c;
+
+  Py_INCREF(Py_None);
+  return Py_None;
 }
 
-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;
+static PyMethodDef PyStdOut_methods[] = { 
+  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
+  PyDoc_STR("write(string) -> None")},
+  {NULL,    NULL}   /* sentinel */
+};
+
+static PyMemberDef PyStdOut_memberlist[] = {
+  {(char*)"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
+   (char*)"flag indicating that a space needs to be printed; used by print"},
+  {NULL} /* Sentinel */
+};
+
+static PyTypeObject PyStdOut_Type = {
+  /* The ob_type field must be initialized in the module init function
+   * to be portable to Windows without using C++. */
+  PyObject_HEAD_INIT(NULL)
+  0,                            /*ob_size*/
+  "PyOut",                      /*tp_name*/
+  sizeof(PyStdOut),             /*tp_basicsize*/
+  0,                            /*tp_itemsize*/
+  /* methods */
+  (destructor)PyStdOut_dealloc, /*tp_dealloc*/
+  0,                            /*tp_print*/
+  0,                            /*tp_getattr*/
+  0,                            /*tp_setattr*/
+  0,                            /*tp_compare*/
+  0,                            /*tp_repr*/
+  0,                            /*tp_as_number*/
+  0,                            /*tp_as_sequence*/
+  0,                            /*tp_as_mapping*/
+  0,                            /*tp_hash*/
+  0,                            /*tp_call*/
+  0,                            /*tp_str*/
+  PyObject_GenericGetAttr,      /*tp_getattro*/
+  /* softspace is writable:  we must supply tp_setattro */
+  PyObject_GenericSetAttr,      /* tp_setattro */
+  0,                            /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
+  0,                            /*tp_doc*/
+  0,                            /*tp_traverse*/
+  0,                            /*tp_clear*/
+  0,                            /*tp_richcompare*/
+  0,                            /*tp_weaklistoffset*/
+  0,                            /*tp_iter*/
+  0,                            /*tp_iternext*/
+  PyStdOut_methods,             /*tp_methods*/
+  PyStdOut_memberlist,          /*tp_members*/
+  0,                            /*tp_getset*/
+  0,                            /*tp_base*/
+  0,                            /*tp_dict*/
+  0,                            /*tp_descr_get*/
+  0,                            /*tp_descr_set*/
+  0,                            /*tp_dictoffset*/
+  0,                            /*tp_init*/
+  0,                            /*tp_alloc*/
+  0,                            /*tp_new*/
+  0,                            /*tp_free*/
+  0,                            /*tp_is_gc*/
+};
+
+PyObject * newPyStdOut( std::string& out )
+{
+  PyStdOut *self;
+  self = PyObject_New(PyStdOut, &PyStdOut_Type);
+  if (self == NULL)
+    return NULL;
+  self->softspace = 0;
+  self->out=&out;
+  return (PyObject*)self;
+}
+
+/*************************************************
+End initialization Python structures and objects
+**************************************************/
+
+
+//
+// BEGIN EnforcedTreeWidgetDelegate
+//
+
+EnforcedTreeWidgetDelegate::EnforcedTreeWidgetDelegate(QObject *parent)
+  : QItemDelegate(parent)
+{
+}
+
+QWidget *EnforcedTreeWidgetDelegate::createEditor(QWidget *parent,
+                                              const QStyleOptionViewItem & option ,
+                                              const QModelIndex & index ) const
+{
+  QModelIndex father = index.parent();
+  QString entry = father.child(index.row(), ENF_VER_ENTRY_COLUMN).data(Qt::EditRole).toString();
+  
+  if (index.column() == ENF_VER_X_COLUMN || \
+      index.column() == ENF_VER_Y_COLUMN || \
+      index.column() == ENF_VER_Z_COLUMN)
+  {
+    SMESHGUI_SpinBox *editor = new SMESHGUI_SpinBox(parent);
+    editor->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+    editor->setReadOnly(!entry.isEmpty());
+    editor->setDisabled(!entry.isEmpty());
+    return editor;
+  }
+  else
+  {
+    QLineEdit *editor = new QLineEdit(parent);
+    if (index.column() != ENF_VER_GROUP_COLUMN) {
+      editor->setReadOnly(!entry.isEmpty());
+      editor->setDisabled(!entry.isEmpty());
+    }
+    return editor;
   }
 }
 
-bool BLSURFPluginGUI_HypothesisCreator::checkParams() const
+void EnforcedTreeWidgetDelegate::setEditorData(QWidget *editor,
+                                           const QModelIndex &index) const
 {
-  bool ok = true;
-  if ( !isDouble( myPhySize->text(), false )) {
-    if ( myPhySize->text().isEmpty() )
-      myPhySize->setText(tr("OBLIGATORY_VALUE"));
-    myPhySize->selectAll();
-    ok = false;
+  QString value = index.model()->data(index, Qt::EditRole).toString();
+
+  if (index.column() == ENF_VER_X_COLUMN ||
+      index.column() == ENF_VER_Y_COLUMN ||
+      index.column() == ENF_VER_Z_COLUMN)
+  {
+    SMESHGUI_SpinBox *lineEdit = static_cast<SMESHGUI_SpinBox*>(editor);
+    lineEdit->setText(value);
   }
-  if ( !isDouble( myPhyMin->text(), true )) {
-    myPhyMin->selectAll();
-    ok = false;
+  else {
+    QLineEdit *lineEdit = static_cast<QLineEdit*>(editor);
+    lineEdit->setText(value);
   }
-  if ( !isDouble( myPhyMax->text(), true )) {
-    myPhyMax->selectAll();
-    ok = false;
+}
+
+void EnforcedTreeWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
+                                          const QModelIndex &index) const
+{
+  QModelIndex parent = index.parent();
+  QString entry = parent.child(index.row(), ENF_VER_ENTRY_COLUMN).data(Qt::EditRole).toString();
+  if (index.column() == ENF_VER_X_COLUMN || index.column() == ENF_VER_Y_COLUMN || index.column() == ENF_VER_Z_COLUMN) {
+    SMESHGUI_SpinBox *lineEdit = static_cast<SMESHGUI_SpinBox*>(editor);
+    if (entry.isEmpty() && !vertexExists(model, index, lineEdit->GetString()))
+      model->setData(index, lineEdit->GetValue(), Qt::EditRole);
+  } else if (index.column() == ENF_VER_NAME_COLUMN) {
+    QLineEdit *lineEdit = static_cast<QLineEdit*>(editor);
+    QString value = lineEdit->text();
+    if (entry.isEmpty() && !vertexExists(model, index, value))
+      model->setData(index, value, Qt::EditRole);
+  } else if (index.column() == ENF_VER_ENTRY_COLUMN) {
+    QLineEdit *lineEdit = static_cast<QLineEdit*>(editor);
+    QString value = lineEdit->text();
+    if (! vertexExists(model, index, value))
+      model->setData(index, value, Qt::EditRole);
+  } else if (index.column() == ENF_VER_GROUP_COLUMN) {
+    QLineEdit *lineEdit = static_cast<QLineEdit*>(editor);
+    model->setData(index, lineEdit->text(), Qt::EditRole);
   }
-  if ( !isDouble( myGeoMin->text(), true )) {
-    myGeoMin->selectAll();
-    ok = false;
+}
+
+void EnforcedTreeWidgetDelegate::updateEditorGeometry(QWidget *editor,
+    const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
+{
+  editor->setGeometry(option.rect);
+}
+
+bool EnforcedTreeWidgetDelegate::vertexExists(QAbstractItemModel *model,
+    const QModelIndex &index, QString value) const
+{
+  bool exists = false;
+  QModelIndex parent = index.parent();
+  int row = index.row();
+  int col = index.column();
+
+  if (parent.isValid() && !value.isEmpty()) {
+    if (col == ENF_VER_X_COLUMN || col == ENF_VER_Y_COLUMN || col == ENF_VER_Z_COLUMN) {
+      double x, y, z;
+      if (col == ENF_VER_X_COLUMN) {
+        x = value.toDouble();
+        y = parent.child(row, ENF_VER_Y_COLUMN).data(Qt::EditRole).toDouble();
+        z = parent.child(row, ENF_VER_Z_COLUMN).data(Qt::EditRole).toDouble();
+      }
+      if (col == ENF_VER_Y_COLUMN) {
+        y = value.toDouble();
+        x = parent.child(row, ENF_VER_X_COLUMN).data(Qt::EditRole).toDouble();
+        z = parent.child(row, ENF_VER_Z_COLUMN).data(Qt::EditRole).toDouble();
+      }
+      if (col == ENF_VER_Z_COLUMN) {
+        z = value.toDouble();
+        x = parent.child(row, ENF_VER_X_COLUMN).data(Qt::EditRole).toDouble();
+        y = parent.child(row, ENF_VER_Y_COLUMN).data(Qt::EditRole).toDouble();
+      }
+      int nbChildren = model->rowCount(parent);
+      for (int i = 0 ; i < nbChildren ; i++) {
+        if (i != row) {
+          double childX = parent.child(i, ENF_VER_X_COLUMN).data(Qt::EditRole).toDouble();
+          double childY = parent.child(i, ENF_VER_Y_COLUMN).data(Qt::EditRole).toDouble();
+          double childZ = parent.child(i, ENF_VER_Z_COLUMN).data(Qt::EditRole).toDouble();
+          if ((childX == x) && (childY == y) && (childZ == z)) {
+            exists = true;
+            break;
+          }
+        }
+      }
+    }
+    else if (col == ENF_VER_NAME_COLUMN) {
+      int nbChildren = model->rowCount(parent);
+      for (int i = 0 ; i < nbChildren ; i++) {
+        if (i != row) {
+          QString childName = parent.child(i, ENF_VER_NAME_COLUMN).data(Qt::EditRole).toString();
+          if (childName == value) {
+            exists = true;
+            break;
+          }
+        }
+      }
+    }
   }
-  if ( !isDouble( myGeoMin->text(), true )) {
-    myGeoMin->selectAll();
-    ok = false;
+
+  return exists;
+}
+
+//
+// END EnforcedTreeWidgetDelegate
+//
+
+//
+// BEGIN BLSURFPluginGUI_ObjectReferenceParamWdg
+//
+//================================================================================
+
+// BLSURFPluginGUI_ObjectReferenceParamWdg::BLSURFPluginGUI_ObjectReferenceParamWdg
+// ( SUIT_SelectionFilter* f, QWidget* parent, bool multiSelection)
+//   : StdMeshersGUI_ObjectReferenceParamWdg(f, parent, multiSelection)
+// {
+//   init();
+// }
+// 
+// 
+// BLSURFPluginGUI_ObjectReferenceParamWdg::BLSURFPluginGUI_ObjectReferenceParamWdg
+// ( MeshObjectType objType, QWidget* parent, bool multiSelection )
+//   : StdMeshersGUI_ObjectReferenceParamWdg( objType, parent, multiSelection )
+// {
+//   init();
+// }
+// 
+// BLSURFPluginGUI_ObjectReferenceParamWdg::~BLSURFPluginGUI_ObjectReferenceParamWdg()
+// {
+//   if ( myFilter )
+//   {
+//     mySelectionMgr->removeFilter( myFilter );
+//     delete myFilter;
+//   }
+// }
+// 
+// void BLSURFPluginGUI_ObjectReferenceParamWdg::init()
+// {
+//   StdMeshersGUI_ObjectReferenceParamWdg::init();
+//   disconnect( mySelButton, SIGNAL(clicked()), SLOT(activateSelection()));
+//   connect( mySelButton, SIGNAL(toggled(bool)), SLOT(setActivationStatus(bool)));
+// }
+// 
+// void BLSURFPluginGUI_ObjectReferenceParamWdg::setActivationStatus(bool status)
+// {
+//   if (status)
+//     activateSelection();
+//   else
+//     deactivateSelection();
+// }
+// 
+// void BLSURFPluginGUI_ObjectReferenceParamWdg::activateSelectionOnly()
+// {
+//   if ( !mySelectionActivated && mySelectionMgr )
+//   {
+//     mySelectionActivated = true;
+//     mySelectionMgr->clearFilters();
+//     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+//       aViewWindow->SetSelectionMode(ActorSelection);
+//     if ( myFilter )
+//       mySelectionMgr->installFilter( myFilter );
+//     connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
+//   }
+//   emit selectionActivated();
+// }
+// 
+// void BLSURFPluginGUI_ObjectReferenceParamWdg::deactivateSelectionOnly()
+// {
+//   mySelectionActivated = false;
+//   disconnect(mySelectionMgr, 0, this, 0 );
+//   mySelectionMgr->removeFilter( myFilter );
+// }
+// 
+//
+// END BLSURFPluginGUI_ObjectReferenceParamWdg
+//
+
+/**
+ * \brief {BLSURFPluginGUI_HypothesisCreator constructor}
+ * @param theHypType Name of the hypothesis type (here BLSURF_Parameters)
+ *
+ * */
+BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator( const QString& theHypType )
+  : SMESHGUI_GenericHypothesisCreator( theHypType )
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator");
+  this->mySMPMap.clear();
+
+  GeomToolSelected = NULL;
+  GeomToolSelected = getGeomSelectionTool();
+
+  aSel = GeomToolSelected->selectionMgr();
+
+  /* Initialize the Python interpreter */
+  if (! Py_IsInitialized())
+    throw ("Error: Python interpreter is not initialized");
+  PyGILState_STATE gstate;
+  gstate = PyGILState_Ensure();
+
+  main_mod = NULL;
+  main_mod = PyImport_AddModule("__main__");
+
+  main_dict = NULL;
+  main_dict = PyModule_GetDict(main_mod);
+
+  PyRun_SimpleString("from math import *");
+  PyGILState_Release(gstate);
+
+}
+
+BLSURFPluginGUI_HypothesisCreator::~BLSURFPluginGUI_HypothesisCreator()
+{
+}
+
+/**
+ * \brief {Get or create the geom selection tool for active study}
+ * */
+GeomSelectionTools* BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool()
+{
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+  if (that->GeomToolSelected == NULL || that->GeomToolSelected->getMyStudy() != aStudy) {
+    that->GeomToolSelected = new GeomSelectionTools(aStudy);
   }
+  return that->GeomToolSelected;
+}
+
+GEOM::GEOM_Gen_var BLSURFPluginGUI_HypothesisCreator::getGeomEngine()
+{
+  return GeometryGUI::GetGeomGen();
+}
+
+
+bool BLSURFPluginGUI_HypothesisCreator::checkParams(QString& msg) const
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::checkParams");
+  bool ok = true;
+
+  BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
+    BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( hypothesis() );
+
   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 )
     {
@@ -139,27 +572,81 @@ bool BLSURFPluginGUI_HypothesisCreator::checkParams() const
       QString value = myOptionTable->item( row, OPTION_VALUE_COLUMN )->text().trimmed();
       if ( !value.isEmpty() ) {
         try {
-          h->SetOptionValue( name.toLatin1().constData(), value.toLatin1().constData() );
+          QString optionType = myOptionTable->item( row, OPTION_TYPE_COLUMN )->text().trimmed();
+          if (optionType == "PRECAD")
+            h->SetPreCADOptionValue( name.toLatin1().constData(), value.toLatin1().constData() );
+          else if (optionType == "BLSURF")
+            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() );
+          msg = ex.details.text.in();
           ok = false;
         }
       }
     }
+  }
+  if ( !ok )
+  {
     h->SetOptionValues( myOptions ); // restore values
+    h->SetPreCADOptionValues( myPreCADOptions ); // restore values
   }
 
+  // SizeMap and attractors
+  if ( ok )
+  {
+    mySizeMapTable->setFocus();
+    QApplication::instance()->processEvents();
+
+    BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+    int row = 0, nbRows = mySizeMapTable->topLevelItemCount();
+    std::string e, s;
+    for ( ; row < nbRows; ++row )
+    {
+      QString entry   = mySizeMapTable->topLevelItem( row )->data(SMP_ENTRY_COLUMN, Qt::EditRole).toString();
+      QString sizeMap = mySizeMapTable->topLevelItem( row )->data(SMP_SIZEMAP_COLUMN, Qt::EditRole).toString();
+      MESSAGE("entry ="<<entry.toStdString())
+      if ( !sizeMap.isEmpty() ) {
+        if (that->sizeMapValidationFromRow(row))
+        {
+          try {
+            MESSAGE("entry ="<<entry.toStdString())
+            MESSAGE("sizeMap ="<<sizeMap.toStdString())
+            
+            e = entry.toStdString();
+            s = that->mySMPMap[entry].toStdString();
+            MESSAGE("row = "<<row)
+            MESSAGE("e = "<<e)
+            MESSAGE("s = "<<s)
+            h->SetSizeMapEntry( e.c_str(), s.c_str() );
+          }
+          catch ( const SALOME::SALOME_Exception& ex )
+          {
+            msg = ex.details.text.in();
+            ok = false;
+          }
+        }
+        else {
+          ok = false;
+        }
+      }
+    }
+  }
+
+  // Enforced vertices
+  // TODO
+
   return ok;
 }
 
 QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
 {
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::buildFrame");
+
   QFrame* fr = new QFrame( 0 );
+ // fr-> setMinimumSize(600,400);
   QVBoxLayout* lay = new QVBoxLayout( fr );
+ // lay->setSizeConstraint(QLayout::SetDefaultConstraint);
   lay->setMargin( 5 );
   lay->setSpacing( 0 );
 
@@ -175,137 +662,840 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   aStdLayout->setSpacing( 6 );
   aStdLayout->setMargin( 11 );
 
-  int row = 0;
   myName = 0;
-  if( isCreation() ) {
-    aStdLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), myStdGroup ), row, 0, 1, 1 );
+  if( isCreation() )
     myName = new QLineEdit( myStdGroup );
-    aStdLayout->addWidget( myName, row++, 1, 1, 1 );
-  }
 
-  aStdLayout->addWidget( new QLabel( tr( "BLSURF_PHY_MESH" ), myStdGroup ), row, 0, 1, 1 );
+  myGradation = new SMESHGUI_SpinBox( myStdGroup );
+  myGradation->RangeStepAndValidator(1.1, 2.5, 0.1, "length_precision");
+
   myPhysicalMesh = new QComboBox( myStdGroup );
-  aStdLayout->addWidget( myPhysicalMesh, row++, 1, 1, 1 );
   QStringList physicalTypes;
-  physicalTypes << tr( "BLSURF_DEFAULT_USER" ) << tr( "BLSURF_CUSTOM_USER" );
+  physicalTypes << tr( "BLSURF_DEFAULT_USER" ) << tr( "BLSURF_CUSTOM_USER" ) << tr( "BLSURF_SIZE_MAP");
   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 );
+  myPhySize = new SMESHGUI_SpinBox( myStdGroup );
+  myPhySize->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
 
 #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 );
+  myPhyMin = new SMESHGUI_SpinBox( myStdGroup );
+  myPhyMin->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
+  myPhyMin->setText("");
+  myPhyMax = new SMESHGUI_SpinBox( myStdGroup );
+  myPhyMax->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
+  myPhyMax->setText("");
 #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 << 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 );
-  
-  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 );
+  myAngleMeshS = new SMESHGUI_SpinBox( myStdGroup );
+  myAngleMeshS->RangeStepAndValidator(0, 16, 0.5, "angular_precision");
 
-#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 );
+  myAngleMeshC = new SMESHGUI_SpinBox( myStdGroup );
+  myAngleMeshC->RangeStepAndValidator(0, 16, 0.5, "angular_precision");
 
-  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMAX" ), myStdGroup ), row, 0, 1, 1 );
-  myGeoMax = new QLineEdit( myStdGroup );
-  aStdLayout->addWidget( myGeoMax, row++, 1, 1, 1 );
+#ifdef WITH_SIZE_BOUNDARIES
+  myGeoMin = new SMESHGUI_SpinBox( myStdGroup );
+  myGeoMin->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
+  myGeoMin->setText("");
+  myGeoMax = new SMESHGUI_SpinBox( myStdGroup );
+  myGeoMax->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
+  myGeoMax->setText("");
 #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 );
-  
+
+  // ADD WIDGETS (STANDARD TAB)
+  int row = 0;
+  if( isCreation() ) {
+    aStdLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), myStdGroup ),        row, 0, 1, 1 );
+    aStdLayout->addWidget( myName,                                              row++, 1, 1, 3 );
+  }
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_PHY_MESH" ), myStdGroup ),     row, 0, 1, 1 );
+  aStdLayout->addWidget( myPhysicalMesh,                                        row++, 1, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYDEF" ), myStdGroup),       row, 0, 1, 1 );
+  aStdLayout->addWidget( myPhySize,                                             row++, 1, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_GRADATION" ), myStdGroup ),    row, 0, 1, 1 );
+  aStdLayout->addWidget( myGradation,                                           row++, 1, 1, 1 );
+#ifdef WITH_SIZE_BOUNDARIES
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYMIN" ), myStdGroup ),      row, 0, 1, 1 );
+  aStdLayout->addWidget( myPhyMin,                                              row++, 1, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYMAX" ), myStdGroup ),      row, 0, 1, 1 );
+  aStdLayout->addWidget( myPhyMax,                                              row++, 1, 1, 1 );
+#endif
+  int maxrow = row;
+  if( isCreation() )
+    row = 1;
+  else
+    row = 0;
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_GEOM_MESH" ), myStdGroup ),    row, 2, 1, 1 );
+  aStdLayout->addWidget( myGeometricMesh,                                       row++, 3, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_S" ), myStdGroup ), row, 2, 1, 1 );
+  aStdLayout->addWidget( myAngleMeshS,                                          row++, 3, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_C" ), myStdGroup ), row, 2, 1, 1 );
+  aStdLayout->addWidget( myAngleMeshC,                                          row++, 3, 1, 1 );
+#ifdef WITH_SIZE_BOUNDARIES
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMIN" ), myStdGroup ),      row, 2, 1, 1 );
+  aStdLayout->addWidget( myGeoMin,                                              row++, 3, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMAX" ), myStdGroup ),      row, 2, 1, 1 );
+  aStdLayout->addWidget( myGeoMax,                                              row++, 3, 1, 1 );
+#endif
+  row = max(row,maxrow)+1;
+  aStdLayout->addWidget( myAllowQuadrangles,                                    row, 0, 1, 2 );
+  aStdLayout->addWidget( myDecimesh,                                            row++, 2, 1, 2 );
+  aStdLayout->setRowStretch(row,1);
+  maxrow = row;
+
   // advanced parameters
   myAdvGroup = new QWidget();
   QGridLayout* anAdvLayout = new QGridLayout( myAdvGroup );
   anAdvLayout->setSpacing( 6 );
   anAdvLayout->setMargin( 11 );
+  anAdvLayout->setRowStretch( 4, 5 );
+  anAdvLayout->setColumnStretch( 1, 5 );
 
-  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" );
+  topologyTypes << tr( "BLSURF_TOPOLOGY_CAD" ) 
+                << tr( "BLSURF_TOPOLOGY_PROCESS" ) 
+                << tr( "BLSURF_TOPOLOGY_PROCESS2" ) 
+                << tr( "BLSURF_TOPOLOGY_PRECAD" );
   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" );
+  headers << tr( "OPTION_ID_COLUMN" )<< tr( "OPTION_TYPE_COLUMN" )  << tr( "OPTION_NAME_COLUMN" ) << tr( "OPTION_VALUE_COLUMN" );
   myOptionTable->setHorizontalHeaderLabels( headers );
   myOptionTable->horizontalHeader()->hideSection( OPTION_ID_COLUMN );
+//   myOptionTable->horizontalHeader()->hideSection( OPTION_TYPE_COLUMN );
+  myOptionTable->horizontalHeader()->setStretchLastSection(true);
+  myOptionTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
   //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 );
+  myPreCADGroupBox = new QGroupBox(tr("BLSURF_PRECAD_GROUP"),  myAdvGroup );
+  myPreCADGroupBox->setEnabled(false);
+  QGridLayout* aPreCADGroupLayout = new QGridLayout(myPreCADGroupBox);
+  myPreCADMergeEdges = new QCheckBox(tr("BLSURF_PRECAD_MERGE_EDGES"),myPreCADGroupBox);
+  aPreCADGroupLayout->addWidget(myPreCADMergeEdges,0,0,1,2);
+  myPreCADRemoveNanoEdges = new QCheckBox(tr("BLSURF_PRECAD_REMOVE_NANO_EDGES"),myPreCADGroupBox);
+  aPreCADGroupLayout->addWidget(myPreCADRemoveNanoEdges,1,0,1,2);
+  myPreCADEpsNano = new SMESHGUI_SpinBox(myPreCADGroupBox);
+  myPreCADEpsNano->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision");
+  myPreCADEpsNano->setText("");
+  aPreCADGroupLayout->addWidget( new QLabel( tr( "BLSURF_PRECAD_EPS_NANO" ), myPreCADGroupBox ), 2, 0, 1, 1 );
+  aPreCADGroupLayout->addWidget(myPreCADEpsNano, 2, 1, 1, 1 );
+  myPreCADDiscardInput = new QCheckBox(tr("BLSURF_PRECAD_DISCARD_INPUT"),myPreCADGroupBox);
+  aPreCADGroupLayout->addWidget(myPreCADDiscardInput, 3, 0, 1, 2);
+  
+  QPushButton* chooseGMFBtn = new QPushButton( tr( "BLSURF_GMF_FILE" ),  myAdvGroup );
+  myGMFFileName = new QLineEdit(myAdvGroup);
+//   myGMFFileMode = new QCheckBox(tr("BLSURF_GMF_MODE"),myAdvGroup);
+
+  // ADD WIDGETS (ADVANCED TAB)
+  anAdvLayout->addWidget( new QLabel( tr( "BLSURF_VERBOSITY" ), myAdvGroup ), 0, 0, 1, 1 );
+  anAdvLayout->addWidget( myVerbosity,                                        0, 1, 1, 1 );
+  anAdvLayout->addWidget( new QLabel( tr( "BLSURF_TOPOLOGY" ), myAdvGroup ),  1, 0, 1, 1 );
+  anAdvLayout->addWidget( myTopology,                                         1, 1, 1, 1 );
+  anAdvLayout->addWidget( myPreCADGroupBox ,                                  2, 0, 1, 2 );
+  anAdvLayout->addWidget( addBtn,                                             0, 2, 1, 1 );
+  anAdvLayout->addWidget( rmBtn,                                              0, 3, 1, 1 );
+  anAdvLayout->addWidget( myOptionTable,                                      1, 2, 3, 2 );
+  anAdvLayout->addWidget( chooseGMFBtn,                                       3, 0, 1, 1 );
+  anAdvLayout->addWidget( myGMFFileName,                                      3, 1, 1, 1 );
+//   anAdvLayout->addWidget( myGMFFileMode,                                      4, 0, 1, 2 );
+  anAdvLayout->setRowStretch(4,1);
+
+
+  // Size Maps parameters
+
+  mySmpGroup = new QWidget();
+//   mySmpGroup->setMinimumWidth(500);
+
+  //Layout
+  QGridLayout* anSmpLayout = new QGridLayout(mySmpGroup);
+  
+  // Table
+  mySizeMapTable = new QTreeWidget( mySmpGroup );
+  mySizeMapTable ->setMinimumWidth(200);
+  QStringList sizeMapHeaders;
+  sizeMapHeaders << tr( "SMP_NAME_COLUMN" )<< tr( "SMP_SIZEMAP_COLUMN" )<< tr( "SMP_ENTRY_COLUMN" );// << tr( "SMP_DIST_COLUMN" );
+  mySizeMapTable->setHeaderLabels(sizeMapHeaders);
+  mySizeMapTable->resizeColumnToContents(SMP_NAME_COLUMN);
+  mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN);
+  mySizeMapTable->hideColumn(SMP_ENTRY_COLUMN);
+  mySizeMapTable->setAlternatingRowColors(true);
+  
+  // tab widget
+  smpTab = new QTabWidget( mySmpGroup );
+  smpTab->setTabShape( QTabWidget::Rounded );
+  smpTab->setTabPosition( QTabWidget::South );
+  lay->addWidget( smpTab );
+  
+  // Filters of selection
+  TColStd_MapOfInteger SM_ShapeTypes, ATT_ShapeTypes;
+  
+  SM_ShapeTypes.Add( TopAbs_VERTEX );
+  SM_ShapeTypes.Add( TopAbs_EDGE );
+  SM_ShapeTypes.Add( TopAbs_FACE );
+  SM_ShapeTypes.Add( TopAbs_COMPOUND );
+  
+  ATT_ShapeTypes.Add( TopAbs_VERTEX );
+  ATT_ShapeTypes.Add( TopAbs_EDGE );
+  ATT_ShapeTypes.Add( TopAbs_WIRE );
+  ATT_ShapeTypes.Add( TopAbs_COMPOUND );
+  
+  SMESH_NumberFilter* myFilter1 = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 0, SM_ShapeTypes);
+  SMESH_NumberFilter* myFilter2 = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 0, ATT_ShapeTypes);
+  SMESH_NumberFilter* myFilter3 = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 0, TopAbs_FACE);
+  
+  // Standard size map tab
+  mySmpStdGroup = new QWidget();
+  QGridLayout* anSmpStdLayout = new QGridLayout(mySmpStdGroup);
+  myGeomSelWdg1 = new StdMeshersGUI_ObjectReferenceParamWdg( myFilter1, 0, /*multiSel=*/false,/*stretch=*/false);
+  myGeomSelWdg1->SetDefaultText(tr("BLS_SEL_SHAPE"), "QLineEdit { color: grey }");
+  mySmpSizeSpin = new SMESHGUI_SpinBox(mySmpStdGroup);
+  mySmpSizeSpin->RangeStepAndValidator(0., COORD_MAX, 1.0, "length_precision");
+  QLabel* mySmpSizeLabel = new QLabel(tr("BLSURF_SM_SIZE"),mySmpStdGroup);
+  
+  // Attractor tab
+  myAttractorGroup = new QWidget();
+  QGridLayout* anAttLayout = new QGridLayout(myAttractorGroup);
+  myGeomSelWdg2 = new StdMeshersGUI_ObjectReferenceParamWdg( myFilter3, 0, /*multiSel=*/false,/*stretch=*/false);
+  myGeomSelWdg2->SetDefaultText(tr("BLS_SEL_FACE"), "QLineEdit { color: grey }");
+  myGeomSelWdg2->AvoidSimultaneousSelection(myGeomSelWdg1);
+  myAttractorCheck = new QCheckBox(tr("BLSURF_ATTRACTOR"),myAttractorGroup);
+  myConstSizeCheck = new QCheckBox(tr("BLSURF_CONST_SIZE"),myAttractorGroup);
+  QFrame* attLine  = new QFrame(myAttractorGroup);
+  attLine->setFrameShape(QFrame::HLine);
+  attLine->setFrameShadow(QFrame::Sunken);
+  myAttSelWdg = new StdMeshersGUI_ObjectReferenceParamWdg( myFilter2, myAttractorGroup, /*multiSel=*/false,/*stretch=*/false);
+  myAttSelWdg->SetDefaultText(tr("BLS_SEL_ATTRACTOR"), "QLineEdit { color: grey }"); 
+  myAttSizeSpin = new SMESHGUI_SpinBox(myAttractorGroup);
+  myAttSizeSpin->RangeStepAndValidator(0., COORD_MAX, 1.0, "length_precision");
+  myAttSizeLabel = new QLabel(tr("BLSURF_SM_SIZE"),myAttractorGroup);
+  myAttDistSpin = new SMESHGUI_SpinBox(myAttractorGroup);
+  myAttDistSpin->RangeStepAndValidator(0., COORD_MAX, 10.0, "length_precision");
+  myAttDistLabel = new QLabel(tr("BLSURF_ATT_DIST"),myAttractorGroup);
+  myAttDistSpin2 = new SMESHGUI_SpinBox(myAttractorGroup);
+  myAttDistSpin2->RangeStepAndValidator(0., COORD_MAX, 1.0, "length_precision");
+  myAttDistLabel2 = new QLabel(tr("BLSURF_ATT_RADIUS"),myAttractorGroup);
+  
+  myAttSelWdg->AvoidSimultaneousSelection(myGeomSelWdg1);
+  myAttSelWdg->AvoidSimultaneousSelection(myGeomSelWdg2);
+  
+  // Push buttons
+  
+  addMapButton = new QPushButton(tr("BLSURF_SM_ADD"),mySmpGroup);
+  removeMapButton = new QPushButton(tr("BLSURF_SM_REMOVE"),mySmpGroup);
+  modifyMapButton = new QPushButton(tr("BLSURF_SM_MODIFY"),mySmpGroup);
+  modifyMapButton->setEnabled(false);
+  
+  // Init SpinBoxes
+  myAttSelWdg->setEnabled(false);
+  myAttSizeSpin->setEnabled(false);
+  myAttSizeLabel->setEnabled(false);
+  myAttDistSpin->setEnabled(false);
+  myAttDistLabel->setEnabled(false);
+  myAttDistSpin2->setEnabled(false);
+  myAttDistLabel2->setEnabled(false);
+  myAttDistSpin->setValue(0.);
+  myAttDistSpin2->setValue(0.);
+  myAttSizeSpin->setValue(0.);
+  mySmpSizeSpin->setValue(0.);
+
+  
+  // ADD WIDGETS (SIZEMAP TAB)
+  anSmpLayout->addWidget(mySizeMapTable,     0,  0, SMP_NB_LINES, 1);
+  anSmpLayout->setColumnStretch(0, 1);
+//  anSmpLayout->addWidget(line2,              SMP_SEPARATOR2, 1, 2, 2);
+  anSmpLayout->addWidget(smpTab,             SMP_TAB_WDG,     1, 1, 3);
+  anSmpLayout->setRowStretch(SMP_TAB_WDG, 1);
+  anSmpLayout->addWidget(addMapButton,       SMP_ADD_BTN,     1, 1, 1);
+  anSmpLayout->addWidget(removeMapButton,    SMP_ADD_BTN,     2, 1, 1);
+  anSmpLayout->addWidget(modifyMapButton,    SMP_ADD_BTN,     3, 1, 1);
+  
+  // STANDARD TAB
+  anSmpStdLayout->addWidget(myGeomSelWdg1,   SMP_GEOM_BTN_1,  1, 1, 2);
+  anSmpStdLayout->addWidget(mySmpSizeLabel,  SMP_SIZE,        1, 1, 1);
+  anSmpStdLayout->addWidget(mySmpSizeSpin,   SMP_SIZE,        2, 1, 1);
+  anSmpStdLayout->setRowStretch(SMP_SPACE2, 1);
+  
+  // ADVANCED TAB
+  anAttLayout->addWidget(myGeomSelWdg2,      SMP_GEOM_BTN_2,  1, 1, 2);
+  anAttLayout->addWidget(myAttractorCheck,   ATT_CHECK,       1, 1, 2);
+  anAttLayout->addWidget(myConstSizeCheck,   CONST_SIZE_CHECK,1, 1, 2);
+  anAttLayout->addWidget(attLine,            SMP_SPACE,       1, 1, 2);
+  anAttLayout->addWidget(myAttSelWdg,        SMP_ATT_SHAPE,   1, 1, 2);
+  anAttLayout->addWidget(myAttSizeLabel,     SMP_ATT_SIZE,    1, 1, 1);
+  anAttLayout->addWidget(myAttSizeSpin,      SMP_ATT_SIZE,    2, 1, 1);
+  anAttLayout->addWidget(myAttDistLabel,     SMP_ATT_DIST,    1, 1, 1);
+  anAttLayout->addWidget(myAttDistSpin,      SMP_ATT_DIST,    2, 1, 1);
+  anAttLayout->addWidget(myAttDistLabel2,    SMP_ATT_RAD,     1, 1, 1);
+  anAttLayout->addWidget(myAttDistSpin2,     SMP_ATT_RAD,     2, 1, 1);
+  anAttLayout->setRowStretch(SMP_ATT_RAD+1, 1);
+  
+  smpTab->insertTab( SMP_STD_TAB, mySmpStdGroup, tr( "BLSURF_SM_STD_TAB" ) );
+  smpTab->insertTab( ATT_TAB, myAttractorGroup, tr( "BLSURF_SM_ATT_TAB" ) );
+
+  smpTab->setCurrentIndex( SMP_STD_TAB ); 
+
+  // Enforced vertices parameters
+  myEnfGroup = new QWidget();
+  QGridLayout* anEnfLayout = new QGridLayout(myEnfGroup);
+//
+//   myEnforcedVertexWidget = new DlgBlSurfHyp_Enforced(myEnfGroup);
+//   anEnfLayout->addWidget(myEnforcedVertexWidget);
+//   MESSAGE("Creating DlgBlSurfHyp_Enforced widget instance");
+//   myEnforcedVertexWidget = new DlgBlSurfHyp_Enforced();
+
+  myEnforcedTreeWidget = new QTreeWidget(myEnfGroup);
+  myEnforcedTreeWidget->setColumnCount( ENF_VER_NB_COLUMNS );
+  myEnforcedTreeWidget->setSortingEnabled(true);
+  QStringList enforcedHeaders;
+  enforcedHeaders << tr("BLSURF_ENF_VER_NAME_COLUMN") << tr("BLSURF_ENF_VER_FACE_ENTRY_COLUMN")
+                  << tr("BLSURF_ENF_VER_X_COLUMN")<< tr("BLSURF_ENF_VER_Y_COLUMN") << tr("BLSURF_ENF_VER_Z_COLUMN")
+                  << tr("BLSURF_ENF_VER_ENTRY_COLUMN") << tr( "BLSURF_ENF_VER_GROUP_COLUMN" );
+
+  myEnforcedTreeWidget->setHeaderLabels(enforcedHeaders);
+  myEnforcedTreeWidget->header()->setStretchLastSection(true);
+  myEnforcedTreeWidget->setAlternatingRowColors(true);
+  myEnforcedTreeWidget->setUniformRowHeights(true);
+  myEnforcedTreeWidget->setAnimated(true);
+  myEnforcedTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  myEnforcedTreeWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
+  for (int column = 0; column < ENF_VER_NB_COLUMNS; ++column) {
+    myEnforcedTreeWidget->header()->setResizeMode(column,QHeaderView::Interactive);
+    myEnforcedTreeWidget->resizeColumnToContents(column);
+  }
+  myEnforcedTreeWidget->hideColumn(ENF_VER_FACE_ENTRY_COLUMN);
+  myEnforcedTreeWidget->hideColumn(ENF_VER_ENTRY_COLUMN);
+  myEnforcedTreeWidget->setItemDelegate(new EnforcedTreeWidgetDelegate());
+  
+// FACE AND VERTEX SELECTION
+  TColStd_MapOfInteger shapeTypes1, shapeTypes2;
+  shapeTypes1.Add( TopAbs_FACE );
+  shapeTypes1.Add( TopAbs_COMPOUND );
+  shapeTypes2.Add( TopAbs_VERTEX );
+  shapeTypes2.Add( TopAbs_COMPOUND );
+
+  SMESH_NumberFilter* faceFilter = new SMESH_NumberFilter("GEOM", TopAbs_FACE, 0, shapeTypes1);
+  myEnfFaceWdg = new StdMeshersGUI_ObjectReferenceParamWdg( faceFilter, 0, /*multiSel=*/true, /*stretch=*/false);
+  myEnfFaceWdg->SetDefaultText(tr("BLS_SEL_FACES"), "QLineEdit { color: grey }");
+
+  SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes2);
+  myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true, /*stretch=*/false);
+  myEnfVertexWdg->SetDefaultText(tr("BLS_SEL_VERTICES"), "QLineEdit { color: grey }");
+
+  myEnfVertexWdg->AvoidSimultaneousSelection(myEnfFaceWdg);
+
+  QLabel* myXCoordLabel = new QLabel( tr( "BLSURF_ENF_VER_X_LABEL" ), myEnfGroup );
+  myXCoord = new SMESHGUI_SpinBox(myEnfGroup);
+  myXCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+
+  QLabel* myYCoordLabel = new QLabel( tr( "BLSURF_ENF_VER_Y_LABEL" ), myEnfGroup );
+  myYCoord = new SMESHGUI_SpinBox(myEnfGroup);
+  myYCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+
+  QLabel* myZCoordLabel = new QLabel( tr( "BLSURF_ENF_VER_Z_LABEL" ), myEnfGroup );
+  myZCoord = new SMESHGUI_SpinBox(myEnfGroup);
+  myZCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision");
+
+  QLabel* myGroupNameLabel = new QLabel( tr( "BLSURF_ENF_VER_GROUP_LABEL" ), myEnfGroup );
+  myGroupName = new QLineEdit(myEnfGroup);
+
+  addVertexButton = new QPushButton(tr("BLSURF_ENF_VER_VERTEX"),myEnfGroup);
+  removeVertexButton = new QPushButton(tr("BLSURF_ENF_VER_REMOVE"),myEnfGroup);
+
+  myInternalEnforcedVerticesAllFaces = new QCheckBox(tr("BLSURF_ENF_VER_INTERNAL_VERTICES"),myEnfGroup);
+
+  QLabel* myInternalEnforcedVerticesAllFacesGroupLabel = new QLabel( tr( "BLSURF_ENF_VER_GROUP_LABEL" ), myEnfGroup );
+  myInternalEnforcedVerticesAllFacesGroup = new QLineEdit(myEnfGroup);
+
+//   myGlobalGroupName = new QCheckBox(tr("BLSURF_ENF_VER_GROUPS"), myEnfGroup);
+//   myGlobalGroupName->setChecked(false);
+
+  anEnfLayout->addWidget(myEnforcedTreeWidget,     0, 0, ENF_VER_NB_LINES, 1);
+  QGridLayout* anEnfLayout2 = new QGridLayout(myEnfGroup);
+//  FACE AND VERTEX SELECTION
+  anEnfLayout2->addWidget(myEnfFaceWdg,             ENF_VER_FACE, 0, 1, 2);
+  anEnfLayout2->addWidget(myEnfVertexWdg,           ENF_VER_VERTEX, 0, 1, 2);
+  anEnfLayout2->addWidget(myXCoordLabel,            ENF_VER_X_COORD, 0, 1, 1);
+  anEnfLayout2->addWidget(myXCoord,                 ENF_VER_X_COORD, 1, 1, 1);
+  anEnfLayout2->addWidget(myYCoordLabel,            ENF_VER_Y_COORD, 0, 1, 1);
+  anEnfLayout2->addWidget(myYCoord,                 ENF_VER_Y_COORD, 1, 1, 1);
+  anEnfLayout2->addWidget(myZCoordLabel,            ENF_VER_Z_COORD, 0, 1, 1);
+  anEnfLayout2->addWidget(myZCoord,                 ENF_VER_Z_COORD, 1, 1, 1);
+  anEnfLayout2->addWidget(myGroupNameLabel,         ENF_VER_GROUP, 0, 1, 1);
+  anEnfLayout2->addWidget(myGroupName,              ENF_VER_GROUP, 1, 1, 1);
+//   anEnfLayout2->addWidget(myGlobalGroupName,        ENF_VER_GROUP_CHECK, 0, 1, 2);
+//   anEnfLayout2->setRowStretch(                      ENF_VER_SPACE, 1);
+  anEnfLayout2->addWidget(addVertexButton,          ENF_VER_BTN, 0, 1, 1);
+  anEnfLayout2->addWidget(removeVertexButton,       ENF_VER_BTN, 1, 1, 1);
+  anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFaces, ENF_VER_INTERNAL_ALL_FACES, 0, 1, 2);
+  anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFacesGroupLabel, ENF_VER_INTERNAL_ALL_FACES_GROUP, 0, 1, 1);
+  anEnfLayout2->addWidget(myInternalEnforcedVerticesAllFacesGroup, ENF_VER_INTERNAL_ALL_FACES_GROUP, 1, 1, 1);
+  anEnfLayout2->setRowStretch(ENF_VER_NB_LINES+1, 1);
+//   anEnfLayout2->addWidget(makeGroupsCheck,          ENF_VER_GROUP_CHECK, 0, 1, 2);
+  anEnfLayout->addLayout(anEnfLayout2, 0,1,ENF_VER_NB_LINES+1,2);
+//   anEnfLayout->setRowStretch(1, 1);
 
   // ---
   tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
-  tab->insertTab( ADV_TAB, myAdvGroup, tr( "GHS3D_ADV_ARGS" ) );
+  tab->insertTab( ADV_TAB, myAdvGroup, tr( "BLSURF_ADV_ARGS" ) );
+  tab->insertTab( SMP_TAB, mySmpGroup, tr( "BLSURF_SIZE_MAP" ) );
+  tab->insertTab( ENF_TAB, myEnfGroup, tr( "BLSURF_ENF_VER" ) );
+
   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() ) );
+  connect( myGeometricMesh,     SIGNAL( activated( int ) ),            this,         SLOT( onGeometricMeshChanged() ) );
+  connect( myPhysicalMesh,      SIGNAL( activated( int ) ),            this,         SLOT( onPhysicalMeshChanged() ) );
+  connect( myTopology,          SIGNAL( activated( int ) ),            this,         SLOT( onTopologyChanged( int ) ) );
+  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() ) );
+  connect( chooseGMFBtn,        SIGNAL( clicked()),                    this,         SLOT( onChooseGMFFile() ) );
+
+  // Size Maps
+  connect( addMapButton,        SIGNAL( clicked()),                    this,         SLOT( onAddMap() ) );
+  connect( removeMapButton,     SIGNAL( clicked()),                    this,         SLOT( onRemoveMap() ) );
+  connect( modifyMapButton,     SIGNAL( clicked()),                    this,         SLOT( onModifyMap() ) );
+//   connect( mySizeMapTable,      SIGNAL( cellChanged ( int, int  )),    this,         SLOT( onSetSizeMap(int,int ) ) );
+  connect( mySizeMapTable,      SIGNAL( itemClicked (QTreeWidgetItem *, int)),this,  SLOT( onSmpItemClicked(QTreeWidgetItem *, int) ) );
+  connect( myGeomSelWdg2,       SIGNAL( contentModified() ),           this,         SLOT( onMapGeomContentModified() ) );
+  connect( myGeomSelWdg1,       SIGNAL( contentModified() ),           this,         SLOT( onMapGeomContentModified() ) );
+//   connect( myAttractorGroup,    SIGNAL( clicked(bool) ),               this,         SLOT( onAttractorGroupClicked(bool) ) );
+  connect( mySizeMapTable,      SIGNAL( itemChanged (QTreeWidgetItem *, int)),this,  SLOT( onSetSizeMap(QTreeWidgetItem *, int) ) );
+  connect( myAttractorCheck,    SIGNAL( stateChanged ( int )),         this,         SLOT( onAttractorClicked( int ) ) );
+  connect( myConstSizeCheck,    SIGNAL( stateChanged ( int )),         this,         SLOT( onConstSizeClicked( int ) ) );
+  connect( smpTab,              SIGNAL( currentChanged ( int )),       this,         SLOT( onSmpTabChanged( int ) ) );
+
+  // Enforced vertices
+  connect( myEnforcedTreeWidget,SIGNAL( itemClicked(QTreeWidgetItem *, int)), this,  SLOT( synchronizeCoords() ) );
+  connect( myEnforcedTreeWidget,SIGNAL( itemChanged(QTreeWidgetItem *, int)), this,  SLOT( updateEnforcedVertexValues(QTreeWidgetItem *, int) ) );
+//   connect( myEnforcedTreeWidget,SIGNAL( itemChanged(QTreeWidgetItem *, int)), this,  SLOT( update(QTreeWidgetItem *, int) ) );
+  connect( myEnforcedTreeWidget,SIGNAL( itemSelectionChanged() ),      this,         SLOT( synchronizeCoords() ) );
+  connect( addVertexButton,     SIGNAL( clicked()),                    this,         SLOT( onAddEnforcedVertices() ) );
+  connect( removeVertexButton,  SIGNAL( clicked()),                    this,         SLOT( onRemoveEnforcedVertex() ) );
+  connect( myEnfVertexWdg,      SIGNAL( contentModified()),            this,         SLOT( onSelectEnforcedVertex() ) );
+  connect( myInternalEnforcedVerticesAllFaces, SIGNAL( stateChanged ( int )), this,  SLOT( onInternalVerticesClicked( int ) ) );
+//   connect( myEnfVertexWdg,     SIGNAL( selectionActivated()),         this,         SLOT( onVertexSelectionActivated() ) );
+//   connect( myEnfFaceWdg,       SIGNAL( selectionActivated()),         this,         SLOT( onFaceSelectionActivated() ) );
 
   return fr;
 }
 
+/** BLSURFPluginGUI_HypothesisCreator::deactivateSelection(QWidget*, QWidget*)
+This method stop the selection of the widgets StdMeshersGUI_ObjectReferenceParamWdg
+*/
+// void BLSURFPluginGUI_HypothesisCreator::deactivateSelection(QWidget* old, QWidget* now)
+// {
+//   if ((now == myXCoord) || (now == myYCoord) || (now == myZCoord)
+//       || (now = myGroupName) || (now = myGlobalGroupName) || (now = myEnforcedTreeWidget)) {
+//     BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+//     that->getGeomSelectionTool()->selectionMgr()->clearFilters();
+//     myEnfFaceWdg->deactivateSelection();
+//     myEnfVertexWdg->deactivateSelection();
+//   }
+// }
+
+/** 
+ * This method resets the content of the X, Y, Z widgets;
+**/
+void BLSURFPluginGUI_HypothesisCreator::clearEnforcedVertexWidgets()
+{
+  myXCoord->setCleared(true);
+  myYCoord->setCleared(true);
+  myZCoord->setCleared(true);
+  myXCoord->setText("");
+  myYCoord->setText("");
+  myZCoord->setText("");
+//   myGroupName->setText("");
+}
+
+/** BLSURFPluginGUI_HypothesisCreator::updateEnforcedVertexValues(item, column)
+This method updates the tooltip of a modified item. The QLineEdit widgets content
+is synchronized with the coordinates of the enforced vertex clicked in the tree widget.
+*/
+void BLSURFPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTreeWidgetItem* item, int column) {
+//   MESSAGE("BLSURFPluginGUI_HypothesisCreator::updateEnforcedVertexValues");
+  QVariant vertexName = item->data(ENF_VER_NAME_COLUMN, Qt::EditRole);
+  QVariant x = item->data(ENF_VER_X_COLUMN, Qt::EditRole);
+  QVariant y = item->data(ENF_VER_Y_COLUMN, Qt::EditRole);
+  QVariant z = item->data(ENF_VER_Z_COLUMN, Qt::EditRole);
+  QVariant entry = item->data(ENF_VER_ENTRY_COLUMN, Qt::EditRole);
+  QString groupName = item->data(ENF_VER_GROUP_COLUMN, Qt::EditRole).toString();
+  QTreeWidgetItem* parent = item->parent();
+  
+  clearEnforcedVertexWidgets();
+  
+  if (parent && (!x.isNull() || !entry.isNull())) {
+      QString shapeName = parent->data(ENF_VER_NAME_COLUMN, Qt::EditRole).toString();
+      QString toolTip = shapeName + QString(": ") + vertexName.toString();
+      if (entry.isNull()) {
+        toolTip += QString("(") + x.toString();
+        toolTip += QString(", ") + y.toString();
+        toolTip += QString(", ") + z.toString();
+        toolTip += QString(")");
+      }
+      
+      if (!groupName.isEmpty())
+        toolTip += QString(" [") + groupName + QString("]");
+
+      item->setToolTip(ENF_VER_NAME_COLUMN,toolTip);
+
+    if (!x.isNull()) {
+      myXCoord->SetValue(x.toDouble());
+      myYCoord->SetValue(y.toDouble());
+      myZCoord->SetValue(z.toDouble());
+    }
+    
+    if (!groupName.isEmpty())
+      myGroupName->setText(groupName);
+  }
+}
+
+void BLSURFPluginGUI_HypothesisCreator::onSelectEnforcedVertex() {
+  int nbSelEnfVertex = myEnfVertexWdg->NbObjects();
+  clearEnforcedVertexWidgets();
+  if (nbSelEnfVertex == 1)
+  {
+    if ( CORBA::is_nil( getGeomEngine() ) && !GeometryGUI::InitGeomGen() )
+    return ;
+
+    myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(nbSelEnfVertex-1);
+    if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
+      BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+      GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() );
+      if (CORBA::is_nil(measureOp))
+        return;
+      
+      CORBA::Double x,y,z;
+      measureOp->PointCoordinates (myEnfVertex, x, y, z);
+      if ( measureOp->IsDone() )
+      {
+        myXCoord->SetValue(x);
+        myYCoord->SetValue(y);
+        myZCoord->SetValue(z);
+      }
+    }
+  }
+}
+
+/** BLSURFPluginGUI_HypothesisCreator::synchronizeCoords()
+This method synchronizes the QLineEdit/SMESHGUI_SpinBox widgets content with the coordinates
+of the enforced vertex clicked in the tree widget.
+*/
+void BLSURFPluginGUI_HypothesisCreator::synchronizeCoords() {
+  clearEnforcedVertexWidgets();
+  QList<QTreeWidgetItem *> items = myEnforcedTreeWidget->selectedItems();
+  if (! items.isEmpty() && items.size() == 1) {
+    QTreeWidgetItem *item = items[0];
+//     for (int i=0 ; i < items.size() ; i++) {
+//       item = items[i];
+      QVariant x = item->data(ENF_VER_X_COLUMN, Qt::EditRole);
+      QVariant y = item->data(ENF_VER_Y_COLUMN, Qt::EditRole);
+      QVariant z = item->data(ENF_VER_Z_COLUMN, Qt::EditRole);
+      QVariant entry = item->data(ENF_VER_ENTRY_COLUMN, Qt::EditRole);
+      QVariant group = item->data(ENF_VER_GROUP_COLUMN, Qt::EditRole);
+      if (!x.isNull()/* && entry.isNull()*/) {
+        myXCoord->SetValue(x.toDouble());
+        myYCoord->SetValue(y.toDouble());
+        myZCoord->SetValue(z.toDouble());
+//         break;
+      }
+      if (!group.isNull() && (!x.isNull() || !entry.isNull()))
+        myGroupName->setText(group.toString());
+//     }
+  }
+}
+
+/** BLSURFPluginGUI_HypothesisCreator::addEnforcedFace(entry, shapeName, useInternalVertices)
+This method adds a face containing enforced vertices in the tree widget.
+*/
+QTreeWidgetItem* BLSURFPluginGUI_HypothesisCreator::addEnforcedFace(std::string theFaceEntry, std::string theFaceName) {
+  // Find theFaceEntry item
+  QList<QTreeWidgetItem* > theItemList = myEnforcedTreeWidget->findItems(QString(theFaceEntry.c_str()),Qt::MatchExactly,ENF_VER_FACE_ENTRY_COLUMN);
+  QTreeWidgetItem* theItem;
+  if (theItemList.empty()) {
+    theItem = new QTreeWidgetItem();
+    theItem->setData(ENF_VER_FACE_ENTRY_COLUMN, Qt::EditRole, QVariant(theFaceEntry.c_str()));
+    theItem->setData(ENF_VER_NAME_COLUMN, Qt::EditRole, QVariant(theFaceName.c_str()));
+    theItem->setToolTip(ENF_VER_NAME_COLUMN,QString(theFaceEntry.c_str()));
+    myEnforcedTreeWidget->addTopLevelItem(theItem);
+  }
+  else {
+    theItem = theItemList[0];
+  }
+  return theItem;
+}
+
+/** BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(entry, shapeName, x, y, z)
+This method adds an enforced vertex (x,y,z) to shapeName in the tree widget.
+*/
+void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(QTreeWidgetItem* theItem, double x, double y, double z, 
+                                                          std::string vertexName, std::string geomEntry, std::string groupName) {
+
+  std::string theFaceName = theItem->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString().toStdString();
+//   MESSAGE("theItemName is " << theItem->text(ENF_VER_NAME_COLUMN).toStdString());
+  bool okToCreate = true;
+
+  const int nbVert = theItem->childCount();
+//   MESSAGE("Number of child rows: " << nbVert);
+  if (nbVert >0) {
+    double childValueX,childValueY,childValueZ;
+    QString childEntry, childGroupName;
+    QTreeWidgetItem* child;
+    for (int row = 0;row<nbVert;row++) {
+      child = theItem->child(row);
+      childGroupName = child->data(ENF_VER_GROUP_COLUMN,Qt::EditRole).toString();
+      childEntry = child->data(ENF_VER_ENTRY_COLUMN,Qt::EditRole).toString();
+      childValueX = child->data(ENF_VER_X_COLUMN,Qt::EditRole).toDouble();
+      childValueY = child->data(ENF_VER_Y_COLUMN,Qt::EditRole).toDouble();
+      childValueZ = child->data(ENF_VER_Z_COLUMN,Qt::EditRole).toDouble();
+      if (((childValueX == x) && (childValueY == y) && (childValueZ == z)) || ( (childEntry.toStdString() != "") && (childEntry.toStdString() == geomEntry))) {
+        // update group name
+        if (childGroupName.toStdString() != groupName) {
+          MESSAGE("Group is updated from \"" << childGroupName.toStdString() << "\" to \"" << groupName << "\"");
+          child->setData(ENF_VER_GROUP_COLUMN, Qt::EditRole, QVariant(groupName.c_str()));
+        }
+        okToCreate = false;
+        break;
+      } // if
+    } // for
+  } // if
+  if (!okToCreate) {
+    if (geomEntry.empty()) {
+      MESSAGE("In " << theFaceName << " vertex with coords " << x << ", " << y << ", " << z << " already exist: dont create again");
+    }
+    else {
+      MESSAGE("In " << theFaceName << " vertex with entry " << geomEntry << " already exist: dont create again");
+    }
+    return;
+  }
+    
+  if (geomEntry.empty()) {
+    MESSAGE("In " << theFaceName << " vertex with coords " << x << ", " << y << ", " << z<< " is created");
+  }
+  else {
+    MESSAGE("In " << theFaceName << " vertex with geom entry " << geomEntry << " is created");
+  }
+
+  QTreeWidgetItem *vertexItem = new QTreeWidgetItem( theItem);
+  vertexItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
+  QPixmap iconSelect (SUIT_Session::session()->resourceMgr()->loadPixmap("SMESH", tr("ICON_SELECT")));
+  QSize iconSize = iconSelect.size()*0.7;
+  
+  int vertexIndex=myEnforcedTreeWidget->indexOfTopLevelItem(theItem);
+  QString myVertexName;
+  int indexRef = -1;
+  while(indexRef != vertexIndex) {
+    indexRef = vertexIndex;
+    if (vertexName.empty())
+      myVertexName = QString("Vertex #%1").arg(vertexIndex);
+    else
+      myVertexName = QString(vertexName.c_str());
+
+    for (int row = 0;row<nbVert;row++) {
+      QString name = theItem->child(row)->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString();
+      if (myVertexName == name) {
+        vertexIndex++;
+        break;
+      }
+    }
+  }
+  vertexItem->setData( ENF_VER_NAME_COLUMN, Qt::EditRole, myVertexName );
+  if (geomEntry.empty()) {
+    vertexItem->setData( ENF_VER_X_COLUMN, Qt::EditRole, QVariant(x) );
+    vertexItem->setData( ENF_VER_Y_COLUMN, Qt::EditRole, QVariant(y) );
+    vertexItem->setData( ENF_VER_Z_COLUMN, Qt::EditRole, QVariant(z) );
+  }
+  else {
+    vertexItem->setIcon(ENF_VER_NAME_COLUMN, QIcon(iconSelect.scaled(iconSize,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
+    vertexItem->setData( ENF_VER_ENTRY_COLUMN, Qt::EditRole, QString(geomEntry.c_str()) );
+  }
+  if (groupName != "")
+    vertexItem->setData( ENF_VER_GROUP_COLUMN, Qt::EditRole, QVariant(groupName.c_str()));
+
+  QString toolTip = QString(theFaceName.c_str())+QString(": ")+myVertexName;
+  if (geomEntry.empty()) {
+    toolTip += QString(" (%1, ").arg(x);
+    toolTip += QString("%1, ").arg(y);
+    toolTip += QString("%1)").arg(z);
+  }
+  if (groupName != "")
+    toolTip += QString(" [%1]").arg(groupName.c_str());
+  
+  vertexItem->setToolTip(ENF_VER_NAME_COLUMN,toolTip);
+  theItem->setExpanded(true);
+  myEnforcedTreeWidget->setCurrentItem(vertexItem,ENF_VER_NAME_COLUMN);
+}
+
+/** BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices()
+This method is called when a item is added into the enforced vertices tree widget
+*/
+void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() {
+//   MESSAGE("BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices");
+
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+
+  that->getGeomSelectionTool()->selectionMgr()->clearFilters();
+  myEnfFaceWdg->deactivateSelection();
+  myEnfVertexWdg->deactivateSelection();
+
+  for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column)
+    myEnforcedTreeWidget->resizeColumnToContents(column);
+
+  // Vertex selection
+  int selEnfFace   = myEnfFaceWdg->NbObjects();
+  int selEnfVertex = myEnfVertexWdg->NbObjects();
+  bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty());
+
+  if (selEnfFace == 0)
+    return;
+
+  if ((selEnfVertex == 0) && coordsEmpty)
+    return;
+
+  string entry, shapeName;
+
+  for (int i = 0 ; i < selEnfFace ; i++) {
+    myEnfFace = myEnfFaceWdg->GetObject< GEOM::GEOM_Object >(i);
+    entry = myEnfFace->GetStudyEntry();
+    shapeName = myEnfFace->GetName();
+    
+    QTreeWidgetItem * faceItem = addEnforcedFace(entry, shapeName);
+    
+    std::string groupName = myGroupName->text().toStdString();
+
+    if (boost::trim_copy(groupName).empty())
+      groupName = "";
+
+    if (selEnfVertex == 1)
+    {
+      double x,y,z;
+      x = myXCoord->GetValue();
+      y = myYCoord->GetValue();
+      z = myZCoord->GetValue();
+      if (selEnfVertex == 1) {
+        myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >();
+        addEnforcedVertex(faceItem, x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
+      }
+      else
+        addEnforcedVertex(faceItem, x, y, z, "", "", groupName);
+    }
+    else
+    {
+      if ( CORBA::is_nil(getGeomEngine()))
+        return;
+
+      GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() );
+      if (CORBA::is_nil(measureOp))
+        return;
+
+      CORBA::Double x,y,z;
+      x = y = z = 0.;
+      for (int j = 0 ; j < selEnfVertex ; j++)
+      {
+        myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(j);
+        if (myEnfVertex->GetShapeType() == GEOM::VERTEX) {
+          measureOp->PointCoordinates (myEnfVertex, x, y, z);
+          if ( measureOp->IsDone() )
+            addEnforcedVertex(faceItem, x, y, z, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
+        } else if (myEnfVertex->GetShapeType() == GEOM::COMPOUND) {
+            addEnforcedVertex(faceItem, 0, 0, 0, myEnfVertex->GetName(),myEnfVertex->GetStudyEntry(), groupName);
+        }
+      }
+    }
+  }
+
+  myEnfFaceWdg->SetObject(GEOM::GEOM_Object::_nil());
+  myEnfVertexWdg->SetObject(GEOM::GEOM_Object::_nil());
+  
+  for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column)
+    myEnforcedTreeWidget->resizeColumnToContents(column);
+
+  if ( myPhysicalMesh->currentIndex() != SizeMap ) {
+    myPhysicalMesh->setCurrentIndex( SizeMap );
+    onPhysicalMeshChanged();
+  }
+}
+
+/** BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
+This method is called when a item is removed from the enforced vertices tree widget
+*/
+void BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() {
+//   MESSAGE("BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex");
+  QList<QTreeWidgetItem *> selectedItems = myEnforcedTreeWidget->selectedItems();
+  QList<QTreeWidgetItem *> selectedVertices;
+  QSet<QTreeWidgetItem *> selectedEntries;
+  QTreeWidgetItem* item;
+
+  foreach( item, selectedItems ) {
+    QVariant value = item->data(ENF_VER_X_COLUMN, Qt::EditRole);
+    if (! value.isNull())
+      selectedVertices.append(item);
+    else {
+      value = item->data(ENF_VER_ENTRY_COLUMN, Qt::EditRole);
+      if (! value.isNull())
+        selectedVertices.append(item);
+      else
+        selectedEntries.insert(item);
+    }
+  }
+
+  foreach(item,selectedVertices) {
+    QTreeWidgetItem* parent = item->parent();
+//     MESSAGE("From geometry "<< parent->text(ENF_VER_NAME_COLUMN).toStdString()<<" remove " << item->text(ENF_VER_NAME_COLUMN).toStdString());
+    parent->removeChild(item);
+    delete item;
+    if (parent->childCount() == 0) {
+      if (selectedEntries.contains(parent))
+        selectedEntries.remove(parent);
+      delete parent;
+    }
+  }
+
+  foreach(item,selectedEntries) {
+//     MESSAGE("Remove " << item->text(ENF_VER_NAME_COLUMN).toStdString());
+    delete item;
+  }
+
+  myEnforcedTreeWidget->selectionModel()->clearSelection();
+}
+
+
+void BLSURFPluginGUI_HypothesisCreator::onInternalVerticesClicked(int state)
+{
+  if (state == Qt::Checked) {
+    myInternalEnforcedVerticesAllFacesGroup->setEnabled(true);
+  }
+  if (state == Qt::Unchecked) {
+    myInternalEnforcedVerticesAllFacesGroup->setEnabled(false);
+  }
+}
+
+/** BLSURFPluginGUI_HypothesisCreator::retrieveParams()
+This method updates the GUI widgets with the hypothesis data
+*/
 void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
 {
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::retrieveParams");
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
 
   BlsurfHypothesisData data;
@@ -317,49 +1507,180 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const
     myName->setMinimumWidth( metrics.width( data.myName )+5 );
   }
   myTopology->setCurrentIndex( data.myTopology );
+  myPreCADGroupBox->setEnabled(data.myTopology == PreCAD);
+  myPreCADMergeEdges->setChecked( data.myPreCADMergeEdges );
+  myPreCADRemoveNanoEdges->setChecked( data.myPreCADRemoveNanoEdges );
+  myPreCADDiscardInput->setChecked( data.myPreCADDiscardInput );
+  MESSAGE("data.myPreCADEpsNano: "<<data.myPreCADEpsNano)
+  if (data.myPreCADEpsNano < 0)
+    myPreCADEpsNano->setText("");
+  else
+    myPreCADEpsNano->SetValue( data.myPreCADEpsNano );
   myPhysicalMesh->setCurrentIndex( data.myPhysicalMesh );
-  myPhySize->setText( data.myPhySize );
+  myPhySize->SetValue( data.myPhySize );
 #ifdef WITH_SIZE_BOUNDARIES
-  myPhyMin->setText( data.myPhyMin );
-  myPhyMax->setText( data.myPhyMax );
-  myGeoMin->setText( data.myGeoMin );
-  myGeoMax->setText( data.myGeoMax );
+  MESSAGE("data.myPhyMin: "<<data.myPhyMin)
+  if (data.myPhyMin < 0)
+    myPhyMin->setText("");
+  else
+    myPhyMin->SetValue( data.myPhyMin );
+  MESSAGE("data.myPhyMax: "<<data.myPhyMax)
+  if (data.myPhyMax < 0)
+    myPhyMax->setText("");
+  else
+    myPhyMax->SetValue( data.myPhyMax );
+  MESSAGE("data.myGeoMin: "<<data.myGeoMin)
+  if (data.myGeoMin < 0)
+    myGeoMin->setText("");
+  else
+    myGeoMin->SetValue( data.myGeoMin );
+  MESSAGE("data.myGeoMax: "<<data.myGeoMax)
+  if (data.myGeoMax < 0)
+    myGeoMax->setText("");
+  else
+    myGeoMax->SetValue( data.myGeoMax );
 #endif
   myGeometricMesh->setCurrentIndex( data.myGeometricMesh );
-  myAngleMeshS->setValue( data.myAngleMeshS );
-  myAngleMeshC->setValue( data.myAngleMeshC );
-  myGradation->setValue( data.myGradation );
+  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());
+//     MESSAGE("retrieveParams():myOptions->length() = " << 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->setRowCount( row+1 );
+        myOptionTable->setItem( row, OPTION_ID_COLUMN, new QTableWidgetItem( idStr ) );
+        myOptionTable->item( row, OPTION_ID_COLUMN )->setFlags( 0 );
+        myOptionTable->setItem( row, OPTION_TYPE_COLUMN, new QTableWidgetItem( "BLSURF" ) );
+        myOptionTable->item( row, OPTION_TYPE_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 );
       }
-    } 
+    }
+  }
+  if ( myPreCADOptions.operator->() ) {
+//     MESSAGE("retrieveParams():myPreCADOptions->length() = " << myPreCADOptions->length());
+    for ( int i = 0, nb = myPreCADOptions->length(); i < nb; ++i ) {
+      QString option = that->myPreCADOptions[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_TYPE_COLUMN, new QTableWidgetItem( "PRECAD" ) );
+        myOptionTable->item( row, OPTION_TYPE_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 );
+  myGMFFileName->setText(QString(data.myGMFFileName.c_str()));
+//   myGMFFileMode->setChecked(data.myGMFFileMode);
+  
+  // Sizemaps
+  MESSAGE("retrieveParams():that->mySMPMap.size() = " << that->mySMPMap.size());
+  QMapIterator<QString, QString> i(that->mySMPMap);
+  GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool();
+  while (i.hasNext()) {
+    i.next();
+    const QString entry = i.key();
+    const QString sizeMap = i.value();
+    string shapeName = myGeomToolSelected->getNameFromEntry(entry.toStdString()); 
+    int row = mySizeMapTable->topLevelItemCount();
+    QTreeWidgetItem* item = new QTreeWidgetItem();
+    mySizeMapTable->addTopLevelItem( item ); 
+    item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
+    item->setData(SMP_ENTRY_COLUMN,Qt::DisplayRole, QVariant(entry) );
+    item->setData(SMP_NAME_COLUMN, Qt::DisplayRole, QVariant( QString::fromStdString(shapeName) ) );
+    if (that->myATTMap.contains(entry)){
+      const QString attEntry = that->myATTMap[entry];
+      std::string attName = myGeomToolSelected->getNameFromEntry(attEntry.toStdString());
+      QTreeWidgetItem* child = new QTreeWidgetItem();
+      item->addChild( child );
+      item->setExpanded(true);
+      child->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant( sizeMap  ) );
+      child->setData(SMP_ENTRY_COLUMN, Qt::DisplayRole, QVariant( attEntry  ) );
+      child->setData(SMP_NAME_COLUMN, Qt::DisplayRole, QVariant( QString::fromStdString( attName ) ) );
+   
+      if (that->myAttDistMap[entry] >  std::numeric_limits<double>::epsilon()){
+        item->setData(SMP_SIZEMAP_COLUMN, Qt::DisplayRole, QVariant( QString::fromStdString("Attractor" )  ) ); 
+      }
+      else{
+        item->setData(SMP_SIZEMAP_COLUMN, Qt::DisplayRole, QVariant( QString::fromStdString("Constant Size" )  ) );
+      }
+    }
+    else
+    {
+      item->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant( sizeMap ) );
+    } 
+  }
+  mySizeMapTable->resizeColumnToContents( SMP_ENTRY_COLUMN );
+  mySizeMapTable->resizeColumnToContents( SMP_NAME_COLUMN );
+  mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN);
+
+  // Enforced vertices
+  MESSAGE("retrieveParams(): data.entryCoordsListMap.size() = " << data.faceEntryEnfVertexListMap.size());
+  TFaceEntryEnfVertexListMap::const_iterator evmIt = data.faceEntryEnfVertexListMap.begin();
+
+  for ( ; evmIt != data.faceEntryEnfVertexListMap.end() ; ++evmIt) {
+    TEntry entry = (*evmIt).first;
+    std::string shapeName = myGeomToolSelected->getNameFromEntry(entry);
+    MESSAGE("Face entry: " << entry);
+    MESSAGE("Face name: " << shapeName);
+    
+    QTreeWidgetItem* faceItem = that->addEnforcedFace(entry, shapeName);
+
+    TEnfVertexList evs = (*evmIt).second;
+
+    TEnfVertexList::const_iterator evsIt = evs.begin();
+    TEnfVertex *enfVertex;
+    for ( ; evsIt != evs.end() ; ++evsIt) {
+      enfVertex = (*evsIt);
+      MESSAGE("Name: " << enfVertex->name);
+      double x, y, z = 0;
+      if (enfVertex->coords.size()) {
+        x = enfVertex->coords[0];
+        y = enfVertex->coords[1];
+        z = enfVertex->coords[2];
+      }
+      that->addEnforcedVertex(faceItem, x, y, z, enfVertex->name, enfVertex->geomEntry, enfVertex->grpName);
+    }
+  }
+  
+  for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column)
+    myEnforcedTreeWidget->resizeColumnToContents(column);
+
+  myInternalEnforcedVerticesAllFaces->setChecked(data.myInternalEnforcedVerticesAllFaces);
+  myInternalEnforcedVerticesAllFacesGroup->setText(QString(data.myInternalEnforcedVerticesAllFacesGroup.c_str()));
+  myInternalEnforcedVerticesAllFacesGroup->setEnabled(data.myInternalEnforcedVerticesAllFaces);
 
   // update widgets
   that->onPhysicalMeshChanged();
   that->onGeometricMeshChanged();
 }
 
+/** BLSURFPluginGUI_HypothesisCreator::storeParams()
+This method updates the hypothesis data with the GUI widgets content.
+*/
 QString BLSURFPluginGUI_HypothesisCreator::storeParams() const
 {
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
@@ -371,45 +1692,194 @@ QString BLSURFPluginGUI_HypothesisCreator::storeParams() const
   return guiHyp;
 }
 
+/** BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo(h_data)
+Updates the hypothesis data from hypothesis values.
+*/
 bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData& h_data ) const
 {
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo");
   BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
     BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis() );
 
   HypothesisData* data = SMESH::GetHypothesisData( hypType() );
   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.myVerbosity        = h->GetVerbosity();
+  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.myAngleMeshC         = h->GetAngleMeshC();
+  h_data.myGradation          = h->GetGradation();
+  h_data.myAllowQuadrangles   = h->GetQuadAllowed();
+  h_data.myDecimesh           = h->GetDecimesh();
+  h_data.myVerbosity          = h->GetVerbosity();
+  h_data.myPreCADMergeEdges   = h->GetPreCADMergeEdges();
+  h_data.myPreCADRemoveNanoEdges = h->GetPreCADRemoveNanoEdges();
+  h_data.myPreCADDiscardInput = h->GetPreCADDiscardInput();
+  double EpsNano = h->GetPreCADEpsNano();
+  h_data.myPreCADEpsNano      = EpsNano > 0 ? EpsNano : -1.0;
 
 #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("");
+//   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("");
+  h_data.myPhyMin = PhyMin > 0 ? PhyMin : -1.0;
+  h_data.myPhyMax = PhyMax > 0 ? PhyMax : -1.0;
+  h_data.myGeoMin = GeoMin > 0 ? GeoMin : -1.0;
+  h_data.myGeoMax = GeoMax > 0 ? GeoMax : -1.0;
 #endif
 
   BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
   that->myOptions = h->GetOptionValues();
+  that->myPreCADOptions = h->GetPreCADOptionValues();
+  
+  h_data.myGMFFileName = h->GetGMFFile();
+//   h_data.myGMFFileMode = h->GetGMFFileMode();
+
+  that->mySMPMap.clear();
+  that->myATTMap.clear();
+  that->myAttDistMap.clear();
+  that->myDistMap.clear();
+
+  // classic size maps
+  BLSURFPlugin::string_array_var mySizeMaps = h->GetSizeMapEntries();
+//   MESSAGE("mySizeMaps->length() = " << mySizeMaps->length());
+  QString fullSizeMaps;
+  QStringList fullSizeMapList;
+  GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool();
+  for ( int i = 0;i<mySizeMaps->length(); ++i ) {
+    fullSizeMaps =  mySizeMaps[i].in();
+//     MESSAGE("fullSizeMaps: " << fullSizeMaps.toStdString());
+    fullSizeMapList = fullSizeMaps.split( "|", QString::KeepEmptyParts );
+    if ( fullSizeMapList.count() > 1 ) {
+      string fullSizeMap = fullSizeMapList[1].toStdString();
+      int pos = fullSizeMap.find("return")+7;
+//       MESSAGE("pos:" << pos);
+      QString sizeMap;
+      try {
+        sizeMap = QString::fromStdString(fullSizeMap.substr(pos, fullSizeMap.size()-pos));
+      }
+      catch (...) {
+        continue;
+      }
+      that->mySMPMap[fullSizeMapList[0]] = sizeMap;
+//       MESSAGE("mySMPMap[" << fullSizeMapList[0].toStdString() << "] = " << sizeMap.toStdString());
+      that->mySMPShapeTypeMap[fullSizeMapList[0]] = myGeomToolSelected->entryToShapeType(fullSizeMapList[0].toStdString());
+//       MESSAGE("mySMPShapeTypeMap[" << fullSizeMapList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[fullSizeMapList[0]]);
+    }
+  }
+
+  // custom size maps
+/*
+  BLSURFPlugin::string_array_var myCustomSizeMaps = h->GetCustomSizeMapEntries();
+  MESSAGE("myCustomSizeMaps->length() = " << myCustomSizeMaps->length());
+
+  for ( int i = 0;i<myCustomSizeMaps->length(); ++i ) {
+    QString fullCustomSizeMaps =  myCustomSizeMaps[i].in();
+    QStringList fullCustomSizeMapList = fullCustomSizeMaps.split( "|", QString::KeepEmptyParts );
+    if ( fullCustomSizeMapList.count() > 1 ) {
+      that->mySMPMap[fullCustomSizeMapList[0]] = fullCustomSizeMapList[1];
+      that->mySMPShapeTypeMap[fullCustomSizeMapList[0]] = GeomToolSelected->entryToShapeType(fullCustomSizeMapList[0].toStdString());
+      MESSAGE("mySMPMap[" << fullCustomSizeMapList[0].toStdString() << "] = " << fullCustomSizeMapList[1].toStdString());
+      MESSAGE("mySMPShapeTypeMap[" << fullCustomSizeMapList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[fullCustomSizeMapList[0]]);
+    }
+  }
+*/
+  // attractor
+  BLSURFPlugin::string_array_var allMyAttractors = h->GetAttractorEntries();
+//   MESSAGE("myAttractors->length() = " << allMyAttractors->length());
+
+  for ( int i = 0;i<allMyAttractors->length(); ++i ) {
+    QString myAttractors =  allMyAttractors[i].in();
+    QStringList myAttractorList = myAttractors.split( "|", QString::KeepEmptyParts );
+    if ( myAttractorList.count() > 1 ) {
+      that->mySMPMap[myAttractorList[0]] = myAttractorList[1];
+      that->mySMPShapeTypeMap[myAttractorList[0]] = myGeomToolSelected->entryToShapeType(myAttractorList[0].toStdString());
+//       MESSAGE("mySMPMap[" << myAttractorList[0].toStdString() << "] = " << myAttractorList[1].toStdString());
+//       MESSAGE("mySMPShapeTypeMap[" << myAttractorList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[myAttractorList[0]]);
+    }
+  }
+  
+  // attractor new version
+  MESSAGE("retrieveParams, Attractors")
+  BLSURFPlugin::TAttParamsMap_var allMyAttractorParams = h->GetAttractorParams();
+  for ( int i = 0;i<allMyAttractorParams->length(); ++i ) {
+    BLSURFPlugin::TAttractorParams myAttractorParams =  allMyAttractorParams[i];
+    QString faceEntry = myAttractorParams.faceEntry.in();
+    QString attEntry  = myAttractorParams.attEntry.in();
+    MESSAGE("attEntry = "<<attEntry.toStdString())
+    double  startSize = myAttractorParams.startSize;
+    double  endSize   = myAttractorParams.endSize;
+    double  infDist   = myAttractorParams.infDist;
+    double  constDist = myAttractorParams.constDist;
+    that->mySMPMap[faceEntry] = QString::number( startSize, 'g',  6 ); // TODO utiliser les préférences ici (cf. sketcher)
+    that->mySMPShapeTypeMap[faceEntry] = myGeomToolSelected->entryToShapeType(faceEntry.toStdString());
+    that->myATTMap[faceEntry] = attEntry;
+    that->myAttDistMap[faceEntry] = infDist;
+    that->myDistMap[faceEntry] = constDist;
+  }
+  
+  // Enforced vertices
+  h_data.enfVertexList.clear();
+  h_data.faceEntryEnfVertexListMap.clear();
+  /* TODO GROUPS
+  h_data.groupNameEnfVertexListMap.clear();
+  */
+
+  BLSURFPlugin::TFaceEntryEnfVertexListMap_var faceEntryEnfVertexListMap = h->GetAllEnforcedVerticesByFace();
+  MESSAGE("faceEntryEnfVertexListMap->length() = " << faceEntryEnfVertexListMap->length());
+
+  for ( int i = 0;i<faceEntryEnfVertexListMap->length(); ++i ) {
+    std::string entry =  faceEntryEnfVertexListMap[i].faceEntry.in();
+//     BLSURFPlugin::TEnfVertexList vertexList = faceEntryEnfVertexListMap[i].enfVertexList.in();
+    BLSURFPlugin::TEnfVertexList vertexList = faceEntryEnfVertexListMap[i].enfVertexList;
+//     BLSURFPlugin::TEnfVertexList_var vertexList = h->GetEnforcedVerticesEntry(entry.c_str());
+
+//     TEnfVertexList& enfVertexList = h_data.faceEntryEnfVertexListMap[entry];
+
+    for (int j=0 ; j<vertexList.length(); ++j) {
+      TEnfVertex *enfVertex = new TEnfVertex();
+      
+      enfVertex->name = CORBA::string_dup(vertexList[j].name.in());
+      enfVertex->geomEntry = CORBA::string_dup(vertexList[j].geomEntry.in());
+      enfVertex->grpName = CORBA::string_dup(vertexList[j].grpName.in());
+      for (int k=0 ; k< vertexList[j].coords.length();k++)
+        enfVertex->coords.push_back(vertexList[j].coords[k]);
+
+      h_data.faceEntryEnfVertexListMap[entry].insert(enfVertex);
+
+      /* TODO GROUPS
+      if (groupName != "") {
+        h_data.groupNameEnfVertexListMap[groupName].insert(ev);
+      }
+      */
+    }
+//     h_data.enfVertMap[entry] = evs;
+//     h_data.entryCoordsListMap[entry] = coordsList;
+
+    if (h_data.faceEntryEnfVertexListMap[entry].size() == 0) {
+      h_data.faceEntryEnfVertexListMap.erase(entry);
+    }
+  }
+  h_data.myInternalEnforcedVerticesAllFaces = h->GetInternalEnforcedVertexAllFaces();
+  h_data.myInternalEnforcedVerticesAllFacesGroup = h->GetInternalEnforcedVertexAllFacesGroup();
 
   return true;
 }
 
+/** BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo(h_data)
+Saves the hypothesis data to hypothesis values.
+*/
 bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesisData& h_data ) const
 {
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo");
   BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
     BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( hypothesis() );
 
@@ -433,10 +1903,18 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
       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 ( h->GetPreCADMergeEdges() != h_data.myPreCADMergeEdges )
+      h->SetPreCADMergeEdges( h_data.myPreCADMergeEdges );
+    if ( h->GetPreCADRemoveNanoEdges() != h_data.myPreCADRemoveNanoEdges )
+      h->SetPreCADRemoveNanoEdges( h_data.myPreCADRemoveNanoEdges );
+    if ( h->GetPreCADDiscardInput() != h_data.myPreCADDiscardInput )
+      h->SetPreCADDiscardInput( h_data.myPreCADDiscardInput );
+    if ( h->GetPreCADEpsNano() != h_data.myPreCADEpsNano && h_data.myPreCADEpsNano > 0)
+      h->SetPreCADEpsNano( h_data.myPreCADEpsNano );
+
+    if( ((int) h_data.myPhysicalMesh == PhysicalUserDefined)||((int) h_data.myPhysicalMesh == SizeMap) ) {
+      if ( h->GetPhySize() != h_data.myPhySize )
+        h->SetPhySize( h_data.myPhySize );
     }
     if( (int) h_data.myGeometricMesh == UserDefined ) {
       if ( h->GetAngleMeshS() != h_data.myAngleMeshS )
@@ -445,112 +1923,291 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
         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() );
+    if (h->GetPhyMin() != h_data.myPhyMin && h_data.myPhyMin > 0)
+      h->SetPhyMin( h_data.myPhyMin );
+    if (h->GetPhyMax() != h_data.myPhyMax && h_data.myPhyMax > 0)
+      h->SetPhyMax( h_data.myPhyMax );
+    if (h->GetGeoMin() != h_data.myGeoMin && h_data.myGeoMin > 0)
+      h->SetGeoMin( h_data.myGeoMin );
+    if (h->GetGeoMax() != h_data.myGeoMax && h_data.myGeoMax > 0)
+      h->SetGeoMax( h_data.myGeoMax );
 #endif
 
-    printf("storeParamsToHypo():myOptions->length()=%d\n",myOptions->length());
     h->SetOptionValues( myOptions ); // is set in checkParams()
+    h->SetPreCADOptionValues( myPreCADOptions ); // is set in checkParams()
+    
+    if ( h->GetGMFFile() != h_data.myGMFFileName )
+//       || ( h->GetGMFFileMode() != h_data.myGMFFileMode ) )
+//       h->SetGMFFile( h_data.myGMFFileName.c_str(), h_data.myGMFFileMode );
+      h->SetGMFFile( h_data.myGMFFileName.c_str());
+
+    BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+    QMapIterator<QString,QString> i(that->mySMPMap);
+    while (i.hasNext()) {
+      i.next();
+      const QString entry = i.key();
+      const QString sizeMap = i.value();
+
+      if (sizeMap == "__TO_DELETE__") {
+        MESSAGE("Delete entry " << entry.toStdString() << " from engine");
+        h->UnsetEntry(entry.toLatin1().constData());
+      }
+      else if (sizeMap.startsWith("ATTRACTOR")) {
+//         MESSAGE("SetAttractorEntry(" << entry.toStdString() << ")= " << sizeMap.toStdString());
+        h->SetAttractorEntry( entry.toLatin1().constData(), sizeMap.toLatin1().constData());
+      }
+      else if (sizeMap.startsWith("def")) {
+//         MESSAGE("SetCustomSizeMapEntry(" << entry.toStdString() << ")= " << sizeMap.toStdString());
+//        h->SetCustomSizeMapEntry( entry.toLatin1().constData(), sizeMap.toLatin1().constData() );
+      }
+      else {
+        if (!myATTMap[entry].isEmpty()){
+          QString att_entry = myATTMap[entry];
+          double infDist = myAttDistMap[entry];
+          double constDist = myDistMap[entry];
+          double phySize = h->GetPhySize();
+          QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+          h->SetClassAttractorEntry( entry.toLatin1().constData(), att_entry.toLatin1().constData(), sizeMap.toDouble() , phySize, infDist, constDist ); 
+          QApplication::restoreOverrideCursor();
+        }
+        else {
+          QString fullSizeMap;
+          fullSizeMap = QString("");
+          if (that->mySMPShapeTypeMap[entry]  == TopAbs_FACE)
+            fullSizeMap = QString("def f(u,v): return ") + sizeMap;
+          else if (that->mySMPShapeTypeMap[entry]  == TopAbs_EDGE)
+            fullSizeMap = QString("def f(t): return ") + sizeMap;
+          else if (that->mySMPShapeTypeMap[entry] == TopAbs_VERTEX)
+            fullSizeMap = QString("def f(): return ") + sizeMap;
+          MESSAGE("SetSizeMapEntry("<<entry.toStdString()<<") = " <<fullSizeMap.toStdString());
+          h->SetSizeMapEntry( entry.toLatin1().constData(), fullSizeMap.toLatin1().constData() );
+        }
+      }
+    }
+
+    // Enforced vertices
+    bool ret;
+    double x, y, z = 0;
+    std::string enfName;
+    /* TODO GROUPS
+    std::string groupName = "";
+    */
+
+    TFaceEntryEnfVertexListMap::const_iterator evmIt = h_data.faceEntryEnfVertexListMap.begin();
+    // 1. Clear all enforced vertices in hypothesis
+    // 2. Add new enforced vertex according to h_data
+    
+    if ( h->GetAllEnforcedVertices()->length() > 0 )
+      h->ClearAllEnforcedVertices();
+    TEnfName faceEntry;
+    TEnfVertexList evs;
+    TEnfVertexList::const_iterator evsIt;
+    for ( ; evmIt != h_data.faceEntryEnfVertexListMap.end() ; ++evmIt)
+    {
+      faceEntry = evmIt->first;
+      evs = evmIt->second;
+      MESSAGE("Number of enforced vertices for face entry " << faceEntry << ": " << evs.size());
+      evsIt = evs.begin();
+      for ( ; evsIt != evs.end() ; ++evsIt)
+      {
+        x =y =z = 0;
+        if ((*evsIt)->coords.size()) {
+          x = (*evsIt)->coords[0];
+          y = (*evsIt)->coords[1];
+          z = (*evsIt)->coords[2];
+        }
+        ret = h->SetEnforcedVertexEntry( faceEntry.c_str(), x, y, z, (*evsIt)->name.c_str(), (*evsIt)->geomEntry.c_str(), (*evsIt)->grpName.c_str());
+      } // for
+    } // for
+
+    if ( h->GetInternalEnforcedVertexAllFaces() != h_data.myInternalEnforcedVerticesAllFaces )
+      h->SetInternalEnforcedVertexAllFaces( h_data.myInternalEnforcedVerticesAllFaces );
+    if ( h->GetInternalEnforcedVertexAllFacesGroup() != h_data.myInternalEnforcedVerticesAllFacesGroup )
+      h->SetInternalEnforcedVertexAllFacesGroup( h_data.myInternalEnforcedVerticesAllFacesGroup.c_str() );
+
+  } // try
+  catch(const std::exception& ex) {
+    std::cout << "Exception: " << ex.what() << std::endl;
+    throw ex;
   }
-  catch(const SALOME::SALOME_Exception& ex)
-  {
-    SalomeApp_Tools::QtCatchCorbaException(ex);
-    ok = false;
-  }
+//   catch(const SALOME::SALOME_Exception& ex)
+//   {
+//     throw ex;
+// //     SalomeApp_Tools::QtCatchCorbaException(ex);
+// //     ok = false;
+//   }
   return ok;
 }
 
+/** BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets(h_data)
+Stores the widgets content to the hypothesis data.
+*/
 QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothesisData& h_data ) const
 {
-  h_data.myName             = myName ? myName->text() : "";
-  h_data.myTopology         = myTopology->currentIndex();
-  h_data.myPhysicalMesh     = myPhysicalMesh->currentIndex();
-  h_data.myPhySize          = myPhySize->text();
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets");
+  h_data.myName                  = myName ? myName->text() : "";
+  h_data.myTopology              = myTopology->currentIndex();
+  h_data.myPhysicalMesh          = myPhysicalMesh->currentIndex();
+  h_data.myPhySize               = myPhySize->GetValue();
 #ifdef WITH_SIZE_BOUNDARIES
-  h_data.myPhyMin           = myPhyMin->text();
-  h_data.myPhyMax           = myPhyMax->text();
-  h_data.myGeoMin           = myGeoMin->text();
-  h_data.myGeoMax           = myGeoMax->text();
+  h_data.myPhyMin                = myPhyMin->GetValue();
+  h_data.myPhyMax                = myPhyMax->GetValue();
+  h_data.myGeoMin                = myGeoMin->GetValue();
+  h_data.myGeoMax                = myGeoMax->GetValue();
 #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();
+  h_data.myGeometricMesh         = myGeometricMesh->currentIndex();
+  h_data.myAngleMeshS            = myAngleMeshS->GetValue();
+  h_data.myAngleMeshC            = myAngleMeshC->GetValue();
+  h_data.myGradation             = myGradation->GetValue();
+  h_data.myAllowQuadrangles      = myAllowQuadrangles->isChecked();
+  h_data.myDecimesh              = myDecimesh->isChecked();
+  h_data.myVerbosity             = myVerbosity->value();
+  h_data.myPreCADMergeEdges      = myPreCADMergeEdges->isChecked();
+  h_data.myPreCADRemoveNanoEdges = myPreCADRemoveNanoEdges->isChecked();
+  h_data.myPreCADDiscardInput    = myPreCADDiscardInput->isChecked();
+  h_data.myPreCADEpsNano         = myPreCADEpsNano->GetValue();
 
   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_HPHYDEF") + " = " + QString::number( 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 + "; ";
+  guiHyp += "hphymin = " + QString::number( h_data.myPhyMin ) + "; ";
+  guiHyp += "hphymax = " + QString::number( h_data.myPhyMax ) + "; ";
+  guiHyp += "hgeomin = " + QString::number( h_data.myGeoMin ) + "; ";
+  guiHyp += "hgeomax = " + QString::number( h_data.myGeoMax ) + "; ";
 #endif
+  guiHyp += tr("BLSURF_PRECAD_MERGE_EDGES") + " = " + QString(h_data.myPreCADMergeEdges ? "yes" : "no") + "; ";
+  guiHyp += tr("BLSURF_PRECAD_REMOVE_NANO_EDGES") + " = " + QString(h_data.myPreCADRemoveNanoEdges ? "yes" : "no") + "; ";
+  guiHyp += tr("BLSURF_PRECAD_DISCARD_INPUT") + " = " + QString(h_data.myPreCADDiscardInput ? "yes" : "no") + "; ";
+  guiHyp += tr("BLSURF_PRECAD_EPS_NANO") + " = " + QString::number( h_data.myPreCADEpsNano ) + "; ";
 
   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() )
+    std::string optionType = myOptionTable->item( row, OPTION_TYPE_COLUMN )->text().toStdString();
+    if ( id >= 0 && ( ( optionType == "BLSURF" && id < myOptions->length() ) || ( optionType == "PRECAD" && id < myPreCADOptions->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 != "" )
+      if (optionType == "PRECAD")
+        that->myPreCADOptions[ id ] = ( name + ":" + value).toLatin1().constData();
+      else
+        that->myOptions[ id ] = ( name + ":" + value).toLatin1().constData();
+
+      if ( value != "" ) {
+        if (optionType == "PRECAD")
+          guiHyp += "PRECAD_";
         guiHyp += name + " = " + value + "; ";
+      }
     }
   }
+  
+  h_data.myGMFFileName = myGMFFileName->text().toStdString();
+//   h_data.myGMFFileMode = myGMFFileMode->isChecked();
 
-  cout << "guiHyp : " << guiHyp.toLatin1().data() << endl;
+  // SizeMap
+  row = 0, nbRows = mySizeMapTable->topLevelItemCount();
+  for ( ; row < nbRows; ++row )
+  {
+      QString entry   = mySizeMapTable->topLevelItem(row)->data(SMP_ENTRY_COLUMN ,Qt::EditRole).toString();
+      if ( that->mySMPMap.contains(entry) )
+        guiHyp += "SetSizeMapEntry(" + entry + ", " + that->mySMPMap[entry] + "); ";
+  }
 
+  // Enforced vertices
+  h_data.enfVertexList.clear();
+  h_data.faceEntryEnfVertexListMap.clear();
+
+  int nbEnforcedShapes = myEnforcedTreeWidget->topLevelItemCount();
+  int nbEnforcedVertices = 0;
+  std::string groupName = "";
+//   MESSAGE("Nb of enforced shapes: " << nbEnforcedShapes);
+  for (int i=0 ; i<nbEnforcedShapes ; i++) {
+    QTreeWidgetItem* shapeItem = myEnforcedTreeWidget->topLevelItem(i);
+    if (shapeItem) {
+      std::string faceEntry = shapeItem->data(ENF_VER_FACE_ENTRY_COLUMN,Qt::EditRole).toString().toStdString();
+      nbEnforcedVertices = shapeItem->childCount();
+      if (nbEnforcedVertices >0) {
+        double childValueX,childValueY,childValueZ;
+        std::string childName, vertexEntry;
+        QTreeWidgetItem* child;
+        TEnfVertexList evs;
+        evs.clear();
+        for (row = 0;row<nbEnforcedVertices;row++) {
+          child = shapeItem->child(row);
+          childName   = child->data(ENF_VER_NAME_COLUMN,Qt::EditRole).toString().toStdString();
+          childValueX = child->data(ENF_VER_X_COLUMN,Qt::EditRole).toDouble();
+          childValueY = child->data(ENF_VER_Y_COLUMN,Qt::EditRole).toDouble();
+          childValueZ = child->data(ENF_VER_Z_COLUMN,Qt::EditRole).toDouble();
+          vertexEntry = child->data(ENF_VER_ENTRY_COLUMN,Qt::EditRole).toString().toStdString();
+//           if (myGlobalGroupName->isChecked())
+//             groupName = myGlobalGroupName->text().toStdString();
+//           else
+            groupName = child->data(ENF_VER_GROUP_COLUMN,Qt::EditRole).toString().toStdString();
+
+          TEnfVertex *enfVertex = new TEnfVertex();
+          enfVertex->name = childName;
+          if (vertexEntry.empty()) {
+            enfVertex->coords.push_back(childValueX);
+            enfVertex->coords.push_back(childValueY);
+            enfVertex->coords.push_back(childValueZ);
+          }
+          else
+            enfVertex->geomEntry = vertexEntry;
+          enfVertex->grpName = groupName;
+//           TEnfVertexList::iterator it = h_data.enfVertexList.find(enfVertex);
+//           if (it == h_data.enfVertexList.end())
+          h_data.enfVertexList.insert(enfVertex);
+          evs.insert(enfVertex);
+          /* TODO GROUPS
+          if (groupName != "")
+            h_data.groupNameEnfVertexListMap[groupName].insert(vertex);
+          */
+        }
+        h_data.faceEntryEnfVertexListMap[faceEntry] = evs;
+      }
+    }
+  }
+
+  h_data.myInternalEnforcedVerticesAllFaces      = myInternalEnforcedVerticesAllFaces->isChecked();
+  h_data.myInternalEnforcedVerticesAllFacesGroup = myInternalEnforcedVerticesAllFacesGroup->text().toStdString();
+
+  MESSAGE("guiHyp : " << guiHyp.toLatin1().data());
   return guiHyp;
 }
 
+
+void BLSURFPluginGUI_HypothesisCreator::onTopologyChanged(int index) {
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onTopologyChanged");
+  myPreCADGroupBox->setEnabled(index == PreCAD);
+}
+
 void BLSURFPluginGUI_HypothesisCreator::onPhysicalMeshChanged() {
-  bool isCustom = (myPhysicalMesh->currentIndex() == PhysicalUserDefined);
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onPhysicalMeshChanged");
+  bool isPhysicalUserDefined = (myPhysicalMesh->currentIndex() == PhysicalUserDefined);
+  bool isSizeMap = (myPhysicalMesh->currentIndex() == SizeMap);
+  bool isCustom = (isPhysicalUserDefined || isSizeMap) ;
+  bool geomIsCustom = (myGeometricMesh->currentIndex() == UserDefined);
+
+  myGradation->setEnabled(!isPhysicalUserDefined || geomIsCustom);
   myPhySize->setEnabled(isCustom);
   myPhyMax->setEnabled(isCustom);
   myPhyMin->setEnabled(isCustom);
 
+  if ( !myGradation->isEnabled())
+    myGradation->SetValue( 1.1 );
+
   if ( !isCustom ) {
-    QString aPhySize = "";
-    switch( myPhysicalMesh->currentIndex() ) {
-      case DefaultSize:
-      default:
-        aPhySize = "10";
-        break;
-      }
-    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();
@@ -559,29 +2216,20 @@ void BLSURFPluginGUI_HypothesisCreator::onPhysicalMeshChanged() {
 }
 
 void BLSURFPluginGUI_HypothesisCreator::onGeometricMeshChanged() {
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onGeometricMeshChanged");
   bool isCustom = (myGeometricMesh->currentIndex() == UserDefined);
+  bool phyIsSizemap = (myPhysicalMesh->currentIndex() == SizeMap);
+
   myAngleMeshS->setEnabled(isCustom);
   myAngleMeshC->setEnabled(isCustom);
-  myGradation->setEnabled(isCustom);
+  myGradation->setEnabled(isCustom || phyIsSizemap);
   myGeoMax->setEnabled(isCustom);
   myGeoMin->setEnabled(isCustom);
 
+  if ( !myGradation->isEnabled())
+    myGradation->SetValue( 1.1 );
+
   if ( ! isCustom ) {
-    double aAngleMeshS, aGradation;
-    switch( myGeometricMesh->currentIndex() ) {
-      case DefaultGeom:
-      default:
-        aAngleMeshS = 8;
-        aGradation = 1.1;
-        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 );
@@ -595,11 +2243,21 @@ void BLSURFPluginGUI_HypothesisCreator::onAddOption()
   QMenu* menu = (QMenu*)sender();
   // fill popup with option names
   menu->clear();
+  QString name_value, name;
   if ( myOptions.operator->() ) {
+    QMenu* blsurfMenu = menu->addMenu(tr("OPTION_MENU_BLSURF"));
     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 );
+      name_value = myOptions[i].in();
+      name = name_value.split( ":", QString::KeepEmptyParts )[0];
+      blsurfMenu->addAction( name );
+    }
+  }
+  if ( myPreCADOptions.operator->() ) {
+    QMenu* preCADmenu = menu->addMenu(tr("OPTION_MENU_PRECAD"));
+    for ( int i = 0, nb = myPreCADOptions->length(); i < nb; ++i ) {
+      name_value = myPreCADOptions[i].in();
+      name = name_value.split( ":", QString::KeepEmptyParts )[0];
+      preCADmenu->addAction( name );
     }
   }
 }
@@ -608,28 +2266,39 @@ 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 option, optionType;
+  if (menu->title() == tr("OPTION_MENU_BLSURF")) {
+    option = myOptions[idx].in();
+    optionType = "BLSURF";
+  }
+  else if (menu->title() == tr("OPTION_MENU_PRECAD")) {
+    option = myPreCADOptions[idx].in();
+    optionType = "PRECAD";
+  }
   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;
+      if ( myOptionTable->item( row, OPTION_TYPE_COLUMN )->text() == optionType )
+        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_TYPE_COLUMN, new QTableWidgetItem( optionType ) );
+    myOptionTable->item( row, OPTION_TYPE_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->item( row, OPTION_VALUE_COLUMN )->setFlags( Qt::ItemIsSelectable |
+                                                               Qt::ItemIsEditable   |
+                                                               Qt::ItemIsEnabled );
     myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN );
   }
   myOptionTable->clearSelection();
@@ -638,20 +2307,24 @@ void BLSURFPluginGUI_HypothesisCreator::onOptionChosenInPopup( QAction* a )
   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<int> selectedRows;
-  QList<QTableWidgetItem*> selected = myOptionTable->selectedItems(); 
+  QList<QTableWidgetItem*> 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();
+      std::string optionType = myOptionTable->item( row, OPTION_TYPE_COLUMN )->text().toStdString();
+      if ( id >= 0 )
+        if (optionType == "BLSURF" && id < myOptions->length() )
+          myOptions[ id ] = myOptionTable->item( row, OPTION_NAME_COLUMN )->text().toLatin1().constData();
+        else if (optionType == "PRECAD" && id < myPreCADOptions->length() )
+          myPreCADOptions[ id ] = myOptionTable->item( row, OPTION_NAME_COLUMN )->text().toLatin1().constData();
     }
   }
   qSort( selectedRows );
@@ -661,7 +2334,559 @@ void BLSURFPluginGUI_HypothesisCreator::onDeleteOption()
     myOptionTable->removeRow( it.previous() );
 }
 
+void BLSURFPluginGUI_HypothesisCreator::onChooseGMFFile()
+{
+//   QFileDialog dlg(0);
+//   dlg.selectFile(myGMFFileName->text());
+//   dlg.setNameFilter(tr("BLSURF_GMF_FILE_FORMAT"));
+//   dlg.setDefaultSuffix(QString("mesh"));
+  myGMFFileName->setText(QFileDialog::getSaveFileName(0, tr("BLSURF_GMF_FILE_DIALOG"), myGMFFileName->text(), tr("BLSURF_GMF_FILE_FORMAT")));
+}
+
+
+// **********************
+// *** BEGIN SIZE MAP ***
+// **********************
+
+void BLSURFPluginGUI_HypothesisCreator::onMapGeomContentModified()
+{
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+  
+  if ( myGeomSelWdg2->IsObjectSelected() ){ 
+    mySMapObject = myGeomSelWdg2->GetObject< GEOM::GEOM_Object >(0);
+  }
+  else if ( myGeomSelWdg1->IsObjectSelected() ){
+    mySMapObject = myGeomSelWdg1->GetObject< GEOM::GEOM_Object >(0);
+  }
+  std::string entry = (string) mySMapObject->GetStudyEntry();
+  QString qEntry = QString::fromStdString(entry);
+  if (that->mySMPMap.contains(qEntry) && that->mySMPMap[qEntry] != "__TO_DELETE__" ) {  
+    addMapButton->setEnabled(false);
+    modifyMapButton->setEnabled(true);
+  }
+  else{
+    addMapButton->setEnabled(true);
+    modifyMapButton->setEnabled(false);
+  }
+      
+} 
+
+void BLSURFPluginGUI_HypothesisCreator::onSmpItemClicked(QTreeWidgetItem * item, int col)
+{ 
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onSmpItemClicked("<<col<<")")
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+  if (col == SMP_SIZEMAP_COLUMN){
+    QString entry   = item->data( SMP_ENTRY_COLUMN, Qt::EditRole ).toString();
+    if (!mySMPMap.contains(entry))
+      return;
+    QString sizeMap = item->data( SMP_SIZEMAP_COLUMN, Qt::EditRole ).toString();
+    CORBA::Object_var obj = entryToObject(entry); 
+    if (sizeMap.startsWith("Attractor") || sizeMap.startsWith("Constant")){  // ADVANCED MAPS
+      smpTab->setCurrentIndex(ATT_TAB);         // Change Tab
+      double phySize = that->mySMPMap[entry].toDouble();  // Retrieve values of the selected item in the current tab widgets
+      double infDist = that->myAttDistMap[entry];
+      double constDist = that->myDistMap[entry];
+      QString attEntry = that->myATTMap[entry];
+      CORBA::Object_var attObj = entryToObject(attEntry);
+      myAttSizeSpin->setValue(phySize);
+      if (sizeMap.startsWith("Attractor")){     
+        myAttDistSpin->setValue(infDist);
+        myAttractorCheck->setChecked(true);
+      }
+      else {
+        myAttractorCheck->setChecked(false);
+      }
+      if (sizeMap.startsWith("Constant") || constDist > std::numeric_limits<double>::epsilon()){
+        myAttDistSpin2->setValue(constDist);
+        myConstSizeCheck->setChecked(true);
+      }
+      else{
+        myConstSizeCheck->setChecked(false);
+      }
+      myGeomSelWdg2->SetObject(obj); 
+      myAttSelWdg->SetObject(attObj);
+    }
+    else {                                                                   // CLASSIC MAPS
+      smpTab->setCurrentIndex(SMP_STD_TAB);  // Change Tab
+      myGeomSelWdg1->SetObject(obj);         // Retrieve values of the selected item in the current tab widgets
+      if (!sizeMap.startsWith("def")){
+        mySmpSizeSpin->setValue(that->mySMPMap[entry].toDouble()); 
+      }
+    }  
+  } 
+}
+
+void BLSURFPluginGUI_HypothesisCreator::onSmpTabChanged(int tab)
+{
+  myAttDistSpin->setValue(0.);           // Reinitialize widgets 
+  myAttSizeSpin->setValue(0.);
+  myAttDistSpin2->setValue(0.);
+  mySmpSizeSpin->setValue(0.); 
+  myGeomSelWdg1->deactivateSelection();
+  myGeomSelWdg2->deactivateSelection();
+  myAttSelWdg->deactivateSelection();
+  myGeomSelWdg1->SetObject(CORBA::Object::_nil());
+  myGeomSelWdg2->SetObject(CORBA::Object::_nil());
+  myAttSelWdg->SetObject(CORBA::Object::_nil());
+  myAttractorCheck->setChecked(false);
+  myConstSizeCheck->setChecked(false);
+}
+
+void BLSURFPluginGUI_HypothesisCreator::onAttractorClicked(int state)
+{
+  if (state == Qt::Checked){
+    myAttSelWdg->setEnabled(true);
+    myAttSizeSpin->setEnabled(true);
+    myAttSizeLabel->setEnabled(true);
+    myAttDistSpin->setEnabled(true);
+    myAttDistLabel->setEnabled(true);
+    if (!myAttSelWdg->IsObjectSelected()){
+      myAttSelWdg->SetDefaultText(tr("BLS_SEL_ATTRACTOR"), "QLineEdit { color: grey }");
+    }
+  }
+  if (state == Qt::Unchecked){
+    myAttDistSpin->setEnabled(false);
+    myAttDistLabel->setEnabled(false);
+    myAttDistSpin->setValue(0.);
+    if(myConstSizeCheck->checkState() == Qt::Unchecked){  // No predefined map selected
+      myAttSelWdg->setEnabled(false);
+      myAttSizeSpin->setEnabled(false);
+      myAttSizeLabel->setEnabled(false);
+      myAttDistSpin2->setEnabled(false);
+      myAttDistLabel2->setEnabled(false);
+    }
+    else if (!myAttSelWdg->IsObjectSelected()){           // Only constant size selected
+      myAttSelWdg->SetDefaultText(tr("BLS_SEL_SHAPE"), "QLineEdit { color: grey }");
+    }
+  }   
+}
+
+void BLSURFPluginGUI_HypothesisCreator::onConstSizeClicked(int state)
+{ 
+  if (state == Qt::Checked){
+    myAttSelWdg->setEnabled(true);
+    myAttSizeSpin->setEnabled(true);
+    myAttSizeLabel->setEnabled(true);
+    myAttDistSpin2->setEnabled(true);
+    myAttDistLabel2->setEnabled(true);
+    if (myAttractorCheck->checkState() == Qt::Unchecked &&
+        !myAttSelWdg->IsObjectSelected()){
+      myAttSelWdg->SetDefaultText(tr("BLS_SEL_SHAPE"), "QLineEdit { color: grey }");
+    }
+  }
+  if (state == Qt::Unchecked){
+    myAttDistSpin2->setEnabled(false);
+    myAttDistLabel2->setEnabled(false);
+    myAttDistSpin2->setValue(0.);
+    if(myAttractorCheck->checkState() == Qt::Unchecked){  // No predefined map selected
+        myAttSelWdg->setEnabled(false);
+        myAttSizeSpin->setEnabled(false);
+        myAttSizeLabel->setEnabled(false);
+        myAttDistSpin->setEnabled(false);
+        myAttDistLabel->setEnabled(false);
+    }
+    else if (!myAttSelWdg->IsObjectSelected()){           // Only constant size selected
+    myAttSelWdg->SetDefaultText(tr("BLS_SEL_ATTRACTOR"), "QLineEdit { color: grey }");
+    }
+  }   
+}
+
+void BLSURFPluginGUI_HypothesisCreator::onRemoveMap()
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onRemoveMap()");
+  QList<int> selectedRows;
+  QList<QTreeWidgetItem*> selected = mySizeMapTable->selectedItems();
+  QTreeWidgetItem* item;
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+
+  qSort( selectedRows );
+  QListIterator<QTreeWidgetItem*> it( selected );
+  it.toBack();
+  while ( it.hasPrevious() ) {
+      item = it.previous();
+      QString entry = item->data(SMP_ENTRY_COLUMN, Qt::EditRole).toString();
+      if (that->mySMPMap.contains(entry))
+        that->mySMPMap[entry] = "__TO_DELETE__";
+      if (that->mySMPShapeTypeMap.contains(entry))
+        that->mySMPShapeTypeMap.remove(entry);
+      if (that->myATTMap.contains(entry))
+        that->myATTMap.remove(entry);
+      if (that->myDistMap.contains(entry))
+        that->myDistMap.remove(entry);
+      if (that->myAttDistMap.contains(entry))
+        that->myAttDistMap.remove(entry);
+      delete item;
+  }
+  mySizeMapTable->resizeColumnToContents(SMP_NAME_COLUMN);
+  mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN);
+}
+
+void BLSURFPluginGUI_HypothesisCreator::onSetSizeMap(QTreeWidgetItem* item, int col)
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onSetSizeMap("<< col << ")");
+  MESSAGE("mySMPMap.size() = "<<mySMPMap.size());
+  if (col == SMP_SIZEMAP_COLUMN) {
+    BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+    QString entry   = item->data(SMP_ENTRY_COLUMN, Qt::EditRole).toString();
+    QString sizeMap = item->data(SMP_SIZEMAP_COLUMN, Qt::EditRole).toString();
+    MESSAGE("entry: " << entry.toStdString() << ", sizeMap: " << sizeMap.toStdString());
+    if (! that->mySMPShapeTypeMap.contains(entry))
+      MESSAGE("no such entry in mySMPShapeTypeMap")
+      return;
+    if (that->mySMPMap.contains(entry))
+      if (that->mySMPMap[entry] == sizeMap 
+        || sizeMap.startsWith("Attractor") 
+        || sizeMap.startsWith("Constant") ){
+        return;
+      } 
+    if (! sizeMap.isEmpty()) {
+      that->mySMPMap[entry] = sizeMap;
+      sizeMapValidationFromEntry(entry); 
+    }
+    else {
+      MESSAGE("Size map empty: reverse to precedent value" );
+      item->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant(that->mySMPMap[entry]) );
+    }
+    mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN);
+  }
+}
+
+void BLSURFPluginGUI_HypothesisCreator::onAddMap()
+{
+  if ( smpTab->currentIndex() == ATT_TAB ){    
+    if ( myGeomSelWdg2->IsObjectSelected() && myAttSelWdg->IsObjectSelected() ){ 
+      mySMapObject = myGeomSelWdg2->GetObject< GEOM::GEOM_Object >(0);
+      myAttObject = myAttSelWdg->GetObject< GEOM::GEOM_Object >(0);
+      insertAttractor(mySMapObject, myAttObject);
+    }
+  }
+  if (smpTab->currentIndex() == SMP_STD_TAB  ){
+    if ( myGeomSelWdg1->IsObjectSelected() ){
+      mySMapObject = myGeomSelWdg1->GetObject< GEOM::GEOM_Object >(0);
+      insertElement(mySMapObject);  
+    }  
+  }
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;  
+  that->getGeomSelectionTool()->selectionMgr()->clearFilters();
+  myAttDistSpin->setValue(0.);
+  myAttSizeSpin->setValue(0.);
+  myAttDistSpin2->setValue(0.);
+  mySmpSizeSpin->setValue(0.);
+  myConstSizeCheck->setChecked(false);
+  myAttractorCheck->setChecked(false);
+  myGeomSelWdg1->deactivateSelection();
+  myGeomSelWdg2->deactivateSelection();
+  myAttSelWdg->deactivateSelection();
+  myGeomSelWdg1->SetObject(CORBA::Object::_nil());
+  myGeomSelWdg2->SetObject(CORBA::Object::_nil());
+  myAttSelWdg->SetObject(CORBA::Object::_nil());
+}
+
+void BLSURFPluginGUI_HypothesisCreator::onModifyMap()
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::onModifyMap()");
+  if ( smpTab->currentIndex() == ATT_TAB ){    
+    if ( myGeomSelWdg2->IsObjectSelected() && myAttSelWdg->IsObjectSelected() ){ 
+      mySMapObject = myGeomSelWdg2->GetObject< GEOM::GEOM_Object >(0);
+      myAttObject = myAttSelWdg->GetObject< GEOM::GEOM_Object >(0);
+      insertAttractor(mySMapObject, myAttObject, /*modify = */true);
+    }
+  }
+  if (smpTab->currentIndex() == SMP_STD_TAB  ){
+    if ( myGeomSelWdg1->IsObjectSelected() ){
+      mySMapObject = myGeomSelWdg1->GetObject< GEOM::GEOM_Object >(0);
+      insertElement(mySMapObject, /*modify = */true);  
+    }  
+  }
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;  
+  that->getGeomSelectionTool()->selectionMgr()->clearFilters();
+  myAttDistSpin->setValue(0.);
+  myAttSizeSpin->setValue(0.);
+  myAttDistSpin2->setValue(0.);
+  mySmpSizeSpin->setValue(0.);
+  myConstSizeCheck->setChecked(false);
+  myAttractorCheck->setChecked(false);
+  myGeomSelWdg1->deactivateSelection();
+  myGeomSelWdg2->deactivateSelection();
+  myAttSelWdg->deactivateSelection();
+  myGeomSelWdg1->SetObject(CORBA::Object::_nil());
+  myGeomSelWdg2->SetObject(CORBA::Object::_nil());
+  myAttSelWdg->SetObject(CORBA::Object::_nil());
+}
+
+void BLSURFPluginGUI_HypothesisCreator::insertElement(GEOM::GEOM_Object_var anObject, bool modify)
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::insertElement()");
+  BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
+    BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis());
+
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+
+  TopAbs_ShapeEnum shapeType;
+  string entry, shapeName;
+  entry = (string) anObject->GetStudyEntry();
+  MESSAGE("entry = "<<entry);
+  shapeName = anObject->GetName();
+  shapeType = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( anObject ).ShapeType();
+  // Group management : the type of entities in the group is stored in the SMPShapeTypeMap
+  // in order to write the size map with the right syntax in StoreParamsToHypo 
+  // (f(t) for edges, f(u,v) for faces ...)
+  if (shapeType == TopAbs_COMPOUND){
+    TopoDS_Shape theShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( anObject );
+    TopoDS_Shape childShape;
+    TopoDS_Iterator anIt(theShape);
+    for(;anIt.More();anIt.Next()){
+      childShape = anIt.Value();
+      shapeType = childShape.ShapeType();
+      if(!childShape.IsNull()){
+        break;
+      }
+    }
+  }
+  mySizeMapTable->setFocus();
+  QString shapeEntry;
+  shapeEntry = QString::fromStdString(entry);
+  double phySize = mySmpSizeSpin->value();
+  std::ostringstream oss;
+  oss << phySize;
+  QString sizeMap;
+  sizeMap  = QString::fromStdString(oss.str());
+  QTreeWidgetItem* item = new QTreeWidgetItem();
+  if (modify){
+    int rowToChange = findRowFromEntry(shapeEntry);
+    item = mySizeMapTable->topLevelItem( rowToChange );
+  }
+  else{
+    if (that->mySMPMap.contains(shapeEntry)) {  
+      if (that->mySMPMap[shapeEntry] != "__TO_DELETE__") {
+  //             MESSAGE("Size map for shape with name(entry): "<< shapeName << "(" << entry << ")");
+        return;
+      }
+    }
+    mySizeMapTable->addTopLevelItem(item);
+  }
+  that->mySMPMap[shapeEntry] = sizeMap;
+  that->myDistMap[shapeEntry] = 0. ;
+  that->mySMPShapeTypeMap[shapeEntry] = shapeType;
+  item->setFlags( Qt::ItemIsSelectable |Qt::ItemIsEditable   |Qt::ItemIsEnabled );
+  item->setData(SMP_ENTRY_COLUMN, Qt::EditRole, QVariant(shapeEntry) );
+  item->setData(SMP_NAME_COLUMN, Qt::EditRole, QVariant(QString::fromStdString(shapeName)) );
+  item->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant(sizeMap) );
+  mySizeMapTable->resizeColumnToContents( SMP_SIZEMAP_COLUMN );
+  mySizeMapTable->resizeColumnToContents( SMP_NAME_COLUMN );
+  mySizeMapTable->resizeColumnToContents( SMP_ENTRY_COLUMN );
+  mySizeMapTable->clearSelection();
+
+  if ( myPhysicalMesh->currentIndex() != SizeMap ) {
+    myPhysicalMesh->setCurrentIndex( SizeMap );
+    onPhysicalMeshChanged();
+  }
+}
+
+void BLSURFPluginGUI_HypothesisCreator::insertAttractor(GEOM::GEOM_Object_var aFace, GEOM::GEOM_Object_var anAttractor, bool modify)
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::insertAttractor()");
+  BLSURFPlugin::BLSURFPlugin_Hypothesis_var h =
+    BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis());
+
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+
+  TopAbs_ShapeEnum shapeType;
+  string entry, attEntry, faceName, attName;
+  entry = (string) aFace->GetStudyEntry();
+  attEntry = (string) anAttractor->GetStudyEntry();
+  faceName = aFace->GetName();
+  attName = anAttractor->GetName();
+  shapeType = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( aFace ).ShapeType();
+  mySizeMapTable->setFocus();
+  QString shapeEntry = QString::fromStdString(entry);
+  QString qAttEntry = QString::fromStdString(attEntry);
+  
+  double phySize = h->GetPhySize();
+  double infDist = 0. ;
+  double constDist = 0. ;
+  phySize = myAttSizeSpin->value();
+  if (myAttractorCheck->isChecked()){
+    infDist = myAttDistSpin->value();
+  }
+  if (myConstSizeCheck->isChecked()){
+    constDist = myAttDistSpin2->value();
+  } 
+  std::ostringstream oss;
+  std::ostringstream oss2;
+  std::ostringstream oss3;
+  oss << phySize;
+  oss2 << infDist;
+  oss3 << constDist;
+  QString sizeMap  = QString::fromStdString(oss.str());
+  QString infDistString = QString::fromStdString(oss2.str());
+  QString constDistString = QString::fromStdString(oss3.str());
+  
+  QTreeWidgetItem* item; 
+  QTreeWidgetItem* child; 
+  if (modify){
+    int rowToChange = findRowFromEntry(shapeEntry);
+    item = mySizeMapTable->topLevelItem( rowToChange );
+    child = item->child( 0 );
+  }
+  else{
+    if (that->mySMPMap.contains(shapeEntry)) {  
+      if (that->mySMPMap[shapeEntry] != "__TO_DELETE__") {
+    //             MESSAGE("Size map for shape with name(entry): "<< shapeName << "(" << entry << ")");
+        return;
+      }
+    }
+    item = new QTreeWidgetItem();
+    child = new QTreeWidgetItem();
+    mySizeMapTable->addTopLevelItem(item);
+    item->addChild(child);
+  }
+  that->mySMPMap.insert(shapeEntry,sizeMap);
+  that->myATTMap.insert(shapeEntry,qAttEntry);
+  that->myAttDistMap.insert(shapeEntry,infDist);
+  that->myDistMap.insert(shapeEntry,constDist);
+  that->mySMPShapeTypeMap.insert(shapeEntry,shapeType);
+  item->setExpanded(true); 
+  item->setData(SMP_ENTRY_COLUMN, Qt::EditRole, QVariant(shapeEntry) );
+  item->setData(SMP_NAME_COLUMN, Qt::EditRole, QVariant(QString::fromStdString(faceName)) );
+  if (infDist > std::numeric_limits<double>::epsilon()){
+    item->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant(QString::fromStdString("Attractor")) );
+  }
+  else if (constDist > std::numeric_limits<double>::epsilon()){
+    item->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant(QString::fromStdString("Constant Size")) );
+  }
+  item->setFlags( Qt::ItemIsSelectable |Qt::ItemIsEditable   |Qt::ItemIsEnabled );    
+  
+  child->setData(SMP_ENTRY_COLUMN, Qt::EditRole, QVariant(qAttEntry) );
+  child->setData(SMP_NAME_COLUMN, Qt::EditRole, QVariant(QString::fromStdString(attName)) );
+  child->setData(SMP_SIZEMAP_COLUMN, Qt::EditRole, QVariant(sizeMap) );
+  
+  mySizeMapTable->resizeColumnToContents( SMP_ENTRY_COLUMN );
+  mySizeMapTable->resizeColumnToContents( SMP_NAME_COLUMN );
+  mySizeMapTable->resizeColumnToContents( SMP_SIZEMAP_COLUMN );
+
+  if ( myPhysicalMesh->currentIndex() != SizeMap ) {
+    myPhysicalMesh->setCurrentIndex( SizeMap );
+    onPhysicalMeshChanged();
+  }
+  MESSAGE("mySMPMap.size() = "<<mySMPMap.size());
+}
+
+bool BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation()
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation()");
+  int row = 0, nbRows = mySizeMapTable->topLevelItemCount();
+  for ( ; row < nbRows; ++row )
+    if (! sizeMapValidationFromRow(row))
+      return false;
+  return true;
+}
+
+bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow(int myRow, bool displayError)
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow(), row = "<<myRow);
+  QString myEntry   = mySizeMapTable->topLevelItem( myRow )->data( SMP_ENTRY_COLUMN, Qt::EditRole ).toString();
+  bool res = sizeMapValidationFromEntry(myEntry,displayError);
+  mySizeMapTable->setFocus();
+  return res;
+}
+
+bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry(QString myEntry, bool displayError)
+{
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry()");
+  MESSAGE("myEntry = "<<myEntry.toStdString())
+
+  BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
+
+  if (! that->mySMPMap.contains(myEntry)) {
+//     MESSAGE("Geometry with entry "<<myEntry.toStdString()<<" was not found.");
+    return false;
+  }
+  if (! that->mySMPShapeTypeMap.contains(myEntry)) {
+//     MESSAGE("Shape type with entry "<<myEntry.toStdString()<<" was not found.");
+    return false;
+  }
+
+  string expr;
+
+  if (that->mySMPMap[myEntry].startsWith("def")) {
+//     MESSAGE("custom function" );
+    expr = that->mySMPMap[myEntry].toStdString();
+  }
+  else if (that->mySMPMap[myEntry].startsWith("ATTRACTOR")) {
+//     MESSAGE("Attractor" );
+    if ((that->mySMPMap[myEntry].count(QRegExp("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)(?:;(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+))?\\)$")) != 1)) {
+
+      if (displayError)
+        SUIT_MessageBox::warning( dlg(),"Definition of attractor : Error" ,"An attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False[;d])" );
+      return false;
+    }
+    return true;
+  }
+  else {
+    // case size map is empty
+    if (that->mySMPMap[myEntry].isEmpty()) {
+      if (displayError)
+        SUIT_MessageBox::warning( dlg(),"Definition of size map : Error" , "Size map can't be empty");
+      return false;
+    }
+    else {
+      if ( that->mySMPShapeTypeMap[myEntry] == TopAbs_FACE)
+        expr = "def f(u,v) : return " + that->mySMPMap[myEntry].toStdString();
+      else if ( that->mySMPShapeTypeMap[myEntry] == TopAbs_EDGE)
+        expr = "def f(t) : return " + that->mySMPMap[myEntry].toStdString();
+      else if ( that->mySMPShapeTypeMap[myEntry] == TopAbs_VERTEX)
+        expr = "def f() : return " + that->mySMPMap[myEntry].toStdString();
+    }
+  }
+  //assert(Py_IsInitialized());
+  if (! Py_IsInitialized())
+    throw ("Erreur: Python interpreter is not initialized");
+  PyGILState_STATE gstate;
+  gstate = PyGILState_Ensure();
+
+  PyObject * obj = NULL;
+  PyObject* new_stderr = NULL;
+  string  err_description="";
+  obj= PyRun_String(expr.c_str(), Py_file_input, main_dict, NULL);
+  if (obj == NULL){
+    fflush(stderr);
+    err_description="";
+    new_stderr=newPyStdOut(err_description);
+    PySys_SetObject((char*)"stderr", new_stderr);
+    PyErr_Print();
+    PySys_SetObject((char*)"stderr", PySys_GetObject((char*)"__stderr__"));
+    Py_DECREF(new_stderr);
+    if (displayError)
+      SUIT_MessageBox::warning( dlg(),"Definition of Python Function : Error" ,err_description.c_str() );
+    PyGILState_Release(gstate);
+    return false;
+  }
+  Py_DECREF(obj);
+
+  PyObject * func = NULL;
+  func = PyObject_GetAttrString(main_mod, "f");
+  if ( func == NULL){
+    fflush(stderr);
+    err_description="";
+    new_stderr=newPyStdOut(err_description);
+    PySys_SetObject((char*)"stderr", new_stderr);
+    PyErr_Print();
+    PySys_SetObject((char*)"stderr", PySys_GetObject((char*)"__stderr__"));
+    Py_DECREF(new_stderr);
+    if (displayError)
+      SUIT_MessageBox::warning( dlg(),"Python Error" ,err_description.c_str() );
+    PyGILState_Release(gstate);
+    return false;
+  }
+
+  PyGILState_Release(gstate);
+
+//   MESSAGE("SizeMap expression "<<expr<<" is valid");
+
+  return true;
+}
+
 QString BLSURFPluginGUI_HypothesisCreator::caption() const
 {
   return tr( "BLSURF_TITLE" );
@@ -681,3 +2906,43 @@ QString BLSURFPluginGUI_HypothesisCreator::helpPage() const
 {
   return "blsurf_hypo_page.html";
 }
+
+LightApp_SelectionMgr* BLSURFPluginGUI_HypothesisCreator::selectionMgr()
+{
+
+  SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  if( anApp )
+    return dynamic_cast<LightApp_SelectionMgr*>( anApp->selectionMgr() );
+  else
+    return 0;
+}
+
+CORBA::Object_var BLSURFPluginGUI_HypothesisCreator::entryToObject(QString entry)
+{
+  SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen();
+  SALOMEDS::Study_ptr myStudy = smeshGen_i->GetCurrentStudy();
+  CORBA::Object_var obj;
+  SALOMEDS::GenericAttribute_var anAttr;
+  SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.toStdString().c_str() );
+  if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR")) {
+    SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+    CORBA::String_var aVal = anIOR->Value();
+    obj = myStudy->ConvertIORToObject(aVal);
+  }
+  return obj;
+}
+
+int BLSURFPluginGUI_HypothesisCreator::findRowFromEntry(QString entry){
+  QString entryForChecking;
+  int endRow = mySizeMapTable->topLevelItemCount()-1;
+  int row = 0;
+  entryForChecking = mySizeMapTable->topLevelItem( row )->data( SMP_ENTRY_COLUMN, Qt::EditRole ).toString();
+  while (entry != entryForChecking && row <= endRow){
+    row++;
+    entryForChecking = mySizeMapTable->topLevelItem( row )->data( SMP_ENTRY_COLUMN, Qt::EditRole ).toString();
+  }
+  MESSAGE("BLSURFPluginGUI_HypothesisCreator::findRowFromEntry; row = "<<row<<" , endRow ="<<endRow)
+  return row;
+}
+
+
index 15e701e9755c5adfc04eb5f3480dd78406be6491..efd475aa911f98f30f5cc00e26bd8801103f7d6d 100644 (file)
@@ -1,32 +1,34 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2012  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 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.
+// 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
+// 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
+// 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)
+//           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
 // ---
 //
 #ifndef BLSURFPLUGINGUI_HypothesisCreator_H
 #define BLSURFPLUGINGUI_HypothesisCreator_H
 
 #ifdef WIN32
-  #ifdef BLSURFPLUGIN_GUI_EXPORTS
+  #if defined BLSURFPLUGIN_GUI_EXPORTS || defined BLSURFPluginGUI_EXPORTS
     #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllexport )
   #else
     #define BLSURFPLUGIN_GUI_EXPORT __declspec( dllimport )
   #define BLSURFPLUGIN_GUI_EXPORT
 #endif
 
+#ifdef WNT
+// E.A. : On windows with python 2.6, there is a conflict
+// E.A. : between pymath.h and Standard_math.h which define
+// E.A. : some same symbols : acosh, asinh, ...
+#include <Standard_math.hxx>
+#include <pymath.h>
+#endif
+
+#include <Python.h>
+
+#include <QItemDelegate>
+
 #include <SMESHGUI_Hypotheses.h>
+#include "StdMeshersGUI_ObjectReferenceParamWdg.h"
 #include <SALOMEconfig.h>
+#include <cstring>
+#include <map>
+#include <set>
+#include <vector>
+#include <TopAbs_ShapeEnum.hxx>
+#include <GeomSelectionTools.h>
+#include <GEOM_Client.hxx>
 #include CORBA_SERVER_HEADER(BLSURFPlugin_Algorithm)
 
 class QGroupBox;
-class QtxDoubleSpinBox;
 class QComboBox;
 class QCheckBox;
 class QLineEdit;
 class QTableWidget;
+class QTreeWidget;
+class QModelIndex;
 class QSpinBox;
+class QDoubleSpinBox;
 class QMenu;
 class QAction;
+class QTreeWidgetItem;
+class QTableWidgetItem;
+class QObject;
+
+class SMESHGUI_SpinBox;
+class LightApp_SelectionMgr;
+// class DlgBlSurfHyp_Enforced;
+
+// Name
+typedef std::string TEnfName;
+// Entry
+typedef std::string TEntry;
+// List of entries
+typedef std::set<TEntry> TEntryList;
+// Enforced vertex = 3 coordinates
+typedef std::vector<double> TEnfVertexCoords;
+// List of enforced vertices
+typedef std::set< TEnfVertexCoords > TEnfVertexCoordsList;
+// Enforced vertex
+struct TEnfVertex{
+  TEnfName name;
+  TEntry geomEntry;
+  TEnfVertexCoords coords;
+  TEnfName grpName;
+};
+
+
+struct CompareEnfVertices
+{
+  bool operator () (const TEnfVertex* e1, const TEnfVertex* e2) const {
+    if (e1 && e2) {
+      if (e1->coords.size() && e2->coords.size())
+        return (e1->coords < e2->coords);
+      else
+        return (e1->geomEntry < e2->geomEntry);
+    }
+    return false;
+  }
+};
+
+// List of enforced vertices
+typedef std::set< TEnfVertex*, CompareEnfVertices > TEnfVertexList;
+
+// Map Face Entry / List of enforced vertices
+typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap;
+
+// Map Face Entry / InternalEnforcedVertices
+typedef std::map< TEntry, bool > TFaceEntryInternalVerticesMap;
 
 typedef struct
 {
   int     myTopology, myVerbosity;
   int     myPhysicalMesh, myGeometricMesh;
   double  myAngleMeshS, myAngleMeshC, myGradation;
-  QString myPhySize, myGeoMin, myGeoMax, myPhyMin, myPhyMax;
-  bool    myAllowQuadrangles, myDecimesh;
+  double  myPhySize, myGeoMin, myGeoMax, myPhyMin,myPhyMax;
+  bool    myAllowQuadrangles, myDecimesh,mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex,myInternalEnforcedVerticesAllFaces;
+  bool    myPreCADMergeEdges, myPreCADRemoveNanoEdges, myPreCADDiscardInput;
+  double  myPreCADEpsNano;
+//   bool    myGMFFileMode;
+  std::string myGMFFileName, myInternalEnforcedVerticesAllFacesGroup;
+  TEnfVertexList enfVertexList;
+  TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap;
+  /* TODO GROUPS
+  TGroupNameEnfVertexListMap groupNameEnfVertexListMap;
+  */
   QString myName;
-
 } BlsurfHypothesisData;
 
+
+
+// class BLSURFPluginGUI_ObjectReferenceParamWdg: public StdMeshersGUI_ObjectReferenceParamWdg
+// {
+//   Q_OBJECT
+// public:
+//   BLSURFPluginGUI_ObjectReferenceParamWdg( SUIT_SelectionFilter* filter, 
+//                                          QWidget*              parent,
+//                                          bool                  multiSelection=false);
+//   BLSURFPluginGUI_ObjectReferenceParamWdg( MeshObjectType objType,
+//                                          QWidget*       parent,
+//                                          bool           multiSelection=false);
+//   ~BLSURFPluginGUI_ObjectReferenceParamWdg();
+// 
+// private:
+//   void init();
+//   
+// public slots:
+//   void activateSelectionOnly();
+//   void deactivateSelectionOnly();
+//   void setActivationStatus(bool status);
+// };
+
 /*!
  * \brief Class for creation of BLSURF hypotheses
 */
@@ -71,52 +174,184 @@ public:
   BLSURFPluginGUI_HypothesisCreator( const QString& );
   virtual ~BLSURFPluginGUI_HypothesisCreator();
 
-  virtual bool     checkParams() const;
-  virtual QString  helpPage() const;
+  virtual bool        checkParams(QString& msg) const;
+  virtual QString     helpPage() const;
 
 protected:
-  virtual QFrame*  buildFrame    ();
-  virtual void     retrieveParams() const;
-  virtual QString  storeParams   () const;
-  
-  virtual QString  caption() const;
-  virtual QPixmap  icon() const;
-  virtual QString  type() const;
+  virtual QFrame*     buildFrame    ();
+  virtual void        retrieveParams() const;
+  virtual QString     storeParams   () const;
+
+  virtual QString     caption() const;
+  virtual QPixmap     icon() const;
+  virtual QString     type() const;
 
 protected slots:
-  void             onPhysicalMeshChanged();
-  void             onGeometricMeshChanged();
-  void             onAddOption();
-  void             onDeleteOption();
-  void             onOptionChosenInPopup( QAction* );
+  void                onPhysicalMeshChanged();
+  void                onGeometricMeshChanged();
+  void                onAddOption();
+  void                onDeleteOption();
+  void                onChooseGMFFile();
+  void                onOptionChosenInPopup( QAction* );
+  void                onTopologyChanged( int );
+  void                onMapGeomContentModified();
+  void                onSmpItemClicked( QTreeWidgetItem *, int );
+  void                onSmpTabChanged(int);
+  void                onAttractorClicked(int);
+  void                onConstSizeClicked(int);
+  void                onAddMap();
+  void                onRemoveMap();
+  void                onModifyMap();
+  void                onSetSizeMap(QTreeWidgetItem *, int);
+
+  QTreeWidgetItem*    addEnforcedFace(std::string theFaceEntry, std::string theFaceName);
+
+  void                addEnforcedVertex(QTreeWidgetItem * theFaceItem, double x=0, double y=0, double z=0, 
+                                        std::string vertexName = "", std::string geomEntry = "", std::string groupName = "");
+  
+  void                onAddEnforcedVertices();
+  void                onRemoveEnforcedVertex();
+  void                synchronizeCoords();
+  void                updateEnforcedVertexValues(QTreeWidgetItem* , int );
+  void                onSelectEnforcedVertex();
+//   void                deactivateSelection(QWidget*, QWidget*);
+  void                clearEnforcedVertexWidgets();
+  void                onInternalVerticesClicked(int);
 
 private:
-  bool             readParamsFromHypo( BlsurfHypothesisData& ) const;
-  QString          readParamsFromWidgets( BlsurfHypothesisData& ) const;
-  bool             storeParamsToHypo( const BlsurfHypothesisData& ) const;
+  bool                readParamsFromHypo( BlsurfHypothesisData& ) const;
+  QString             readParamsFromWidgets( BlsurfHypothesisData& ) const;
+  bool                storeParamsToHypo( const BlsurfHypothesisData& ) const;
+  bool                sizeMapsValidation();
+  bool                sizeMapValidationFromRow(int,bool displayError = true);
+  bool                sizeMapValidationFromEntry(QString,bool displayError = true);
+  GeomSelectionTools* getGeomSelectionTool();
+  GEOM::GEOM_Gen_var  getGeomEngine();
+  //void                insertElementType( TopAbs_ShapeEnum );
+  void                insertElement( GEOM::GEOM_Object_var, bool modify = false );
+  void                insertAttractor(GEOM::GEOM_Object_var, GEOM::GEOM_Object_var, bool modify = false);
+  int                 findRowFromEntry(QString entry);
+  CORBA::Object_var   entryToObject(QString entry);
+  static LightApp_SelectionMgr* selectionMgr();
 
 private:
   QWidget*            myStdGroup;
   QLineEdit*          myName;
   QComboBox*          myPhysicalMesh;
-  QLineEdit*          myPhySize;
-  QLineEdit*          myPhyMin;
-  QLineEdit*          myPhyMax;
+  SMESHGUI_SpinBox*   myPhySize;
+  SMESHGUI_SpinBox*   myPhyMin;
+  SMESHGUI_SpinBox*   myPhyMax;
   QComboBox*          myGeometricMesh;
-  QtxDoubleSpinBox*   myAngleMeshS;
-  QtxDoubleSpinBox*   myAngleMeshC;
-  QLineEdit*          myGeoMin;
-  QLineEdit*          myGeoMax;
-  QtxDoubleSpinBox*   myGradation;
+  SMESHGUI_SpinBox*   myAngleMeshS;
+  SMESHGUI_SpinBox*   myAngleMeshC;
+  SMESHGUI_SpinBox*   myGeoMin;
+  SMESHGUI_SpinBox*   myGeoMax;
+  SMESHGUI_SpinBox*   myGradation;
   QCheckBox*          myAllowQuadrangles;
   QCheckBox*          myDecimesh;
 
   QWidget*            myAdvGroup;
   QComboBox*          myTopology;
+  QGroupBox*          myPreCADGroupBox;
+  QCheckBox*          myPreCADMergeEdges;
+  QCheckBox*          myPreCADRemoveNanoEdges;
+  QCheckBox*          myPreCADDiscardInput;
+  SMESHGUI_SpinBox*   myPreCADEpsNano;
   QSpinBox*           myVerbosity;
   QTableWidget*       myOptionTable;
+  QLineEdit*          myGMFFileName;
+//   QCheckBox*          myGMFFileMode;
+
+  // Sizemap widgets
+  QWidget             *mySmpGroup;
+  QTreeWidget         *mySizeMapTable;
+  QPushButton         *addMapButton;
+  QPushButton         *removeMapButton;
+  QPushButton         *modifyMapButton;
+  QTabWidget          *smpTab; 
+  QWidget             *myAttractorGroup;
+  QWidget             *mySmpStdGroup;
+  QCheckBox           *myAttractorCheck;
+  QCheckBox           *myConstSizeCheck;
+  QGroupBox           *myDistanceGroup;
+//   QGroupBox           *myParamsGroup;
+//   QWidget             *myParamsGroup;
+  SMESHGUI_SpinBox    *myAttSizeSpin;
+  SMESHGUI_SpinBox    *myAttDistSpin;
+  SMESHGUI_SpinBox    *myAttDistSpin2;
+  SMESHGUI_SpinBox    *mySmpSizeSpin;
+  QLabel              *myAttDistLabel;
+  QLabel              *myAttDistLabel2;
+  QLabel              *myAttSizeLabel;
+  // Selection widgets for size maps
+  StdMeshersGUI_ObjectReferenceParamWdg *myGeomSelWdg1;
+  StdMeshersGUI_ObjectReferenceParamWdg *myGeomSelWdg2;
+  StdMeshersGUI_ObjectReferenceParamWdg *myAttSelWdg;
+  StdMeshersGUI_ObjectReferenceParamWdg *myDistSelWdg;
+  GEOM::GEOM_Object_var                  mySMapObject;
+  GEOM::GEOM_Object_var                  myAttObject;
+  GEOM::GEOM_Object_var                  myDistObject;
+  
+  
+  
+  
+  QWidget*            myEnfGroup;
+//    TODO FACE AND VERTEX SELECTION
+  StdMeshersGUI_ObjectReferenceParamWdg *myEnfFaceWdg;
+  GEOM::GEOM_Object_var myEnfFace;
+  StdMeshersGUI_ObjectReferenceParamWdg *myEnfVertexWdg;
+  GEOM::GEOM_Object_var myEnfVertex;
+
+//   DlgBlSurfHyp_Enforced* myEnforcedVertexWidget;
+  QTreeWidget*        myEnforcedTreeWidget;
+  SMESHGUI_SpinBox*   myXCoord;
+  SMESHGUI_SpinBox*   myYCoord;
+  SMESHGUI_SpinBox*   myZCoord;
+
+  QLineEdit*          myGroupName;
+//   QGroupBox*          makeGroupsCheck;
+//   QCheckBox*          myGlobalGroupName;
+
+  QPushButton*        addVertexButton;
+  QPushButton*        removeVertexButton;
+
+  QCheckBox           *myInternalEnforcedVerticesAllFaces;
+  QLineEdit           *myInternalEnforcedVerticesAllFacesGroup;
+
+  // map =  entry , size map
+  QMap<QString, QString>          mySMPMap;           // Map <face entry, size>
+  QMap<QString, QString>          myATTMap;           // Map <face entry, att. entry>
+  QMap<QString, double>           myDistMap;          // Map <entry,distance with constant size> 
+  QMap<QString, double>           myAttDistMap;       // Map <entry, influence distance> 
+  QMap<QString, TopAbs_ShapeEnum> mySMPShapeTypeMap;
+  GeomSelectionTools*             GeomToolSelected;
+  LightApp_SelectionMgr*          aSel;
+
+  BLSURFPlugin::string_array_var myOptions, myPreCADOptions;
+
+  PyObject *          main_mod;
+  PyObject *          main_dict;
+};
+
+
+class EnforcedTreeWidgetDelegate : public QItemDelegate
+{
+    Q_OBJECT
+
+public:
+  EnforcedTreeWidgetDelegate(QObject *parent = 0);
+
+  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
+                        const QModelIndex &index) const;
+
+  void setEditorData(QWidget *editor, const QModelIndex &index) const;
+  void setModelData(QWidget *editor, QAbstractItemModel *model,
+                    const QModelIndex &index) const;
+
+  void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
+                    const QModelIndex &index) const;
 
-  BLSURFPlugin::string_array_var myOptions;
+  bool vertexExists(QAbstractItemModel *model, const QModelIndex &index, QString value) const;
 };
 
 #endif // BLSURFPLUGINGUI_HypothesisCreator_H
index 1ccb479dbbeca9411ce09cc7c40f17c734a28d98..62c3f594e1082ee10aa5403d0111598c679f85df 100644 (file)
@@ -1,27 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<!--
-  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
-
--->
-<TS version="1.1" >
+<TS version="2.0" language="en_US">
     <context>
         <name>@default</name>
+        <message>
+            <source>BLSURF_ICON_SELECT</source>
+            <translation>mesh_select_BLSURF.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_BLSURF_PARAMETERS</source>
             <translation>mesh_hypo_BLSURF.png</translation>
index 0e4e862624982800837a5331beac72078a1b6241..e533c0a41ed93105075cff055b1f885a0460aa4f 100644 (file)
+<?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<!--
-  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
-
--->
-<TS version="1.1" >
-    <context>
-        <name>@default</name>
-        <message>
-            <source>ADD_OPTION</source>
-            <translation>Add option</translation>
-        </message>
-        <message>
-            <source>BLSURF_ALLOW_QUADRANGLES</source>
-            <translation>Allow Quadrangles (Test)</translation>
-        </message>
-        <message>
-            <source>BLSURF_ANGLE_MESH_C</source>
-            <translation>Angle Mesh C</translation>
-        </message>
-        <message>
-            <source>BLSURF_ANGLE_MESH_S</source>
-            <translation>Angle Mesh S</translation>
-        </message>
-        <message>
-            <source>BLSURF_CUSTOM_GEOM</source>
-            <translation>Custom</translation>
-        </message>
-        <message>
-            <source>BLSURF_CUSTOM_USER</source>
-            <translation>Custom</translation>
-        </message>
-        <message>
-            <source>BLSURF_DECIMESH</source>
-            <translation>Patch independent</translation>
-        </message>
-        <message>
-            <source>BLSURF_DEFAULT_GEOM</source>
-            <translation>None</translation>
-        </message>
-        <message>
-            <source>BLSURF_DEFAULT_USER</source>
-            <translation>None</translation>
-        </message>
-        <message>
-            <source>BLSURF_GEOM_MESH</source>
-            <translation>Geometrical Mesh</translation>
-        </message>
-        <message>
-            <source>BLSURF_GRADATION</source>
-            <translation>Gradation</translation>
-        </message>
-        <message>
-            <source>BLSURF_HGEOMAX</source>
-            <translation>Max Geometrical Size</translation>
-        </message>
-        <message>
-            <source>BLSURF_HGEOMIN</source>
-            <translation>Min Geometrical Size</translation>
-        </message>
-        <message>
-            <source>BLSURF_HPHYDEF</source>
-            <translation>User Size</translation>
-        </message>
-        <message>
-            <source>BLSURF_HPHYMAX</source>
-            <translation>Max Physical Size</translation>
-        </message>
-        <message>
-            <source>BLSURF_HPHYMIN</source>
-            <translation>Min Physical Size</translation>
-        </message>
-        <message>
-            <source>BLSURF_HYPOTHESIS</source>
-            <translation>BLSURF 2D</translation>
-        </message>
-        <message>
-            <source>BLSURF_PHY_MESH</source>
-            <translation>Physical Mesh</translation>
-        </message>
-        <message>
-            <source>BLSURF_TITLE</source>
-            <translation>Hypothesis Construction</translation>
-        </message>
-        <message>
-            <source>BLSURF_TOPOLOGY</source>
-            <translation>Topology</translation>
-        </message>
-        <message>
-            <source>BLSURF_TOPOLOGY_CAD</source>
-            <translation>From CAD</translation>
-        </message>
-        <message>
-            <source>BLSURF_TOPOLOGY_PROCESS</source>
-            <translation>Pre-process</translation>
-        </message>
-        <message>
-            <source>BLSURF_TOPOLOGY_PROCESS2</source>
-            <translation>Pre-process++</translation>
-        </message>
-        <message>
-            <source>BLSURF_VERBOSITY</source>
-            <translation>Verbosity level</translation>
-        </message>
-        <message>
-            <source>OBLIGATORY_VALUE</source>
-            <translation>(Obligatory value)</translation>
-        </message>
-        <message>
-            <source>OPTION_NAME_COLUMN</source>
-            <translation>Option</translation>
-        </message>
-        <message>
-            <source>OPTION_VALUE_COLUMN</source>
-            <translation>Value</translation>
-        </message>
-        <message>
-            <source>REMOVE_OPTION</source>
-            <translation>Clear option</translation>
-        </message>
-    </context>
+<TS version="2.0" language="en_US">
+<context>
+    <name>@default</name>
+    <message>
+        <source>ADD_OPTION</source>
+        <translation>Add option</translation>
+    </message>
+    <message>
+        <source>BLSURF_ALLOW_QUADRANGLES</source>
+        <translation>Allow Quadrangles (Test)</translation>
+    </message>
+    <message>
+        <source>BLSURF_ANGLE_MESH_C</source>
+        <translation>Angle Mesh C</translation>
+    </message>
+    <message>
+        <source>BLSURF_ANGLE_MESH_S</source>
+        <translation>Angle Mesh S</translation>
+    </message>
+    <message>
+        <source>BLSURF_CUSTOM_GEOM</source>
+        <translation>Custom</translation>
+    </message>
+    <message>
+        <source>BLSURF_CUSTOM_USER</source>
+        <translation>Custom</translation>
+    </message>
+    <message>
+        <source>BLSURF_DECIMESH</source>
+        <translation>Patch independent</translation>
+    </message>
+    <message>
+        <source>BLSURF_DEFAULT_GEOM</source>
+        <translation>None</translation>
+    </message>
+    <message>
+        <source>BLSURF_DEFAULT_USER</source>
+        <translation>None</translation>
+    </message>
+    <message>
+        <source>BLSURF_GEOM_MESH</source>
+        <translation>Geometrical Mesh</translation>
+    </message>
+    <message>
+        <source>BLSURF_GRADATION</source>
+        <translation>Gradation</translation>
+    </message>
+    <message>
+        <source>BLSURF_HGEOMAX</source>
+        <translation>Max Geometrical Size</translation>
+    </message>
+    <message>
+        <source>BLSURF_HGEOMIN</source>
+        <translation>Min Geometrical Size</translation>
+    </message>
+    <message>
+        <source>BLSURF_HPHYDEF</source>
+        <translation>User Size</translation>
+    </message>
+    <message>
+        <source>BLSURF_HPHYMAX</source>
+        <translation>Max Physical Size</translation>
+    </message>
+    <message>
+        <source>BLSURF_HPHYMIN</source>
+        <translation>Min Physical Size</translation>
+    </message>
+    <message>
+        <source>BLSURF_HYPOTHESIS</source>
+        <translation>BLSURF 2D</translation>
+    </message>
+    <message>
+        <source>BLSURF_PHY_MESH</source>
+        <translation>Physical Mesh</translation>
+    </message>
+    <message>
+        <source>BLSURF_ADV_ARGS</source>
+        <translation>Advanced</translation>
+    </message>
+    <message>
+        <source>BLSURF_TITLE</source>
+        <translation>Hypothesis Construction</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY</source>
+        <translation>Topology</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY_CAD</source>
+        <translation>From CAD</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY_PROCESS</source>
+        <translation>Pre-process</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY_PROCESS2</source>
+        <translation>Pre-process++</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY_PRECAD</source>
+        <translation>PreCAD</translation>
+    </message>
+    <message>
+        <source>BLSURF_VERBOSITY</source>
+        <translation>Verbosity level</translation>
+    </message>
+    <message>
+        <source>OBLIGATORY_VALUE</source>
+        <translation>(Obligatory value)</translation>
+    </message>
+    <message>
+        <source>OPTION_TYPE_COLUMN</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>OPTION_NAME_COLUMN</source>
+        <translation>Option</translation>
+    </message>
+    <message>
+        <source>OPTION_VALUE_COLUMN</source>
+        <translation>Value</translation>
+    </message>
+    <message>
+        <source>OPTION_MENU_BLSURF</source>
+        <translation>BLSURF</translation>
+    </message>
+    <message>
+        <source>OPTION_MENU_PRECAD</source>
+        <translation>PreCAD</translation>
+    </message>
+    <message>
+        <source>REMOVE_OPTION</source>
+        <translation>Clear option</translation>
+    </message>
+    <message>
+        <source>BLSURF_GMF_FILE</source>
+        <translation>Export GMF</translation>
+    </message>
+    <message>
+        <source>BLSURF_GMF_MODE</source>
+        <translation>Binary</translation>
+    </message>
+    <message>
+        <source>BLSURF_GMF_FILE_DIALOG</source>
+        <translation>Select GMF file...</translation>
+    </message>
+    <message>
+        <source>BLSURF_GMF_FILE_FORMAT</source>
+        <translation>GMF File (*.mesh *.meshb)</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_GROUP</source>
+        <translation>PreCAD options</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_MERGE_EDGES</source>
+        <translation>Merge edges</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_REMOVE_NANO_EDGES</source>
+        <translation>Remove nano edges</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_DISCARD_INPUT</source>
+        <translation>Discard input topology</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_EPS_NANO</source>
+        <translation>Nano edge length</translation>
+    </message>
+    <message>
+        <source>BLSURF_SIZE_MAP</source>
+        <translation>Local Size</translation>
+    </message>
+    <message>
+        <source>SMP_ENTRY_COLUMN</source>
+        <translation>Entry</translation>
+    </message>
+    <message>
+        <source>SMP_NAME_COLUMN</source>
+        <translation>Name</translation>
+    </message>
+    <message>
+        <source>SMP_SIZEMAP_COLUMN</source>
+        <translation>Local size</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_SURFACE</source>
+        <translation>On face (or group)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_EDGE</source>
+        <translation>On edge (or group)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_POINT</source>
+        <translation>On point (or group)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_ATTRACTOR</source>
+        <translation>Add Attractor</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_STD_TAB</source>
+        <translation>Simple map</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_ATT_TAB</source>
+        <translation>Advanced</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_PARAMS</source>
+        <translation>Parameters</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATTRACTOR</source>
+        <translation>Attractor</translation>
+    </message>
+    <message>
+        <source>BLSURF_CONST_SIZE</source>
+        <translation>Constant size near shape</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATT_DIST</source>
+        <translation>Influence dist.</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATT_RADIUS</source>
+        <translation>Constant over</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_SIZE</source>
+        <translation>Local Size</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_DIST</source>
+        <translation>Distance</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_SHAPE</source>
+        <translation>Select a shape</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_VERTICES</source>
+        <translation>Select vertices</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_FACE</source>
+        <translation>Select a face</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_FACES</source>
+        <translation>Select faces</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_ATTRACTOR</source>
+        <translation>Select the attractor</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_ADD</source>
+        <translation>Add</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_MODIFY</source>
+        <translation>Modify</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_REMOVE</source>
+        <translation>Remove</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_SURF_VALUE</source>
+        <translation>Size on face(s)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_EDGE_VALUE</source>
+        <translation>Size on edge(s)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_POINT_VALUE</source>
+        <translation>Size on point(s)</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER</source>
+        <translation>Enforced vertices</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_FACE_ENTRY_COLUMN</source>
+        <translation>Face Entry</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_NAME_COLUMN</source>
+        <translation>Name</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_X_COLUMN</source>
+        <translation>X</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_Y_COLUMN</source>
+        <translation>Y</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_Z_COLUMN</source>
+        <translation>Z</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_ENTRY_COLUMN</source>
+        <translation>Vertex Entry</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_GROUP_COLUMN</source>
+        <translation>Group</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_SELECT_FACE</source>
+        <translation>Select a face</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_SELECT_VERTEX</source>
+        <translation>Select a vertex</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_X_LABEL</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_Y_LABEL</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_Z_LABEL</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_GROUP_LABEL</source>
+        <translation>Group:</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_VERTEX</source>
+        <translation>Add</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_REMOVE</source>
+        <translation>Remove</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_INTERNAL_VERTICES</source>
+        <translation>Use internal vertices of all faces</translation>
+    </message>
+</context>
 </TS>
diff --git a/src/GUI/BLSURFPlugin_msg_fr.ts b/src/GUI/BLSURFPlugin_msg_fr.ts
new file mode 100755 (executable)
index 0000000..6a8bde3
--- /dev/null
@@ -0,0 +1,355 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR" sourcelanguage="en_US">
+<context>
+    <name>@default</name>
+    <message>
+        <source>ADD_OPTION</source>
+        <translation>Ajouter l&apos;option</translation>
+    </message>
+    <message>
+        <source>BLSURF_ALLOW_QUADRANGLES</source>
+        <translation>Autoriser les quadrangles (Test)</translation>
+    </message>
+    <message>
+        <source>BLSURF_ANGLE_MESH_C</source>
+        <translation>Angle de maillage C</translation>
+    </message>
+    <message>
+        <source>BLSURF_ANGLE_MESH_S</source>
+        <translation>Angle de maillage S</translation>
+    </message>
+    <message>
+        <source>BLSURF_CUSTOM_GEOM</source>
+        <translation>Personnalisé</translation>
+    </message>
+    <message>
+        <source>BLSURF_CUSTOM_USER</source>
+        <translation>Personnalisé</translation>
+    </message>
+    <message>
+        <source>BLSURF_DECIMESH</source>
+        <translation>S&apos;affranchir des frontières des surfaces</translation>
+    </message>
+    <message>
+        <source>BLSURF_DEFAULT_GEOM</source>
+        <translation>Inactif</translation>
+    </message>
+    <message>
+        <source>BLSURF_DEFAULT_USER</source>
+        <translation>Inactif</translation>
+    </message>
+    <message>
+        <source>BLSURF_GEOM_MESH</source>
+        <translation>Maillage géométrique</translation>
+    </message>
+    <message>
+        <source>BLSURF_GRADATION</source>
+        <translation>Taux d&apos;accroissement</translation>
+    </message>
+    <message>
+        <source>BLSURF_HGEOMAX</source>
+        <translation>Taille géométrique maximale</translation>
+    </message>
+    <message>
+        <source>BLSURF_HGEOMIN</source>
+        <translation>Taille géométrique minimale</translation>
+    </message>
+    <message>
+        <source>BLSURF_HPHYDEF</source>
+        <translation>Taille d&apos;utilisateur</translation>
+    </message>
+    <message>
+        <source>BLSURF_HPHYMAX</source>
+        <translation>Taille physique maximale</translation>
+    </message>
+    <message>
+        <source>BLSURF_HPHYMIN</source>
+        <translation>Taille physique minimale</translation>
+    </message>
+    <message>
+        <source>BLSURF_HYPOTHESIS</source>
+        <translation>BLSURF 2D</translation>
+    </message>
+    <message>
+        <source>BLSURF_PHY_MESH</source>
+        <translation>Maillage physique</translation>
+    </message>
+    <message>
+        <source>BLSURF_ADV_ARGS</source>
+        <translation>Avancé</translation>
+    </message>
+    <message>
+        <source>BLSURF_TITLE</source>
+        <translation>Construction d&apos;une hypothèse</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY</source>
+        <translation>Topologie</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY_CAD</source>
+        <translation>A partir de la CAO</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY_PROCESS</source>
+        <translation>Prétraitement</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY_PROCESS2</source>
+        <translation>Prétraitement++</translation>
+    </message>
+    <message>
+        <source>BLSURF_TOPOLOGY_PRECAD</source>
+        <translation>PreCAD</translation>
+    </message>
+    <message>
+        <source>BLSURF_VERBOSITY</source>
+        <translation>Niveau de verbosité</translation>
+    </message>
+    <message>
+        <source>OBLIGATORY_VALUE</source>
+        <translation>(Valeur obligatoire)</translation>
+    </message>
+    <message>
+        <source>OPTION_TYPE_COLUMN</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>OPTION_NAME_COLUMN</source>
+        <translation>Option</translation>
+    </message>
+    <message>
+        <source>OPTION_VALUE_COLUMN</source>
+        <translation>Valeur</translation>
+    </message>
+    <message>
+        <source>OPTION_MENU_BLSURF</source>
+        <translation>BLSURF</translation>
+    </message>
+    <message>
+        <source>OPTION_MENU_PRECAD</source>
+        <translation>PreCAD</translation>
+    </message>
+    <message>
+        <source>REMOVE_OPTION</source>
+        <translation>Effacer l&apos;option</translation>
+    </message>
+    <message>
+        <source>BLSURF_GMF_FILE</source>
+        <translation>Export GMF</translation>
+    </message>
+    <message>
+        <source>BLSURF_GMF_MODE</source>
+        <translation>Binaire</translation>
+    </message>
+    <message>
+        <source>BLSURF_GMF_FILE_DIALOG</source>
+        <translation>Choisir un fichier au format GMF...</translation>
+    </message>
+    <message>
+        <source>BLSURF_GMF_FILE_FORMAT</source>
+        <translation>Fichier GMF (*.mesh *.meshb)</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_GROUP</source>
+        <translation>Options PreCAD</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_MERGE_EDGES</source>
+        <translation>Fusionner des arêtes</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_REMOVE_NANO_EDGES</source>
+        <translation>Supprimer les petites arêtes</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_DISCARD_INPUT</source>
+        <translation>Ignorer la topologie</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_EPS_NANO</source>
+        <translation>Longueur max des petites arêtes</translation>
+    </message>
+    <message>
+        <source>BLSURF_SIZE_MAP</source>
+        <translation>Tailles locales</translation>
+    </message>
+    <message>
+        <source>SMP_ENTRY_COLUMN</source>
+        <translation>Entrée</translation>
+    </message>
+    <message>
+        <source>SMP_NAME_COLUMN</source>
+        <translation>Nom</translation>
+    </message>
+    <message>
+        <source>SMP_SIZEMAP_COLUMN</source>
+        <translation>Taille locale</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_SURFACE</source>
+        <translation>Sur une face (ou groupe)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_EDGE</source>
+        <translation>Sur une arête (ou groupe)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_POINT</source>
+        <translation>Sur un point (ou groupe)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_ATTRACTOR</source>
+        <translation>Ajouter un attracteur</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_STD_TAB</source>
+        <translation>Simple</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_ATT_TAB</source>
+        <translation>Avancé</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_REMOVE</source>
+        <translation>Supprimer</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_ADD</source>
+        <translation>Ajouter</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_MODIFY</source>
+        <translation>Modifier</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_PARAMS</source>
+        <translation>Paramètres</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATTRACTOR</source>
+        <translation>Attracteur</translation>
+    </message>
+    <message>
+        <source>BLSURF_CONST_SIZE</source>
+        <translation>Taille constante autour d&apos;un objet</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATT_DIST</source>
+        <translation>Dist. d&apos;influence :</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATT_RADIUS</source>
+        <translation>Constant sur :</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_SIZE</source>
+        <translation>Taille Locale :</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_DIST</source>
+        <translation>Distance</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_SHAPE</source>
+        <translation>Sélectionnez un objet</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_VERTICES</source>
+        <translation>Sélectionnez une/des point(s)</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_FACE</source>
+        <translation>Sélectionnez une face</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_FACES</source>
+        <translation>Sélectionnez une/des face(s)</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_ATTRACTOR</source>
+        <translation>Sélectionnez l&apos;attracteur</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_SURF_VALUE</source>
+        <translation>Taille sur les/la face(s)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_EDGE_VALUE</source>
+        <translation>Taille sur les/l&apos;arête(s)</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_POINT_VALUE</source>
+        <translation>Taille sur les/le point(s)</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER</source>
+        <translation>Points de passage</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_FACE_ENTRY_COLUMN</source>
+        <translation>ID de face</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_NAME_COLUMN</source>
+        <translation>Nom</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_X_COLUMN</source>
+        <translation>X</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_Y_COLUMN</source>
+        <translation>Y</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_Z_COLUMN</source>
+        <translation>Z</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_ENTRY_COLUMN</source>
+        <translation>ID de point</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_GROUP_COLUMN</source>
+        <translation>Groupe</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_SELECT_FACE</source>
+        <translation>Sélectionner une face</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_SELECT_VERTEX</source>
+        <translation>Sélectionner un point</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_X_LABEL</source>
+        <translation>X:</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_Y_LABEL</source>
+        <translation>Y:</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_Z_LABEL</source>
+        <translation>Z:</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_GROUP_LABEL</source>
+        <translation>Groupe:</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_VERTEX</source>
+        <translation>Ajouter</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_REMOVE</source>
+        <translation>Supprimer</translation>
+    </message>
+    <message>
+        <source>BLSURF_ENF_VER_INTERNAL_VERTICES</source>
+        <translation>Utiliser les points internes de toutes les faces</translation>
+    </message>
+</context>
+</TS>
index 20136b45c65394de65bbb0d1c853619804a06144..8f0b6a0f5ba8c91a957310f65452de42f69079ce 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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 =
+salomeinclude_HEADERS =        \
+       BLSURFPluginGUI_HypothesisCreator.h
 
 # Libraries targets
 lib_LTLIBRARIES = libBLSURFPluginGUI.la
 
-dist_libBLSURFPluginGUI_la_SOURCES =           \
-       BLSURFPluginGUI.cxx                     \
-       BLSURFPluginGUI_HypothesisCreator.h     \
+dist_libBLSURFPluginGUI_la_SOURCES = \
+       BLSURFPluginGUI.cxx \
        BLSURFPluginGUI_HypothesisCreator.cxx
 
 MOC_FILES = \
@@ -51,20 +52,24 @@ libBLSURFPluginGUI_la_CPPFLAGS =    \
        $(GEOM_CXXFLAGS)                \
        $(MED_CXXFLAGS)                 \
        $(SMESH_CXXFLAGS)               \
+       $(VTK_INCLUDES) \
        $(BOOST_CPPFLAGS)               \
        $(CORBA_CXXFLAGS)               \
        $(CORBA_INCLUDES)               \
        $(BLSURF_INCLUDES)              \
        -I$(srcdir)/../BLSURFPlugin     \
-       -I$(top_builddir)/idl           \
-       -I$(top_builddir)/salome_adm/unix
+       -I$(top_builddir)/idl
 
 libBLSURFPluginGUI_la_LDFLAGS =                        \
+       $(QT_LIBS) \
        ../BLSURFPlugin/libBLSURFEngine.la      \
-       ${SMESH_LDFLAGS} -lSMESH                \
+       $(GUI_LDFLAGS) -lqtx -lSalomeApp -lsuit -lSalomeObject -lLightApp       \
+       $(GEOM_LDFLAGS) -lGEOM \
+       ${SMESH_LDFLAGS} -lSMESH -lGeomSelectionTools -lStdMeshersGUI -lSMESHFiltersSelection \
        $(CAS_KERNEL) $(BLSURF_LIBS)
 
 # resources files
 nodist_salomeres_DATA =                \
        BLSURFPlugin_images.qm  \
-       BLSURFPlugin_msg_en.qm
+       BLSURFPlugin_msg_en.qm  \
+       BLSURFPlugin_msg_fr.qm
index 5768f50c0bdba0a449307d6999b6d42125d6e128..55f2b5c0acd86fea3d632737a71e7538160b7090 100644 (file)
@@ -1,21 +1,22 @@
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2012  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 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.
+# 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
+# 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
+# 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)
@@ -29,4 +30,4 @@ if BLSURFPLUGIN_ENABLE_GUI
   SUBDIRS += GUI
 endif
 
-DIST_SUBDIRS = BLSURFPlugin GUI
\ No newline at end of file
+DIST_SUBDIRS = BLSURFPlugin GUI