]> SALOME platform Git repositories - plugins/hexoticplugin.git/commitdiff
Salome HOME
Merge from V6_main 13/12/2012 BR_KERNEL_REFACTORING V7_siman V7_1_0_pre
authorvsr <vsr@opencascade.com>
Thu, 13 Dec 2012 12:27:50 +0000 (12:27 +0000)
committervsr <vsr@opencascade.com>
Thu, 13 Dec 2012 12:27:50 +0000 (12:27 +0000)
17 files changed:
adm_local/unix/config_files/check_Hexotic.m4
doc/salome/gui/HexoticPLUGIN/CMakeLists.txt [new file with mode: 0755]
doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png
doc/salome/gui/HexoticPLUGIN/input/hexotic_hypo.doc
idl/HexoticPlugin_Algorithm.idl
src/GUI/HexoticPLUGIN_msg_en.ts
src/GUI/HexoticPLUGIN_msg_fr.ts
src/GUI/HexoticPluginGUI_HypothesisCreator.cxx
src/GUI/HexoticPluginGUI_HypothesisCreator.h
src/GUI/HexoticPluginGUI_StdWidget_QTD.ui
src/GUI/Makefile.am
src/HexoticPlugin/HexoticPlugin_Hexotic.cxx
src/HexoticPlugin/HexoticPlugin_Hexotic.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx

index ec17b4766998a28fd6747758f70e0085444e9a61..43876ccc1853a3d8267454789cda6e1ed6e85c67 100755 (executable)
@@ -22,59 +22,40 @@ dnl  Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
 dnl
 AC_DEFUN([CHECK_HEXOTIC],[
 
-AC_REQUIRE([AC_PROG_CXX])dnl
-AC_REQUIRE([AC_PROG_CXXCPP])dnl
-
 AC_CHECKING(for Hexotic commercial product)
 
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-
-AC_ARG_WITH(,
-           [  --with-hexotic=DIR      root directory path of Hexotic installation])
+AC_ARG_WITH([hexotic],
+           [AC_HELP_STRING([--with-hexotic=EXEC],
+                           [hexotic executable])],
+            [],
+            [with_hexotic=auto])
 
 Hexotic_ok=no
 
 if test "$with_hexotic" == "no" ; then
     AC_MSG_WARN(You have choosen building plugin without Hexotic)
 else
+    echo
+    echo -------------------------------------------------
+    echo You are about to choose to use somehow the
+    echo Hexotic commercial product to generate 3D hexahedral mesh.
+    echo
+    
     if test "$with_hexotic" == "yes" || test "$with_hexotic" == "auto"; then
-        Hexotic_HOME=""
+       AC_PATH_PROG([Hexotic],[hexotic])
     else
-        Hexotic_HOME="$with_hexotic"
+       Hexotic="$with_hexotic"
+       AC_MSG_RESULT([Use $Hexotic as hexotic executable])
     fi
     
-    if test "$Hexotic_HOME" == "" ; then
-        if test "x$HexoticHOME" != "x" ; then
-            Hexotic_HOME=$HexoticHOME
-        else
-            AC_MSG_WARN(Build plugin without Hexotic)
-        fi
-    fi
-    
-    if test "x$Hexotic_HOME" != "x"; then
-    
-      echo
-      echo -------------------------------------------------
-      echo You are about to choose to use somehow the
-      echo Hexotic commercial product to generate 3D hexahedral mesh.
-      echo
-    
-      AC_CHECKING(for Hexotic executable)
-    
-      AC_CHECK_PROG(Hexotic,hexotic,found)
-    
-      if test "x$Hexotic" == x ; then
-        AC_MSG_WARN(hexotic program not found in PATH variable)
+    if test "x$Hexotic" == x ; then
+        AC_MSG_WARN(hexotic program is not found in PATH variable)
         AC_MSG_WARN(Build plugin without Hexotic)
-      else
+    else
         Hexotic_ok=yes
-      fi
-    
     fi
 fi
 
 AC_MSG_RESULT(for Hexotic: $Hexotic_ok)
-AC_LANG_RESTORE
 
 ])dnl
