Salome HOME
Merge V8_4_BR branch.
authorrnv <rnv@opencascade.com>
Wed, 13 Dec 2017 09:17:51 +0000 (12:17 +0300)
committerrnv <rnv@opencascade.com>
Wed, 13 Dec 2017 09:18:31 +0000 (12:18 +0300)
13 files changed:
1  2 
CMakeLists.txt
idl/SMESH_Mesh.idl
src/SMESH/SMESH_Algo.cxx
src/SMESH/SMESH_Mesh.cxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_DumpPython.cxx
src/SMESH_I/SMESH_Filter_i.cxx
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_SWIG/smeshBuilder.py

diff --combined CMakeLists.txt
index abe280dd55f615ee35dee7336cdb3f854a57cf9f,57381c39c65a759d3fd0a9c43f38c2d6e0116936..083efdcec8cb26abf18de25cd763e01771423cda
@@@ -31,11 -31,11 +31,11 @@@ ENDIF(WIN32
  STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
  
  SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
- SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
+ SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
  SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
  SET(${PROJECT_NAME_UC}_VERSION
    ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
 -SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
 +SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
  
  # Common CMake macros
  # ===================
@@@ -77,6 -77,11 +77,11 @@@ OPTION(SALOME_BUILD_DOC "Generate SALOM
  OPTION(SALOME_BUILD_GUI            "Enable GUI" ON)
  OPTION(SALOME_SMESH_USE_CGNS       "Enable import/export to CGNS format" OFF)
  OPTION(SALOME_SMESH_USE_TBB        "Enable parallel computation" OFF)
+ OPTION(SALOME_SMESH_DYNLOAD_LOCAL  "Load plug-ins' symbols locally (Linux only)" ON)
+ IF(SALOME_SMESH_DYNLOAD_LOCAL)
+   ADD_DEFINITIONS(-DDYNLOAD_LOCAL)
+ ENDIF(SALOME_SMESH_DYNLOAD_LOCAL)
  
  #On Linux use Fortran to compile MEFISTO2D
  IF(NOT WIN32)
@@@ -85,7 -90,7 +90,7 @@@
    ADD_DEFINITIONS(-DENABLE_MEFISTO)
  ENDIF(NOT WIN32)
  
- MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB)
+ MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB SALOME_SMESH_DYNLOAD_LOCAL)
  
  # Prerequisites
  # =============
diff --combined idl/SMESH_Mesh.idl
index fbb9430d3bd0e31a8c70ee2f31a76f266579045f,74619a175b81847b1015b226d0ee61131f29adac..f01de1d07abfc3791452470d0c6f3102a469412d
@@@ -238,11 -238,28 +238,28 @@@ module SMES
  
    /*!
     * Enumeration for ExportToMED*()
+    * MED_V2_1 and MED_V2_2 are here for compatibility and mean respectively obsolete and MED_LATEST.
+    * MED_MINOR_0 to MED_MINOR_9 are use to specify the minor version used by MEDfichier
+    * to write MED files (major version cannot be changed).
+    * This allows backward compatibility from a newer version of SALOME to an older one:
+    * for instance, a MESH produced in SALOME 8.4 (med 3.3) can be written in med 3.2 format
+    * to be read in SALOME 8.3.
     */
    enum MED_VERSION
    {
      MED_V2_1,
-     MED_V2_2
+     MED_V2_2,
+     MED_LATEST,
+     MED_MINOR_0,
+     MED_MINOR_1,
+     MED_MINOR_2,
+     MED_MINOR_3,
+     MED_MINOR_4,
+     MED_MINOR_5,
+     MED_MINOR_6,
+     MED_MINOR_7,
+     MED_MINOR_8,
+     MED_MINOR_9
    };
  
    /*! 
        raises (SALOME::SALOME_Exception);
  
      /*!
 -     * Remove an hypothesis previouly added with AddHypothesis.
 +     * Remove an hypothesis previously added with AddHypothesis.
       */
      Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
                                         in SMESH_Hypothesis anHyp)
        raises (SALOME::SALOME_Exception);
  
      /*!
-      * Export Mesh to MED_V2_1 MED format
-      * Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_V2_1
+      * Export Mesh to MED_LATEST MED format
+      * Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_LATEST
       * and overwrite parameter equal to true
       * The method is kept in order to support old functionality
       */
      double GetComputeProgress();
  
      /*!
 -     * Get informations about mesh contents
 +     * Get information about mesh contents
       */
      long NbNodes()
        raises (SALOME::SALOME_Exception);
diff --combined src/SMESH/SMESH_Algo.cxx
index 95e775433db585fdc6579a205a3f24fb71b299bd,968154d1a5fa788d2e659fc5a17f2f4e8c17fc78..acb3e7137f0a4217d9092cf7718317f5b86d9816
@@@ -42,8 -42,6 +42,6 @@@
  #include "SMESH_TypeDefs.hxx"
  #include "SMESH_subMesh.hxx"
  
- #include <Basics_OCCTVersion.hxx>
  #include <BRepAdaptor_Curve.hxx>
  #include <BRepLProp.hxx>
  #include <BRep_Tool.hxx>
@@@ -87,7 -85,7 +85,7 @@@ using namespace std
  bool SMESH_Algo::Features::IsCompatible( const SMESH_Algo::Features& algo2 ) const
  {
    if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
 -  // algo2 is of highter dimension
 +  // algo2 is of higher dimension
    if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
      return false;
    bool compatible = true;
diff --combined src/SMESH/SMESH_Mesh.cxx
index 93fbbac35e74cd245dda6e429bcaafdeebc1e142,7de8ef36ffca63ee8462cafc015fe6dec359db55..713869c25da4e803f72c0ba114cef40c7ad1571d
@@@ -1402,6 -1402,7 +1402,7 @@@ void SMESH_Mesh::ExportMED(const char 
                             bool                theAllElemsToGroup)
    throw(SALOME_Exception)
  {
+   //MESSAGE("MED_VERSION:"<< theVersion);
    SMESH_TRY;
  
    DriverMED_W_SMESHDS_Mesh myWriter;
@@@ -2188,7 -2189,7 +2189,7 @@@ ostream& SMESH_Mesh::Dump(ostream& save
          save << clause << ".3) Faces in detail: " << endl;
          map <int,int>::iterator itF;
          for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
 -          save << "--> nb nodes: " << itF->first << " - nb elemens:\t" << itF->second << endl;
 +          save << "--> nb nodes: " << itF->first << " - nb elements:\t" << itF->second << endl;
        }
      }
      save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
          save << clause << ".5) Volumes in detail: " << endl;
          map <int,int>::iterator itV;
          for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
 -          save << "--> nb nodes: " << itV->first << " - nb elemens:\t" << itV->second << endl;
 +          save << "--> nb nodes: " << itV->first << " - nb elements:\t" << itV->second << endl;
        }
      }
      save << endl;
index 0061006d95516389cd21786dd29136d61d7d0484,b584a345d6db12cd61a2060866d30b9404a6a563..f85aa4a45a4ac0ac8b6aeb3691188777a4e50271
  #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
  #include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
  #include CORBA_CLIENT_HEADER(SMESH_Measurements)
+ #include CORBA_CLIENT_HEADER(SMESH_Mesh)
  
  // Qt includes
  // #define       INCLUDE_MENUITEM_DEF // VSR commented ????????
@@@ -627,7 -628,7 +628,7 @@@ namespac
          "SMESH_TETRAHEDRA","SMESH_QUADRATIC_TETRAHEDRONS","SMESH_PYRAMIDS",
          "SMESH_QUADRATIC_PYRAMIDS","SMESH_HEXAHEDRA","SMESH_QUADRATIC_HEXAHEDRONS",
          "SMESH_TRIQUADRATIC_HEXAHEDRONS","SMESH_PENTAHEDRA","SMESH_QUADRATIC_PENTAHEDRONS",
 -              "SMESH_BIQUADRATIC_PENTAHEDRONS",
 +        "SMESH_BIQUADRATIC_PENTAHEDRONS",
          "SMESH_OCTAHEDRA","SMESH_POLYEDRONS","SMESH_QUADRATIC_POLYEDRONS","SMESH_BALLS"
        };
        // is typeMsg complete? (compilation failure mains that enum SMDSAbs_EntityType changed)
      // Get parameters of export operation
  
      QString            aFilename;
