]> SALOME platform Git repositories - plugins/ghs3dplugin.git/commitdiff
Salome HOME
Merge from V7_main V7_2_1_BR
authorrnc <rnc@opencascade.com>
Mon, 2 Sep 2013 12:20:44 +0000 (12:20 +0000)
committerrnc <rnc@opencascade.com>
Mon, 2 Sep 2013 12:20:44 +0000 (12:20 +0000)
24 files changed:
Makefile.am
build_configure
configure.ac
doc/salome/gui/GHS3DPLUGIN/CMakeLists.txt
doc/salome/gui/GHS3DPLUGIN/Makefile.am
doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png
doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc
idl/GHS3DPlugin_Algorithm.idl
idl/Makefile.am
resources/GHS3DPlugin.xml
src/GHS3DPlugin/GHS3DPluginBuilder.py
src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx
src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx
src/GHS3DPlugin/Makefile.am
src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx
src/GUI/GHS3DPluginGUI_HypothesisCreator.h
src/GUI/GHS3DPlugin_msg_en.ts
src/GUI/GHS3DPlugin_msg_fr.ts
src/GUI/GHS3DPlugin_msg_ja.ts [new file with mode: 0644]
src/GUI/Makefile.am

index 91c9c4f723eed4249d6c5bf285a8db35565d6833..ec3f2d1c68c0f08a0d5f77c2f986f928ac67d9a5 100644 (file)
@@ -29,13 +29,11 @@ if GHS3DPLUGIN_ENABLE_GUI
   ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
                     -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
                     -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-                    -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
                     -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
                     -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files
 else !GHS3DPLUGIN_ENABLE_GUI
   ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
                     -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-                    -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
                     -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
                     -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files
 endif
index ef04e8cdf76e56702f6a2c0f3d147a818b2315af..c532a520267c07f3380046d58cc156572d2651fa 100755 (executable)
@@ -53,10 +53,10 @@ fi
 ########################################################################
 # Test if the MED_ROOT_DIR is set correctly
 
-if test ! -d "${MED_ROOT_DIR}"; then
-    echo "failed : MED_ROOT_DIR variable is not correct !"
-    exit
-fi
+if test ! -d "${MED_ROOT_DIR}"; then
+    echo "failed : MED_ROOT_DIR variable is not correct !"
+    exit
+fi
 
 ########################################################################
 # Test if the SMESH_ROOT_DIR is set correctly
@@ -84,13 +84,11 @@ 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 \
-          -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
           -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
           -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
 else
   aclocal -I adm_local/unix/config_files \
           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-          -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
           -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
           -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
 fi
index 8f57e4a2754bc5d83d060487748e727853c4993b..b561e46dc324902976f4817a7810b19334503aa6 100644 (file)
@@ -331,14 +331,6 @@ echo
 
 CHECK_GEOM
 
-echo
-echo ---------------------------------------------
-echo Testing Med
-echo ---------------------------------------------
-echo
-
-CHECK_MED
-
 echo
 echo ---------------------------------------------
 echo Testing SMesh
@@ -363,11 +355,11 @@ echo
 
 echo Configure
 if test "${gui_ok}" = "yes"; then
-  variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok OpenGL_ok qt_ok vtk_ok"
+  variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok SMesh_ok MeshGems_Tetra_ok OpenGL_ok qt_ok vtk_ok"
 elif test "${SalomeGUI_need}" != "no"; then
-  variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok vtk_ok"
+  variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok SMesh_ok MeshGems_Tetra_ok vtk_ok"
 else
-  variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok Geom_ok Med_ok SMesh_ok MeshGems_Tetra_ok vtk_ok"
+  variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok Geom_ok SMesh_ok MeshGems_Tetra_ok vtk_ok"
 fi
 
 for var in $variables
index 13068c99fe8dfec2cf8b6bc8cb8e4b5d9f61aed9..94dad40846279c83c6b2e19d4a591a8fd23bd244 100755 (executable)
@@ -44,8 +44,6 @@ IF(WINDOWS)
   @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%
@@ -57,8 +55,8 @@ IF(WINDOWS)
   SET(EXT "bat")
   SET(CALL_STR "call")
 ELSE(WINDOWS)