diff --git a/doc/salome/gui/HexoticPLUGIN/CMakeLists.txt b/doc/salome/gui/HexoticPLUGIN/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..d49781b
--- /dev/null
@@ -0,0 +1,75 @@
+# Copyright (C) 2012  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# 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(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
+
+SET(top_builddir ${CMAKE_BINARY_DIR})
+SET(top_srcdir ${CMAKE_SOURCE_DIR})
+SET(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
+SET(builddir ${CMAKE_CURRENT_BINARY_DIR})
+SET(datadir${CMAKE_INSTALL_PREFIX}/share)
+SET(docdir ${datadir}/doc/salome)
+SET(guidocdir ${docdir}/gui/HexoticPLUGIN)
+
+SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
+SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py)
+SALOME_CONFIGURE_FILE(static/header.html.in ${builddir}/static/header.html)
+SALOME_CONFIGURE_FILE(static/header_py.html.in ${builddir}/static/header_py.html)
+
+SET(DOC_SMESH_MeshersList HexoticPLUGIN)
+SET(f "$(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py")
+IF(WINDOWS)
+  STRING(REPLACE "/" "\\" f ${f})
+  STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PYTHONPATH%
+  @SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python\;%PYTHONPATH%
+  @SET PATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PATH%
+  @SET PATH=$ENV{KERNEL_ROOT_DIR}/lib/salome\;%PATH%
+  @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/bin/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=$ENV{MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=$ENV{MED_ROOT_DIR}/bin/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/bin/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=$ENV{SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=$ENV{SMESH_ROOT_DIR}/bin/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
+  @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome\;%PYTHONPATH%
+  @SET SMESH_MeshersList=${DOC_SMESH_MeshersList}
+  ")
+  SET(EXT "bat")
+  SET(CALL_STR "call")
+ELSE(WINDOWS)
+  SET(DOC_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/bin/salome:${SMESH_ROOT_DIR}/bin/salome:${SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${GEOM_ROOT_DIR}/bin/salome:${GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${KERNEL_ROOT_DIR}/bin/salome:${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${OMNIORB_ROOT_USER}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT_USER}/lib64/python${PYTHON_VERSION}/site-packages)
+  SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:${PYTHONPATH}
+  export SMESH_MeshersList=${DOC_SMESH_MeshersList}
+  ")
+  SET(EXT "sh")
+  SET(CALL_STR ".")
+ENDIF(WINDOWS)
+
+FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} "${SCR}")
+
+ADD_CUSTOM_TARGET(usr_docs ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} && ${PYTHON_EXECUTABLE} ${f} -d -o smesh.py HexoticPLUGIN
+  COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
+  COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
+  COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.remove(r'''smesh.py'''); os.remove(r'''tmp_env.${EXT}''')"
+  COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/HexoticPLUGIN''',True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''',r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/HexoticPLUGIN''', ignore=shutil.ignore_patterns('*usr_docs*', '*CMakeFiles*', '*.cmake', 'doxyfile*', '*.vcproj', 'static', 'Makefile*')); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''',r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/HexoticPLUGIN'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''',r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/HexoticPLUGIN/hexoticpluginpy_doc''')"
+  VERBATIM 
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}             
+)
index c4797319884b8d9c62867110c70eeaf5e9575bc0..a91e133d48ed6f6b559c7b23f1be084ead3e11bb 100644 (file)
Binary files a/doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png differ
index bfed6b2e421d4cbb417b10f499c1caff267b9dca..168ddaea05c9b059e2e0f24bf6ffb01825c06da7 100644 (file)
@@ -38,6 +38,9 @@ Parameters by default).</li>
 <li><b>Verbosity</b> - specifies the verbose level to print information on meshing steps.
 </li>
 
+<li><b>Max memory (MB)</b> - specifies the maximum allocatable memory in MegaBytes.
+</li>
+
 <li><b>Sub-domains mesh mode</b> - This option allows the user to mesh or not mesh internal subdomains (such as holes), or to mesh non-manifold domains.
 <ul>
 <li>sd 1 : meshes in inside/out mode: the internal cavities are ignored, the whole domain is meshed into a single domain;</li>
index 293da24e8a2939b5b3d7a4dd606533a02d9232ec..31a9f90ea078826705a38da77e910e450a359765 100644 (file)
@@ -76,6 +76,9 @@ module HexoticPlugin
    
     void SetHexoticVerbosity(in long value);
     long GetHexoticVerbosity();
+
+    void SetHexoticMaxMemory(in long value);
+    long GetHexoticMaxMemory();
   };
 };
 
index e6bf808230596aaf7ad11c1d50a58c2e91e69f71..d19476798638713a4fc04ca3af1a0859a0b6ea69 100644 (file)
         <source>Hexotic_VERBOSITY</source>
         <translation>Verbosity</translation>
     </message>
+    <message>
+        <source>Hexotic_MAX_MEMORY</source>
+        <translation>Max memory (MB)</translation>
+    </message>
     <message>
         <source>Hexotic_SUBDOMAIN_MESH_MODE</source>
         <translation>Sub-domains mesh mode</translation>
index 97930c188c51d94b83a36397e7ef44f0d7870b91..12e77d01e0876f9e0c0b9296154659d9a9986661 100755 (executable)
         <source>Hexotic_INVALID_ELEMENTS</source>
         <translation>Autoriser des éléments invalides</translation>
     </message>
-    <message>
-        <source>Hexotic_QUADRANGLES</source>
-        <translation>Quadrangles Salomé</translation>
-    </message>
     <message>
         <source>Hexotic_SHARP_ANGLE_THRESHOLD</source>
         <translation>Seuil d&apos;un angle aigu en degrés</translation>
         <source>Hexotic_VERBOSITY</source>
         <translation>Verbosité</translation>
     </message>
+    <message>
+        <source>Hexotic_MAX_MEMORY</source>
+        <translation>Mémoire maximum (MB)</translation>
+    </message>
     <message>
         <source>Hexotic_SUBDOMAIN_MESH_MODE</source>
         <translation>Mode de maillage des sous-domaines</translation>
index 9208a04d9bd625d119f4c9fdd31be42b7095c001..ace81f176ea6c409acc40fcc6ec839cbe38d24e5 100644 (file)
@@ -180,6 +180,8 @@ void HexoticPluginGUI_HypothesisCreator::retrieveParams() const
 
   myStdWidget->myHexoticVerbosity->setValue( data.myHexoticVerbosity );
 
+  myStdWidget->myHexoticMaxMemory->setValue( data.myHexoticMaxMemory );
+
   myStdWidget->myHexoticSdMode->setCurrentIndex(data.myHexoticSdMode);
 
   std::cout << "myStdWidget->myMinSize->value(): " << myStdWidget->myMinSize->value() << std::endl;
@@ -203,6 +205,7 @@ void HexoticPluginGUI_HypothesisCreator::printData( HexoticHypothesisData& data)
   valStr += tr("Hexotic_NB_PROC") + " = " + QString::number( data.myHexoticNbProc ) + "; ";
   valStr += tr("Hexotic_WORKING_DIR") + " = " + data.myHexoticWorkingDir + "; ";
   valStr += tr("Hexotic_VERBOSITY") + " = " + QString::number( data.myHexoticVerbosity ) + "; ";
+  valStr += tr("Hexotic_MAX_MEMORY") + " = " + QString::number( data.myHexoticMaxMemory ) + "; ";
   valStr += tr("Hexotic_SD_MODE") + " = " + QString::number( data.myHexoticSdMode ) + "; ";
 
   std::cout << "Data: " << valStr.toStdString() << std::endl;
@@ -225,6 +228,7 @@ QString HexoticPluginGUI_HypothesisCreator::storeParams() const
   valStr += tr("Hexotic_NB_PROC") + " = " + QString::number( data.myHexoticNbProc ) + "; ";
   valStr += tr("Hexotic_WORKING_DIR") + " = " + data.myHexoticWorkingDir + "; ";
   valStr += tr("Hexotic_VERBOSITY") + " = " + QString::number( data.myHexoticVerbosity) + "; ";
+  valStr += tr("Hexotic_MAX_MEMORY") + " = " + QString::number( data.myHexoticMaxMemory ) + "; ";
   valStr += tr("Hexotic_SD_MODE") + " = " + QString::number( data.myHexoticSdMode) + "; ";
 
 //  std::cout << "Data: " << valStr.toStdString() << std::endl;
@@ -249,6 +253,7 @@ bool HexoticPluginGUI_HypothesisCreator::readParamsFromHypo( HexoticHypothesisDa
   h_data.myHexoticNbProc = h->GetHexoticNbProc();
   h_data.myHexoticWorkingDir = h->GetHexoticWorkingDirectory();
   h_data.myHexoticVerbosity = h->GetHexoticVerbosity();
+  h_data.myHexoticMaxMemory = h->GetHexoticMaxMemory();
   h_data.myHexoticSdMode = h->GetHexoticSdMode()-1;
 
   return true;
@@ -276,6 +281,7 @@ bool HexoticPluginGUI_HypothesisCreator::storeParamsToHypo( const HexoticHypothe
     h->SetHexoticNbProc( h_data.myHexoticNbProc );
     h->SetHexoticWorkingDirectory( h_data.myHexoticWorkingDir.toLatin1().constData() );
     h->SetHexoticVerbosity( h_data.myHexoticVerbosity );
+    h->SetHexoticMaxMemory( h_data.myHexoticMaxMemory );
     h->SetHexoticSdMode( h_data.myHexoticSdMode+1 );
   }
   catch(const SALOME::SALOME_Exception& ex)
@@ -296,7 +302,8 @@ bool HexoticPluginGUI_HypothesisCreator::readParamsFromWidgets( HexoticHypothesi
   h_data.myHexoticNbProc = myStdWidget->myHexoticNbProc->value();
   h_data.myHexoticWorkingDir = myStdWidget->myHexoticWorkingDir->text();
   h_data.myHexoticVerbosity = myStdWidget->myHexoticVerbosity->value();
-       h_data.myHexoticSdMode = myStdWidget->myHexoticSdMode->currentIndex();
+  h_data.myHexoticMaxMemory = myStdWidget->myHexoticMaxMemory->value();
+  h_data.myHexoticSdMode = myStdWidget->myHexoticSdMode->currentIndex();
 
   h_data.myMinSize = myStdWidget->myMinSize->text().isEmpty() ? 0.0 : myStdWidget->myMinSize->value();
   h_data.myMaxSize = myStdWidget->myMaxSize->text().isEmpty() ? 0.0 : myStdWidget->myMaxSize->value();
index 7757e9344a2ac6d7da2aef4367ca4ac658692314..a68de66308ef76c717df17e62b5fd5a1356f2088 100644 (file)
@@ -46,6 +46,7 @@ typedef struct
   int      myHexoticNbProc;
   QString  myHexoticWorkingDir;
   int      myHexoticVerbosity;
+  int      myHexoticMaxMemory;
   int      myHexoticSdMode;
 } HexoticHypothesisData;
 
index c708c4e59d722cb0511c1ae55b79f37eddf27dd5..9cfa5b977bb4b6c5e7783b390cf0a7db34333832 100644 (file)
@@ -2,6 +2,14 @@
 <ui version="4.0">
  <class>HexoticPluginGUI_StdWidget_QTD</class>
  <widget class="QWidget" name="HexoticPluginGUI_StdWidget_QTD">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>561</width>
+    <height>581</height>
+   </rect>
+  </property>
   <layout class="QGridLayout" name="gridLayout">
    <property name="margin">
     <number>0</number>
    <item row="5" column="3">
     <widget class="QLineEdit" name="myHexoticWorkingDir"/>
    </item>
-   <item row="6" column="0">
+   <item row="7" column="0">
     <widget class="QLabel" name="label_8">
      <property name="text">
       <string>Hexotic_VERBOSITY</string>
      </property>
     </widget>
    </item>
-   <item row="6" column="3">
+   <item row="7" column="3">
     <widget class="QSpinBox" name="myHexoticVerbosity">
      <property name="maximum">
       <number>2</number>
      </property>
     </widget>
    </item>
-   <item row="7" column="0" colspan="4">
+   <item row="8" column="0" colspan="4">
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
       <string>Hexotic_SUBDOMAIN_MESH_MODE</string>
      </property>
     </widget>
    </item>
+   <item row="6" column="0">
+    <widget class="QLabel" name="label_9">
+     <property name="text">
+      <string>Hexotic_MAX_MEMORY</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="3">
+    <widget class="QSpinBox" name="myHexoticMaxMemory">
+     <property name="maximum">
+      <number>99999</number>
+     </property>
+     <property name="singleStep">
+      <number>128</number>
+     </property>
+     <property name="value">
+      <number>2048</number>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
   </customwidget>
  </customwidgets>
  <tabstops>
+  <tabstop>myMinSize</tabstop>
+  <tabstop>myMaxSize</tabstop>
+  <tabstop>myHexesMinLevel</tabstop>
+  <tabstop>myHexesMaxLevel</tabstop>
   <tabstop>myHexoticIgnoreRidges</tabstop>
+  <tabstop>myHexoticInvalidElements</tabstop>
   <tabstop>myHexoticSharpAngleThreshold</tabstop>
   <tabstop>myHexoticNbProc</tabstop>
   <tabstop>dirBtn</tabstop>
   <tabstop>myHexoticWorkingDir</tabstop>
+  <tabstop>myHexoticMaxMemory</tabstop>
   <tabstop>myHexoticVerbosity</tabstop>
   <tabstop>myHexoticSdMode</tabstop>
  </tabstops>
index 2fb5bc0e420754cf22d37da991c55725d4d5675b..f5d02d70fc2710901278b8e65cc4f9b177b96080 100644 (file)
@@ -69,6 +69,7 @@ libHexoticPluginGUI_la_CPPFLAGS =     \
 
 libHexoticPluginGUI_la_LDFLAGS =                          \
        ../HexoticPlugin/libHexoticEngine.la               \
+       ../../idl/libSalomeIDLHexoticPLUGIN.la \
        ${SMESH_LDFLAGS} -lSMESH                           \
        $(CAS_KERNEL)                                      \
        $(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp            \
index 8ee7dba46e9573817fd12e5b021434c6ac02b209..c188a4850409eaf4a87133049aff8e560362ebe0 100644 (file)
 #include "HexoticPlugin_Hexotic.hxx"
 #include "HexoticPlugin_Hypothesis.hxx"
 
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
-
-#include <TopoDS.hxx>
-#include <TopExp_Explorer.hxx>
-#include <OSD_File.hxx>
-
 #include "utilities.h"
 
 #ifndef WIN32
@@ -45,9 +38,9 @@
 #define DUMP(txt)
 #endif
 
-#include <SMESHDS_GroupBase.hxx>
 #include <SMESHDS_Mesh.hxx>
-#include <SMESH_ControlsDef.hxx>
+#include <SMESHDS_GroupBase.hxx>
+#include <SMESH_ComputeError.hxx>
 #include <SMESH_File.hxx>
 #include <SMESH_Gen.hxx>
 #include <SMESH_HypoFilter.hxx>
 
 #include <Standard_ProgramError.hxx>
 
-#include <BRepClass3d_SolidClassifier.hxx>
-#include <Bnd_Box.hxx>
+#include <BRep_Tool.hxx>
 #include <BRepBndLib.hxx>
-#include <Precision.hxx>
-
+#include <BRepClass3d_SolidClassifier.hxx>
 #include <BRepBuilderAPI_MakeVertex.hxx>
-#include <BRep_Tool.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_Array1OfShape.hxx>
-#include <BRepExtrema_DistShapeShape.hxx>
-#include <TColStd_Array1OfReal.hxx>
 #include <BRepExtrema_DistShapeShape.hxx>
+#include <OSD_File.hxx>
+#include <Precision.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopoDS.hxx>
 
 static void removeFile( const TCollection_AsciiString& fileName )
 {
@@ -241,7 +232,7 @@ static TopoDS_Shape findShape(SMDS_MeshNode**     t_Node,
 //=======================================================================
 
 static int findEdge(const SMDS_MeshNode* aNode,
-                    const SMESHDS_Mesh*  theMesh,
+                    const SMESHDS_Mesh*  aMesh,
                     const int            nEdge,
                     const TopoDS_Shape*  t_Edge) {
 
@@ -270,7 +261,7 @@ static int findEdge(const SMDS_MeshNode* aNode,
   }
 
   delete [] t_Dist;
-  return theMesh->ShapeToIndex( foundEdge );
+  return aMesh->ShapeToIndex( foundEdge );
 }
 
 //=======================================================================
@@ -355,270 +346,9 @@ static void removeHexoticFiles(TCollection_AsciiString file_In, TCollection_Asci
   removeFile( file_Out );
 }
 
-//=======================================================================
-//function : writeHexoticFile
-//purpose  : 
-//=======================================================================
-
-static bool writeHexoticFile (std::ofstream&                       theFile,
-                              const SMESHDS_Mesh*                  theMesh,
-                              std::map <int,int>&                  theSmdsToHexoticIdMap,
-                              std::map <int,const SMDS_MeshNode*>& /*theHexoticIdToNodeMap*/,
-                              const TCollection_AsciiString&       Hexotic_In) {
-  cout << std::endl;
-  cout << "Creating Hexotic processed mesh file : " << Hexotic_In << std::endl;
-
-  int nbShape = 0;
-
-  TopExp_Explorer expface(theMesh->ShapeToMesh(), TopAbs_FACE);
-  for ( ; expface.More(); expface.Next() )
-    nbShape++;
-
-  int *tabID;
-  int *tabNodeId;
-  TopoDS_Shape *tabShape, aShape;
-
-  int shapeID;
-  bool idFound;
-
-  int nbVertices    = 0;
-  int nbTriangles   = 0;
-  const char* space = "  ";
-  int dummy_0D      = 0;
-  int dummy_2D;
-  int nbNodes = 0;
-
-  int aSmdsNodeID = 1;
-  const SMDS_MeshNode* aNode;
-  SMDS_NodeIteratorPtr itOnNode;
-
-  std::list< const SMDS_MeshElement* > faces;
-  std::list< const SMDS_MeshElement* >::iterator itListFace;
-  const SMDS_MeshElement* aFace;
-  SMESHDS_SubMesh* theSubMesh;
-  std::map<int,int>::const_iterator itOnSmdsNode;
-  SMDS_ElemIteratorPtr itOnSubNode, itOnSubFace;
-
-// Writing SMESH points into Hexotic File
-
-  nbVertices = theMesh->NbNodes();
-
-  theFile << "MeshVersionFormatted 2" << std::endl;
-  theFile << std::endl;
-  theFile << "Dimension" << std::endl;
-  theFile << 3 << std::endl;
-  theFile << "# Set of mesh vertices" << std::endl;
-  theFile << "Vertices" << std::endl;
-  theFile << nbVertices << std::endl;
-
-  tabID     = new int[nbShape];
-  tabNodeId = new int[ nbVertices ];
-  tabShape  = new TopoDS_Shape[nbShape];
-
-  itOnNode = theMesh->nodesIterator();
-  while ( itOnNode->more() ) {
-      aNode = itOnNode->next();
-      dummy_0D = aNode->getshapeId();
-      tabNodeId[ aSmdsNodeID - 1 ] = 0;
-      idFound  = false;
-      for ( int j=0; j< aSmdsNodeID; j++ ) {
-        if ( dummy_0D == tabNodeId[j] ) {
-          idFound = true;
-          break;
-        }
-      }
-      if ( ! idFound )
-        tabNodeId[ aSmdsNodeID - 1 ] = dummy_0D;
-      theSmdsToHexoticIdMap.insert(std::map <int,int>::value_type( aNode->GetID(), aSmdsNodeID ));
-      aSmdsNodeID++;
-      theFile << aNode->X() << space << aNode->Y() << space << aNode->Z() << space << dummy_0D << std::endl;
-      }
-
-// Writing SMESH faces into Hexotic File
-
-  ostringstream triaOut;
-  nbTriangles = 0;
-
-  expface.ReInit();
-  for ( int i = 0; expface.More(); expface.Next(), i++ ) {
-    tabID[i] = 0;
-    aShape   = expface.Current();
-    shapeID  = theMesh->ShapeToIndex( aShape );
-    idFound  = false;
-    for ( int j=0; j<=i; j++) {
-      if ( shapeID == tabID[j] ) {
-        idFound = true;
-        break;
-      }
-    }
-    if ( ! idFound ) {
-      tabID[i]    = shapeID;
-      tabShape[i] = aShape;
-    }
-  }
-  for ( int i=0; i<nbShape; i++ ) {
-    if ( ! (tabID[i] == 0) ) {
-      aShape      = tabShape[i];
-      shapeID     = tabID[i];
-      theSubMesh  = theMesh->MeshElements( aShape );
-      itOnSubFace = theSubMesh->GetElements();
-      while ( itOnSubFace->more() ) {
-        aFace    = itOnSubFace->next();
-        dummy_2D = shapeID;
-        
-        nbNodes = aFace->IsQuadratic() ? aFace->NbNodes()/2 : aFace->NbNodes();
-        if ( nbNodes == 3 ) // triangle
-        {
-          nbTriangles++;
-          for ( int i = 0; i < nbNodes; ++i )
-          {
-            aSmdsNodeID = aFace->GetNode( i )->GetID();
-            itOnSmdsNode = theSmdsToHexoticIdMap.find( aSmdsNodeID );
-            ASSERT( itOnSmdsNode != theSmdsToHexoticIdMap.end() );
-            triaOut << (*itOnSmdsNode).second << space;
-          }
-          triaOut << dummy_2D << std::endl;
-        }
-        else // polygon
-        {
-          int nbTria = nbNodes - 2, n0 = theSmdsToHexoticIdMap[ aFace->GetNode(0)->GetID() ];
-          nbTriangles += nbTria;
-          for ( int i = 0; i < nbTria; ++i )
-          {
-            triaOut << n0 << space;
-            triaOut << theSmdsToHexoticIdMap[ aFace->GetNode(i+1)->GetID() ] << space;
-            triaOut << theSmdsToHexoticIdMap[ aFace->GetNode(i+2)->GetID() ] << space;
-            triaOut << dummy_2D << std::endl;
-          }
-        }
-      }
-    }
-  }
-
-  theFile << std::endl;
-  theFile << "# Set of mesh triangles (v1,v2,v3,tag)" << std::endl;
-  theFile << "Triangles" << std::endl;
-  theFile << nbTriangles << std::endl;
-  theFile << triaOut.str() << std::endl;
-
-  theFile << std::endl;
-  theFile << "End" << std::endl;
-
-  cout << "Processed mesh file created, it contains :" << std::endl;
-  cout << "    " << nbVertices  << " vertices"  << std::endl;
-  cout << "    " << nbTriangles << " triangles" << std::endl;
-  cout << std::endl;
-
-  delete [] tabID;
-  delete [] tabNodeId;
-  delete [] tabShape;
-
-  return true;
-}
-
-//=======================================================================
-//function : writeHexoticFile
-//purpose  : 
-//=======================================================================
-
-static bool writeHexoticFile (std::ofstream&                       theFile,
-                              const SMESH_MesherHelper*            theHelper,
-                              std::map <int,int>&                  theSmdsToHexoticIdMap,
-                              const TCollection_AsciiString&       Hexotic_In)
-{
-  cout << std::endl;
-  cout << "Creating Hexotic processed mesh file : " << Hexotic_In << std::endl;
-
-  int nbVertices    = 0;
-  int nbTriangles   = 0;
-  const char* space = "  ";
-  int dummy_0D      = 0;
-  int dummy_2D      = 0;
-
-  int aSmdsNodeID = 1;
-  const SMDS_MeshNode* aNode;
-  SMDS_NodeIteratorPtr itOnNode;
-
-  const SMDS_MeshElement* aFace;
-  std::map<int,int>::const_iterator itOnSmdsNode;
-  SMDS_ElemIteratorPtr itOnSubNode, itOnSubFace;
-
-  // Writing SMESH points into Hexotic File
-
-  nbVertices = theHelper->GetMeshDS()->NbNodes();
-
-  theFile << "MeshVersionFormatted 2" << std::endl;
-  theFile << std::endl;
-  theFile << "Dimension" << std::endl;
-  theFile << 3 << std::endl;
-  theFile << "# Set of mesh vertices" << std::endl;
-  theFile << "Vertices" << std::endl;
-  theFile << nbVertices << std::endl;
-
-  itOnNode = theHelper->GetMeshDS()->nodesIterator();
-  while ( itOnNode->more() )
-  {
-    aNode = itOnNode->next();
-    theSmdsToHexoticIdMap.insert(make_pair( aNode->GetID(), aSmdsNodeID ));
-    aSmdsNodeID++;
-    theFile << aNode->X() << space << aNode->Y() << space << aNode->Z() << space << dummy_0D << std::endl;
-  }
-
-  // Writing SMESH faces into Hexotic File
-
-  ostringstream triaOut;
-
-  itOnSubFace = theHelper->GetMeshDS()->elementsIterator(SMDSAbs_Face);
-  while ( itOnSubFace->more() )
-  {
-    aFace = itOnSubFace->next();
-    int nbNodes = aFace->IsQuadratic() ? aFace->NbNodes()/2 : aFace->NbNodes();
-    if ( nbNodes == 3 ) // triangle
-    {
-      nbTriangles++;
-      for ( int i = 0; i < nbNodes; ++i )
-      {
-        aSmdsNodeID = aFace->GetNode( i )->GetID();
-        itOnSmdsNode = theSmdsToHexoticIdMap.find( aSmdsNodeID );
-        ASSERT( itOnSmdsNode != theSmdsToHexoticIdMap.end() );
-        triaOut << (*itOnSmdsNode).second << space;
-      }
-      triaOut << dummy_2D << std::endl;
-    }
-    else // polygon
-    {
-      int nbTria = nbNodes - 2, n0 = theSmdsToHexoticIdMap[ aFace->GetNode(0)->GetID() ];
-      nbTriangles += nbTria;
-      for ( int i = 0; i < nbTria; ++i )
-      {
-        triaOut << n0 << space;
-        triaOut << theSmdsToHexoticIdMap[ aFace->GetNode(i+1)->GetID() ] << space;
-        triaOut << theSmdsToHexoticIdMap[ aFace->GetNode(i+2)->GetID() ] << space;
-        triaOut << dummy_2D << std::endl;
-      }
-    }
-  }
-
-  theFile << std::endl;
-  theFile << "# Set of mesh triangles (v1,v2,v3,tag)" << std::endl;
-  theFile << "Triangles" << std::endl;
-  theFile << nbTriangles << std::endl;
-  theFile << triaOut.str() << std::endl;
-
-  theFile << std::endl;
-  theFile << "End" << std::endl;
-
-  cout << "Processed mesh file created, it contains :" << std::endl;
-  cout << "    " << nbVertices  << " vertices"  << std::endl;
-  cout << "    " << nbTriangles << " triangles" << std::endl;
-  cout << std::endl;
-
-  return true;
-}
-
 //=======================================================================
 //function : readResult
-//purpose  : 
+//purpose  : Read GMF file in case of a mesh with geometry
 //=======================================================================
 
 static bool readResult(std::string         theFile,
@@ -628,8 +358,7 @@ static bool readResult(std::string         theFile,
                        SMESHDS_Mesh*       theMesh,
                        const int           nbShape,
                        const TopoDS_Shape* tabShape,
-                       double**            tabBox,
-                       const int           sdMode)
+                       double**            tabBox)
 {
   // ---------------------------------
   // Optimisation of the plugin ...
@@ -672,7 +401,6 @@ static bool readResult(std::string         theFile,
   TopoDS_Shape *tabCorner, *tabEdge;
 
   const int nbDomains = countShape( theMesh, TopAbs_SHELL );
-  MESSAGE("Nb domains in the meshed shape: " << nbDomains );
   const int holeID = -1;
 
   // tabID    = new int[nbShape];
@@ -850,7 +578,7 @@ static bool readResult(std::string         theFile,
               else {
                 shapeID = tabID[0];
               }
-              if ( (sdMode == 4 && shapeID != holeID) || sdMode != 2 )
+              if ( shapeID != holeID )
                 aHexoticElement = theMesh->AddVolume( node[0], node[3], node[2], node[1], node[4], node[7], node[6], node[5] );
               break;
             }
@@ -910,15 +638,14 @@ static bool readResult(std::string         theFile,
 
 //=======================================================================
 //function : readResult
-//purpose  : 
+//purpose  : Read GMF file in case of a mesh w/o geometry
 //=======================================================================
 
-static bool readResult(std::string            theFile,
+static bool readResult(std::string theFile,
 #ifdef WITH_SMESH_CANCEL_COMPUTE
-                       HexoticPlugin_Hexotic* theAlgo,
+                       HexoticPlugin_Hexotic*  theAlgo,
 #endif
-                       SMESH_MesherHelper*    theHelper,
-                       const int              sdMode)
+                       SMESH_MesherHelper* theHelper)
 {
   SMESHDS_Mesh* theMesh = theHelper->GetMeshDS();
 
@@ -1090,6 +817,7 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
     _hexoticNbProc = hyp->GetHexoticNbProc();
     _hexoticWorkingDirectory = hyp->GetHexoticWorkingDirectory();
     _hexoticVerbosity = hyp->GetHexoticVerbosity();
+    _hexoticMaxMemory = hyp->GetHexoticMaxMemory();
     _hexoticSdMode = hyp->GetHexoticSdMode();
   }
   else {
@@ -1106,6 +834,7 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
     _hexoticNbProc = hyp->GetDefaultHexoticNbProc();
     _hexoticWorkingDirectory = hyp->GetDefaultHexoticWorkingDirectory();
     _hexoticVerbosity = hyp->GetDefaultHexoticVerbosity();
+    _hexoticMaxMemory = hyp->GetDefaultHexoticMaxMemory();
     _hexoticSdMode = hyp->GetDefaultHexoticSdMode();
   }
 }
@@ -1151,6 +880,7 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   cout << "Hexotic execution..." << std::endl;
   cout << _name << " parameters :" << std::endl;
   cout << "    " << _name << " Verbosity = " << _hexoticVerbosity << std::endl;
+  cout << "    " << _name << " Max Memory = " << _hexoticMaxMemory << std::endl;
   cout << "    " << _name << " Segments Min Level = " << _hexesMinLevel << std::endl;
   cout << "    " << _name << " Segments Max Level = " << _hexesMaxLevel << std::endl;
   cout << "    " << _name << " Segments Min Size = " << _hexesMinSize << std::endl;
@@ -1171,8 +901,9 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   TCollection_AsciiString subdom = " -sd ", sharp = " -sharp ";
   TCollection_AsciiString proc = " -nproc ";
   TCollection_AsciiString verb = " -v ";
+  TCollection_AsciiString maxmem = " -m ";
 
-  TCollection_AsciiString minLevel, maxLevel, minSize, maxSize, sharpAngle, mode, nbproc, verbosity;
+  TCollection_AsciiString minLevel, maxLevel, minSize, maxSize, sharpAngle, mode, nbproc, verbosity, maxMemory;
   minLevel = _hexesMinLevel;
   maxLevel = _hexesMaxLevel;
   minSize = _hexesMinSize;
@@ -1181,6 +912,7 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   mode = _hexoticSdMode;
   nbproc = _hexoticNbProc;
   verbosity = _hexoticVerbosity;
+  maxMemory = _hexoticMaxMemory;
 
   if (_hexoticIgnoreRidges)
     run_Hexotic +=  ignoreRidges;
@@ -1207,6 +939,7 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   run_Hexotic += subdom + mode;
   run_Hexotic += proc + nbproc;
   run_Hexotic += verb + verbosity;
+  run_Hexotic += maxmem + maxMemory;
 
   return run_Hexotic.ToCString();
 }
@@ -1217,14 +950,14 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
  */
 //=============================================================================
 
-bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          theMesh,
-                                     const TopoDS_Shape& theShape)
+bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
+                                     const TopoDS_Shape& aShape)
 {
 #ifdef WITH_SMESH_CANCEL_COMPUTE
   _compute_canceled = false;
 #endif
   bool Ok = true;
-  SMESHDS_Mesh* meshDS = theMesh.GetMeshDS();
+  SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
   TCollection_AsciiString hexahedraMessage;
 
   if (_iShape == 0 && _nbShape == 0) {
@@ -1235,7 +968,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          theMesh,
   // to prevent from displaying error message after computing,
   // SetIsAlwaysComputed( true ) to empty sub-meshes
   for ( int i = 0; i < _nbShape; ++i )
-    if ( SMESH_subMesh* sm = theMesh.GetSubMeshContaining( theShape ))
+    if ( SMESH_subMesh* sm = aMesh.GetSubMeshContaining( aShape ))
     {
       SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true,
                                                                /*complexShapeFirst=*/false);
@@ -1307,9 +1040,9 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          theMesh,
 #endif
       Hexotic_In  = aTmpDir + "Hexotic_In.mesh";
       removeHexoticFiles(Hexotic_In, Hexotic_Out);
-      std::ofstream HexoticFile (Hexotic_In.ToCString(), std::ios::out);
-      Ok = ( writeHexoticFile(HexoticFile, meshDS, aSmdsToHexoticIdMap, aHexoticIdToNodeMap, Hexotic_In) );
-      HexoticFile.close();
+      cout << std::endl;
+      cout << "Creating Hexotic input mesh file : " << Hexotic_In << std::endl;
+      aMesh.ExportGMF(Hexotic_In.ToCString(), meshDS, true);
 #ifdef WITH_BLSURFPLUGIN
     }
     else {
@@ -1324,14 +1057,6 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          theMesh,
     cout << std::endl;
     cout << "Hexotic command : " << run_Hexotic << std::endl;
 
-    
-//     removeHexoticFiles(Hexotic_In, Hexotic_Out);
-// 
-//     std::ofstream HexoticFile (Hexotic_In.ToCString(), std::ios::out);
-// 
-//     Ok = ( writeHexoticFile(HexoticFile, meshDS, aSmdsToHexoticIdMap, aHexoticIdToNodeMap, Hexotic_In) );
-
-//     HexoticFile.close();
     modeFile_In += Hexotic_In;
     system( modeFile_In.ToCString() );
     aSmdsToHexoticIdMap.clear();
@@ -1353,8 +1078,22 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          theMesh,
 #ifdef WITH_SMESH_CANCEL_COMPUTE
                        this,
 #endif
-                       meshDS, _nbShape, tabShape, tabBox, _hexoticSdMode );
+                       meshDS, _nbShape, tabShape, tabBox );
       if(Ok)
+/*********************
+// TODO: Detect and remove elements in holes in case of sd mode = 4
+      // Remove previous nodes and elements
+      SMDS_ElemIteratorPtr itElement = meshDS->elementsIterator();
+      SMDS_NodeIteratorPtr itNode = meshDS->nodesIterator();
+    
+      while ( itElement->more() )
+        meshDS->RemoveElement( itElement->next() );
+      while ( itNode->more() )
+        meshDS->RemoveNode( itNode->next() );
+  
+      SMESH_ComputeErrorPtr myError = aMesh.GMFToMesh(Hexotic_Out.ToCString());
+      if (myError)
+*/
         hexahedraMessage = "success";
       else
         hexahedraMessage = "failed";
@@ -1406,6 +1145,9 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
 #ifdef WITH_SMESH_CANCEL_COMPUTE
   _compute_canceled = false;
 #endif
+/*
+  SMESH_ComputeErrorPtr myError = SMESH_ComputeError::New();
+*/
   bool Ok = true;
   TCollection_AsciiString hexahedraMessage;
 
@@ -1425,16 +1167,11 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
   std::string run_Hexotic = getHexoticCommand(Hexotic_In, Hexotic_Out);
   run_Hexotic += std::string(" 1 > ") + aLogFileName.ToCString();  // dump into file
 
-  cout << std::endl;
-  cout << "Hexotic command : " << run_Hexotic << std::endl;
-
   removeHexoticFiles(Hexotic_In, Hexotic_Out);
 
-  std::ofstream HexoticFile (Hexotic_In.ToCString(), std::ios::out);
-
-  Ok = ( writeHexoticFile(HexoticFile, aHelper, aSmdsToHexoticIdMap, Hexotic_In) );
-
-  HexoticFile.close();
+  cout << std::endl;
+  cout << "Creating Hexotic input mesh file : " << Hexotic_In << std::endl;
+  aMesh.ExportGMF(Hexotic_In.ToCString(), aHelper->GetMeshDS());
   modeFile_In += Hexotic_In;
   system( modeFile_In.ToCString() );
   aSmdsToHexoticIdMap.clear();
@@ -1442,6 +1179,8 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
 
   MESSAGE("HexoticPlugin_Hexotic::Compute");
 
+  cout << std::endl;
+  cout << "Hexotic command : " << run_Hexotic << std::endl;
   system( run_Hexotic.data() );
 
   // --------------
@@ -1456,13 +1195,40 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
 #ifdef WITH_SMESH_CANCEL_COMPUTE
                      this,
 #endif
-                     aHelper, _hexoticSdMode );
+                     aHelper );
     if(Ok)
+/*
+    // Remove previous nodes and elements
+    SMDS_ElemIteratorPtr itElement = aHelper->GetMeshDS()->elementsIterator();
+    SMDS_NodeIteratorPtr itNode = aHelper->GetMeshDS()->nodesIterator();
+    
+    while ( itElement->more() )
+      aHelper->GetMeshDS()->RemoveElement( itElement->next() );
+    while ( itNode->more() )
+      aHelper->GetMeshDS()->RemoveNode( itNode->next() );
+
+    // Import GMF mesh
+    myError = aMesh.GMFToMesh(Hexotic_Out.ToCString());
+    
+    itElement = aHelper->GetMeshDS()->elementsIterator();
+    itNode = aHelper->GetMeshDS()->nodesIterator();
+
+    // Assign nodes and elements to the pseudo shape
+    while ( itNode->more() )
+      aHelper->GetMeshDS()->SetNodeInVolume(itNode->next(), 1);
+    while ( itElement->more() )
+      aHelper->GetMeshDS()->SetMeshElementOnShape(itElement->next(), 1);
+
+    if(myError->IsOK())
+*/
       hexahedraMessage = "success";
     else
       hexahedraMessage = "failed";
   }
   else {
+/*
+    myError->myName = COMPERR_EXCEPTION;
+*/
     hexahedraMessage = "failed";
     cout << "Problem with Hexotic output file " << Hexotic_Out << std::endl;
     // analyse log file
@@ -1484,6 +1250,9 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
     return error(SMESH_Comment("interruption initiated by user"));
 #endif
   return Ok;
+/*
+  return myError->IsOK();
+*/
 }
 
 //=============================================================================
index dae3a5b1ebc1c9a9a1bc3e65c94d8ea9bbba5c30..621f3e58019ed8cee618bb94be718ffda27f4805 100644 (file)
@@ -91,6 +91,7 @@ private:
   int  _hexoticNbProc;
   std::string  _hexoticWorkingDirectory;
   int _hexoticVerbosity;
+  int _hexoticMaxMemory;
   int _hexoticSdMode;
   SMDS_MeshNode** _tabNode;
   
index 29a828be11d86c77e3aa6ebcd366ba620de25a6e..47ac5f4e012dfe6be64f56abf771c412e9cfd08a 100644 (file)
@@ -45,7 +45,8 @@ HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis (int hypId, int studyId,
     _hexoticNbProc( GetDefaultHexoticNbProc() ),
     _hexoticWorkingDirectory( GetDefaultHexoticWorkingDirectory() ),
     _hexoticSdMode(GetDefaultHexoticSdMode()),
-    _hexoticVerbosity(GetDefaultHexoticVerbosity())
+    _hexoticVerbosity(GetDefaultHexoticVerbosity()),
+    _hexoticMaxMemory(GetDefaultHexoticMaxMemory())
 {
   MESSAGE("HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis");
   _name = "Hexotic_Parameters";
@@ -136,6 +137,13 @@ void HexoticPlugin_Hypothesis::SetHexoticVerbosity(int theVal) {
   }
 }
 
+void HexoticPlugin_Hypothesis::SetHexoticMaxMemory(int theVal) {
+  if (theVal != _hexoticMaxMemory) {
+    _hexoticMaxMemory = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
 //=============================================================================
 /*!
  *  
@@ -157,6 +165,7 @@ std::ostream& HexoticPlugin_Hypothesis::SaveTo(std::ostream& save)
   save<<"maxSize="<<_maxSize<<";";
   save<<"hexoticSdMode="<<_hexoticSdMode<<";";
   save<<"hexoticVerbosity="<<_hexoticVerbosity<<";";
+  save<<"hexoticMaxMemory="<<_hexoticMaxMemory<<";";
   return save;
 }
 
@@ -200,6 +209,7 @@ std::istream& HexoticPlugin_Hypothesis::LoadFrom(std::istream& load)
       if (str3=="maxSize") _maxSize = atof(str4.c_str());
       if (str3=="hexoticSdMode") _hexoticSdMode = atoi(str4.c_str());
       if (str3=="hexoticVerbosity") _hexoticVerbosity = atoi(str4.c_str());
+      if (str3=="hexoticMaxMemory") _hexoticMaxMemory = atoi(str4.c_str());
    }
    return load;
 }
@@ -320,4 +330,9 @@ int HexoticPlugin_Hypothesis::GetDefaultHexoticVerbosity()
   return 1;
 }
 
+int HexoticPlugin_Hypothesis::GetDefaultHexoticMaxMemory()
+{
+  return 2048;
+}
+
 
index 430284e37e3ed15c849078c3a05cd874a724b336..cd0f7be359f6456c7a2153e156b74986e4a4496d 100644 (file)
@@ -72,6 +72,9 @@ public:
   void SetHexoticVerbosity(int theVal);
   int GetHexoticVerbosity() const { return _hexoticVerbosity; }
 
+  void SetHexoticMaxMemory(int theVal);
+  int GetHexoticMaxMemory() const { return _hexoticMaxMemory; }
+
   // the parameters default values 
 
   static int GetDefaultHexesMinLevel();
@@ -85,6 +88,7 @@ public:
   static std::string GetDefaultHexoticWorkingDirectory();
   static int GetDefaultHexoticSdMode();
   static int GetDefaultHexoticVerbosity();
+  static int GetDefaultHexoticMaxMemory();
 
   // Persistence
   virtual std::ostream& SaveTo(std::ostream& save);
@@ -117,6 +121,7 @@ private:
   int    _hexoticNbProc;
   int    _hexoticSdMode;
   int    _hexoticVerbosity;
+  int    _hexoticMaxMemory;
   std::string _hexoticWorkingDirectory ;
 };
 
index 60f091c43a3b118cbf7ff84962266ed5737a2679..9e94658339da0b36f539f12092c92b2175c67e87 100644 (file)
@@ -75,6 +75,7 @@ HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i()
  *  HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory 
  *  HexoticPlugin_Hypothesis_i::SetHexoticSdMode
  *  HexoticPlugin_Hypothesis_i::SetVerbosity
+ *  HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory
  */
 //=============================================================================
 
@@ -204,6 +205,16 @@ void HexoticPlugin_Hypothesis_i::SetHexoticVerbosity (CORBA::Long theValue)
     SMESH::TPythonDump() << _this() << ".SetHexoticVerbosity( " << theValue << " )";
 }
 
+void HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory (CORBA::Long theValue)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory");
+  ASSERT(myBaseImpl);
+  CORBA::Long oldValue = GetHexoticMaxMemory();
+  this->GetImpl()->SetHexoticMaxMemory(theValue);
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexoticMaxMemory( " << theValue << " )";
+}
+
 //=============================================================================
 /*!
  *  HexoticPlugin_Hypothesis_i::GetHexesMinLevel
@@ -217,6 +228,7 @@ void HexoticPlugin_Hypothesis_i::SetHexoticVerbosity (CORBA::Long theValue)
  *  HexoticPlugin_Hypothesis_i::GetHexoticWorkingDirectory 
  *  HexoticPlugin_Hypothesis_i::GetHexoticSdMode
  *  HexoticPlugin_Hypothesis_i::GetVerbosity
+ *  HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory
  */
 //=============================================================================
 
@@ -296,6 +308,13 @@ CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticVerbosity()
   return this->GetImpl()->GetHexoticVerbosity();
 }
 
+CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticMaxMemory");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetHexoticMaxMemory();
+}
+
 //=============================================================================
 /*!
  *  HexoticPlugin_Hypothesis_i::GetImpl
index 601348445a07e6ed6ae96fce2f3a52635c9b5d54..388a86f3a57a9e3fe3ad8493ba1994e1a8697f07 100644 (file)
@@ -81,6 +81,9 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis_i:
   void SetHexoticVerbosity(CORBA::Long theVal);
   CORBA::Long GetHexoticVerbosity();
 
+  void SetHexoticMaxMemory(CORBA::Long theVal);
+  CORBA::Long GetHexoticMaxMemory();
+
   // Get implementation
   ::HexoticPlugin_Hypothesis* GetImpl();