-     SMESH::MED_VERSION aFormat = SMESH::MED_V2_2;
+     SMESH::MED_VERSION aFormat = SMESH::MED_LATEST;
      // Init the parameters with the default values
      bool aIsASCII_STL   = true;
      bool toCreateGroups = false;
      else if ( isMED || isSAUV ) // Export to MED or SAUV
      {
        QMap<QString, SMESH::MED_VERSION> aFilterMap;
-       //QString v21 (aMesh->GetVersionString(SMESH::MED_V2_1, 2));
        if ( isMED ) {
          QString v22 (aMesh->GetVersionString(SMESH::MED_V2_2, 2));
-         //aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( v21 ) + " (*.med)", SMESH::MED_V2_1 );
          aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( v22 ) + " (*.med)", SMESH::MED_V2_2 );
+         int minor = v22.split(".").last().toInt();
+         int vv= int(SMESH::MED_MINOR_0); // add all minor from 0 to current
+         for (int ii=0; ii<minor; ii++)
+           {
+             QString vs = aMesh->GetVersionString(SMESH::MED_VERSION(vv), 2);
+             aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)",  SMESH::MED_VERSION(vv));
+             vv = vv +1;
+           }
        }
        else { // isSAUV
          aFilterMap.insert("All files (*)", SMESH::MED_V2_1 );
              }
            if( !toOverwrite ) {
              // can't append to an existing using other format
-             SMESH::MED_VERSION aVersion = SMESH::MED_V2_1;
+             SMESH::MED_VERSION aVersion = aFormat; //SMESH::MED_V2_1;
              bool isVersionOk = SMESHGUI::GetSMESHGen()->GetMEDVersion( aFilename.toUtf8().constData(), aVersion );
              if( !isVersionOk || aVersion != aFormat ) {
                int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
        type = QObject::tr( "LENGTH_EDGES" );
      else if ( dynamic_cast< SMESH::Controls::Length2D* >( f.get() ) )
        type = QObject::tr( "LENGTH2D_EDGES" );
 +    else if ( dynamic_cast< SMESH::Controls::Deflection2D* >( f.get() ) )
 +      type = QObject::tr( "DEFLECTION2D_FACES" );
      else if ( dynamic_cast< SMESH::Controls::MultiConnection* >( f.get() ) )
        type = QObject::tr( "MULTI_BORDERS" );
      else if ( dynamic_cast< SMESH::Controls::MultiConnection2D* >( f.get() ) )
      ActionControl.Bind( SMESHOp::OpBareBorderFace,        SMESH_Actor::eBareBorderFace );
      ActionControl.Bind( SMESHOp::OpOverConstrainedFace,   SMESH_Actor::eOverConstrainedFace );
      ActionControl.Bind( SMESHOp::OpLength2D,              SMESH_Actor::eLength2D );
 +    ActionControl.Bind( SMESHOp::OpDeflection2D,          SMESH_Actor::eDeflection2D );
      ActionControl.Bind( SMESHOp::OpConnection2D,          SMESH_Actor::eMultiConnection2D );
      ActionControl.Bind( SMESHOp::OpArea,                  SMESH_Actor::eArea );
      ActionControl.Bind( SMESHOp::OpTaper,                 SMESH_Actor::eTaper );
@@@ -2649,9 -2653,7 +2656,7 @@@ bool SMESHGUI::OnGUIEvent( int theComma
        if(checkLock(aStudy)) break;
        SUIT_OverrideCursor wc;
        try {
- #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
          OCC_CATCH_SIGNALS;
- #endif
          SMESH::UpdateView();
        }
        catch (std::bad_alloc) { // PAL16774 (Crash after display of many groups)
    case SMESHOp::OpBareBorderFace:
    case SMESHOp::OpOverConstrainedFace:
    case SMESHOp::OpLength2D:
 +  case SMESHOp::OpDeflection2D:
    case SMESHOp::OpConnection2D:
    case SMESHOp::OpArea:
    case SMESHOp::OpTaper:
@@@ -3922,7 -3923,6 +3927,7 @@@ void SMESHGUI::initialize( CAM_Applicat
    createSMESHAction( SMESHOp::OpBareBorderFace,        "BARE_BORDER_FACE",        "ICON_BARE_BORDER_FACE",        0, true );
    createSMESHAction( SMESHOp::OpOverConstrainedFace,   "OVER_CONSTRAINED_FACE",   "ICON_OVER_CONSTRAINED_FACE",   0, true );
    createSMESHAction( SMESHOp::OpLength2D,              "LENGTH_2D",               "ICON_LENGTH_2D",     0, true );
 +  createSMESHAction( SMESHOp::OpDeflection2D,          "DEFLECTION_2D",           "ICON_DEFLECTION_2D", 0, true );
    createSMESHAction( SMESHOp::OpConnection2D,          "CONNECTION_2D",           "ICON_CONNECTION_2D", 0, true );
    createSMESHAction( SMESHOp::OpArea,                  "AREA",                    "ICON_AREA",          0, true );
    createSMESHAction( SMESHOp::OpTaper,                 "TAPER",                   "ICON_TAPER",         0, true );
                 << SMESHOp::OpNodeConnectivityNb                                         // node controls
                 << SMESHOp::OpFreeEdge << SMESHOp::OpFreeBorder
                 << SMESHOp::OpLength << SMESHOp::OpConnection << SMESHOp::OpEqualEdge    // edge controls
 +               << SMESHOp::OpDeflection2D
                 << SMESHOp::OpFreeFace << SMESHOp::OpLength2D << SMESHOp::OpConnection2D
                 << SMESHOp::OpArea << SMESHOp::OpTaper << SMESHOp::OpAspectRatio
                 << SMESHOp::OpMinimumAngle << SMESHOp::OpWarpingAngle << SMESHOp::OpSkew
    createMenu( SMESHOp::OpSkew,                  faceId,   -1 );
    createMenu( SMESHOp::OpMaxElementLength2D,    faceId,   -1 );
    createMenu( SMESHOp::OpEqualFace,             faceId,   -1 );
 +  createMenu( SMESHOp::OpDeflection2D,          faceId,   -1 );
    createMenu( SMESHOp::OpAspectRatio3D,         volumeId, -1 );
    createMenu( SMESHOp::OpVolume,                volumeId, -1 );
    createMenu( SMESHOp::OpMaxElementLength3D,    volumeId, -1 );
    createTool( SMESHOp::OpSkew,                ctrl2dTb );
    createTool( SMESHOp::OpMaxElementLength2D,  ctrl2dTb );
    createTool( SMESHOp::OpEqualFace,           ctrl2dTb );
 +  createTool( SMESHOp::OpDeflection2D,        ctrl2dTb );
  
    createTool( SMESHOp::OpAspectRatio3D,         ctrl3dTb );
    createTool( SMESHOp::OpVolume,                ctrl3dTb );
    popupMgr()->insert ( action( SMESHOp::OpOverConstrainedFace ), aSubId, -1 );
    popupMgr()->setRule( action( SMESHOp::OpOverConstrainedFace ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
    popupMgr()->setRule( action( SMESHOp::OpOverConstrainedFace ), "controlMode = 'eOverConstrainedFace'", QtxPopupMgr::ToggleRule );
 +
    popupMgr()->insert ( action( SMESHOp::OpEqualFace ), aSubId, -1 );
    popupMgr()->setRule( action( SMESHOp::OpEqualFace ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
    popupMgr()->setRule( action( SMESHOp::OpEqualFace ), "controlMode = 'eCoincidentElems2D'", QtxPopupMgr::ToggleRule );
  
 +  popupMgr()->insert ( action( SMESHOp::OpDeflection2D ), aSubId, -1 );
 +  popupMgr()->setRule( action( SMESHOp::OpDeflection2D ), aMeshInVtkHasFaces + " && hasGeomReference", QtxPopupMgr::VisibleRule );
 +  popupMgr()->setRule( action( SMESHOp::OpDeflection2D ), "controlMode = 'eDeflection2D'", QtxPopupMgr::ToggleRule );
 +
    aSubId = popupMgr()->insert( tr( "MEN_VOLUME_CTRL" ), anId, -1 ); // VOLUME CONTROLS
  
    popupMgr()->insert ( action( SMESHOp::OpAspectRatio3D  ), aSubId, -1 );
index ce634a4b30471ba91a2dce300f393304e70f029c,b762d30188e9f0455db5407600a85e5c7add84cf..dd82c712df9a994a10d89b98ef017262b45bfcdc
@@@ -1539,7 -1539,7 +1539,7 @@@ SMESHGUI_ComputeOp::SMESHGUI_ComputeOp(
  
  //================================================================================
  /*!
 - * \brief Desctructor
 + * \brief Destructor
  */
  //================================================================================
  
@@@ -1984,9 -1984,7 +1984,7 @@@ void SMESHGUI_PrecomputeOp::onPreview(
    
    SMESH::long_array_var aShapesId = new SMESH::long_array();
    try {
- #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
      OCC_CATCH_SIGNALS;
- #endif
        
      SMESH::MeshPreviewStruct_var previewData =
        gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId);
    }
  
    try {
- #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
      OCC_CATCH_SIGNALS;
- #endif
      aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
      // check if there are memory problems
      for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
@@@ -2158,7 -2154,7 +2154,7 @@@ SMESHGUI_EvaluateOp::SMESHGUI_EvaluateO
  
  //================================================================================
  /*!
 - * \brief Desctructor
 + * \brief Destructor
  */
  //================================================================================
  
@@@ -2227,9 -2223,7 +2223,7 @@@ void SMESHGUI_BaseComputeOp::evaluateMe
      }
      SUIT_OverrideCursor aWaitCursor;
      try {
- #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
        OCC_CATCH_SIGNALS;
- #endif
        aRes = gen->Evaluate(myMesh, myMainShape);
      }
      catch(const SALOME::SALOME_Exception & S_ex){
      }
  
      try {
- #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
        OCC_CATCH_SIGNALS;
- #endif
        aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
      }
      catch(const SALOME::SALOME_Exception & S_ex){
index 3c70da492c84906f8064b8953bb8ca0e1c33607c,220e3d581eca960aa1bd84247f64381b0f89becc..b8f06d7a46434fc245bfbecc2f8d07c797968594
  #include <unistd.h>
  #endif
  
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyObject          ,Standard_Transient);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyCommand         ,Standard_Transient);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesisReader,Standard_Transient);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyGen             ,_pyObject);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyMesh            ,_pyObject);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pySubMesh         ,_pyObject);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyMeshEditor      ,_pyObject);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesis      ,_pyObject);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pySelfEraser      ,_pyObject);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyGroup           ,_pyObject);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyFilter          ,_pyObject);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyAlgorithm       ,_pyHypothesis);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyComplexParamHypo,_pyHypothesis);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyNumberOfSegmentsHyp,_pyHypothesis);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pyLayerDistributionHypo,_pyHypothesis);
OCCT_IMPLEMENT_STANDARD_RTTIEXT(_pySegmentLengthAroundVertexHyp,_pyHypothesis);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyObject          ,Standard_Transient);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyCommand         ,Standard_Transient);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesisReader,Standard_Transient);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyGen             ,_pyObject);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyMesh            ,_pyObject);
+ IMPLEMENT_STANDARD_RTTIEXT(_pySubMesh         ,_pyObject);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyMeshEditor      ,_pyObject);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesis      ,_pyObject);
+ IMPLEMENT_STANDARD_RTTIEXT(_pySelfEraser      ,_pyObject);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyGroup           ,_pyObject);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyFilter          ,_pyObject);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyAlgorithm       ,_pyHypothesis);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyComplexParamHypo,_pyHypothesis);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyNumberOfSegmentsHyp,_pyHypothesis);
+ IMPLEMENT_STANDARD_RTTIEXT(_pyLayerDistributionHypo,_pyHypothesis);
+ IMPLEMENT_STANDARD_RTTIEXT(_pySegmentLengthAroundVertexHyp,_pyHypothesis);
  
  using namespace std;
  using SMESH::TPythonDump;
  
  /*!
   * \brief Container of commands into which the initial script is split.
 - *        It also contains data coresponding to SMESH_Gen contents
 + *        It also contains data corresponding to SMESH_Gen contents
   */
  static Handle(_pyGen) theGen;
  