-  SET(DOC_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/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(DOC_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${MED_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome")
+  SET(DOC_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome:${SMESH_ROOT_DIR}/bin/salome:${SMESH_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(DOC_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome")
   SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:\${PYTHONPATH}
   export LD_LIBRARY_PATH=${DOC_LD_LIBRARY_PATH}:\${LD_LIBRARY_PATH}
   export SMESH_MeshersList=${DOC_SMESH_MeshersList}
index b7dd89a54796ee3b064cd42734cb331adeb4260b..4250603a145df933baf0de72ee59ca2f86f278da 100755 (executable)
@@ -23,8 +23,8 @@ EXTRA_DIST += images input static/footer.html static/salome_extra.css
 guidocdir = $(docdir)/gui/GHS3DPLUGIN
 guidoc_DATA = images/head.png
 
-DOC_PYTHONPATH=$(prefix)/bin/salome:$(prefix)/lib/python$(PYTHON_VERSION)/site-packages/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)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages
-DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:$(SMESH_ROOT_DIR)/lib/salome:$(MED_ROOT_DIR)/lib/salome:$(GEOM_ROOT_DIR)/lib/salome:$(KERNEL_ROOT_DIR)/lib/salome
+DOC_PYTHONPATH=$(prefix)/bin/salome:$(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(SMESH_ROOT_DIR)/bin/salome:$(SMESH_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)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages
+DOC_LD_LIBRARY_PATH=$(prefix)/lib/salome:$(SMESH_ROOT_DIR)/lib/salome:$(GEOM_ROOT_DIR)/lib/salome:$(KERNEL_ROOT_DIR)/lib/salome
 DOC_SMESH_MeshersList=GHS3DPlugin
 
 tmp/smeshBuilder.py: $(top_srcdir)/src/GHS3DPlugin/GHS3DPluginBuilder.py
index e272cefdd0ba5f5bc8e99c25749cf4423fca8751..e71688edaae24fe3806061178a7beaab3aa6c0a2 100644 (file)
Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png differ
index 9cececfb087d62392251dfee9696012d08086dc5..0930956412b98b84fe51075ae7068aecac2a1f32 100644 (file)
@@ -22,6 +22,10 @@ create mesh in the holes inside a solid shape, else only the outermost
 shape will be meshed. Volumic elements created within holes are bound
 to the solid.
 
+- <b>To make groups of domains</b> - if checked, the algorithm will
+create groups of just generated elements corresponding to each mesh
+domain.<br>
+
 - <b>Optimization level</b> - allows choosing the required
 optimization level (higher level of optimisation provides better mesh,
 but can be time-consuming):
index 2a608ddd744e3b2aadf898bda82ffeaf62c5e687..01be91516465443a50ba5accc6fb3dc2b556dfda 100644 (file)
@@ -19,7 +19,6 @@
 
 //  File   : GHS3D_Algorithm.idl
 //  Author : Julia DOROVSKIKH
-//  $Header$
 //
 #ifndef _GHS3D_Algorithm_IDL_
 #define _GHS3D_Algorithm_IDL_
@@ -72,6 +71,13 @@ module GHS3DPlugin
      */
     void SetToMeshHoles(in boolean toMesh);
     boolean GetToMeshHoles();
+    /*!
+     * To make groups of volumes of different domains when mesh is generated from skin.
+     * Default is to make groups.
+     * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
+     */
+    void SetToMakeGroupsOfDomains(in boolean toMakeGroups);
+    boolean GetToMakeGroupsOfDomains();
     /*!
      * Maximal size of memory to be used by the algorithm (in Megabytes).
      * Negative value means not to use this option
index 723911d70e8e97891c6953c830b9d07155ea1e67..638da85bd553d0cd1497a37a6d10652bb2efc993 100644 (file)
@@ -49,14 +49,12 @@ libSalomeIDLGHS3DPLUGIN_la_CPPFLAGS = \
        $(CORBA_INCLUDES) \
        $(KERNEL_CXXFLAGS) \
        $(GEOM_CXXFLAGS) \
-       $(MED_CXXFLAGS) \
        $(SMESH_CXXFLAGS)
 
 libSalomeIDLGHS3DPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0
 libSalomeIDLGHS3DPLUGIN_la_LIBADD  = \
        $(KERNEL_LDFLAGS) -lSalomeIDLKernel \
        $(GEOM_LDFLAGS) -lSalomeIDLGEOM \
-       $(MED_LDFLAGS) -lSalomeIDLMED \
        $(SMESH_LDFLAGS) -lSalomeIDLSMESH \
        @CORBA_LIBS@
 
@@ -68,7 +66,6 @@ OMNIORB_IDLPYFLAGS  = \
        -I$(top_builddir)/idl/salome \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
        -I$(GEOM_ROOT_DIR)/idl/salome \
-       -I$(MED_ROOT_DIR)/idl/salome \
        -I$(SMESH_ROOT_DIR)/idl/salome
 
 IDLCXXFLAGS = \
@@ -77,13 +74,11 @@ IDLCXXFLAGS = \
        -I$(top_builddir)/idl/salome \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
        -I$(GEOM_ROOT_DIR)/idl/salome \
-       -I$(MED_ROOT_DIR)/idl/salome \
        -I$(SMESH_ROOT_DIR)/idl/salome
 IDLPYFLAGS  = \
        @IDLPYFLAGS@ \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
        -I$(GEOM_ROOT_DIR)/idl/salome \
-       -I$(MED_ROOT_DIR)/idl/salome \
        -I$(SMESH_ROOT_DIR)/idl/salome
 
 # potential problem on parallel make on the following - multiple outputs
@@ -121,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$(MED_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$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 144cb6da374988921e9f682c0a9f3b77c473b6ba..8d0ac365ac39ffb1fa38ece3952827d2f46f953e 100644 (file)
@@ -27,6 +27,7 @@
 
 <meshers-group name="GHS3D"
                resources="GHS3DPlugin"
+               idl-module="GHS3DPlugin"
                server-lib="GHS3DEngine"
                gui-lib="GHS3DPluginGUI">
   <hypotheses>
index 4e07a2ed49989b3d1447aac50317410ac29b48d7..08dfb09fcde67d91ac1b1791c03f96241bf280be 100644 (file)
@@ -86,6 +86,14 @@ class GHS3D_Algorithm(Mesh_Algorithm):
         self.Parameters().SetToMeshHoles(toMesh)
         pass
 
+    ## To make groups of volumes of different domains when mesh is generated from skin.
+    #  Default is to make groups.
+    # This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
+    #  @param toMesh "mesh holes" flag value
+    def SetToMakeGroupsOfDomains(self, toMakeGroups):
+        self.Parameters().SetToMakeGroupsOfDomains(toMakeGroups)
+        pass
+
     ## Set Optimization level:
     #  @param level optimization level, one of the following values
     #  - None_Optimization
index 87588cb6410415a34a21487bdc9ad01e6b9c14ab..0ff403ad5a882dd7a3008acd22ce190488dd0e8a 100644 (file)
 
 #include <Basics_Utils.hxx>
 
-//#include "SMESH_Gen.hxx"
+//#include <SMESH_Gen.hxx>
 #include <SMESH_Client.hxx>
-#include "SMESH_Mesh.hxx"
-#include "SMESH_Comment.hxx"
-#include "SMESH_MesherHelper.hxx"
-#include "SMESH_MeshEditor.hxx"
-#include "SMESH_OctreeNode.hxx"
-#include "SMESH_Group.hxx"
+#include <SMESH_Mesh.hxx>
+#include <SMESH_Comment.hxx>
+#include <SMESH_MesherHelper.hxx>
+#include <SMESH_MeshEditor.hxx>
+#include <SMESH_OctreeNode.hxx>
+#include <SMESH_Group.hxx>
 #include <SMESH_subMeshEventListener.hxx>
 #include <SMESH_HypoFilter.hxx>
+#include <SMESH_MeshAlgos.hxx>
 
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_FaceOfNodes.hxx"
-#include "SMDS_VolumeOfNodes.hxx"
+#include <SMDS_MeshElement.hxx>
+#include <SMDS_MeshNode.hxx>
+#include <SMDS_FaceOfNodes.hxx>
+#include <SMDS_VolumeOfNodes.hxx>
 
-#include "SMESHDS_Group.hxx"
+#include <SMESHDS_Group.hxx>
 
 #include <StdMeshers_QuadToTriaAdaptor.hxx>
 #include <StdMeshers_ViscousLayers.hxx>
@@ -76,7 +77,7 @@
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Solid.hxx>
 
-#include "utilities.h"
+#include <utilities.h>
 
 #ifdef WIN32
 #include <io.h>
@@ -111,6 +112,8 @@ extern "C"
 
 typedef const list<const SMDS_MeshFace*> TTriaList;
 
+static const char theDomainGroupNamePrefix[] = "Domain_";
+
 static void removeFile( const TCollection_AsciiString& fileName )
 {
   try {
@@ -131,7 +134,7 @@ GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen)
   : SMESH_3D_Algo(hypId, studyId, gen)
 {
   MESSAGE("GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D");
-  _name = "GHS3D_3D";
+  _name = Name();
   _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
   _onlyUnaryInput = false; // Compute() will be called on a compound of solids
   _iShape=0;
@@ -151,9 +154,7 @@ GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen)
   if (myStudy)
     MESSAGE("myStudy->StudyId() = " << myStudy->StudyId());
   
-#ifdef WITH_SMESH_CANCEL_COMPUTE
   _compute_canceled = false;
-#endif
 }
 
 //=============================================================================
@@ -1054,15 +1055,94 @@ static void updateMeshGroups(SMESH_Mesh* theMesh, std::set<std::string> groupsTo
   }
 }
 
+//=======================================================================
+//function : removeEmptyGroupsOfDomains
+//purpose  : remove empty groups named "Domain_nb" created due to
+//           "To make groups of domains" option.
+//=======================================================================
+
+static void removeEmptyGroupsOfDomains(SMESH_Mesh* mesh,
+                                       bool        notEmptyAsWell = false)
+{
+  const char* refName = theDomainGroupNamePrefix;
+  const size_t refLen = strlen( theDomainGroupNamePrefix );
+
+  std::list<int> groupIDs = mesh->GetGroupIds();
+  std::list<int>::const_iterator id = groupIDs.begin();
+  for ( ; id != groupIDs.end(); ++id )
+  {
+    SMESH_Group* group = mesh->GetGroup( *id );
+    if ( !group || ( !group->GetGroupDS()->IsEmpty() && !notEmptyAsWell ))
+      continue;
+    const char* name = group->GetName();
+    char* end;
+    // check the name
+    if ( strncmp( name, refName, refLen ) == 0 && // starts from refName;
+         isdigit( *( name + refLen )) &&          // refName is followed by a digit;
+         strtol( name + refLen, &end, 10) >= 0 && // there are only digits ...
+         *end == '\0')                            // ... till a string end.
+    {
+      mesh->RemoveGroup( *id );
+    }
+  }
+}
+
+//================================================================================
+/*!
+ * \brief Create the groups corresponding to domains
+ */
+//================================================================================
+
+static void makeDomainGroups( std::vector< std::vector< const SMDS_MeshElement* > >& elemsOfDomain,
+                              SMESH_MesherHelper*                                    theHelper)
+{
+  // int nbDomains = 0;
+  // for ( size_t i = 0; i < elemsOfDomain.size(); ++i )
+  //   nbDomains += ( elemsOfDomain[i].size() > 0 );
+
+  // if ( nbDomains > 1 )
+  for ( size_t iDomain = 0; iDomain < elemsOfDomain.size(); ++iDomain )
+  {
+    std::vector< const SMDS_MeshElement* > & elems = elemsOfDomain[ iDomain ];
+    if ( elems.empty() ) continue;
+
+    // find existing groups
+    std::vector< SMESH_Group* > groupOfType( SMDSAbs_NbElementTypes, (SMESH_Group*)NULL );
+    const std::string domainName = ( SMESH_Comment( theDomainGroupNamePrefix ) << iDomain );
+    SMESH_Mesh::GroupIteratorPtr groupIt = theHelper->GetMesh()->GetGroups();
+    while ( groupIt->more() )
+    {
+      SMESH_Group* group = groupIt->next();
+      if ( domainName == group->GetName() &&
+           dynamic_cast< SMESHDS_Group* >( group->GetGroupDS()) )
+        groupOfType[ group->GetGroupDS()->GetType() ] = group;
+    }
+    // create and fill the groups
+    size_t iElem = 0;
+    int groupID;
+    do
+    {
+      SMESH_Group* group = groupOfType[ elems[ iElem ]->GetType() ];
+      if ( !group )
+        group = theHelper->GetMesh()->AddGroup( elems[ iElem ]->GetType(),
+                                                domainName.c_str(), groupID );
+      SMDS_MeshGroup& groupDS =
+        static_cast< SMESHDS_Group* >( group->GetGroupDS() )->SMDSGroup();
+
+      while ( iElem < elems.size() && groupDS.Add( elems[iElem] ))
+        ++iElem;
+
+    } while ( iElem < elems.size() );
+  }
+}
+
 //=======================================================================
 //function : readGMFFile
 //purpose  : read GMF file w/o geometry associated to mesh
 //=======================================================================
 
 static bool readGMFFile(const char*                     theFile,
-#ifdef WITH_SMESH_CANCEL_COMPUTE
                         GHS3DPlugin_GHS3D*              theAlgo,
-#endif 
                         SMESH_MesherHelper*             theHelper,
                         TopoDS_Shape                    theSolid,
                         vector <const SMDS_MeshNode*> & theNodeByGhs3dId,
@@ -1070,8 +1150,8 @@ static bool readGMFFile(const char*                     theFile,
                         std::vector<std::string> &      aNodeGroupByGhs3dId,
                         std::vector<std::string> &      anEdgeGroupByGhs3dId,
                         std::vector<std::string> &      aFaceGroupByGhs3dId,
-                        std::set<std::string> &         groupsToRemove
-                       )
+                        std::set<std::string> &         groupsToRemove,
+                        bool                            toMakeGroupsOfDomains=false)
 {
   std::string tmpStr;
   SMESHDS_Mesh* theMeshDS = theHelper->GetMeshDS();
@@ -1098,13 +1178,14 @@ static bool readGMFFile(const char*                     theFile,
   // ---------------------------------
 
   int nbElem = 0, nbRef = 0;
-  int aGMFNodeID = 0/*, shapeID*/;
-  //int *nodeAssigne;
+  int aGMFNodeID = 0;
   const SMDS_MeshNode** GMFNode;
 #ifdef _DEBUG_
   std::map<int, std::set<int> > subdomainId2tetraId;
 #endif
   std::map <GmfKwdCod,int> tabRef;
+  const bool force3d = true; // since there is no geometry
+  const int  noID  = 0;
 
   tabRef[GmfVertices]       = 3; // for new nodes and enforced nodes
   tabRef[GmfCorners]        = 1;
@@ -1125,28 +1206,27 @@ static bool readGMFFile(const char*                     theFile,
   // Issue 0020682. Avoid creating nodes and tetras at place where
   // volumic elements already exist
   SMESH_ElementSearcher* elemSearcher = 0;
-  vector< const SMDS_MeshElement* > foundVolumes;
+  std::vector< const SMDS_MeshElement* > foundVolumes;
   if ( theHelper->GetMesh()->NbVolumes() > 0 )
-    elemSearcher = SMESH_MeshEditor( theHelper->GetMesh() ).GetElementSearcher();
+    elemSearcher = SMESH_MeshAlgos::GetElementSearcher( *theHelper->GetMeshDS() );
+
+  // IMP 0022172: [CEA 790] create the groups corresponding to domains
+  std::vector< std::vector< const SMDS_MeshElement* > > elemsOfDomain;
 
   int nbVertices = GmfStatKwd(InpMsh, GmfVertices) - nbInitialNodes;
   GMFNode = new const SMDS_MeshNode*[ nbVertices + 1 ];
-  //nodeAssigne = new int[ nbVertices + 1 ];
 
   std::map <GmfKwdCod,int>::const_iterator it = tabRef.begin();
   for ( ; it != tabRef.end() ; ++it)
   {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     if(theAlgo->computeCanceled()) {
       GmfCloseMesh(InpMsh);
       delete [] GMFNode;
-      //delete [] nodeAssigne;
       return false;
     }
-#endif
     int dummy;
     GmfKwdCod token = it->first;
-    nbRef    = it->second;
+    nbRef           = it->second;
 
     nbElem = GmfStatKwd(InpMsh, token);
     if (nbElem > 0) {
@@ -1157,6 +1237,7 @@ static bool readGMFFile(const char*                     theFile,
       continue;
 
     std::vector<int> id (nbElem*tabRef[token]); // node ids
+    std::vector<int> domainID( nbElem ); // domain
 
     if (token == GmfVertices) {
       (nbElem <= 1) ? tmpStr = " vertex" : tmpStr = " vertices";
@@ -1181,16 +1262,12 @@ static bool readGMFFile(const char*                     theFile,
       double x, y, z;
       const SMDS_MeshNode * aGMFNode;
 
-      //shapeID = theMeshDS->ShapeToIndex( theSolid );
       for ( int iElem = 0; iElem < nbElem; iElem++ ) {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
         if(theAlgo->computeCanceled()) {
           GmfCloseMesh(InpMsh);
           delete [] GMFNode;
-          //delete [] nodeAssigne;
           return false;
         }
-#endif
         if (ver == GmfFloat) {
           GmfGetLin(InpMsh, token, &VerTab_f[0], &VerTab_f[1], &VerTab_f[2], &dummy);
           x = VerTab_f[0];
@@ -1209,7 +1286,6 @@ static bool readGMFFile(const char*                     theFile,
           
           aGMFID = iElem -nbInitialNodes +1;
           GMFNode[ aGMFID ] = aGMFNode;
-          //nodeAssigne[ aGMFID ] = 0;
           if (aGMFID-1 < aNodeGroupByGhs3dId.size() && !aNodeGroupByGhs3dId.at(aGMFID-1).empty())
             addElemInMeshGroup(theHelper->GetMesh(), aGMFNode, aNodeGroupByGhs3dId.at(aGMFID-1), groupsToRemove);
         }
@@ -1228,22 +1304,22 @@ static bool readGMFFile(const char*                     theFile,
     else if (token == GmfEdges && nbElem > 0) {
       (nbElem <= 1) ? tmpStr = " edge" : tmpStr = " edges";
       for ( int iElem = 0; iElem < nbElem; iElem++ )
-        GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &dummy);
+        GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &domainID[iElem]);
     }
     else if (token == GmfTriangles && nbElem > 0) {
       (nbElem <= 1) ? tmpStr = " triangle" : tmpStr = " triangles";
       for ( int iElem = 0; iElem < nbElem; iElem++ )
-        GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &dummy);
+        GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &domainID[iElem]);
     }
     else if (token == GmfQuadrilaterals && nbElem > 0) {
       (nbElem <= 1) ? tmpStr = " Quadrilateral" : tmpStr = " Quadrilaterals";
       for ( int iElem = 0; iElem < nbElem; iElem++ )
-        GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &dummy);
+        GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &domainID[iElem]);
     }
     else if (token == GmfTetrahedra && nbElem > 0) {
       (nbElem <= 1) ? tmpStr = " Tetrahedron" : tmpStr = " Tetrahedra";
       for ( int iElem = 0; iElem < nbElem; iElem++ ) {
-        GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &dummy);
+        GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &domainID[iElem]);
 #ifdef _DEBUG_
         subdomainId2tetraId[dummy].insert(iElem+1);
 //         MESSAGE("subdomainId2tetraId["<<dummy<<"].insert("<<iElem+1<<")");
@@ -1254,7 +1330,7 @@ static bool readGMFFile(const char*                     theFile,
       (nbElem <= 1) ? tmpStr = " Hexahedron" : tmpStr = " Hexahedra";
       for ( int iElem = 0; iElem < nbElem; iElem++ )
         GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3],
-                  &id[iElem*tabRef[token]+4], &id[iElem*tabRef[token]+5], &id[iElem*tabRef[token]+6], &id[iElem*tabRef[token]+7], &dummy);
+                  &id[iElem*tabRef[token]+4], &id[iElem*tabRef[token]+5], &id[iElem*tabRef[token]+6], &id[iElem*tabRef[token]+7], &domainID[iElem]);
     }
     std::cout << tmpStr << std::endl;
     std::cout << std::endl;
@@ -1275,14 +1351,11 @@ static bool readGMFFile(const char*                     theFile,
 
       for ( int iElem = 0; iElem < nbElem; iElem++ )
       {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
         if(theAlgo->computeCanceled()) {
           GmfCloseMesh(InpMsh);
           delete [] GMFNode;
-          //delete [] nodeAssigne;
           return false;
         }
-#endif
         // Check if elem is already in input mesh. If yes => skip
         bool fullyCreatedElement = false; // if at least one of the nodes was created
         for ( int iRef = 0; iRef < nbRef; iRef++ )
@@ -1301,30 +1374,26 @@ static bool readGMFFile(const char*                     theFile,
             node  [ iRef ] = GMFNode[ aGMFNodeID ];
           }
         }
-
+        aCreatedElem = 0;
         switch (token)
         {
         case GmfEdges:
           if (fullyCreatedElement) {
-            aCreatedElem = theHelper->AddEdge( node[0], node[1], /*id =*/0, /*force3d =*/false );
+            aCreatedElem = theHelper->AddEdge( node[0], node[1], noID, force3d );
             if (anEdgeGroupByGhs3dId.size() && !anEdgeGroupByGhs3dId[iElem].empty())
               addElemInMeshGroup(theHelper->GetMesh(), aCreatedElem, anEdgeGroupByGhs3dId[iElem], groupsToRemove);
           }
           break;
         case GmfTriangles:
           if (fullyCreatedElement) {
-            aCreatedElem = theHelper->AddFace( node[0], node[1], node[2], /*id =*/0, /*force3d =*/false );
-            // for ( int iRef = 0; iRef < nbRef; iRef++ )
-            //   nodeAssigne[ nodeID[ iRef ]] = 1;
+            aCreatedElem = theHelper->AddFace( node[0], node[1], node[2], noID, force3d );
             if (aFaceGroupByGhs3dId.size() && !aFaceGroupByGhs3dId[iElem].empty())
               addElemInMeshGroup(theHelper->GetMesh(), aCreatedElem, aFaceGroupByGhs3dId[iElem], groupsToRemove);
           }
           break;
         case GmfQuadrilaterals:
           if (fullyCreatedElement) {
-            theHelper->AddFace( node[0], node[1], node[2], node[3], /*id =*/0, /*force3d =*/false );
-            // for ( int iRef = 0; iRef < nbRef; iRef++ )
-            //   nodeAssigne[ nodeID[ iRef ]] = 1;
+            aCreatedElem = theHelper->AddFace( node[0], node[1], node[2], node[3], noID, force3d );
           }
           break;
         case GmfTetrahedra:
@@ -1340,8 +1409,7 @@ static bool readGMFFile(const char*                     theFile,
                                                     SMDSAbs_Volume, foundVolumes ))
             break;
           }
-          theHelper->AddVolume( node[1], node[0], node[2], node[3], /*id =*/0, /*force3d =*/false );
-//           theMeshDS->SetMeshElementOnShape( aTet, shapeID );
+          aCreatedElem = theHelper->AddVolume( node[1], node[0], node[2], node[3], noID, force3d );
           break;
         case GmfHexahedra:
           if ( elemSearcher ) {
@@ -1360,27 +1428,31 @@ static bool readGMFFile(const char*                     theFile,
                                                     SMDSAbs_Volume, foundVolumes ))
             break;
           }
-          theHelper->AddVolume( node[0], node[3], node[2], node[1],
-                                node[4], node[7], node[6], node[5], /*id =*/0, /*force3d =*/false );
-//           theMeshDS->SetMeshElementOnShape( aTet, shapeID );
+          aCreatedElem = theHelper->AddVolume( node[0], node[3], node[2], node[1],
+                                               node[4], node[7], node[6], node[5], noID, force3d );
           break;
         default: continue;
         }
-      }
+        if ( aCreatedElem && toMakeGroupsOfDomains )
+        {
+          if ( domainID[iElem] >= (int) elemsOfDomain.size() )
+            elemsOfDomain.resize( domainID[iElem] + 1 );
+          elemsOfDomain[ domainID[iElem] ].push_back( aCreatedElem );
+        }
+      } // loop on elements of one type
       break;
-    }
-    }
-  }
-
-  // for ( int i = 0; i < nbVertices; ++i ) {
-  //   if ( !nodeAssigne[ i+1 ])
-  //     theMeshDS->SetNodeInVolume( GMFNode[ i+1 ], shapeID );
-  // }
+    } // case ...
+    } // switch (token)
+  } // loop on tabRef
 
   GmfCloseMesh(InpMsh);
   delete [] GMFNode;
