Salome HOME
remove "using namespace std" from SMESH headers
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPlugin_Hexotic.cxx
index 588d40888578230d10d280936350189fad01c9b2..73ef7d120485eab4de31bb056f7a1dad6ebfda3f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -99,14 +99,14 @@ HexoticPlugin_Hexotic::HexoticPlugin_Hexotic(int hypId, int studyId, SMESH_Gen*
   : SMESH_3D_Algo(hypId, studyId, gen)
 {
   MESSAGE("HexoticPlugin_Hexotic::HexoticPlugin_Hexotic");
-  _name = "Hexotic_3D";
+  _name = "MG-Hexa";
   _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
 //   _onlyUnaryInput = false;
   _requireShape = false;
   _iShape=0;
   _nbShape=0;
   _hexoticFilesKept=false;
-  _compatibleHypothesis.push_back("Hexotic_Parameters");
+  _compatibleHypothesis.push_back( HexoticPlugin_Hypothesis::GetHypType() );
 #ifdef WITH_BLSURFPLUGIN
   _blsurfHypo = NULL;
 #endif
@@ -147,7 +147,7 @@ bool HexoticPlugin_Hexotic::CheckBLSURFHypothesis( SMESH_Mesh&         aMesh,
 
   // If a BLSURF hypothesis is applied, get it
   SMESH_HypoFilter blsurfFilter;
-  blsurfFilter.Init( blsurfFilter.HasName( "BLSURF_Parameters" ));
+  blsurfFilter.Init( blsurfFilter.HasName( BLSURFPlugin_Hypothesis::GetHypType() ));
   std::list<const SMESHDS_Hypothesis *> appliedHyps;
   aMesh.GetHypotheses( aShape, blsurfFilter, appliedHyps, false );
 
@@ -155,7 +155,7 @@ bool HexoticPlugin_Hexotic::CheckBLSURFHypothesis( SMESH_Mesh&         aMesh,
     itl = appliedHyps.begin();
     theHyp = (*itl); // use only the first hypothesis
     std::string hypName = theHyp->GetName();
-    if (hypName == "BLSURF_Parameters") {
+    if (hypName == BLSURFPlugin_Hypothesis::GetHypType()) {
       _blsurfHypo = static_cast<const BLSURFPlugin_Hypothesis*> (theHyp);
       ASSERT(_blsurfHypo);
       return true;
@@ -192,7 +192,7 @@ bool HexoticPlugin_Hexotic::CheckHypothesis( SMESH_Mesh&
   theHyp = (*itl); // use only the first hypothesis
 
   std::string hypName = theHyp->GetName();
-  if (hypName == "Hexotic_Parameters") {
+  if (hypName == HexoticPlugin_Hypothesis::GetHypType() ) {
     _hypothesis = static_cast<const HexoticPlugin_Hypothesis*> (theHyp);
     ASSERT(_hypothesis);
     aStatus = SMESH_Hypothesis::HYP_OK;
@@ -249,44 +249,6 @@ static TopoDS_Shape findShape(SMDS_MeshNode**     t_Node,
   return aShape;
 }
 
-//=======================================================================
-//function : findEdge
-//purpose  :
-//=======================================================================
-
-static int findEdge(const SMDS_MeshNode* aNode,
-                    const SMESHDS_Mesh*  aMesh,
-                    const int            nEdge,
-                    const TopoDS_Shape*  t_Edge) {
-
-  TopoDS_Shape aPntShape, foundEdge;
-  TopoDS_Vertex aVertex;
-  gp_Pnt aPnt( aNode->X(), aNode->Y(), aNode->Z() );
-
-  int foundInd, ind;
-  double nearest = RealLast(), *t_Dist;
-  double epsilon = Precision::Confusion();
-
-  t_Dist = new double[ nEdge ];
-  aPntShape = BRepBuilderAPI_MakeVertex( aPnt ).Shape();
-  aVertex   = TopoDS::Vertex( aPntShape );
-
-  for ( ind=0; ind < nEdge; ind++ ) {
-    BRepExtrema_DistShapeShape aDistance ( aVertex, t_Edge[ind] );
-    t_Dist[ind] = aDistance.Value();
-    if ( t_Dist[ind] < nearest ) {
-      nearest   = t_Dist[ind];
-      foundEdge = t_Edge[ind];
-      foundInd  = ind;
-      if ( nearest < epsilon )
-        ind = nEdge;
-    }
-  }
-
-  delete [] t_Dist;
-  return aMesh->ShapeToIndex( foundEdge );
-}
-
 //=======================================================================
 //function : getNbShape
 //purpose  :
@@ -353,7 +315,7 @@ void getShape(Mesh* mesh, Shape shape, Tab *t_Shape) {
 
 static void printWarning(const int nbExpected, std::string aString, const int nbFound) {
   cout << std::endl;
-  cout << "WARNING : " << nbExpected << " " << aString << " expected, Hexotic has found " << nbFound << std::endl;
+  cout << "WARNING : " << nbExpected << " " << aString << " expected, MG-Hexa has found " << nbFound << std::endl;
   cout << "=======" << std::endl;
   cout << std::endl;
   return;
@@ -398,29 +360,6 @@ static bool readResult(std::string         theFile,
                        const TopoDS_Shape* tabShape,
                        double**            tabBox)
 {
-  // ---------------------------------
-  // Optimisation of the plugin ...
-  // Retrieve the correspondance edge --> shape
-  // (which is very costly) only when user
-  // has defined at least one group of edges
-  // which should be rare for a 3d mesh !
-  // ---------------------------------
-  
-  bool retrieve_edges = false;
-  const std::set<SMESHDS_GroupBase*>& aGroups = theMesh->GetGroups();
-  set<SMESHDS_GroupBase*>::const_iterator GrIt = aGroups.begin();
-  for (; GrIt != aGroups.end(); GrIt++)
-    {
-      SMESHDS_GroupBase* aGrp = *GrIt;
-      if ( !aGrp )
-        continue;
-      if ( aGrp->GetType() == SMDSAbs_Edge )
-        {
-          retrieve_edges = true;
-          break;
-        }
-    }
-  
   // ---------------------------------
   // Read generated elements and nodes
   // ---------------------------------
@@ -496,7 +435,7 @@ static bool readResult(std::string         theFile,
     }
 
     nbElem = 0;
-    if ( nField < (mapField.size() - 1) && nField >= 0 )
+    if ( nField < int(mapField.size() - 1) && nField >= 0 )
       fileRes >> nbElem;
 
     switch (nField) {
@@ -565,6 +504,10 @@ static bool readResult(std::string         theFile,
                 if ( aPnt.Distance( HexoticPnt ) < epsilon )
                   break;
               }
+              if ( nodeAssigne[ nodeID[0] ] != 0 ) { // because "Edges" go before "Corners"
+                theMesh->UnSetNodeOnShape( node[0] );
+                nodeAssigne[ nodeID[0] ] = 0;
+              }
               break;
             }
             case 4: { // "Edges"
@@ -573,10 +516,7 @@ static bool readResult(std::string         theFile,
               int iNode = 1;
               if ( nodeAssigne[ nodeID[0] ] == 0 || nodeAssigne[ nodeID[0] ] == 2 )
                 iNode = 0;
-              if(retrieve_edges)
-                shapeID = findEdge( node[iNode], theMesh, nbShapeEdge, tabEdge );
-              else
-                shapeID = 0;
+              shapeID = dummy;
               break;
             }
             case 5: { // "Ridges"
@@ -738,7 +678,7 @@ static bool readResult(std::string theFile,
     }
 
     nbElem = 0;
-    if ( nField < (mapField.size() - 1) && nField >= 0 )
+    if ( nField < int(mapField.size() - 1) && nField >= 0 )
       fileRes >> nbElem;
 
     switch (nField) {
@@ -835,7 +775,7 @@ static bool readResult(std::string theFile,
 
 //=============================================================================
 /*!
- * Pass parameters to Hexotic
+ * Pass parameters to MG-Hexa
  */
 //=============================================================================
 
@@ -855,11 +795,18 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
     _hexoticVerbosity = hyp->GetHexoticVerbosity();
     _hexoticMaxMemory = hyp->GetHexoticMaxMemory();
     _hexoticSdMode = hyp->GetHexoticSdMode();
+    _textOptions = hyp->GetTextOptions();
     _sizeMaps = hyp->GetSizeMaps();
+    _nbLayers = hyp->GetNbLayers();
+    _firstLayerSize = hyp->GetFirstLayerSize();
+    _direction = hyp->GetDirection();
+    _growth = hyp->GetGrowth();
+    _facesWithLayers = hyp->GetFacesWithLayers();
+    _imprintedFaces = hyp->GetImprintedFaces();
   }
   else {
     cout << std::endl;
-    cout << "WARNING : The Hexotic default parameters are taken into account" << std::endl;
+    cout << "WARNING : The MG-Hexa default parameters are taken into account" << std::endl;
     cout << "=======" << std::endl;
     _hexesMinLevel = hyp->GetDefaultHexesMinLevel();
     _hexesMaxLevel = hyp->GetDefaultHexesMaxLevel();
@@ -873,7 +820,14 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
     _hexoticVerbosity = hyp->GetDefaultHexoticVerbosity();
     _hexoticMaxMemory = hyp->GetDefaultHexoticMaxMemory();
     _hexoticSdMode = hyp->GetDefaultHexoticSdMode();
+    _textOptions = hyp->GetDefaultTextOptions();
     _sizeMaps = hyp->GetDefaultHexoticSizeMaps();
+    _nbLayers = hyp->GetDefaultNbLayers();
+    _firstLayerSize = hyp->GetDefaultFirstLayerSize();
+    _direction = hyp->GetDefaultDirection();
+    _growth = hyp->GetDefaultGrowth();
+    _facesWithLayers = hyp->GetDefaultFacesWithLayers();
+    _imprintedFaces = hyp->GetDefaultImprintedFaces();
   }
 }
 
@@ -882,36 +836,36 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
 //purpose  :
 //=======================================================================
 
-static TCollection_AsciiString getTmpDir()
-{
-  TCollection_AsciiString aTmpDir;
-
-  char *Tmp_dir = getenv("SALOME_TMP_DIR");
-#ifdef WIN32
-  if(Tmp_dir == NULL) {
-    Tmp_dir = getenv("TEMP");
-    if( Tmp_dir== NULL )
-      Tmp_dir = getenv("TMP");
-  }
-#endif
-
-  if(Tmp_dir != NULL) {
-    aTmpDir = Tmp_dir;
-#ifdef WIN32
-    if(aTmpDir.Value(aTmpDir.Length()) != '\\') aTmpDir+='\\';
-#else
-    if(aTmpDir.Value(aTmpDir.Length()) != '/') aTmpDir+='/';
-#endif
-  }
-  else {
-#ifdef WIN32
-    aTmpDir = TCollection_AsciiString("C:\\");
-#else
-    aTmpDir = TCollection_AsciiString("/tmp/");
-#endif
-  }
-  return aTmpDir;
-}
+// static TCollection_AsciiString getTmpDir()
+// {
+//   TCollection_AsciiString aTmpDir;
+
+//   char *Tmp_dir = getenv("SALOME_TMP_DIR");
+// #ifdef WIN32
+//   if(Tmp_dir == NULL) {
+//     Tmp_dir = getenv("TEMP");
+//     if( Tmp_dir== NULL )
+//       Tmp_dir = getenv("TMP");
+//   }
+// #endif
+
+//   if(Tmp_dir != NULL) {
+//     aTmpDir = Tmp_dir;
+// #ifdef WIN32
+//     if(aTmpDir.Value(aTmpDir.Length()) != '\\') aTmpDir+='\\';
+// #else
+//     if(aTmpDir.Value(aTmpDir.Length()) != '/') aTmpDir+='/';
+// #endif
+//   }
+//   else {
+// #ifdef WIN32
+//     aTmpDir = TCollection_AsciiString("C:\\");
+// #else
+//     aTmpDir = TCollection_AsciiString("/tmp/");
+// #endif
+//   }
+//   return aTmpDir;
+// }
 
 //=======================================================================
 //function : getSuffix
@@ -941,7 +895,7 @@ static TCollection_AsciiString getSuffix()
 
 //================================================================================
 /*!
- * \brief Returns a command to run Hexotic mesher
+ * \brief Returns a command to run MG-Hexa mesher
  */
 //================================================================================
 
@@ -950,7 +904,7 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
                                                      const TCollection_AsciiString& Hexotic_SizeMap_Prefix) const
 {
   cout << std::endl;
-  cout << "Hexotic execution..." << std::endl;
+  cout << "MG-Hexa execution..." << std::endl;
   cout << _name << " parameters :" << std::endl;
   cout << "    " << _name << " Verbosity = " << _hexoticVerbosity << std::endl;
   cout << "    " << _name << " Max Memory = " << _hexoticMaxMemory << std::endl;
@@ -958,12 +912,37 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   cout << "    " << _name << " Segments Max Level = " << _hexesMaxLevel << std::endl;
   cout << "    " << _name << " Segments Min Size = " << _hexesMinSize << std::endl;
   cout << "    " << _name << " Segments Max Size = " << _hexesMaxSize << std::endl;
-  cout << "    " << "Hexotic can ignore ridges : " << (_hexoticIgnoreRidges ? "yes":"no") << std::endl;
-  cout << "    " << "Hexotic authorize invalide elements : " << ( _hexoticInvalidElements ? "yes":"no") << std::endl;
+  cout << "    " << "MG-Hexa can ignore ridges : " << (_hexoticIgnoreRidges ? "yes":"no") << std::endl;
+  cout << "    " << "MG-Hexa authorize invalide elements : " << ( _hexoticInvalidElements ? "yes":"no") << std::endl;
   cout << "    " << _name << " Sharp angle threshold = " << _hexoticSharpAngleThreshold << " degrees" << std::endl;
   cout << "    " << _name << " Number of threads = " << _hexoticNbProc << std::endl;
   cout << "    " << _name << " Working directory = \"" << _hexoticWorkingDirectory << "\"" << std::endl;
   cout << "    " << _name << " Sub. Dom mode = " << _hexoticSdMode << std::endl;
+  cout << "    " << _name << " Text options = \"" << _textOptions << "\"" << std::endl;
+  cout << "    " << _name << " Number of layers = " << _nbLayers << std::endl;
+  cout << "    " << _name << " Size of the first layer  = " << _firstLayerSize << std::endl;
+  cout << "    " << _name << " Direction of the layers = " << ( _direction ? "Inward" : "Outward" ) << std::endl;
+  cout << "    " << _name << " Growth = " << _growth << std::endl;
+  if (!_facesWithLayers.empty()) {
+    cout << "    " << _name << " Faces with layers = ";
+    for (size_t i = 0; i < _facesWithLayers.size(); i++)
+    {
+      cout << _facesWithLayers.at(i);
+      if ((i + 1) != _facesWithLayers.size())
+        cout << ", ";
+    }
+    cout << std::endl;
+  }
+  if (!_imprintedFaces.empty()) {
+    cout << "    " << _name << " Imprinted faces = ";
+    for (size_t i = 0; i < _imprintedFaces.size(); i++)
+    {
+      cout << _imprintedFaces.at(i);
+      if ((i + 1) != _imprintedFaces.size())
+        cout << ", ";
+    }
+    cout << std::endl;
+  }
 
   TCollection_AsciiString run_Hexotic( "mg-hexa.exe" );
 
@@ -979,7 +958,15 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   TCollection_AsciiString verb = " --verbose ";
   TCollection_AsciiString maxmem = " --max_memory ";
 
-  TCollection_AsciiString minLevel, maxLevel, minSize, maxSize, sharpAngle, mode, nbproc, verbosity, maxMemory;
+  TCollection_AsciiString comNbLayers = " --number_of_boundary_layers ";
+  TCollection_AsciiString comFirstLayerSize = " --height_of_the_first_layer ";
+  TCollection_AsciiString comDirection = " --boundary_layers_subdomain_direction ";
+  TCollection_AsciiString comGrowth = " --boundary_layers_geometric_progression ";
+  TCollection_AsciiString comFacesWithLayers = " --boundary_layers_surface_ids ";
+  TCollection_AsciiString comImptintedFaces = " --imprinted_surface_ids ";
+
+  TCollection_AsciiString minLevel, maxLevel, minSize, maxSize, sharpAngle, mode, nbproc, verbosity, maxMemory,
+                          textOptions, nbLayers, firstLayerSize, direction, growth, facesWithLayers, imprintedFaces;
   minLevel = _hexesMinLevel;
   maxLevel = _hexesMaxLevel;
   minSize = _hexesMinSize;
@@ -1004,6 +991,23 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   nbproc = _hexoticNbProc;
   verbosity = _hexoticVerbosity;
   maxMemory = _hexoticMaxMemory;
+  textOptions = (" " + _textOptions + " ").c_str();
+  nbLayers = _nbLayers;
+  firstLayerSize = _firstLayerSize;
+  direction = _direction ? "1" : "-1";
+  growth = _growth;
+  for (size_t i = 0; i < _facesWithLayers.size(); i++)
+  {
+    facesWithLayers += _facesWithLayers[i];
+    if ((i + 1) != _facesWithLayers.size())
+      facesWithLayers += ",";
+  }
+  for (size_t i = 0; i < _imprintedFaces.size(); i++)
+  {
+    imprintedFaces += _imprintedFaces[i];
+    if ((i + 1) != _imprintedFaces.size())
+      imprintedFaces += ",";
+  }
 
   if (_hexoticIgnoreRidges)
     run_Hexotic +=  ignoreRidges;
@@ -1029,6 +1033,19 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   if (_sizeMaps.begin() != _sizeMaps.end())
     run_Hexotic += sizeMap + Hexotic_SizeMap_Prefix;
 
+  if (_nbLayers       > 0 &&
+      _firstLayerSize > 0 &&
+      _growth         > 0 &&
+      !_facesWithLayers.empty())
+  {
+    run_Hexotic += comNbLayers + nbLayers;
+    run_Hexotic += comFirstLayerSize + firstLayerSize;
+    run_Hexotic += comDirection + direction;
+    run_Hexotic += comGrowth + growth;
+    run_Hexotic += comFacesWithLayers + facesWithLayers;
+    if (!_imprintedFaces.empty())
+      run_Hexotic += comImptintedFaces + imprintedFaces;
+  }
   run_Hexotic += in + Hexotic_In + out + Hexotic_Out;
   run_Hexotic += subdom + mode;
 #ifndef WIN32
@@ -1037,6 +1054,9 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   run_Hexotic += verb + verbosity;
   run_Hexotic += maxmem + maxMemory;
 
+  if (!_textOptions.empty())
+    run_Hexotic += textOptions;
+
   return run_Hexotic.ToCString();
 }
 
@@ -1430,7 +1450,7 @@ gp_Pnt HexoticPlugin_Hexotic::tangencyPoint(const gp_Pnt& p1,
 
 //=============================================================================
 /*!
- * Here we are going to use the Hexotic mesher
+ * Here we are going to use the MG-Hexa mesher
  */
 //=============================================================================
 
@@ -1448,7 +1468,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
 
   // to prevent from displaying error message after computing,
   // SetIsAlwaysComputed( true ) to empty sub-meshes
-  vector< SMESH_subMesh* > subMeshesAlwaysComp;
+  std::vector< SMESH_subMesh* > subMeshesAlwaysComp;
   for ( int i = 0; i < _nbShape; ++i )
     if ( SMESH_subMesh* sm = aMesh.GetSubMeshContaining( aShape ))
     {
@@ -1503,8 +1523,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
     if ( aTmpDir.Value(aTmpDir.Length()) != '/' ) aTmpDir += '/';
 #endif
     TCollection_AsciiString Hexotic_In(""), Hexotic_Out, Hexotic_SizeMap_Prefix;
-    TCollection_AsciiString modeFile_In( "chmod 666 " ), modeFile_Out( "chmod 666 " );
-    TCollection_AsciiString aLogFileName = aTmpDir + "Hexotic"+getSuffix()+".log";    // log
+    TCollection_AsciiString modeFile_In( "chmod 666 " ), modeFile_Out( "chmod 666 " );    TCollection_AsciiString aLogFileName = aTmpDir + "Hexotic"+getSuffix()+".log";    // log
 
     std::map <int,int> aSmdsToHexoticIdMap;
     std::map <int,const SMDS_MeshNode*> aHexoticIdToNodeMap;
@@ -1513,8 +1532,9 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
 #ifdef WITH_BLSURFPLUGIN
     bool defaultInputFile = true;
     if (_blsurfHypo && !_blsurfHypo->GetQuadAllowed()) {
-      Hexotic_In = TCollection_AsciiString(_blsurfHypo->GetGMFFile().c_str());
-      if (Hexotic_In != "")
+      Hexotic_In = _blsurfHypo->GetGMFFile().c_str();
+      if ( !Hexotic_In.IsEmpty() &&
+           SMESH_File( _blsurfHypo->GetGMFFile() ).exists() )
         defaultInputFile = false;
     }
     if (defaultInputFile) {
@@ -1523,7 +1543,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
       removeHexoticFiles(Hexotic_In, Hexotic_Out);
       splitQuads(aMesh); // quadrangles are no longer acceptable as input
       cout << std::endl;
-      cout << "Creating Hexotic input mesh file : " << Hexotic_In << std::endl;
+      cout << "Creating MG-Hexa input mesh file : " << Hexotic_In << std::endl;
       aMesh.ExportGMF(Hexotic_In.ToCString(), meshDS, true);
 #ifdef WITH_BLSURFPLUGIN
     }
@@ -1539,7 +1559,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
     run_Hexotic += std::string(" 1> ") + aLogFileName.ToCString();  // dump into file
 
     cout << std::endl;
-    cout << "Hexotic command : " << run_Hexotic << std::endl;
+    cout << "MG-Hexa command : " << run_Hexotic << std::endl;
 
 #ifndef WIN32    
     modeFile_In += Hexotic_In;
@@ -1557,8 +1577,10 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
     // --------------
 
     std::ifstream fileRes( Hexotic_Out.ToCString() );
+#ifndef WIN32  
     modeFile_Out += Hexotic_Out;
     system( modeFile_Out.ToCString() );
+#endif
     if ( ! fileRes.fail() ) {
       Ok = readResult( Hexotic_Out.ToCString(),
                        this,
@@ -1595,7 +1617,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
     }
     else {
       hexahedraMessage = "failed";
-      cout << "Problem with Hexotic output file " << Hexotic_Out.ToCString() << std::endl;
+      cout << "Problem with MG-Hexa output file " << Hexotic_Out.ToCString() << std::endl;
       Ok = false;
       // analyse log file
       SMESH_File logFile( aLogFileName.ToCString() );
@@ -1608,11 +1630,11 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
       }
 #ifndef WIN32
       if ( status > 0 && WEXITSTATUS(status) == 127 )
-        error("hexotic: command not found");
+        error("mg-hexa.exe: command not found");
 #else
       int err = errno;
       if ( status == 0 && err == ENOENT ) {
-        error("hexotic: command not found");
+        error("mg-hexa.exe: command not found");
       }
 #endif
     }
@@ -1680,7 +1702,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
   splitQuads(aMesh); // quadrangles are no longer acceptable as input
 
   cout << std::endl;
-  cout << "Creating Hexotic input mesh file : " << Hexotic_In << std::endl;
+  cout << "Creating MG-Hexa input mesh file : " << Hexotic_In << std::endl;
   aMesh.ExportGMF(Hexotic_In.ToCString(), aHelper->GetMeshDS());
 #ifndef WIN32    
   modeFile_In += Hexotic_In;
@@ -1692,7 +1714,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
   MESSAGE("HexoticPlugin_Hexotic::Compute");
 
   cout << std::endl;
-  cout << "Hexotic command : " << run_Hexotic << std::endl;
+  cout << "MG-Hexa command : " << run_Hexotic << std::endl;
   system( run_Hexotic.data() );
 
   // --------------
@@ -1740,7 +1762,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
     myError->myName = COMPERR_EXCEPTION;
 */
     hexahedraMessage = "failed";
-    cout << "Problem with Hexotic output file " << Hexotic_Out << std::endl;
+    cout << "Problem with MG-Hexa output file " << Hexotic_Out << std::endl;
     // analyse log file
     SMESH_File logFile( aLogFileName.ToCString() );
     if ( !logFile.eof() )
@@ -1750,7 +1772,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
       if ( std::search( fileBeg, fileEnd, msgLic, msgLic+strlen(msgLic)) != fileEnd )
         return error("Licence problems.");
     }
-    return error(SMESH_Comment("Problem with Hexotic output file ")<<Hexotic_Out);
+    return error(SMESH_Comment("Problem with MG-Hexa output file ")<<Hexotic_Out);
   }
   cout << "Hexahedra meshing " << hexahedraMessage << std::endl;
   cout << std::endl;
@@ -1760,7 +1782,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
   removeFile(Hexotic_Out);
   removeFile(Hexotic_In);
   removeFile(aLogFileName);
-  for( int i=0; i<sizeMapFiles.size(); i++)
+  for( size_t i=0; i<sizeMapFiles.size(); i++)
   {
     removeFile( TCollection_AsciiString(sizeMapFiles[i].c_str()) );
   }