@@@ -294,8 -294,6 +294,8 @@@ namespace 
      //   - FT_BelongToMeshGroup     = 22
      // v 8.1.0: FT_Undefined == 48, new items:
      //   - FT_NodeConnectivityNumber= 22
 +    // v 8.5.0: FT_Undefined == 49, new items:
 +    //   - FT_Deflection2D          = 22
      //
      // It's necessary to continue recording this history and to fill
      // undef2newItems (see below) accordingly.
        undef2newItems[ 46 ].push_back( 39 );
        undef2newItems[ 47 ].push_back( 22 );
        undef2newItems[ 48 ].push_back( 22 );
 +      undef2newItems[ 49 ].push_back( 22 );
  
        ASSERT( undef2newItems.rbegin()->first == SMESH::FT_Undefined );
      }
@@@ -606,7 -603,7 +606,7 @@@ const char* _pyGen::AccessorMethod() co
  //================================================================================
  /*!
   * \brief Convert a command using a specific converter
 -  * \param theCommand - the command to convert
 +  \param theCommand - the command to convert
   */
  //================================================================================
  
@@@ -860,8 -857,8 +860,8 @@@ Handle(_pyCommand) _pyGen::AddCommand( 
        aCommand->GetString() += tmpCmd.GetString();
      }
      // IMP issue 0021014
 -    // set GetCriterion(elementType,CritType,Compare,Treshold,UnaryOp,BinaryOp,Tolerance)
 -    //                  1           2        3       4        5       6        7
 +    // set GetCriterion(elementType,CritType,Compare,Threshold,UnaryOp,BinaryOp,Tolerance)
 +    //                  1           2        3       4         5       6        7
      // instead of "SMESH.Filter.Criterion(
      // Type,Compare,Threshold,ThresholdStr,ThresholdID,UnaryOp,BinaryOp,Tolerance,TypeOfElement,Precision)
      // 1    2       3         4            5           6       7        8         9             10
  //================================================================================
  /*!
   * \brief Convert the command or remember it for later conversion
 -  * \param theCommand - The python command calling a method of SMESH_Gen
 +  \param theCommand - The python command calling a method of SMESH_Gen
   */
  //================================================================================
  