-  //delete [] nodeAssigne;
-#ifdef _DEBUG_  
+
+  // 0022172: [CEA 790] create the groups corresponding to domains
+  if ( toMakeGroupsOfDomains )
+    makeDomainGroups( elemsOfDomain, theHelper );
+
+#ifdef _DEBUG_
   MESSAGE("Nb subdomains " << subdomainId2tetraId.size());
   std::map<int, std::set<int> >::const_iterator subdomainIt = subdomainId2tetraId.begin();
   TCollection_AsciiString aSubdomainFileName = theFile;
@@ -1444,7 +1516,8 @@ static bool writeGMFFile(const char*                                     theMesh
   GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap::iterator elemIt;
   TIDSortedElemSet::iterator elemSetIt;
   bool isOK;
-  auto_ptr< SMESH_ElementSearcher > pntCls ( SMESH_MeshEditor( theMesh ).GetElementSearcher());
+  auto_ptr< SMESH_ElementSearcher > pntCls
+    ( SMESH_MeshAlgos::GetElementSearcher(*theMesh->GetMeshDS()));
   
   int nbEnforcedVertices = theEnforcedVertices.size();
   
@@ -2811,9 +2884,7 @@ static bool readResultFile(const int                       fileOpen,
 #ifdef WNT
                            const char*                     fileName,
 #endif
-#ifdef WITH_SMESH_CANCEL_COMPUTE
                            GHS3DPlugin_GHS3D*              theAlgo,
-#endif
                            SMESH_MesherHelper&             theHelper,
                            TopoDS_Shape                    tabShape[],
                            double**                        tabBox,
@@ -2824,7 +2895,8 @@ static bool readResultFile(const int                       fileOpen,
                            int                             nbEnforcedVertices,
                            int                             nbEnforcedNodes,
                            GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedEdges,
-                           GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedTriangles)
+                           GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedTriangles,
+                           bool                            toMakeGroupsOfDomains)
 {
   MESSAGE("GHS3DPlugin_GHS3D::readResultFile()");
   Kernel_Utils::Localizer loc;
@@ -2900,10 +2972,8 @@ static bool readResultFile(const int                       fileOpen,
   MESSAGE("nbEnforcedNodes: "<<nbEnforcedNodes);
   // Reading the nodeCoor and update the nodeMap
   for (int iNode=1; iNode <= nbNodes; iNode++) {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     if(theAlgo->computeCanceled())
       return false;
-#endif
     for (int iCoor=0; iCoor < 3; iCoor++)
       coord[ iCoor ] = strtod(ptr, &ptr);
     nodeAssigne[ iNode ] = 1;
@@ -2923,10 +2993,8 @@ static bool readResultFile(const int                       fileOpen,
 
   tabID = new int[nbTriangle];
   for (int i=0; i < nbTriangle; i++) {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     if(theAlgo->computeCanceled())
       return false;
-#endif
     tabID[i] = 0;
     // find the solid corresponding to GHS3D sub-domain following
     // the technique proposed in GHS3D manual in chapter
@@ -2980,13 +3048,14 @@ static bool readResultFile(const int                       fileOpen,
   if ( nbTriangle <= nbShape ) // no holes
     toMeshHoles = true; // not avoid creating tetras in holes
 
+  // IMP 0022172: [CEA 790] create the groups corresponding to domains
+  std::vector< std::vector< const SMDS_MeshElement* > > elemsOfDomain( Max( nbTriangle, nbShape ));
+
   // Associating the tetrahedrons to the shapes
   shapeID = compoundID;
   for (int iElem = 0; iElem < nbElems; iElem++) {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     if(theAlgo->computeCanceled())
       return false;
-#endif
     for (int iNode = 0; iNode < 4; iNode++) {
       ID = strtol(tetraPtr, &tetraPtr, 10);
       itOnNode = theGhs3dIdToNodeMap.find(ID);
@@ -2997,6 +3066,7 @@ static bool readResultFile(const int                       fileOpen,
     // tetras within holes depending on hypo option,
     // so we first check if aTet is inside a hole and then create it 
     //aTet = theMeshDS->AddVolume( node[1], node[0], node[2], node[3] );
+    ghs3dShapeID = 0; // domain ID
     if ( nbTriangle > 1 ) {
       shapeID = HOLE_ID; // negative shapeID means not to create tetras if !toMeshHoles
       ghs3dShapeID = strtol(shapePtr, &shapePtr, 10) - IdShapeRef;
@@ -3041,11 +3111,19 @@ static bool readResultFile(const int                       fileOpen,
       aTet = theHelper.AddVolume( node[1], node[0], node[2], node[3],
                                   /*id=*/0, /*force3d=*/false);
       theMeshDS->SetMeshElementOnShape( aTet, shapeID );
+      if ( toMakeGroupsOfDomains )
+      {
+        if ( int( elemsOfDomain.size() ) < ghs3dShapeID+1 )
+          elemsOfDomain.resize( ghs3dShapeID+1 );
+        elemsOfDomain[ ghs3dShapeID ].push_back( aTet );
+      }
     }
 #ifdef _DEBUG_
     shapeIDs.insert( shapeID );
 #endif
   }
+  if ( toMakeGroupsOfDomains )
+    makeDomainGroups( elemsOfDomain, &theHelper );
   
   // Add enforced elements
   GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap::const_iterator elemIt;
@@ -3209,8 +3287,8 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 
   // a unique working file name
   // to avoid access to the same files by eg different users
-  TCollection_AsciiString aGenericName
-    = (char*) GHS3DPlugin_Hypothesis::GetFileName(_hyp).c_str();
+  _genericName = GHS3DPlugin_Hypothesis::GetFileName(_hyp);
+  TCollection_AsciiString aGenericName((char*) _genericName.c_str() );
 
   TCollection_AsciiString aResultFileName;
   TCollection_AsciiString aLogFileName    = aGenericName + ".log";    // log
@@ -3354,7 +3432,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   // run ghs3d mesher
   // -----------------
 
-  TCollection_AsciiString cmd = TCollection_AsciiString((char*)GHS3DPlugin_Hypothesis::CommandToRun( _hyp ).c_str() );
+  TCollection_AsciiString cmd(char*)GHS3DPlugin_Hypothesis::CommandToRun( _hyp ).c_str() );
   cmd += TCollection_AsciiString(" -f ") + aGenericName;  // file to read
   cmd += TCollection_AsciiString(" 1>" ) + aLogFileName;  // dump into file
   // The output .mesh file does not contain yet the subdomain-info (Ghs3D 4.2)
@@ -3367,9 +3445,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   std::cout << "Ghs3d execution..." << std::endl;
   std::cout << cmd << std::endl;
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
   _compute_canceled = false;
-#endif
 
   system( cmd.ToCString() ); // run
 
@@ -3393,6 +3469,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   else {
     bool toMeshHoles =
       _hyp ? _hyp->GetToMeshHoles(true) : GHS3DPlugin_Hypothesis::DefaultMeshHoles();
+    const bool toMakeGroupsOfDomains = GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp );
 
     helper.IsQuadraticSubMesh( theShape );
     helper.SetElementsOnShape( false );
@@ -3401,14 +3478,13 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 #ifdef WNT
                          aResultFileName.ToCString(),
 #endif
-#ifdef WITH_SMESH_CANCEL_COMPUTE
                          this,
-#endif
                          /*theMesh, */helper, tabShape, tabBox, _nbShape, 
                          aGhs3dIdToNodeMap, aNodeId2NodeIndexMap,
                          toMeshHoles, 
                          nbEnforcedVertices, nbEnforcedNodes, 
-                         enforcedEdges, enforcedTriangles );
+                         enforcedEdges, enforcedTriangles,
+                         toMakeGroupsOfDomains );
                          
 //       Ok = readGMFFile(
 // #ifndef GMF_HAS_SUBDOMAIN_INFO
@@ -3418,6 +3494,8 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 //                        _nbShape, tabShape, tabBox, 
 //                        aGhs3dIdToNodeMap, toMeshHoles,
 //                        nbEnforcedVertices, nbEnforcedNodes);
+
+    removeEmptyGroupsOfDomains( helper.GetMesh(), /*notEmptyAsWell =*/ !toMakeGroupsOfDomains );
   }
 
 
@@ -3431,6 +3509,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   {
     if ( !_keepFiles )
       removeFile( aLogFileName );
+
+    // if ( _hyp && _hyp->GetToMakeGroupsOfDomains() )
+    //   error( COMPERR_WARNING, "'toMakeGroupsOfDomains' is ignored since the mesh is on shape" );
   }
   else if ( OSD_File( aLogFileName ).Size() > 0 )
   {
@@ -3447,11 +3528,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   }
 
   if ( !_keepFiles ) {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     if (! Ok)
       if(_compute_canceled)
         removeFile( aLogFileName );
-#endif
     removeFile( aFacesFileName );
     removeFile( aPointsFileName );
     removeFile( aResultFileName );
@@ -3487,8 +3566,8 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 
   // a unique working file name
   // to avoid access to the same files by eg different users
-  TCollection_AsciiString aGenericName
-    = (char*) GHS3DPlugin_Hypothesis::GetFileName(_hyp).c_str();
+  _genericName = GHS3DPlugin_Hypothesis::GetFileName(_hyp);
+  TCollection_AsciiString aGenericName((char*) _genericName.c_str() );
   TCollection_AsciiString aGenericNameRequired = aGenericName + "_required";
 
   TCollection_AsciiString aLogFileName    = aGenericName + ".log";    // log
@@ -3633,9 +3712,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   std::cout << "Ghs3d execution..." << std::endl;
   std::cout << cmd << std::endl;
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
   _compute_canceled = false;
-#endif
 
   system( cmd.ToCString() ); // run
 
@@ -3646,16 +3723,16 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   // read a result
   // --------------
   GHS3DPlugin_Hypothesis::TSetStrings groupsToRemove = GHS3DPlugin_Hypothesis::GetGroupsToRemove(_hyp);
+  const bool toMakeGroupsOfDomains = GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp );
 
   Ok = readGMFFile(aResultFileName.ToCString(),
-#ifdef WITH_SMESH_CANCEL_COMPUTE
                    this,
-#endif
                    theHelper, theShape, aNodeByGhs3dId, aNodeToGhs3dIdMap,
                    aNodeGroupByGhs3dId, anEdgeGroupByGhs3dId, aFaceGroupByGhs3dId,
-                   groupsToRemove);
+                   groupsToRemove, toMakeGroupsOfDomains);
 
   updateMeshGroups(theHelper->GetMesh(), groupsToRemove);
+  removeEmptyGroupsOfDomains( theHelper->GetMesh(), /*notEmptyAsWell =*/ !toMakeGroupsOfDomains );
 
   if ( Ok ) {
     GHS3DPlugin_Hypothesis* that = (GHS3DPlugin_Hypothesis*)this->_hyp;
@@ -3670,6 +3747,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   {
     if ( !_keepFiles )
       removeFile( aLogFileName );
+
+    //if ( !toMakeGroupsOfDomains && _hyp && _hyp->GetToMakeGroupsOfDomains() )
+    //error( COMPERR_WARNING, "'toMakeGroupsOfDomains' is ignored since 'toMeshHoles' is OFF." );
   }
   else if ( OSD_File( aLogFileName ).Size() > 0 )
   {
@@ -3686,11 +3766,9 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
 
   if ( !_keepFiles )
   {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     if (! Ok)
       if(_compute_canceled)
         removeFile( aLogFileName );
-#endif
     removeFile( aGMFFileName );
     removeFile( aResultFileName );
     removeFile( aRequiredVerticesFileName );
@@ -3699,21 +3777,17 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   return Ok;
 }
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
 void GHS3DPlugin_GHS3D::CancelCompute()
 {
   _compute_canceled = true;
 #ifdef WNT
 #else
-  TCollection_AsciiString aGenericName
-    = (char*) GHS3DPlugin_Hypothesis::GetFileName(_hyp).c_str();
-  TCollection_AsciiString cmd =
-    TCollection_AsciiString("ps ux | grep ") + aGenericName;
-  cmd += TCollection_AsciiString(" | grep -v grep | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1");
-  system( cmd.ToCString() );
+  std::string cmd = "ps xo pid,args | grep " + _genericName;
+  //cmd += " | grep -e \"^ *[0-9]\\+ \\+" + GHS3DPlugin_Hypothesis::GetExeName() + "\"";
+  cmd += " | awk '{print $1}' | xargs kill -9 > /dev/null 2>&1";
+  system( cmd.c_str() );
 #endif
 }
-#endif
 
 //================================================================================
 /*!
@@ -3900,10 +3974,8 @@ static char* getIds( char* ptr, int nbIds, vector<int>& ids )
 bool GHS3DPlugin_GHS3D::storeErrorDescription(const TCollection_AsciiString& logFile,
                                               const _Ghs2smdsConvertor &     toSmdsConvertor )
 {
-#ifdef WITH_SMESH_CANCEL_COMPUTE
   if(_compute_canceled)
     return error(SMESH_Comment("interruption initiated by user"));
-#endif
   // open file
 #ifdef WNT
   int file = ::_open (logFile.ToCString(), _O_RDONLY|_O_BINARY);
@@ -4308,9 +4380,7 @@ bool GHS3DPlugin_GHS3D::importGMFMesh(const char* theGMFFileName, SMESH_Mesh& th
   std::set<std::string> dummyGroupsToRemove;
 
   bool ok = readGMFFile(theGMFFileName,
-#ifdef WITH_SMESH_CANCEL_COMPUTE
                         this,
-#endif
                         helper, theMesh.GetShapeToMesh(), dummyNodeVector, dummyNodeMap, dummyElemGroup, dummyElemGroup, dummyElemGroup, dummyGroupsToRemove);
   theMesh.GetMeshDS()->Modified();
   return ok;
@@ -4368,6 +4438,33 @@ namespace
                                              /*visitAncestors=*/true);
     }
   };
+
+  //================================================================================
+  /*!
+   * \brief Sub-mesh event listener removing empty groups created due to "To make
+   *        groups of domains".
+   */
+  struct _GroupsOfDomainsRemover : public SMESH_subMeshEventListener
+  {
+    _GroupsOfDomainsRemover():
+      SMESH_subMeshEventListener( /*isDeletable = */true,
+                                  "GHS3DPlugin_GHS3D::_GroupsOfDomainsRemover" ) {}
+    /*!
+     * \brief Treat events of the subMesh
+     */
+    void ProcessEvent(const int                       event,
+                      const int                       eventType,
+                      SMESH_subMesh*                  subMesh,
+                      SMESH_subMeshEventListenerData* data,
+                      const SMESH_Hypothesis*         hyp)
+    {
+      if (SMESH_subMesh::ALGO_EVENT == eventType &&
+          !subMesh->GetAlgo() )
+      {
+        removeEmptyGroupsOfDomains( subMesh->GetFather(), /*notEmptyAsWell=*/true );
+      }
+    }
+  };
 }
 
 //================================================================================
@@ -4396,3 +4493,19 @@ void GHS3DPlugin_GHS3D::SubmeshRestored(SMESH_subMesh* subMesh)
     }
   }
 }
+
+//================================================================================
+/*!
+ * \brief Sets an event listener removing empty groups created due to "To make
+ *        groups of domains".
+ * \param subMesh - submesh where algo is set
+ *
+ * This method is called when a submesh gets HYP_OK algo_state.
+ * After being set, event listener is notified on each event of a submesh.
+ */
+//================================================================================
+
+void GHS3DPlugin_GHS3D::SetEventListener(SMESH_subMesh* subMesh)
+{
+  subMesh->SetEventListener( new _GroupsOfDomainsRemover(), 0, subMesh );
+}
index 285acd83fd3c4b992b13ec00ac71a43a27415fa6..232c16e7681b233d0b95af43e64810496bd4c245 100644 (file)
@@ -64,10 +64,8 @@ public:
   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 void CancelCompute();
+  bool         computeCanceled() { return _compute_canceled;};
 
   virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
                         MapShapeNbElems& aResMap);
@@ -77,26 +75,30 @@ public:
 
   virtual void SubmeshRestored(SMESH_subMesh* subMesh);
 
-  bool importGMFMesh(const char* aGMFFileName, SMESH_Mesh& aMesh);
+  virtual void SetEventListener(SMESH_subMesh* subMesh);
+
+  bool         importGMFMesh(const char* aGMFFileName, SMESH_Mesh& aMesh);
 