@@@ -1278,8 -1275,8 +1278,8 @@@ void _pyGen::Free(
  //================================================================================
  /*!
   * \brief Add access method to mesh that is an argument
 -  * \param theCmd - command to add access method
 -  * \retval bool - true if added
 +  \param theCmd - command to add access method
 + * \retval bool - true if added
   */
  //================================================================================
  
@@@ -1297,8 -1294,8 +1297,8 @@@ bool _pyGen::AddMeshAccessorMethod( Han
  //================================================================================
  /*!
   * \brief Add access method to algo that is an object or an argument
 -  * \param theCmd - command to add access method
 -  * \retval bool - true if added
 +  \param theCmd - command to add access method
 + * \retval bool - true if added
   */
  //================================================================================
  
@@@ -1319,8 -1316,8 +1319,8 @@@ bool _pyGen::AddAlgoAccessorMethod( Han
  //================================================================================
  /*!
   * \brief Find hypothesis by ID (entry)
 -  * \param theHypID - The hypothesis ID
 -  * \retval Handle(_pyHypothesis) - The found hypothesis
 +  \param theHypID - The hypothesis ID
 + * \retval Handle(_pyHypothesis) - The found hypothesis
   */
  //================================================================================
  
@@@ -1337,10 -1334,10 +1337,10 @@@ Handle(_pyHypothesis) _pyGen::FindHyp( 
  //================================================================================
  /*!
   * \brief Find algorithm able to create a hypothesis
 -  * \param theGeom - The shape ID the algorithm was created on
 -  * \param theMesh - The mesh ID that created the algorithm
 -  * \param theHypothesis - The hypothesis the algorithm should be able to create
 -  * \retval Handle(_pyHypothesis) - The found algo
 +  \param theGeom - The shape ID the algorithm was created on
 +  \param theMesh - The mesh ID that created the algorithm
 +  \param theHypothesis - The hypothesis the algorithm should be able to create
 + * \retval Handle(_pyHypothesis) - The found algo
   */
  //================================================================================
  
@@@ -1361,8 -1358,8 +1361,8 @@@ Handle(_pyHypothesis) _pyGen::FindAlgo
  //================================================================================
  /*!
   * \brief Find subMesh by ID (entry)
 -  * \param theSubMeshID - The subMesh ID
 -  * \retval Handle(_pySubMesh) - The found subMesh
 +  \param theSubMeshID - The subMesh ID
 + * \retval Handle(_pySubMesh) - The found subMesh
   */
  //================================================================================
  
@@@ -1378,8 -1375,8 +1378,8 @@@ Handle(_pySubMesh) _pyGen::FindSubMesh
  //================================================================================
  /*!
   * \brief Change order of commands in the script
 -  * \param theCmd1 - One command
 -  * \param theCmd2 - Another command
 +  \param theCmd1 - One command
 +  \param theCmd2 - Another command
   */
  //================================================================================
  
@@@ -1396,15 -1393,15 +1396,15 @@@ void _pyGen::ExchangeCommands( Handle(_
    int nb1 = theCmd1->GetOrderNb();
    theCmd1->SetOrderNb( theCmd2->GetOrderNb() );
    theCmd2->SetOrderNb( nb1 );
 -//   cout << "BECOME " << theCmd1->GetOrderNb() << "\t" << theCmd1->GetString() << endl
 -//        << "BECOME " << theCmd2->GetOrderNb() << "\t" << theCmd2->GetString() << endl << endl;
 +  //   cout << "BECOME " << theCmd1->GetOrderNb() << "\t" << theCmd1->GetString() << endl
 +  //        << "BECOME " << theCmd2->GetOrderNb() << "\t" << theCmd2->GetString() << endl << endl;
  }
  
  //================================================================================
  /*!
   * \brief Set one command after the other
 -  * \param theCmd - Command to move
 -  * \param theAfterCmd - Command ater which to insert the first one
 +  \param theCmd - Command to move
 +  \param theAfterCmd - Command ater which to insert the first one
   */
  //================================================================================
  
@@@ -1416,8 -1413,8 +1416,8 @@@ void _pyGen::SetCommandAfter( Handle(_p
  //================================================================================
  /*!
   * \brief Set one command before the other
 -  * \param theCmd - Command to move
 -  * \param theBeforeCmd - Command before which to insert the first one
 +  \param theCmd - Command to move
 +  \param theBeforeCmd - Command before which to insert the first one
   */
  //================================================================================
  
@@@ -1429,8 -1426,8 +1429,8 @@@ void _pyGen::SetCommandBefore( Handle(_
  //================================================================================
  /*!
   * \brief Set one command before or after the other
 -  * \param theCmd - Command to move
 -  * \param theOtherCmd - Command ater or before which to insert the first one
 +  \param theCmd - Command to move
 +  \param theOtherCmd - Command ater or before which to insert the first one
   */
  //================================================================================
  
@@@ -1457,7 -1454,7 +1457,7 @@@ void _pyGen::setNeighbourCommand( Handl
  
  // void _pyGen::addFilterUser( Handle(_pyCommand)& theCommand, const Handle(_pyObject)& user )
  // {
 -  // No more needed after adding _pyObject::myArgCommands
 +// No more needed after adding _pyObject::myArgCommands
  
  //   const char filterPrefix[] = "aFilter0x";
  //   if ( theCommand->GetString().Search( filterPrefix ) < 1 )
  //================================================================================
  /*!
   * \brief Set command be last in list of commands
 -  * \param theCmd - Command to be last
 +  \param theCmd - Command to be last
   */
  //================================================================================
  
@@@ -1495,8 -1492,8 +1495,8 @@@ Handle(_pyCommand)& _pyGen::GetLastComm
  //================================================================================
  /*!
   * \brief Set method to access to object wrapped with python class
 -  * \param theID - The wrapped object entry
 -  * \param theMethod - The accessor method
 +  \param theID - The wrapped object entry
 +  \param theMethod - The accessor method
   */
  //================================================================================
  
@@@ -1508,7 -1505,7 +1508,7 @@@ void _pyGen::SetAccessorMethod(const _p
  //================================================================================
  /*!
   * \brief Generated new ID for object and assign with existing name
 -  * \param theID - ID of existing object
 +  \param theID - ID of existing object
   */
  //================================================================================
  
@@@ -1548,7 -1545,7 +1548,7 @@@ bool _pyGen::AddObject( Handle(_pyObjec
    }
    else if ( theObj->IsKind( STANDARD_TYPE( _pyMeshEditor ))) {
      add = myMeshEditors.insert( make_pair( theObj->GetID(),
 -                                          Handle(_pyMeshEditor)::DownCast( theObj ))).second;
 +                                           Handle(_pyMeshEditor)::DownCast( theObj ))).second;
    }
    else {
      add = myObjects.insert( make_pair( theObj->GetID(), theObj )).second;
@@@ -1792,7 -1789,7 +1792,7 @@@ _pyMesh::_pyMesh(const Handle(_pyComman
  //================================================================================
  /*!
   * \brief Convert an IDL API command of SMESH::SMESH_Mesh to a method call of python Mesh
 -  * \param theCommand - Engine method called for this mesh
 +  \param theCommand - Engine method called for this mesh
   */
  //================================================================================
  
@@@ -2430,7 -2427,7 +2430,7 @@@ void _pyMeshEditor::Process( const Hand
        "ExtrusionAlongPathX","ExtrusionAlongPathObject1D","ExtrusionAlongPathObject2D",
        "ExtrusionSweepObjects","RotationSweepObjects","ExtrusionAlongPathObjects",
        "Mirror","MirrorObject","Translate","TranslateObject","Rotate","RotateObject",
 -      "FindCoincidentNodes","MergeNodes","FindEqualElements",
 +      "FindCoincidentNodes","MergeNodes","FindEqualElements","FillHole",
        "MergeElements","MergeEqualElements","SewFreeBorders","SewConformFreeBorders",
        "FindCoincidentFreeBorders", "SewCoincidentFreeBorders",
        "SewBorderToSide","SewSideElements","ChangeElemNodes","GetLastCreatedNodes",
@@@ -2622,7 -2619,7 +2622,7 @@@ bool _pyMeshEditor::CanClear(
  //================================================================================
  /*!
   * \brief _pyHypothesis constructor
 -  * \param theCreationCmd -
 +  \param theCreationCmd -
   */
  //================================================================================
  
@@@ -2635,8 -2632,8 +2635,8 @@@ _pyHypothesis::_pyHypothesis(const Hand
  //================================================================================
  /*!
   * \brief Creates algorithm or hypothesis
 -  * \param theCreationCmd - The engine command creating a hypothesis
 -  * \retval Handle(_pyHypothesis) - Result _pyHypothesis
 +  \param theCreationCmd - The engine command creating a hypothesis
 + * \retval Handle(_pyHypothesis) - Result _pyHypothesis
   */
  //================================================================================
  
@@@ -2725,9 -2722,9 +2725,9 @@@ bool _pyHypothesis::IsWrappable(const _
  //================================================================================
  /*!
   * \brief Convert the command adding a hypothesis to mesh into a smesh command
 -  * \param theCmd - The command like mesh.AddHypothesis( geom, hypo )
 -  * \param theAlgo - The algo that can create this hypo
 -  * \retval bool - false if the command can't be converted
 +  \param theCmd - The command like mesh.AddHypothesis( geom, hypo )
 +  \param theAlgo - The algo that can create this hypo
 + * \retval bool - false if the command can't be converted
   */
  //================================================================================
  
@@@ -2790,7 -2787,7 +2790,7 @@@ bool _pyHypothesis::Addition2Creation( 
  //================================================================================
  /*!
   * \brief Remember hypothesis parameter values
 - * \param theCommand - The called hypothesis method
 + *  \param theCommand - The called hypothesis method
   */
  //================================================================================
  
@@@ -3143,7 -3140,7 +3143,7 @@@ void _pyHypothesis::setCreationArg( con
  //================================================================================
  /*!
   * \brief Remember hypothesis parameter values
 - * \param theCommand - The called hypothesis method
 + *  \param theCommand - The called hypothesis method
   */
  //================================================================================
  
@@@ -3198,8 -3195,8 +3198,8 @@@ void _pyComplexParamHypo::Process( cons
      {
        CreationMethod& crMethod = type2meth->second;
        while ( (int) crMethod.myArgs.size() < i+1 )
 -          crMethod.myArgs.push_back( "[]" );
 -        crMethod.myArgs[ i ] = theCommand->GetArg( 1 ); // arg value
 +        crMethod.myArgs.push_back( "[]" );
 +      crMethod.myArgs[ i ] = theCommand->GetArg( 1 ); // arg value
      }
      myArgCommands.push_back( theCommand );
    }
@@@ -3243,7 -3240,7 +3243,7 @@@ void _pyComplexParamHypo::Flush(
  //================================================================================
  /*!
   * \brief Convert methods of 1D hypotheses to my own methods
 - * \param theCommand - The called hypothesis method
 + *  \param theCommand - The called hypothesis method
   */
  //================================================================================
  
@@@ -3280,9 -3277,9 +3280,9 @@@ void _pyLayerDistributionHypo::Process
  //================================================================================
  /*!
   * \brief
 -  * \param theAdditionCmd - command to be converted
 -  * \param theMesh - mesh instance
 -  * \retval bool - status
 +  \param theAdditionCmd - command to be converted
 +  \param theMesh - mesh instance
 + * \retval bool - status
   */
  //================================================================================
  
@@@ -3384,9 -3381,9 +3384,9 @@@ void _pyLayerDistributionHypo::Flush(
  //================================================================================
  /*!
   * \brief additionally to Addition2Creation, clears SetDistrType() command
 -  * \param theCmd - AddHypothesis() command
 -  * \param theMesh - mesh to which a hypothesis is added
 -  * \retval bool - conversion result
 +  \param theCmd - AddHypothesis() command
 +  \param theMesh - mesh to which a hypothesis is added
 + * \retval bool - conversion result
   */
  //================================================================================
  
@@@ -3466,9 -3463,9 +3466,9 @@@ void _pyNumberOfSegmentsHyp::Flush(
  /*!
   * \brief Convert the command adding "SegmentLengthAroundVertex" to mesh
   * into regular1D.LengthNearVertex( length, vertex )
 -  * \param theCmd - The command like mesh.AddHypothesis( vertex, SegmentLengthAroundVertex )
 -  * \param theMesh - The mesh needing this hypo
 -  * \retval bool - false if the command can't be converted
 +  \param theCmd - The command like mesh.AddHypothesis( vertex, SegmentLengthAroundVertex )
 +  \param theMesh - The mesh needing this hypo
 + * \retval bool - false if the command can't be converted
   */
  //================================================================================
  
@@@ -3511,7 -3508,7 +3511,7 @@@ bool _pySegmentLengthAroundVertexHyp::A
  //================================================================================
  /*!
   * \brief _pyAlgorithm constructor
 - * \param theCreationCmd - The command like "algo = smeshgen.CreateHypothesis(type,lib)"
 + *  \param theCreationCmd - The command like "algo = smeshgen.CreateHypothesis(type,lib)"
   */
  //================================================================================
  
@@@ -3524,9 -3521,9 +3524,9 @@@ _pyAlgorithm::_pyAlgorithm(const Handle
  //================================================================================
  /*!
   * \brief Convert the command adding an algorithm to mesh
 -  * \param theCmd - The command like mesh.AddHypothesis( geom, algo )
 -  * \param theMesh - The mesh needing this algo
 -  * \retval bool - false if the command can't be converted
 +  \param theCmd - The command like mesh.AddHypothesis( geom, algo )
 +  \param theMesh - The mesh needing this algo
 + * \retval bool - false if the command can't be converted
   */
  //================================================================================
  
@@@ -3544,8 -3541,8 +3544,8 @@@ bool _pyAlgorithm::Addition2Creation( c
  //================================================================================
  /*!
   * \brief Return starting position of a part of python command
 -  * \param thePartIndex - The index of command part
 -  * \retval int - Part position
 +  \param thePartIndex - The index of command part
 + * \retval int - Part position
   */
  //================================================================================
  
@@@ -3562,8 -3559,8 +3562,8 @@@ int _pyCommand::GetBegPos( int thePartI
  //================================================================================
  /*!
   * \brief Store starting position of a part of python command
 -  * \param thePartIndex - The index of command part
 -  * \param thePosition - Part position
 +  \param thePartIndex - The index of command part
 +  \param thePosition - Part position
   */
  //================================================================================
  
@@@ -3578,7 -3575,7 +3578,7 @@@ void _pyCommand::SetBegPos( int thePart
  //================================================================================
  /*!
   * \brief Returns whitespace symbols at the line beginning
 -  * \retval TCollection_AsciiString - result
 + * \retval TCollection_AsciiString - result
   */
  //================================================================================
  
@@@ -3595,7 -3592,7 +3595,7 @@@ TCollection_AsciiString _pyCommand::Get
  //================================================================================
  /*!
   * \brief Return substring of python command looking like ResultValue = Obj.Meth()
 -  * \retval const TCollection_AsciiString & - ResultValue substring
 + * \retval const TCollection_AsciiString & - ResultValue substring
   */
  //================================================================================
  
@@@ -3735,7 -3732,7 +3735,7 @@@ const TCollection_AsciiString & _pyComm
  //================================================================================
  /*!
   * \brief Return substring of python command looking like ResVal = Obj.Method()
 -  * \retval const TCollection_AsciiString & - Method substring
 + * \retval const TCollection_AsciiString & - Method substring
   */
  //================================================================================
  
@@@ -3778,7 -3775,7 +3778,7 @@@ bool _pyCommand::IsMethodCall(
  //================================================================================
  /*!
   * \brief Return substring of python command looking like ResVal = Obj.Meth(Arg1,...)
 -  * \retval const TCollection_AsciiString & - Arg<index> substring
 + * \retval const TCollection_AsciiString & - Arg<index> substring
   */
  //================================================================================
  
@@@ -3879,8 -3876,8 +3879,8 @@@ int _pyCommand::GetArgBeginning() cons
  //================================================================================
  /*!
   * \brief Check if char is a word part
 -  * \param c - The character to check
 -  * \retval bool - The check result
 +  \param c - The character to check
 + * \retval bool - The check result
   */
  //================================================================================
  
@@@ -3893,10 -3890,10 +3893,10 @@@ static inline bool isWord(const char c
  //================================================================================
  /*!
   * \brief Looks for a word in the string and returns word's beginning
 -  * \param theString - The input string
 -  * \param theStartPos - The position to start the search, returning word's beginning
 -  * \param theForward - The search direction
 -  * \retval TCollection_AsciiString - The found word
 +  \param theString - The input string
 +  \param theStartPos - The position to start the search, returning word's beginning
 +  \param theForward - The search direction
 + * \retval TCollection_AsciiString - The found word
   */
  //================================================================================
  
@@@ -4027,9 -4024,9 +4027,9 @@@ std::list< _pyID > _pyCommand::GetStudy
  //================================================================================
  /*!
   * \brief Look for position where not space char is
 -  * \param theString - The string
 -  * \param thePos - The position to search from and which returns result
 -  * \retval bool - false if there are only space after thePos in theString
 +  \param theString - The string
 +  \param thePos - The position to search from and which returns result
 + * \retval bool - false if there are only space after thePos in theString
   */
  //================================================================================
  
@@@ -4047,14 -4044,14 +4047,14 @@@ bool _pyCommand::SkipSpaces( const TCol
  //================================================================================
  /*!
   * \brief Modify a part of the command
 -  * \param thePartIndex - The index of the part
 -  * \param thePart - The new part string
 -  * \param theOldPart - The old part
 +  \param thePartIndex - The index of the part
 +  \param thePart - The new part string
 +  \param theOldPart - The old part
   */
  //================================================================================
  
  void _pyCommand::SetPart(int thePartIndex, const TCollection_AsciiString& thePart,
 -                        TCollection_AsciiString& theOldPart)
 +                         TCollection_AsciiString& theOldPart)
  {
    int pos = GetBegPos( thePartIndex );
    if ( pos <= Length() && theOldPart != thePart)
  //================================================================================
  /*!
   * \brief Set agrument
 -  * \param index - The argument index, it counts from 1
 -  * \param theArg - The argument string
 +  \param index - The argument index, it counts from 1
 +  \param theArg - The argument string
   */
  //================================================================================
  
@@@ -4189,9 -4186,9 +4189,9 @@@ bool _pyCommand::SetDependentCmdsAfter(
  //================================================================================
  /*!
   * \brief Insert accessor method after theObjectID
 -  * \param theObjectID - id of the accessed object
 -  * \param theAcsMethod - name of the method giving access to the object
 -  * \retval bool - false if theObjectID is not found in the command string
 +  \param theObjectID - id of the accessed object
 +  \param theAcsMethod - name of the method giving access to the object
 + * \retval bool - false if theObjectID is not found in the command string
   */
  //================================================================================
  
@@@ -4279,7 -4276,7 +4279,7 @@@ void _pyObject::ClearCommands(
  //================================================================================
  /*!
   * \brief Return method name giving access to an interaface object wrapped by python class
 -  * \retval const char* - method name
 + * \retval const char* - method name
   */
  //================================================================================
  
@@@ -4411,39 -4408,39 +4411,39 @@@ _pySubMesh::_pySubMesh(const Handle(_py
  bool _pySubMesh::CanBeArgOfMethod(const _AString& theMethodName)
  {
    return false;
 -//   // names of all methods where a sub-mesh can be used as argument
 -//   static TStringSet methods;
 -//   if ( methods.empty() ) {
 -//     const char * names[] = {
 -//       // methods of SMESH_Gen
 -//       "CopyMesh",
 -//       // methods of SMESH_Group
 -//       "AddFrom",
 -//       // methods of SMESH_Measurements
 -//       "MinDistance",
 -//       // methods of SMESH_Mesh
 -//       "ExportPartToMED","ExportCGNS","ExportPartToDAT","ExportPartToUNV","ExportPartToSTL",
 -//       "RemoveSubMesh",
 -//       // methods of SMESH_MeshEditor
 -//       "ReorientObject","Reorient2D","TriToQuadObject","QuadToTriObject","SplitQuadObject",
 -//       "SplitVolumesIntoTetra","SmoothObject","SmoothParametricObject","ConvertFromQuadraticObject",
 -//       "RotationSweepObject","RotationSweepObjectMakeGroups","RotationSweepObject1D",
 -//       "RotationSweepObject1DMakeGroups","RotationSweepObject2D","RotationSweepObject2DMakeGroups",
 -//       "ExtrusionSweepObject","ExtrusionSweepObjectMakeGroups","ExtrusionSweepObject0D",
 -//       "ExtrusionSweepObject0DMakeGroups","ExtrusionSweepObject1D","ExtrusionSweepObject2D",
 -//       "ExtrusionSweepObject1DMakeGroups","ExtrusionSweepObject2DMakeGroups",
 -//       "ExtrusionAlongPathObjX","ExtrusionAlongPathObject","ExtrusionAlongPathObjectMakeGroups",
 -//       "ExtrusionAlongPathObject1D","ExtrusionAlongPathObject1DMakeGroups",
 -//       "ExtrusionAlongPathObject2D","ExtrusionAlongPathObject2DMakeGroups","MirrorObject",
 -//       "MirrorObjectMakeGroups","MirrorObjectMakeMesh","TranslateObject","Scale",
 -//       "TranslateObjectMakeGroups","TranslateObjectMakeMesh","ScaleMakeGroups","ScaleMakeMesh",
 -//       "RotateObject","RotateObjectMakeGroups","RotateObjectMakeMesh","FindCoincidentNodesOnPart",
 -//       "FindCoincidentNodesOnPartBut","FindEqualElements","FindAmongElementsByPoint",
 -//       "MakeBoundaryMesh","Create0DElementsOnAllNodes",
 -//       "" }; // <- mark of end
 -//     methods.Insert( names );
 -//   }
 -//   return methods.Contains( theMethodName );
 +  // names of all methods where a sub-mesh can be used as argument
 +  // static TStringSet methods;
 +  // if ( methods.empty() ) {
 +  //   const char * names[] = {
 +  //     // methods of SMESH_Gen
 +  //     "CopyMesh",
 +  //     // methods of SMESH_Group
 +  //     "AddFrom",
 +  //     // methods of SMESH_Measurements
 +  //     "MinDistance",
 +  //     // methods of SMESH_Mesh
 +  //     "ExportPartToMED","ExportCGNS","ExportPartToDAT","ExportPartToUNV","ExportPartToSTL",
 +  //     "RemoveSubMesh",
 +  //     // methods of SMESH_MeshEditor
 +  //     "ReorientObject","Reorient2D","TriToQuadObject","QuadToTriObject","SplitQuadObject",
 +  //     "SplitVolumesIntoTetra","SmoothObject","SmoothParametricObject","ConvertFromQuadraticObject",
 +  //     "RotationSweepObject","RotationSweepObjectMakeGroups","RotationSweepObject1D",
 +  //     "RotationSweepObject1DMakeGroups","RotationSweepObject2D","RotationSweepObject2DMakeGroups",
 +  //     "ExtrusionSweepObject","ExtrusionSweepObjectMakeGroups","ExtrusionSweepObject0D",
 +  //     "ExtrusionSweepObject0DMakeGroups","ExtrusionSweepObject1D","ExtrusionSweepObject2D",
 +  //     "ExtrusionSweepObject1DMakeGroups","ExtrusionSweepObject2DMakeGroups",
 +  //     "ExtrusionAlongPathObjX","ExtrusionAlongPathObject","ExtrusionAlongPathObjectMakeGroups",
 +  //     "ExtrusionAlongPathObject1D","ExtrusionAlongPathObject1DMakeGroups",
 +  //     "ExtrusionAlongPathObject2D","ExtrusionAlongPathObject2DMakeGroups","MirrorObject",
 +  //     "MirrorObjectMakeGroups","MirrorObjectMakeMesh","TranslateObject","Scale",
 +  //     "TranslateObjectMakeGroups","TranslateObjectMakeMesh","ScaleMakeGroups","ScaleMakeMesh",
 +  //     "RotateObject","RotateObjectMakeGroups","RotateObjectMakeMesh","FindCoincidentNodesOnPart",
 +  //     "FindCoincidentNodesOnPartBut","FindEqualElements","FindAmongElementsByPoint",
 +  //     "MakeBoundaryMesh","Create0DElementsOnAllNodes",
 +  //     "" }; // <- mark of end
 +  //   methods.Insert( names );
 +  // }
 +  // return methods.Contains( theMethodName );
  }
  
  //================================================================================
@@@ -4510,13 -4507,13 +4510,13 @@@ _pyGroup::_pyGroup(const Handle(_pyComm
      //}
      //else {
      // ------------------------->>>>> GroupOnGeom( geom, name, typ )
 -      _pyID type = theCreationCmd->GetArg( 1 );
 -      _pyID name = theCreationCmd->GetArg( 2 );
 -      theCreationCmd->SetMethod( "GroupOnGeom" );
 -      theCreationCmd->RemoveArgs();
 -      theCreationCmd->SetArg( 1, geom );
 -      theCreationCmd->SetArg( 2, name );
 -      theCreationCmd->SetArg( 3, type );
 +    _pyID type = theCreationCmd->GetArg( 1 );
 +    _pyID name = theCreationCmd->GetArg( 2 );
 +    theCreationCmd->SetMethod( "GroupOnGeom" );
 +    theCreationCmd->RemoveArgs();
 +    theCreationCmd->SetArg( 1, geom );
 +    theCreationCmd->SetArg( 2, name );
 +    theCreationCmd->SetArg( 3, type );
      //}
    }
    else if ( method == "CreateGroupFromFilter" )
index 878b152f4efa107d54f49d9cd16a721d079a9646,19c46da07fb5bd186afa1a98303547d8ecf23b39..966fa7b0fff890e1df2cec1c4cfa65e02adc397c
@@@ -431,7 -431,6 +431,7 @@@ namespace SMES
        case FT_MultiConnection2D:     myStream<< "aMultiConnection2D";     break;
        case FT_Length:                myStream<< "aLength";                break;
        case FT_Length2D:              myStream<< "aLength2D";              break;
 +      case FT_Deflection2D:          myStream<< "aDeflection2D";          break;
        case FT_NodeConnectivityNumber:myStream<< "aNodeConnectivityNumber";break;
        case FT_BelongToMeshGroup:     myStream<< "aBelongToMeshGroup";     break;
        case FT_BelongToGeom:          myStream<< "aBelongToGeom";          break;
      switch (theVersion) {
      case SMESH::MED_V2_1: myStream << "SMESH.MED_V2_1"; break;
      case SMESH::MED_V2_2: myStream << "SMESH.MED_V2_2"; break;
+     case SMESH::MED_LATEST: myStream << "SMESH.MED_LATEST"; break;
+     case SMESH::MED_MINOR_0: myStream << "SMESH.MED_MINOR_0"; break;
+     case SMESH::MED_MINOR_1: myStream << "SMESH.MED_MINOR_1"; break;
+     case SMESH::MED_MINOR_2: myStream << "SMESH.MED_MINOR_2"; break;
+     case SMESH::MED_MINOR_3: myStream << "SMESH.MED_MINOR_3"; break;
+     case SMESH::MED_MINOR_4: myStream << "SMESH.MED_MINOR_4"; break;
+     case SMESH::MED_MINOR_5: myStream << "SMESH.MED_MINOR_5"; break;
+     case SMESH::MED_MINOR_6: myStream << "SMESH.MED_MINOR_6"; break;
+     case SMESH::MED_MINOR_7: myStream << "SMESH.MED_MINOR_7"; break;
+     case SMESH::MED_MINOR_8: myStream << "SMESH.MED_MINOR_8"; break;
+     case SMESH::MED_MINOR_9: myStream << "SMESH.MED_MINOR_9"; break;
      default: myStream << theVersion;
      }
      return *this;
index 2ec3495645dcc4542fee25d9d9a9bdc9adeda1b4,95c338377faa8b5584e8839fa7c2ece8b9fbbe30..c62297be860f277dc8aa38d97e6745678eff2dbd
@@@ -40,8 -40,6 +40,6 @@@
  #include <SALOMEDS_wrap.hxx>
  #include <GEOM_wrap.hxx>
  
- #include <Basics_OCCTVersion.hxx>
  #include <BRep_Tool.hxx>
  #include <Geom_CylindricalSurface.hxx>
  #include <Geom_Plane.hxx>
@@@ -534,21 -532,6 +532,21 @@@ SMESH::Length2D::Values* Length2D_i::Ge
    return aResult._retn();
  }
  
 +/*
 +  Class       : Deflection2D_i
 +  Description : Functor for calculating distance between a face and geometry
 +*/
 +Deflection2D_i::Deflection2D_i()
 +{
 +  myNumericalFunctorPtr.reset( new Controls::Deflection2D() );
 +  myFunctorPtr = myNumericalFunctorPtr;
 +}
 +
 +FunctorType Deflection2D_i::GetFunctorType()
 +{
 +  return SMESH::FT_Deflection2D;
 +}
 +
  /*
    Class       : MultiConnection_i
    Description : Functor for calculating number of faces conneted to the edge
@@@ -2128,14 -2111,6 +2126,14 @@@ Length2D_ptr FilterManager_i::CreateLen
    return anObj._retn();
  }
  
 +Deflection2D_ptr FilterManager_i::CreateDeflection2D()
 +{
 +  SMESH::Deflection2D_i* aServant = new SMESH::Deflection2D_i();
 +  SMESH::Deflection2D_var   anObj = aServant->_this();
 +  TPythonDump()<<aServant<<" = "<<this<<".CreateLength2D()";
 +  return anObj._retn();
 +}
 +
  MultiConnection_ptr FilterManager_i::CreateMultiConnection()
  {
    SMESH::MultiConnection_i* aServant = new SMESH::MultiConnection_i();
@@@ -2979,9 -2954,6 +2977,9 @@@ CORBA::Boolean Filter_i::SetCriteria( c
        case SMESH::FT_Length2D:
          aFunctor = aFilterMgr->CreateLength2D();
          break;
 +      case SMESH::FT_Deflection2D:
 +        aFunctor = aFilterMgr->CreateDeflection2D();
 +        break;
        case SMESH::FT_AspectRatio:
          aFunctor = aFilterMgr->CreateAspectRatio();
          break;
@@@ -3477,10 -3449,9 +3475,10 @@@ static inline LDOMString toString( CORB
      case FT_EqualFaces            : return "Equal faces";
      case FT_EqualVolumes          : return "Equal volumes";
      case FT_MultiConnection       : return "Borders at multi-connections";
 -    case FT_MultiConnection2D     :return "Borders at multi-connections 2D";
 +    case FT_MultiConnection2D     : return "Borders at multi-connections 2D";
      case FT_Length                : return "Length";
      case FT_Length2D              : return "Length 2D";
 +    case FT_Deflection2D          : return "Deflection 2D";
      case FT_LessThan              : return "Less than";
      case FT_MoreThan              : return "More than";
      case FT_EqualTo               : return "Equal to";
      case FT_LogicalOR             : return "Or";
      case FT_GroupColor            : return "Color of Group";
      case FT_LinearOrQuadratic     : return "Linear or Quadratic";
 -    case FT_ElemGeomType          : return "Element geomtry type";
 +    case FT_ElemGeomType          : return "Element geometry type";
      case FT_EntityType            : return "Entity type";
      case FT_Undefined             : return "";
      default                       : return "";
@@@ -3529,7 -3500,6 +3527,7 @@@ static inline SMESH::FunctorType toFunc
    //  else if ( theStr.equals( "Borders at multi-connections 2D" ) ) return FT_MultiConnection2D;
    else if ( theStr.equals( "Length"                       ) ) return FT_Length;
    //  else if ( theStr.equals( "Length2D"                     ) ) return FT_Length2D;
 +  else if ( theStr.equals( "Deflection"                   ) ) return FT_Deflection2D;
    else if ( theStr.equals( "Range of IDs"                 ) ) return FT_RangeOfIds;
    else if ( theStr.equals( "Bad Oriented Volume"          ) ) return FT_BadOrientedVolume;
    else if ( theStr.equals( "Volumes with bare border"     ) ) return FT_BareBorderVolume;
    else if ( theStr.equals( "Or"                           ) ) return FT_LogicalOR;
    else if ( theStr.equals( "Color of Group"               ) ) return FT_GroupColor;
    else if ( theStr.equals( "Linear or Quadratic"          ) ) return FT_LinearOrQuadratic;
 -  else if ( theStr.equals( "Element geomtry type"         ) ) return FT_ElemGeomType;
 +  else if ( theStr.equals( "Element geometry type"        ) ) return FT_ElemGeomType;
    else if ( theStr.equals( "Entity type"                  ) ) return FT_EntityType;
    else if ( theStr.equals( ""                             ) ) return FT_Undefined;
    else  return FT_Undefined;
@@@ -3969,16 -3939,6 +3967,6 @@@ CORBA::Boolean FilterLibrary_i::Save(
    if ( myFileName == 0 || strlen( myFileName ) == 0 )
      return false;
  
- #if OCC_VERSION_MAJOR < 7
-   FILE* aOutFile = fopen( myFileName, "wt" );
-   if ( !aOutFile )
-     return false;
-   LDOM_XmlWriter aWriter( aOutFile );
-   aWriter.SetIndentation( 2 );
-   aWriter << myDoc;
-   fclose( aOutFile );
- #else
    std::filebuf fb;
    fb.open( myFileName, std::ios::out );
  
    aWriter.SetIndentation( 2 );
    aWriter.Write( os, myDoc );
    fb.close();
- #endif
  
    TPythonDump()<<this<<".Save()";
    return true;
@@@ -4106,7 -4065,6 +4093,7 @@@ static const char** getFunctNames(
      "FT_MultiConnection2D",
      "FT_Length",
      "FT_Length2D",
 +    "FT_Deflection2D",
      "FT_NodeConnectivityNumber",
      "FT_BelongToMeshGroup",
      "FT_BelongToGeom",
      "FT_LinearOrQuadratic",
      "FT_GroupColor",
      "FT_ElemGeomType",
 -    "FT_EntityType", 
 +    "FT_EntityType",
      "FT_CoplanarFaces",
      "FT_BallDiameter",
      "FT_ConnectedElements",
index 33aa46a9614daad8ea5e283add38569efa3aa714,f6877fa472404c875366b9c7cd7887e1adbeaa95..89317f87fe79d11376029812723c79cb781f3123
   #define LoadLib( name ) LoadLibrary( name )
   #define GetProc GetProcAddress
   #define UnLoadLib( handle ) FreeLibrary( handle );
- #else
+ #else // WIN32
   #define LibHandle void*
-  #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL )
+  #ifdef DYNLOAD_LOCAL
+   #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_LOCAL )
+  #else // DYNLOAD_LOCAL
+   #define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL )
+  #endif // DYNLOAD_LOCAL
   #define GetProc dlsym
   #define UnLoadLib( handle ) dlclose( handle );
- #endif
+ #endif // WIN32
  
  #include "SMESH_Gen_i.hxx"
  #include "SMESH_version.h"
@@@ -2968,8 -2972,19 +2972,19 @@@ CORBA::Boolean SMESH_Gen_i::GetMEDVersi
    theVersion = SMESH::MED_V2_1;
    MED::EVersion aVersion = MED::GetVersionId( theFileName );
    switch( aVersion ) {
-     case MED::eV2_1     : theVersion = SMESH::MED_V2_1; return true;
-     case MED::eV2_2     : theVersion = SMESH::MED_V2_2; return true;
+     case MED::eV2_1     : theVersion = SMESH::MED_V2_1;    return true;
+     case MED::eV2_2     : theVersion = SMESH::MED_V2_2;    return true;
+     case MED::eLATEST   : theVersion = SMESH::MED_LATEST;  return true;
+     case MED::eMINOR_0  : theVersion = SMESH::MED_MINOR_0; return true;
+     case MED::eMINOR_1  : theVersion = SMESH::MED_MINOR_1; return true;
+     case MED::eMINOR_2  : theVersion = SMESH::MED_MINOR_2; return true;
+     case MED::eMINOR_3  : theVersion = SMESH::MED_MINOR_3; return true;
+     case MED::eMINOR_4  : theVersion = SMESH::MED_MINOR_4; return true;
+     case MED::eMINOR_5  : theVersion = SMESH::MED_MINOR_5; return true;
+     case MED::eMINOR_6  : theVersion = SMESH::MED_MINOR_6; return true;
+     case MED::eMINOR_7  : theVersion = SMESH::MED_MINOR_7; return true;
+     case MED::eMINOR_8  : theVersion = SMESH::MED_MINOR_8; return true;
+     case MED::eMINOR_9  : theVersion = SMESH::MED_MINOR_9; return true;
      case MED::eVUnknown : return false;
    }
    return false;
@@@ -3812,7 -3827,7 +3827,7 @@@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( S
                  // "Face V positions" - V parameter of node on face
  
                  // Find out nb of nodes on edges and faces
 -                // Collect corresponing sub-meshes
 +                // Collect corresponding sub-meshes
                  int nbEdgeNodes = 0, nbFaceNodes = 0;
                  list<SMESHDS_SubMesh*> aEdgeSM, aFaceSM;
                  // loop on SMESHDS_SubMesh'es
index bca571b9a851136b44f9dc2d7c43d4b38e8e7f4d,1c93dc90a0c9e5378c6ba66319096765394e5263..9a0f20ff74e3dd97313b087219878de167a02d0c
@@@ -64,7 -64,6 +64,6 @@@
  #include <Utils_CorbaException.hxx>
  #include <SALOMEDS_wrap.hxx>
  #include <SALOME_GenericObj_i.hh>
- #include <Basics_OCCTVersion.hxx>
  
  #include <BRepAdaptor_Surface.hxx>
  #include <BRep_Tool.hxx>
  #include <gp_Ax2.hxx>
  #include <gp_Vec.hxx>
  
- #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
- #define NO_CAS_CATCH
- #endif
  #include <Standard_Failure.hxx>
- #ifdef NO_CAS_CATCH
  #include <Standard_ErrorHandler.hxx>
- #endif
  
  #include <sstream>
  #include <limits>
@@@ -3890,7 -3882,6 +3882,6 @@@ SMESH_MeshEditor_i::scale(SMESH::SMESH_
    };
    gp_Trsf aTrsf;
  
- #if OCC_VERSION_LARGE > 0x06070100
    // fight against orthogonalization
    // aTrsf.SetValues( S[0], 0,    0,    thePoint.x * (1-S[0]),
    //                  0,    S[1], 0,    thePoint.y * (1-S[1]),
                  thePoint.z * (1-S[2]));
    M.SetDiagonal( S[0], S[1], S[2] );
  
- #else
-   double tol = std::numeric_limits<double>::max();
-   aTrsf.SetValues( S[0], 0,    0,    thePoint.x * (1-S[0]),
-                    0,    S[1], 0,    thePoint.y * (1-S[1]),
-                    0,    0,    S[2], thePoint.z * (1-S[2]),   tol, tol);
- #endif
    TIDSortedElemSet  copyElements;
    TIDSortedElemSet* workElements = &elements;
    if ( myIsPreviewMode )
@@@ -4006,7 -3990,7 +3990,7 @@@ SMESH_MeshEditor_i::ScaleMakeMesh(SMESH
      // and then "GetGroups" using SMESH_Mesh::GetGroups()
  
      TPythonDump pydump; // to prevent dump at mesh creation
 -    mesh = makeMesh( theMeshName );
 +    mesh   = makeMesh( theMeshName );
      mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
  
      if ( mesh_i )
@@@ -4593,151 -4577,6 +4577,151 @@@ CORBA::Short SMESH_MeshEditor_i::GetPoi
    return 0;
  }
  
 +//=======================================================================
 +//function : IsManifold
 +//purpose  : Check if a 2D mesh is manifold
 +//=======================================================================
 +
 +CORBA::Boolean SMESH_MeshEditor_i::IsManifold()
 +  throw (SALOME::SALOME_Exception)
 +{
 +  bool isManifold = true;
 +
 +  SMESH_TRY;
 +  SMESH_MeshAlgos::TFreeBorderVec foundFreeBordes;
 +  SMESH_MeshAlgos::FindFreeBorders( *getMeshDS(),
 +                                    foundFreeBordes,
 +                                    /*closedOnly=*/true,
 +                                    &isManifold );
 +  SMESH_CATCH( SMESH::throwCorbaException );
 +
 +  return isManifold;
 +}
 +
 +//=======================================================================
 +//function : IsCoherentOrientation2D
 +//purpose  : Check if orientation of 2D elements is coherent
 +//=======================================================================
 +
 +CORBA::Boolean SMESH_MeshEditor_i::IsCoherentOrientation2D()
 +  throw (SALOME::SALOME_Exception)
 +{
 +  bool isGoodOri = true;
 +
 +  SMESH_TRY;
 +  SMESH_MeshAlgos::TFreeBorderVec foundFreeBordes;
 +  SMESH_MeshAlgos::FindFreeBorders( *getMeshDS(),
 +                                    foundFreeBordes,
 +                                    /*closedOnly=*/true,
 +                                    /*isManifold=*/0,
 +                                    &isGoodOri);
 +  SMESH_CATCH( SMESH::throwCorbaException );
 +
 +  return isGoodOri;
 +}
 +
 +//=======================================================================
 +//function : FindFreeBorders
 +//purpose  : Returns all or only closed FreeBorder's.
 +//=======================================================================
 +
 +SMESH::ListOfFreeBorders* SMESH_MeshEditor_i::FindFreeBorders(CORBA::Boolean closedOnly)
 +  throw (SALOME::SALOME_Exception)
 +{
 +  SMESH::ListOfFreeBorders_var resBorders = new SMESH::ListOfFreeBorders;
 +  SMESH_TRY;
 +
 +  SMESH_MeshAlgos::TFreeBorderVec foundFreeBordes;
 +  SMESH_MeshAlgos::FindFreeBorders( *getMeshDS(), foundFreeBordes, closedOnly );
 +
 +  resBorders->length( foundFreeBordes.size() );
 +  for ( size_t i = 0; i < foundFreeBordes.size(); ++i )
 +  {
 +    const SMESH_MeshAlgos::TFreeBorder& bordNodes = foundFreeBordes[i];
 +    SMESH::FreeBorder&                    bordOut = resBorders[i];
 +    bordOut.nodeIDs.length( bordNodes.size() );
 +    for ( size_t iN = 0; iN < bordNodes.size(); ++iN )
 +      bordOut.nodeIDs[ iN ] = bordNodes[ iN ]->GetID();
 +  }
 +
 +  SMESH_CATCH( SMESH::throwCorbaException );
 +
 +  return resBorders._retn();
 +}
 +
 +//=======================================================================
 +//function : FillHole
 +//purpose  : Fill with 2D elements a hole defined by a FreeBorder.
 +//=======================================================================
 +
 +void SMESH_MeshEditor_i::FillHole(const SMESH::FreeBorder& theHole)
 +  throw (SALOME::SALOME_Exception)
 +{
 +  initData();
 +
 +  if ( theHole.nodeIDs.length() < 4 )
 +    THROW_SALOME_CORBA_EXCEPTION("A hole should be bound by at least 3 nodes", SALOME::BAD_PARAM);
 +  if ( theHole.nodeIDs[0] != theHole.nodeIDs[ theHole.nodeIDs.length()-1 ] )
 +    THROW_SALOME_CORBA_EXCEPTION("Not closed hole boundary. "
 +                                 "First and last nodes must be same", SALOME::BAD_PARAM);
 +
 +  SMESH_MeshAlgos::TFreeBorder bordNodes;
 +  bordNodes.resize( theHole.nodeIDs.length() );
 +  for ( size_t iN = 0; iN < theHole.nodeIDs.length(); ++iN )
 +  {
 +    bordNodes[ iN ] = getMeshDS()->FindNode( theHole.nodeIDs[ iN ]);
 +    if ( !bordNodes[ iN ] )
 +      THROW_SALOME_CORBA_EXCEPTION(SMESH_Comment("Node #") << theHole.nodeIDs[ iN ]
 +                                   << " does not exist", SALOME::BAD_PARAM);
 +  }
 +
 +  SMESH_TRY;
 +
 +  MeshEditor_I::TPreviewMesh* previewMesh = 0;
 +  SMDS_Mesh* meshDS = getMeshDS();
 +  if ( myIsPreviewMode )
 +  {
 +    // copy faces sharing nodes of theHole
 +    TIDSortedElemSet holeFaces;
 +    previewMesh = getPreviewMesh( SMDSAbs_Face );
 +    for ( size_t i = 0; i < bordNodes.size(); ++i )
 +    {
 +      SMDS_ElemIteratorPtr fIt = bordNodes[i]->GetInverseElementIterator( SMDSAbs_Face );
 +      while ( fIt->more() )
 +      {
 +        const SMDS_MeshElement* face = fIt->next();
 +        if ( holeFaces.insert( face ).second )
 +          previewMesh->Copy( face );
 +      }
 +      bordNodes[i] = previewMesh->GetMeshDS()->FindNode( bordNodes[i]->GetID() );
 +      ASSERT( bordNodes[i] );
 +    }
 +    meshDS = previewMesh->GetMeshDS();
 +  }
 +
 +  std::vector<const SMDS_MeshElement*> newFaces;
 +  SMESH_MeshAlgos::FillHole( bordNodes, *meshDS, newFaces );
 +
 +  if ( myIsPreviewMode )
 +  {
 +    previewMesh->Clear();
 +    for ( size_t i = 0; i < newFaces.size(); ++i )
 +      previewMesh->Copy( newFaces[i] );
 +  }
 +  else
 +  {
 +    getEditor().ClearLastCreated();
 +    SMESH_SequenceOfElemPtr& aSeq =
 +      const_cast<SMESH_SequenceOfElemPtr&>( getEditor().GetLastCreatedElems() );
 +    for ( size_t i = 0; i < newFaces.size(); ++i )
 +      aSeq.Append( newFaces[i] );
 +
 +    TPythonDump() << this << ".FillHole( SMESH.FreeBorder(" << theHole.nodeIDs << " ))";
 +  }
 +
 +  SMESH_CATCH( SMESH::throwCorbaException );
 +}
 +
  //=======================================================================
  //function : convError
  //purpose  :
index b16d38f2692718e0d49cfacb1374df795b24a354,c4393b108a48d5ef6cc3aa30db764a06704f540a..b598cc0eb5a26e1a1d2c87d1d97e99b650b4a27a
@@@ -3022,6 -3022,7 +3022,7 @@@ void SMESH_Mesh_i::ExportToMEDX (const 
                                   CORBA::Boolean     autoDimension)
    throw(SALOME::SALOME_Exception)
  {
+   //MESSAGE("SMESH::MED_VERSION:"<< theVersion);
    SMESH_TRY;
    if ( _preMeshInfo )
      _preMeshInfo->FullLoadFromFile();
@@@ -3048,6 -3049,7 +3049,7 @@@ void SMESH_Mesh_i::ExportToMED (const c
                                  SMESH::MED_VERSION theVersion)
    throw(SALOME::SALOME_Exception)
  {
+   //MESSAGE("SMESH::MED_VERSION:"<< theVersion);
    ExportToMEDX(file,auto_groups,theVersion,true);
  }
  
@@@ -3061,7 -3063,8 +3063,8 @@@ void SMESH_Mesh_i::ExportMED (const cha
                                CORBA::Boolean auto_groups)
    throw(SALOME::SALOME_Exception)
  {
-   ExportToMEDX(file,auto_groups,SMESH::MED_V2_2,true);
+   //MESSAGE("SMESH::MED_VERSION:"<< SMESH::MED_LATEST);
+   ExportToMEDX(file,auto_groups,SMESH::MED_LATEST,true);
  }
  
  //================================================================================
@@@ -6119,7 -6122,6 +6122,7 @@@ SMESH_MeshPartDS::SMESH_MeshPartDS(SMES
    SMESH::SMESH_Mesh_var mesh = meshPart->GetMesh();
    SMESH_Mesh_i*       mesh_i = SMESH::DownCast<SMESH_Mesh_i*>( mesh );
  
 +  mesh_i->Load();
    _meshDS = mesh_i->GetImpl().GetMeshDS();
  
    SetPersistentId( _meshDS->GetPersistentId() );
@@@ -6189,21 -6191,6 +6192,21 @@@ SMESH_MeshPartDS::SMESH_MeshPartDS(cons
    myInfo = tmpInfo;
  }
  // -------------------------------------------------------------------------------------
 +const SMDS_MeshElement * SMESH_MeshPartDS::FindElement(int IDelem) const
 +{
 +  if ( _meshDS ) return _meshDS->FindElement( IDelem );
 +
 +  TElemID elem( IDelem );
 +  for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType )
 +    if ( !_elements[ iType ].empty() )
 +    {
 +      TIDSortedElemSet::const_iterator it = _elements[ iType ].find( &elem );
 +      if ( it != _elements[ iType ].end() )
 +        return *it;
 +    }
 +  return 0;
 +}
 +// -------------------------------------------------------------------------------------
  SMDS_ElemIteratorPtr SMESH_MeshPartDS::elementGeomIterator(SMDSAbs_GeometryType geomType) const
  {
    if ( _meshDS ) return _meshDS->elementGeomIterator( geomType );
index 3d4dcf599b1489e472c8dfa503e568b80d8f99e1,f2bbcaccc85618c7ab66d1124a8f8c405393f377..6e0f59579baa41d3aac4cd8947262b06f25d36eb
@@@ -966,8 -966,6 +966,8 @@@ class smeshBuilder(object, SMESH._objre
              functor = aFilterMgr.CreateLength()
          elif theCriterion == FT_Length2D:
              functor = aFilterMgr.CreateLength2D()
 +        elif theCriterion == FT_Deflection2D:
 +            functor = aFilterMgr.CreateDeflection2D()
          elif theCriterion == FT_NodeConnectivityNumber:
              functor = aFilterMgr.CreateNodeConnectivityNumber()
          elif theCriterion == FT_BallDiameter:
@@@ -1795,9 -1793,14 +1795,14 @@@ class Mesh
      #  @param auto_groups boolean parameter for creating/not creating
      #  the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
      #  the typical use is auto_groups=False.
-     #  @param version MED format version (MED_V2_1 or MED_V2_2,
-     #                 the latter meaning any current version). The parameter is
-     #                 obsolete since MED_V2_1 is no longer supported.
+     #  @param version MED format version
+     #         - MED_V2_1 is obsolete.
+     #         - MED_V2_2 means current version (kept for compatibility reasons)
+     #         - MED_LATEST means current version.
+     #         - MED_MINOR_x where x from 0 to 9 indicates the minor version of MED
+     #           to use for writing MED files, for backward compatibility :
+     #           for instance, with SALOME 8.4 use MED 3.2 (minor=2) instead of 3.3,
+     #           to allow the file to be read with SALOME 8.3.
      #  @param overwrite boolean parameter for overwriting/not overwriting the file
      #  @param meshPart a part of mesh (group, sub-mesh) to export instead of the mesh
      #  @param autoDimension if @c True (default), a space dimension of a MED mesh can be either
      #         - 'f' stands for "_faces _" field;
      #         - 's' stands for "_solids _" field.
      #  @ingroup l2_impexp
-     def ExportMED(self, f, auto_groups=0, version=MED_V2_2,
+     def ExportMED(self, f, auto_groups=0, version=MED_LATEST,
                    overwrite=1, meshPart=None, autoDimension=True, fields=[], geomAssocFields=''):
          if meshPart or fields or geomAssocFields:
              unRegister = genObjUnRegister()
      #  Export the mesh in a file in MED format
      #  allowing to overwrite the file if it exists or add the exported data to its contents
      #  @param f the file name
-     #  @param version MED format version (MED_V2_1 or MED_V2_2,
-     #                 the latter meaning any current version). The parameter is
-     #                 obsolete since MED_V2_1 is no longer supported.
+     #  @param version MED format version:
+     #         - MED_V2_1 is obsolete.
+     #         - MED_V2_2 means current version (kept for compatibility reasons)
+     #         - MED_LATEST means current version.
+     #         - MED_MINOR_x where x from 0 to 9 indicates the minor version of MED
+     #           to use for writing MED files, for backward compatibility :
+     #           for instance, with SALOME 8.4 use MED 3.2 (minor=2) instead of 3.3,
+     #           to allow the file to be read with SALOME 8.3.
      #  @param opt boolean parameter for creating/not creating
      #         the groups Group_On_All_Nodes, Group_On_All_Faces, ...
      #  @param overwrite boolean parameter for overwriting/not overwriting the file
      #         - 3D in the rest cases.<br>
      #         If @a autoDimension is @c False, the space dimension is always 3.
      #  @ingroup l2_impexp
-     def ExportToMED(self, f, version=MED_V2_2, opt=0, overwrite=1, autoDimension=True):
+     def ExportToMED(self, f, version=MED_LATEST, opt=0, overwrite=1, autoDimension=True):
          self.mesh.ExportToMEDX(f, opt, version, overwrite, autoDimension)
  
      # Operations with groups:
          return self.editor.MakeIDSource(ids, elemType)
  
  
 -    # Get informations about mesh contents:
 +    # Get information about mesh contents:
      # ------------------------------------
  
 -    ## Get the mesh stattistic
 +    ## Get the mesh statistic
      #  @return dictionary type element - count of elements
      #  @ingroup l1_meshinfo
      def GetMeshInfo(self, obj = None):
      def GetPointState(self, x, y, z):
          return self.editor.GetPointState(x, y, z)
  
 +    ## Check if a 2D mesh is manifold
 +    #  @ingroup l1_controls
 +    def IsManifold(self):
 +        return self.editor.IsManifold()
 +
 +    ## Check if orientation of 2D elements is coherent
 +    #  @ingroup l1_controls
 +    def IsCoherentOrientation2D(self):
 +        return self.editor.IsCoherentOrientation2D()
 +
      ## Find the node closest to a point and moves it to a point location
      #  @param x  the X coordinate of a point
      #  @param y  the Y coordinate of a point
      #          Type SMESH.FunctorType._items in the Python Console to see all items.
      #          Note that not all items correspond to numerical functors.
      #  @param MaxAngle      is the maximum angle between element normals at which the fusion
 -    #          is still performed; theMaxAngle is mesured in radians.
 +    #          is still performed; theMaxAngle is measured in radians.
      #          Also it could be a name of variable which defines angle in degrees.
      #  @return TRUE in case of success, FALSE otherwise.
      #  @ingroup l2_modif_unitetri
      #          Type SMESH.FunctorType._items in the Python Console to see all items.
      #          Note that not all items correspond to numerical functors.
      #  @param MaxAngle   a max angle between element normals at which the fusion
 -    #          is still performed; theMaxAngle is mesured in radians.
 +    #          is still performed; theMaxAngle is measured in radians.
      #  @return TRUE in case of success, FALSE otherwise.
      #  @ingroup l2_modif_unitetri
      def TriToQuadObject (self, theObject, theCriterion, MaxAngle):
      def MergeEqualElements(self):
          self.editor.MergeEqualElements()
  
 +    ## Returns all or only closed free borders
 +    #  @return list of SMESH.FreeBorder's
 +    #  @ingroup l2_modif_trsf
 +    def FindFreeBorders(self, ClosedOnly=True):
 +        return self.editor.FindFreeBorders( ClosedOnly )
 +
 +    ## Fill with 2D elements a hole defined by a SMESH.FreeBorder.
 +    #  @param FreeBorder either a SMESH.FreeBorder or a list on node IDs. These nodes
 +    #         must describe all sequential nodes of the hole border. The first and the last
 +    #         nodes must be the same. Use FindFreeBorders() to get nodes of holes.
 +    #  @ingroup l2_modif_trsf
 +    def FillHole(self, holeNodes):
 +        if holeNodes and isinstance( holeNodes, list ) and isinstance( holeNodes[0], int ):
 +            holeNodes = SMESH.FreeBorder(nodeIDs=holeNodes)
 +        if not isinstance( holeNodes, SMESH.FreeBorder ):
 +            raise TypeError, "holeNodes must be either SMESH.FreeBorder or list of integer and not %s" % holeNodes
 +        self.editor.FillHole( holeNodes )
 +
      ## Return groups of FreeBorder's coincident within the given tolerance.
      #  @param tolerance the tolerance. If the tolerance <= 0.0 then one tenth of an average
      #         size of elements adjacent to free borders being compared is used.
  
      ## Identify the elements that will be affected by node duplication (actual duplication is not performed.
      #  This method is the first step of DoubleNodeElemGroupsInRegion.
 -    #  @param theElems - list of groups of elements (edges or faces) to be replicated
 +    #  @param theElems - list of groups of nodes or elements (edges or faces) to be replicated
      #  @param theNodesNot - list of groups of nodes not to replicated
      #  @param theShape - shape to detect affected elements (element which geometric center
      #         located on or inside shape).
      #         The replicated nodes should be associated to affected elements.
 -    #  @return groups of affected elements
 +    #  @return groups of affected elements in order: volumes, faces, edges
      #  @ingroup l2_modif_duplicat
      def AffectedElemGroupsInRegion(self, theElems, theNodesNot, theShape):
          return self.editor.AffectedElemGroupsInRegion(theElems, theNodesNot, theShape)
      def CreateHoleSkin(self, radius, theShape, groupName, theNodesCoords):
          return self.editor.CreateHoleSkin( radius, theShape, groupName, theNodesCoords )
  
 -    def _getFunctor(self, funcType ):
 +    ## Return a cached numerical functor by its type.
 +    #  @param theCriterion functor type - an item of SMESH.FunctorType enumeration.
 +    #          Type SMESH.FunctorType._items in the Python Console to see all items.
 +    #          Note that not all items correspond to numerical functors.
 +    #  @return SMESH_NumericalFunctor. The functor is already initialized
 +    #          with a mesh
 +    #  @ingroup l1_measurements
 +    def GetFunctor(self, funcType ):
          fn = self.functors[ funcType._v ]
          if not fn:
              fn = self.smeshpyD.GetFunctor(funcType)
      #  @return the functor value or zero in case of invalid arguments
      #  @ingroup l1_measurements
      def FunctorValue(self, funcType, elemId, isElem=True):
 -        fn = self._getFunctor( funcType )
 +        fn = self.GetFunctor( funcType )
          if fn.GetElementType() == self.GetElementType(elemId, isElem):
              val = fn.GetValue(elemId)
          else:
              unRegister.set( meshPart )
          if isinstance( meshPart, Mesh ):
              meshPart = meshPart.mesh
 -        fun = self._getFunctor( funType )
 +        fun = self.GetFunctor( funType )
          if fun:
              if meshPart:
                  if hasattr( meshPart, "SetMesh" ):
@@@ -5292,7 -5265,7 +5302,7 @@@ class algoCreator
          if not algoType:
              algoType = self.defaultAlgoType
          if not algoType and self.algoTypeToClass:
 -            algoType = self.algoTypeToClass.keys()[0]
 +            algoType = sorted( self.algoTypeToClass.keys() )[0]
          if self.algoTypeToClass.has_key( algoType ):
              #print "Create algo",algoType
              return self.algoTypeToClass[ algoType ]( self.mesh, shape )