+  static const char* Name() { return "GHS3D_3D"; }
+
+protected:
+  const GHS3DPlugin_Hypothesis*   _hyp;
+  const StdMeshers_ViscousLayers* _viscousLayersHyp;
+  std::string                     _genericName;
+   
 private:
 
-  bool storeErrorDescription(const TCollection_AsciiString& logFile,
-                             const _Ghs2smdsConvertor &     toSmdsConvertor );
+  bool         storeErrorDescription(const TCollection_AsciiString& logFile,
+                                     const _Ghs2smdsConvertor &     toSmdsConvertor );
   TopoDS_Shape entryToShape(std::string entry);
   
   int  _iShape;
   int  _nbShape;
   bool _keepFiles;
-  const GHS3DPlugin_Hypothesis* _hyp;
-  const StdMeshers_ViscousLayers* _viscousLayersHyp;
   SALOMEDS::Study_var myStudy;
   SMESH_Gen_i* smeshGen_i;
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
   volatile bool _compute_canceled;
-#endif
-
 };
 
 /*!
index a5001ae4af0c0458ec83825207906ddeab8cef57..3ec070f6ef60fbcbddd89a64a890e41d8fbd39a2 100644 (file)
@@ -42,6 +42,7 @@
 GHS3DPlugin_Hypothesis::GHS3DPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen)
   : SMESH_Hypothesis(hypId, studyId, gen),
   myToMeshHoles(DefaultMeshHoles()),
+  myToMakeGroupsOfDomains(DefaultToMakeGroupsOfDomains()),
   myMaximumMemory(-1),
   myInitialMemory(-1),
   myOptimizationLevel(DefaultOptimizationLevel()),
@@ -97,6 +98,39 @@ bool GHS3DPlugin_Hypothesis::GetToMeshHoles(bool checkFreeOption) const
   return myToMeshHoles;
 }
 
+//=======================================================================
+//function : SetToMakeGroupsOfDomains
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis::SetToMakeGroupsOfDomains(bool toMakeGroups)
+{
+  if ( myToMakeGroupsOfDomains != toMakeGroups ) {
+    myToMakeGroupsOfDomains = toMakeGroups;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=======================================================================
+//function : GetToMakeGroupsOfDomains
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains() const
+{
+  return myToMakeGroupsOfDomains;
+}
+
+//=======================================================================
+//function : GetToMakeGroupsOfDomains
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains(const GHS3DPlugin_Hypothesis* hyp)
+{
+  bool res;
+  if ( hyp ) res = /*hyp->GetToMeshHoles(true) &&*/ hyp->GetToMakeGroupsOfDomains();
+  else       res = /*DefaultMeshHoles()        &&*/ DefaultToMakeGroupsOfDomains();
+  return res;
+}
+
 //=======================================================================
 //function : SetMaximumMemory
 //=======================================================================
@@ -756,6 +790,15 @@ bool GHS3DPlugin_Hypothesis::DefaultMeshHoles()
   return false; // PAL19680
 }
 
+//=======================================================================
+//function : DefaultToMakeGroupsOfDomains
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::DefaultToMakeGroupsOfDomains()
+{
+  return true; // issue 0022172
+}
+
 //=======================================================================
 //function : DefaultMaximumMemory
 //=======================================================================
@@ -922,6 +965,7 @@ std::ostream & GHS3DPlugin_Hypothesis::SaveTo(std::ostream & save)
   save << (int)myToUseFemCorrection           << " ";
   save << (int)myToRemoveCentralPoint         << " ";
   save << myGradation                         << " ";
+  save << myToMakeGroupsOfDomains             << " ";
   if (!myTextOption.empty()) {
     save << "__OPTIONS_BEGIN__ ";
     save << myTextOption                      << " ";
@@ -1097,6 +1141,12 @@ std::istream & GHS3DPlugin_Hypothesis::LoadFrom(std::istream & load)
   bool hasEnforcedMeshes = false;
   isOK = (load >> separator);
 
+  if ( isOK && ( separator == "0" || separator == "1" ))
+  {
+    myToMakeGroupsOfDomains = ( separator == "1" );
+    isOK = (load >> separator);
+  }
+
   if (isOK) {
     if (separator == "__OPTIONS_BEGIN__")
       hasOptions = true;
@@ -1326,14 +1376,15 @@ bool GHS3DPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS
 
 //================================================================================
 /*!
- * \brief Return false
+ * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not
  */
 //================================================================================
 
-bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults&  /*dflts*/,
+bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults&  dflts,
                                                      const SMESH_Mesh* /*theMesh*/)
 {
-  return false;
+  myToMakeGroupsOfDomains = ( !dflts._shape || dflts._shape->IsNull() );
+  return true;
 }
 
 //================================================================================
@@ -1345,8 +1396,7 @@ bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults&  /*dflts*/
 std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* hyp,
                                                  const bool         hasShapeToMesh)
 {
-  TCollection_AsciiString cmd;
-  cmd = "mg-tetra.exe";
+  TCollection_AsciiString cmd = GetExeName().c_str();
   // check if any option is overridden by hyp->myTextOption
   bool m   = hyp ? ( hyp->myTextOption.find("-m")  == std::string::npos ) : true;
   bool M   = hyp ? ( hyp->myTextOption.find("-M")  == std::string::npos ) : true;
@@ -1478,6 +1528,16 @@ std::string GHS3DPlugin_Hypothesis::GetFileName(const GHS3DPlugin_Hypothesis* hy
   return aGenericName.ToCString();
 }
 
+//================================================================================
+/*
+ * Return the name of executable
+ */
+//================================================================================
+
+std::string GHS3DPlugin_Hypothesis::GetExeName()
+{
+  return "mg-tetra.exe";
+}
 
 //================================================================================
 /*!
index 348b14942493631e6d74a48d5645db953be1deb5..15ccbc27d1b91ad448b9d99674c0bb1da071fb5c 100644 (file)
@@ -124,6 +124,13 @@ public:
    */
   void SetToMeshHoles(bool toMesh);
   bool GetToMeshHoles(bool checkFreeOption = false) const;
+  /*!
+   * To make groups of volumes of different domains when mesh is generated from skin.
+   * Default is to make groups.
+   * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
+   */
+  void SetToMakeGroupsOfDomains(bool toMakeGroups);
+  bool GetToMakeGroupsOfDomains() const;
   /*!
    * Maximal size of memory to be used by the algorithm (in Megabytes)
    */
@@ -216,6 +223,10 @@ public:
    * \brief Return a unique file name
    */
   static std::string GetFileName(const GHS3DPlugin_Hypothesis* hyp);
+  /*!
+   * \brief Return the name of executable
+   */
+  static std::string GetExeName();
 
   /*!
    * To set an enforced vertex
@@ -263,9 +274,11 @@ public:
   static TIDSortedElemGroupMap GetEnforcedTriangles(const GHS3DPlugin_Hypothesis* hyp);
   static TID2SizeMap GetNodeIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp);
   static TSetStrings GetGroupsToRemove(const GHS3DPlugin_Hypothesis* hyp);
+  static bool GetToMakeGroupsOfDomains(const GHS3DPlugin_Hypothesis* hyp);
   void ClearGroupsToRemove();
   
   static bool   DefaultMeshHoles();
+  static bool   DefaultToMakeGroupsOfDomains();
   static int    DefaultMaximumMemory();
   static int    DefaultInitialMemory();
   static short  DefaultOptimizationLevel();
@@ -306,13 +319,14 @@ public:
   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
 
   /*!
-   * \brief Does nothing
+   * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not
    */
   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
 
 private:
 
   bool   myToMeshHoles;
+  bool   myToMakeGroupsOfDomains;
   int    myMaximumMemory;
   int    myInitialMemory;
   short  myOptimizationLevel;
index 791566121d001c33a9aaa8480c5e69313db7e4ab..eb3eeb37ffdedc83009cfc9a652e465b50d2cfb1 100644 (file)
@@ -90,6 +90,27 @@ CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToMeshHoles()
   return this->GetImpl()->GetToMeshHoles();
 }
 
+//=======================================================================
+//function : SetToMakeGroupsOfDomains
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis_i::SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups)
+{
+  ASSERT(myBaseImpl);
+  this->GetImpl()->SetToMakeGroupsOfDomains(toMakeGroups);
+  SMESH::TPythonDump() << _this() << ".SetToMakeGroupsOfDomains( " << toMakeGroups << " )";
+}
+
+//=======================================================================
+//function : GetToMakeGroupsOfDomains
+//=======================================================================
+
+CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToMakeGroupsOfDomains()
+{
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetToMakeGroupsOfDomains();
+}
+
 //=======================================================================
 //function : SetMaximumMemory
 //=======================================================================
@@ -930,8 +951,8 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo
       MESSAGE("Required type is FACE");
       break;
     default:
-       MESSAGE("Incompatible required type: " << theType);
-       return false;
+        MESSAGE("Incompatible required type: " << theType);
+        return false;
   }
 //   MESSAGE("Required type is "<<theType);
   SMESH::array_of_ElementType_var types = theSource->GetTypes();
@@ -959,20 +980,20 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo
 
   string enfMeshName = theName;
   if (enfMeshName.empty())
-         enfMeshName = SObj->GetName();
+          enfMeshName = SObj->GetName();
 
   if (theMesh_i)
   {
     try {
-       bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName);
-               if (theGroupName != "") {
-                 SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
-                                                               << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )";
-               }
-               else {
-                 SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
-                                                               << theSource << ".GetMesh(), " << theType << " )";
-               }
+        bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName);
+                if (theGroupName != "") {
+                  SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
+                                                                << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )";
+                }
+                else {
+                  SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
+                                                                << theSource << ".GetMesh(), " << theType << " )";
+                }
 
       return res;
     }
@@ -992,7 +1013,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo
   {
     MESSAGE("The source is a group")
     try {
-       bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
+        bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
         if (theGroupName != "") {
           SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " 
                                 << theSource << ", " << theType << ", \"" << theGroupName << "\" )";
@@ -1019,7 +1040,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo
   {
     MESSAGE("The source is a group on geom")
     try {
-       bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
+        bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
         if (theGroupName != "") {
           SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " 
                                 << theSource << ", " << theType << ", \"" << theGroupName << "\" )";
index 4ac8b6f163760fff6740146c10504927d0aa223e..81c12dd4b75f13ed658f1c2d1e6e07a5c16ab489 100644 (file)
@@ -55,6 +55,13 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i:
    */
   void SetToMeshHoles(CORBA::Boolean toMesh);
   CORBA::Boolean GetToMeshHoles();
+  /*!
+   * To make groups of volumes of different domains when mesh is generated from skin.
+   * Default is to make groups.
+   * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
+   */
+  void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
+  CORBA::Boolean GetToMakeGroupsOfDomains();
   /*!
    * Maximal size of memory to be used by the algorithm (in Megabytes)
    */
index 4af27ab8d54210bdda87f10346e1e657b8b2b407..0103d4e4a43ece56e186cc27a53e591077cc3d4c 100644 (file)
@@ -47,7 +47,6 @@ libGHS3DEngine_la_CPPFLAGS =  \
        $(KERNEL_CXXFLAGS)    \
        $(CAS_CPPFLAGS)       \
        $(GEOM_CXXFLAGS)      \
-       $(MED_CXXFLAGS)       \
        $(SMESH_CXXFLAGS)     \
        $(VTK_INCLUDES) \
        $(BOOST_CPPFLAGS)     \
@@ -58,7 +57,6 @@ libGHS3DEngine_la_CPPFLAGS =  \
 libGHS3DEngine_la_LDFLAGS  = \
   ../../idl/libSalomeIDLGHS3DPLUGIN.la \
   $(CAS_KERNEL) -lTKBRep -lTKG2d -lTKG3d -lTKTopAlgo -lTKGeomBase -lTKGeomAlgo -lTKCDF \
-  $(MED_LDFLAGS) -lSalomeIDLMED \
   $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lSMESHDS -lSMDS -lStdMeshers -lMeshDriverGMF \
   $(KERNEL_LDFLAGS) -lSalomeGenericObj -lSALOMELocalTrace -lSALOMEBasics -lSalomeNS -lOpUtil
 
index 78cb1fa5566e9150d09468ed8dc2fc4df6ba8ca7..25d71010a197c67ed92c0c6b635497dfeedfc158 100644 (file)
 //  File   : GHS3DPluginGUI_HypothesisCreator.cxx
 //  Author : Michael Zorin
 //  Module : GHS3DPlugin
-//  $Header: 
 //
 #include "GHS3DPluginGUI_HypothesisCreator.h"
-// #include "GHS3DPluginGUI_EnforcedDelegates.h"
 #include "GHS3DPluginGUI_Enums.h"
 
-#include "GeometryGUI.h"
+#include <GeometryGUI.h>
 
 #include <SMESHGUI_Utils.h>
 #include <SMESHGUI_SpinBox.h>
@@ -294,7 +292,7 @@ QWidget *EnforcedMeshTableWidgetDelegate::createEditor(QWidget *parent,
 void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor,
                                                const QModelIndex &index) const
 {
-       QItemDelegate::setEditorData(editor, index);
+        QItemDelegate::setEditorData(editor, index);
 }
 
 void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
@@ -392,7 +390,9 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
   }
 
   myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup );
-  aStdLayout->addWidget( myToMeshHolesCheck, row++, 0, 1, 2 );
+  aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 );
+  myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup );
+  aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 );
 
   aStdLayout->addWidget( new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup ), row, 0, 1, 1 );
   myOptimizationLevelCombo = new QComboBox( myStdGroup );
@@ -645,6 +645,7 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
   tab->setCurrentIndex( STD_TAB );
 
   // connections
+  //connect( myToMeshHolesCheck,      SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool)));
   connect( myMaximumMemoryCheck,    SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
   connect( myInitialMemoryCheck,    SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
   connect( myBoundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
@@ -1384,6 +1385,13 @@ void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
   myEnforcedTableWidget->selectionModel()->clearSelection();
 }
 
+void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn)
+{
+  // myToMakeGroupsOfDomains->setEnabled( isOn );
+  // if ( !isOn )
+  //   myToMakeGroupsOfDomains->setChecked( false );
+}
+
 void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
 {
   QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myWorkingDir->text(), QString() );
@@ -1393,6 +1401,7 @@ void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
 
 void GHS3DPluginGUI_HypothesisCreator::updateWidgets()
 {
+  //myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() );
   myMaximumMemorySpin->setEnabled( myMaximumMemoryCheck->isChecked() );
   myInitialMemoryCheck->setEnabled( !myBoundaryRecoveryCheck->isChecked() );
   myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() && !myBoundaryRecoveryCheck->isChecked() );
@@ -1424,6 +1433,7 @@ void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const
     myName->setText( data.myName );
   
   myToMeshHolesCheck               ->setChecked    ( data.myToMeshHoles );
+  myToMakeGroupsOfDomains          ->setChecked    ( data.myToMakeGroupsOfDomains );
   myOptimizationLevelCombo         ->setCurrentIndex( data.myOptimizationLevel );
   myMaximumMemoryCheck             ->setChecked    ( data.myMaximumMemory > 0 );
   myMaximumMemorySpin              ->setValue      ( qMax( data.myMaximumMemory,
@@ -1668,6 +1678,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData&
   h_data.myName = isCreation() && data ? hypName() : "";
 
   h_data.myToMeshHoles                = h->GetToMeshHoles();
+  h_data.myToMakeGroupsOfDomains      = /*h->GetToMeshHoles() &&*/ h->GetToMakeGroupsOfDomains();
   h_data.myMaximumMemory              = h->GetMaximumMemory();
   h_data.myInitialMemory              = h->GetInitialMemory();
   h_data.myInitialMemory              = h->GetInitialMemory();
@@ -1741,6 +1752,8 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD
 
     if ( h->GetToMeshHoles() != h_data.myToMeshHoles ) // avoid duplication of DumpPython commands
       h->SetToMeshHoles      ( h_data.myToMeshHoles       );
+    if ( h->GetToMakeGroupsOfDomains() != h_data.myToMakeGroupsOfDomains )
+      h->SetToMakeGroupsOfDomains( h_data.myToMakeGroupsOfDomains );
     if ( h->GetMaximumMemory() != h_data.myMaximumMemory )
       h->SetMaximumMemory    ( h_data.myMaximumMemory     );
     if ( h->GetInitialMemory() != h_data.myInitialMemory )
@@ -1854,6 +1867,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisDat
   MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets");
   h_data.myName                       = myName ? myName->text() : "";
   h_data.myToMeshHoles                = myToMeshHolesCheck->isChecked();
+  h_data.myToMakeGroupsOfDomains      = myToMakeGroupsOfDomains->isChecked();
   h_data.myMaximumMemory              = myMaximumMemoryCheck->isChecked() ? myMaximumMemorySpin->value() : -1;
   h_data.myInitialMemory              = myInitialMemoryCheck->isChecked() ? myInitialMemorySpin->value() : -1;
   h_data.myOptimizationLevel          = myOptimizationLevelCombo->currentIndex();
index 44641a5651fb12e08ab66366070771eb1418ba26..a9830d904b63f33fc9d3f5cddea6023d39ca0589 100644 (file)
@@ -140,7 +140,7 @@ typedef std::set< TEnfMesh*, CompareEnfMeshes > TEnfMeshList;
 
 typedef struct
 {
-  bool    myToMeshHoles,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint;
+  bool    myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint;
   int     myMaximumMemory,myInitialMemory,myOptimizationLevel;
   QString myName,myWorkingDir,myTextOption;
   double  myGradation;
@@ -173,6 +173,7 @@ protected:
   virtual QString  type() const;
 
 protected slots:
+  void                onToMeshHoles(bool);
   void                onDirBtnClicked();
   void                updateWidgets();
   
@@ -209,6 +210,7 @@ private:
   QWidget*            myStdGroup;
   QLineEdit*          myName;
   QCheckBox*          myToMeshHolesCheck;
+  QCheckBox*          myToMakeGroupsOfDomains;
   QComboBox*          myOptimizationLevelCombo;
 
   QWidget*            myAdvGroup;
index 9c8884bcd4b7b21e81a4e37b6333c6465b50a581..b77bcb38ee62f1ec9424b7f7b00105049a96b5e8 100644 (file)
         <source>GHS3D_TO_MESH_HOLES</source>
         <translation>To mesh holes</translation>
     </message>
+    <message>
+        <source>GHS3D_TO_MAKE_DOMAIN_GROUPS</source>
+        <translation>To make groups of domains</translation>
+    </message>
     <message>
         <source>INIT_MEMORY_SIZE</source>
         <translation>Initial memory size</translation>
index 922e2cc4afac4f221927fe0aaf71521c8245e948..c2291bd7229d86ac0db28eae297d6a3461dffe14 100755 (executable)
@@ -3,6 +3,10 @@
 <TS version="2.0" language="fr_FR">
 <context>
     <name>@default</name>
+    <message>
+        <source>GHS3D_TO_MAKE_DOMAIN_GROUPS</source>
+        <translation type="unfinished">To make groups of domains</translation>
+    </message>
     <message>
         <source>GHS3D_ADV_ARGS</source>
         <translation>Avancé</translation>
diff --git a/src/GUI/GHS3DPlugin_msg_ja.ts b/src/GUI/GHS3DPlugin_msg_ja.ts
new file mode 100644 (file)
index 0000000..659e85f
--- /dev/null
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS>
+  <context>
+    <name>@default</name>
+    <message>
+      <source>GHS3D_ADV_ARGS</source>
+      <translation>高度な</translation>
+    </message>
+    <message>
+      <source>GHS3D_HYPOTHESIS</source>
+      <translation>GHS3D</translation>
+    </message>
+    <message>
+      <source>GHS3D_OPTIMIZATIOL_LEVEL</source>
+      <translation>最適化のレベル</translation>
+    </message>
+    <message>
+      <source>GHS3D_PERMISSION_DENIED</source>
+      <translation>作業ディレクトリが書き込み可能ではないです。</translation>
+    </message>
+    <message>
+      <source>GHS3D_STD_ARGS</source>
+      <translation>パラメーター</translation>
+    </message>
+    <message>
+      <source>GHS3D_TITLE</source>
+      <translation>仮説構築</translation>
+    </message>
+    <message>
+      <source>GHS3D_TO_MESH_HOLES</source>
+      <translation>メッシュに穴します。</translation>
+    </message>
+    <message>
+      <source>INIT_MEMORY_SIZE</source>
+      <translation>初期メモリのサイズ</translation>
+    </message>
+    <message>
+      <source>KEEP_WORKING_FILES</source>
+      <translation>作業ファイルを維持するには</translation>
+    </message>
+    <message>
+      <source>LEVEL_NONE</source>
+      <translation>なし</translation>
+    </message>
+    <message>
+      <source>LEVEL_LIGHT</source>
+      <translation>光</translation>
+    </message>
+    <message>
+      <source>LEVEL_MEDIUM</source>
+      <translation>中 (標準)</translation>
+    </message>
+    <message>
+      <source>LEVEL_STANDARDPLUS</source>
+      <translation>標準的です +</translation>
+    </message>
+    <message>
+      <source>LEVEL_STRONG</source>
+      <translation>強力な</translation>
+    </message>
+    <message>
+      <source>MAX_MEMORY_SIZE</source>
+      <translation>最大メモリ サイズ</translation>
+    </message>
+    <message>
+      <source>MEGABYTE</source>
+      <translation>メガバイト</translation>
+    </message>
+    <message>
+      <source>NO_INITIAL_CENTRAL_POINT</source>
+      <translation>初期の中心点を削除するには</translation>
+    </message>
+    <message>
+      <source>RECOVERY_VERSION</source>
+      <translation>境界の回復のバージョンを使用するには</translation>
+    </message>
+    <message>
+      <source>FEM_CORRECTION</source>
+      <translation>有限要素法による補正を使用するには</translation>
+    </message>
+    <message>
+      <source>GHS3D_GRADATION</source>
+      <translation>Volumic グラデーション</translation>
+    </message>
+    <message>
+      <source>SELECT_DIR</source>
+      <translation>...</translation>
+    </message>
+    <message>
+      <source>TEXT_OPTION</source>
+      <translation>オプション テキストとして</translation>
+    </message>
+    <message>
+      <source>TO_ADD_NODES</source>
+      <translation>新しいノードを作成するには</translation>
+    </message>
+    <message>
+      <source>VERBOSE_LEVEL</source>
+      <translation>詳細レベル</translation>
+    </message>
+    <message>
+      <source>WORKING_DIR</source>
+      <translation>作業ディレクトリ</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENFORCED_VERTICES</source>
+      <translation>適用された頂点</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENFORCED_MESHES</source>
+      <translation>強制メッシュ</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_NAME_COLUMN</source>
+      <translation>名前</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_VER_X_COLUMN</source>
+      <translation>X</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_VER_Y_COLUMN</source>
+      <translation>Y</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_VER_Z_COLUMN</source>
+      <translation>Z</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_SIZE_COLUMN</source>
+      <translation>サイズ</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_ENTRY_COLUMN</source>
+      <translation>頂点のエントリ</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_MESH_CONSTRAINT_COLUMN</source>
+      <translation>制約</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_VER_COMPOUND_COLUMN</source>
+      <translation>化合物</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_GROUP_COLUMN</source>
+      <translation>グループ</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_SELECT_VERTEX</source>
+      <translation>頂点を選択します</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_SELECT_MESH</source>
+      <translation>メッシュを選択します。</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_VER_X_LABEL</source>
+      <translation>X:</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_VER_Y_LABEL</source>
+      <translation>Y:</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_VER_Z_LABEL</source>
+      <translation>Z:</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_MESH_CONSTRAINT_LABEL</source>
+      <translation>制約:</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_MESH_CONSTRAINT_NODE</source>
+      <translation>ノード</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_MESH_CONSTRAINT_EDGE</source>
+      <translation>エッジ</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_MESH_CONSTRAINT_FACE</source>
+      <translation>直面しています。</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_SIZE_LABEL</source>
+      <translation>サイズ:</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_GROUP_LABEL</source>
+      <translation>グループ:</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_ADD</source>
+      <translation>追加</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_REMOVE</source>
+      <translation>削除</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_VER_INFO</source>
+      <translation>&lt;b&gt;警告&lt;/b&gt;: 強制頂点は現在関連付けられているジオメトリ w/o メッシュののみ考慮します。</translation>
+    </message>
+    <message>
+      <source>GHS3D_ENF_MESH_INFO</source>
+      <translation>&lt;b&gt;警告&lt;/b&gt;: 現在適用されたメッシュはメッシュ関連付けられたジオメトリなしののみ考慮します。</translation>
+    </message>
+  </context>
+</TS>
index 5d912bb9dc305614da7842cb9deb470e031325c2..6d70baa681e94c868d288816e4c3753889845ecc 100644 (file)
@@ -49,7 +49,6 @@ libGHS3DPluginGUI_la_CPPFLAGS = \
        $(KERNEL_CXXFLAGS) \
        $(GUI_CXXFLAGS) \
        $(GEOM_CXXFLAGS) \
-       $(MED_CXXFLAGS) \
        $(SMESH_CXXFLAGS) \
        $(BOOST_CPPFLAGS) \
        $(CORBA_CXXFLAGS) \
@@ -61,7 +60,6 @@ libGHS3DPluginGUI_la_LDFLAGS  = \
        ../../idl/libSalomeIDLGHS3DPLUGIN.la \
        $(QT_LIBS) \
        $(KERNEL_LDFLAGS) -lSALOMELocalTrace \
-       $(MED_LDFLAGS) -lSalomeIDLMED \
        $(GEOM_LDFLAGS) -lGEOM \
        $(SMESH_LDFLAGS) -lSMESH -lGeomSelectionTools  -lStdMeshersGUI -lSMESHFiltersSelection \
        $(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp \
@@ -71,4 +69,5 @@ libGHS3DPluginGUI_la_LDFLAGS  = \
 nodist_salomeres_DATA= \
        GHS3DPlugin_images.qm \
        GHS3DPlugin_msg_en.qm \
-       GHS3DPlugin_msg_fr.qm
+       GHS3DPlugin_msg_fr.qm \
+       GHS3DPlugin_msg_ja.qm