Salome HOME
Merge remote branch 'origin/V8_5_asterstudy' V9_1_0
authorvsr <vsr@opencascade.com>
Wed, 12 Sep 2018 07:49:27 +0000 (10:49 +0300)
committervsr <vsr@opencascade.com>
Wed, 12 Sep 2018 07:49:27 +0000 (10:49 +0300)
1  2 
src/OBJECT/SMESH_Actor.cxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESH_msg_en.ts
src/SMESHGUI/SMESH_msg_fr.ts
src/SMESHGUI/SMESH_msg_ja.ts

index 46bff48d4cc935aeec4fb914019569ad138382d0,0bf3b4176b75cafffaf3ddaf8566305d77f0cce6..23dee68601b29a83e4662531fdd0554d0d6258fa
@@@ -28,6 -28,7 +28,7 @@@
  #include "SMESH_ActorDef.h"
  
  #include "SMDS_UnstructuredGrid.hxx"
+ #include "SMESH_ActorProps.h"
  #include "SMESH_ActorUtils.h"
  #include "SMESH_CellLabelActor.h"
  #include "SMESH_ControlsDef.hxx"
@@@ -87,9 -88,6 +88,6 @@@ static int MYDEBUG = 0
  static int MYDEBUG = 0;
  #endif
  
- static int aLineWidthInc = 2;
  SMESH_ActorDef* SMESH_ActorDef::New(){
    return new SMESH_ActorDef();
  }
@@@ -141,6 -139,9 +139,9 @@@ SMESH_ActorDef::SMESH_ActorDef(
  
    myIsFacesOriented = false;
  
+   int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement();
+   int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
    myControlsPrecision = -1;
    SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
  
    anRGB[0] = 1 - anRGB[0];
    anRGB[1] = 1 - anRGB[1];
    anRGB[2] = 1 - anRGB[2];
+   my2DExtProp->SetLineWidth(aLineWidth + controlsIncrement);
    my2DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
  
    my2DExtActor = SMESH_DeviceActor::New();
    anRGB[0] = 1 - anRGB[0];
    anRGB[1] = 1 - anRGB[1];
    anRGB[2] = 1 - anRGB[2];
+   my3DExtProp->SetLineWidth(aLineWidth + controlsIncrement);
    my3DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
  
    my3DExtActor = SMESH_DeviceActor::New();
  
    my1DProp = vtkProperty::New();
    my1DProp->DeepCopy(myEdgeProp);
-   my1DProp->SetLineWidth(aLineWidth + aLineWidthInc);
+   my1DProp->SetLineWidth(aLineWidth + controlsIncrement);
    my1DProp->SetPointSize(aElem0DSize);
  
    my1DExtProp = vtkProperty::New();
    anRGB[1] = 1 - anRGB[1];
    anRGB[2] = 1 - anRGB[2];
    my1DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-   my1DExtProp->SetLineWidth(aLineWidth + aLineWidthInc);
+   my1DExtProp->SetLineWidth(aLineWidth + controlsIncrement);
    my1DExtProp->SetPointSize(aElem0DSize);
  
    // my1DExtActor is used to show filtered edges or links between nodes
    SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
    myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
    myHighlightProp->SetPointSize(aElem0DSize); // ??
-   myHighlightProp->SetLineWidth(aLineWidth);
+   myHighlightProp->SetLineWidth(aLineWidth + selectionIncrement);
    myHighlightProp->SetRepresentation(1);
  
    myOutLineProp = vtkProperty::New();
    SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
    myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
    myPreselectProp->SetPointSize(aElem0DSize); // ??
-   myPreselectProp->SetLineWidth(aLineWidth);
+   myPreselectProp->SetLineWidth(aLineWidth + selectionIncrement);
    myPreselectProp->SetRepresentation(1);
  
    myHighlitableActor = SMESH_DeviceActor::New();
@@@ -1106,7 -1109,7 +1109,7 @@@ void SMESH_ActorDef::SetControlMode( eC
      }
      QString aTitle = QString(myScalarBarActor->GetTitle());
      aTitle.replace(QRegExp("(:\\s).*"),"\\1"+ QString::number(GetNumberControlEntities()));
 -    myScalarBarActor->SetTitle(aTitle.toLatin1().constData());
 +    myScalarBarActor->SetTitle(aTitle.toUtf8().constData());
  
    }
    else {
@@@ -2197,29 -2200,19 +2200,19 @@@ void SMESH_ActorDef::GetBallColor(doubl
    ::GetColor(myBallProp,r,g,b);
  }
  
- void SMESH_ActorDef::SetHighlightColor(double r,double g,double b)
- { 
-   myHighlightProp->SetColor(r,g,b);
-   Modified();
- }
- void SMESH_ActorDef::GetHighlightColor(double& r,double& g,double& b)
- { 
-   ::GetColor(myHighlightProp,r,g,b);
- }
- void SMESH_ActorDef::SetPreHighlightColor(double r,double g,double b)
- { 
-   myPreselectProp->SetColor(r,g,b);
+ void SMESH_ActorDef::UpdateSelectionProps()
+ {
+   QColor selectionColor = SMESH_ActorProps::props()->selectionColor();
+   QColor highlightColor = SMESH_ActorProps::props()->highlightColor();
+   int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
+   double width = GetLineWidth();
+   myHighlightProp->SetColor(selectionColor.redF(), selectionColor.greenF(), selectionColor.blueF());
+   myHighlightProp->SetLineWidth(width + selectionIncrement);
+   myPreselectProp->SetColor(highlightColor.redF(), highlightColor.greenF(), highlightColor.blueF());
+   myPreselectProp->SetLineWidth(width + selectionIncrement);
    Modified();
  }
  
- void SMESH_ActorDef::GetPreHighlightColor(double& r,double& g,double& b)
- { 
-   ::GetColor(myPreselectProp,r,g,b);
- }
  double SMESH_ActorDef::GetLineWidth()
  {
    return myEdgeProp->GetLineWidth();
  
  void SMESH_ActorDef::SetLineWidth(double theVal)
  {
+   int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement();
+   int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
    myEdgeProp->SetLineWidth(theVal);
  
-   my1DProp->SetLineWidth(theVal + aLineWidthInc);
-   my1DExtProp->SetLineWidth(theVal + aLineWidthInc);
-   my2DExtProp->SetLineWidth(theVal + aLineWidthInc);
-   my3DExtProp->SetLineWidth(theVal + aLineWidthInc);
-   myOutLineProp->SetLineWidth(theVal);
-   myHighlightProp->SetLineWidth(theVal);
-   myPreselectProp->SetLineWidth(theVal);
+   my1DProp->SetLineWidth(theVal + controlsIncrement);
+   my1DExtProp->SetLineWidth(theVal + controlsIncrement);
+   my2DExtProp->SetLineWidth(theVal + controlsIncrement);
+   my3DExtProp->SetLineWidth(theVal + controlsIncrement);
+   myHighlightProp->SetLineWidth(theVal + selectionIncrement);
+   myPreselectProp->SetLineWidth(theVal + selectionIncrement);
    Modified();
  }
  
index 35e2c4850859bdc09d4b07bd8e6c24179925fe7c,ce6896da3c8f2344b393fc3a09f7b84da5122c7a..1225963f69b6af8558c3af9f92c514c5bc047428
@@@ -196,7 -196,7 +196,7 @@@ namespac
  
    void ExportMeshToFile(int theCommandID);
  
 -  void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap);
 +  void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap);
  
    void SetDisplayEntity(int theCommandID);
  
      }
      else if ( theCommandID == SMESHOp::OpImportSAUV ||
                theCommandID == SMESHOp::OpPopupImportSAUV ) {
 -      filter.append( QObject::tr( "SAUV files (*.sauv*)" ) );
 -      filter.append( QObject::tr( "All files (*)" ) );
 +      filter.append( QObject::tr( "SAUV_FILES_FILTER" ) + " (*.sauv *.sauve)" );
 +      filter.append( QObject::tr( "ALL_FILES_FILTER" ) + " (*)" );
      }
      else if ( theCommandID == SMESHOp::OpImportGMF ||
                theCommandID == SMESHOp::OpPopupImportGMF ) {
      if ( filenames.count() > 0 )
      {
        SUIT_OverrideCursor wc;
 -      _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 +      _PTR(Study) aStudy = SMESH::getStudy();
  
        QStringList errors;
        QStringList anEntryList;
  
      // Get parameters of export operation
  
 -    QString            aFilename;
 -    SMESH::MED_VERSION aFormat = SMESH::MED_LATEST;
 +    QString aFilename;
 +    int aFormat =-1;         // for MED minor versions
 +    bool isOkToWrite = true; // to check MED file version compatibility before adding a mesh in an existing file
 +
      // Init the parameters with the default values
      bool aIsASCII_STL   = true;
      bool toCreateGroups = false;
  
        if ( fd->exec() )
          aFilename = fd->selectedFile();
 -      toOverwrite    = fv->isOverwrite();
 +      toOverwrite    = fv->isOverwrite(aFilename);
        toCreateGroups = fd->IsChecked(0);
        SMESHGUI::resourceMgr()->setValue("SMESH", theByTypeResource, toCreateGroups );
  
      }
      else if ( isMED || isSAUV ) // Export to MED or SAUV
      {
 -      QMap<QString, SMESH::MED_VERSION> aFilterMap;
 +      QMap<QString, int> aFilterMap;
        if ( isMED ) {
 -        QString v22 (aMesh->GetVersionString(SMESH::MED_V2_2, 2));
 -        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
 +        //filters << QObject::tr( "MED_FILES_FILTER" ) + " (*.med)";
 +        QString vmed (aMesh->GetVersionString(-1, 2));
 +        //MESSAGE("MED version: " << vmed.toStdString());
 +        int minor = vmed.split(".").last().toInt();
 +        //MESSAGE("MED version minor: "<< minor);
 +        //minor +=3;                  // TODO remove: test multiple minor
 +        aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vmed ) + " (*.med)", minor );
          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;
 +            QString vs = aMesh->GetVersionString(ii, 2);
 +            //std::ostringstream vss; // TODO remove: test multiple minor
 +            //vss << "4.";            // TODO remove: test multiple minor
 +            //vss << ii;              // TODO remove: test multiple minor
 +            //vs = vss.str().c_str(); // TODO remove: test multiple minor
 +            //MESSAGE("MED version: " << vs.toStdString());
 +            aFilterMap.insert( QObject::tr( "MED_VX_FILES_FILTER" ).arg( vs ) + " (*.med)",  ii);
            }
        }
        else { // isSAUV
 -        aFilterMap.insert("All files (*)", SMESH::MED_V2_1 );
 -        aFilterMap.insert("SAUV files (*.sauv)", SMESH::MED_V2_2 );
 -        aFilterMap.insert("SAUV files (*.sauve)", SMESH::MED_V2_1 );
 +        aFilterMap.insert("All files (*)", -1 );
 +        aFilterMap.insert("SAUV files (*.sauv)", -1 );
 +        aFilterMap.insert("SAUV files (*.sauve)", -1 );
        }
  
        QStringList filters;
        QString aDefaultFilter;
 -      QMap<QString, SMESH::MED_VERSION>::const_iterator it = aFilterMap.begin();
 +      QMap<QString, int>::const_iterator it = aFilterMap.begin();
        for ( ; it != aFilterMap.end(); ++it ) {
          filters.push_back( it.key() );
 -        if (it.value() == SMESH::MED_V2_2)
 +        if (it.key() == 0)
            aDefaultFilter = it.key();
        }
        QStringList checkBoxes;
          new SalomeApp_CheckFileDlg ( SMESHGUI::desktop(), false, checkBoxes, true, true, wdgList );
        fd->setWindowTitle( aTitle );
        fd->setNameFilters( filters );
 -      fd->selectNameFilter( aDefaultFilter );
        fd->SetChecked( toCreateGroups, 0 );
        fd->SetChecked( toFindOutDim,   1 );
        if ( !anInitialPath.isEmpty() )
  
        bool is_ok = false;
        while (!is_ok) {
 +        MESSAGE("******* Loop on file dialog ***********");
 +        isOkToWrite =true;
          if ( fd->exec() )
            aFilename = fd->selectedFile();
          else {
            break;
          }
          aFormat = aFilterMap[fd->selectedNameFilter()];
 -        toOverwrite = fv->isOverwrite();
 +        MESSAGE("selected minor: " << aFormat << " file: " << aFilename.toUtf8().constData());
 +        toOverwrite = fv->isOverwrite(aFilename);
 +        MESSAGE("toOverwrite:" << toOverwrite);
          is_ok = true;
          if ( !aFilename.isEmpty() ) {
 -          // med-2.1 does not support poly elements
 -          if ( aFormat==SMESH::MED_V2_1 )
 -            for( aMeshIter = aMeshList.begin(); aMeshIter != aMeshList.end(); aMeshIter++ ) {
 -              SMESH::SMESH_IDSource_var aMeshItem = (*aMeshIter).first;
 -              SMESH::long_array_var nbElems = aMeshItem->GetMeshInfo();
 -              if ( nbElems[ SMESH::Entity_Polygon   ] + nbElems[ SMESH::Entity_Quad_Polygon   ] +
 -                   nbElems[ SMESH::Entity_Polyhedra ] + nbElems[ SMESH::Entity_Quad_Polyhedra ])
 -              {
 -                int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
 -                                                    QObject::tr("SMESH_WRN_WARNING"),
 -                                                    QObject::tr("SMESH_EXPORT_MED_V2_1").arg((*aMeshIter).second),
 -                                                    QObject::tr("SMESH_BUT_YES"),
 -                                                    QObject::tr("SMESH_BUT_NO"), 0, 1);
 -                if (aRet != 0) {
 -                  is_ok = false;
 -                  break;
 -                }
 -              }
 -            }
            if( !toOverwrite ) {
              // can't append to an existing using other format
 -            SMESH::MED_VERSION aVersion = aFormat; //SMESH::MED_V2_1;
 -            bool isVersionOk = SMESHGUI::GetSMESHGen()->GetMEDVersion( aFilename.toUtf8().constData(), aVersion );
 -            if( !isVersionOk || aVersion != aFormat ) {
 +            bool isVersionOk = SMESHGUI::GetSMESHGen()->CheckWriteCompatibility( aFilename.toUtf8().constData() );
 +            MESSAGE("Append check, isVersionOk:" << isVersionOk);
 +            if ( !isVersionOk ) {
                int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
                                                    QObject::tr("SMESH_WRN_WARNING"),
                                                    QObject::tr("SMESH_EXPORT_MED_VERSION_COLLISION").arg(aFilename),
                                                    QObject::tr("SMESH_BUT_YES"),
                                                    QObject::tr("SMESH_BUT_NO"), 0, 1);
                if (aRet == 0)
 -                toOverwrite = true;
 +                {
 +                  toOverwrite = true;
 +                  MESSAGE("incompatible MED file version for add, overwrite accepted");
 +                }
                else
 -                is_ok = false;
 +                {
 +                  isOkToWrite = false;
 +                  is_ok = false;
 +                  MESSAGE("incompatible MED file version for add, overwrite refused");
 +                }
              }
 -
              QStringList aMeshNamesCollisionList;
              SMESH::string_array_var aMeshNames = SMESHGUI::GetSMESHGen()->GetMeshNames( aFilename.toUtf8().constData() );
              for( int i = 0, n = aMeshNames->length(); i < n; i++ ) {
                  }
                }
              }
 -            if( !aMeshNamesCollisionList.isEmpty() ) {
 +           if( !aMeshNamesCollisionList.isEmpty() ) {
 +              isOkToWrite = false;
                QString aMeshNamesCollisionString = aMeshNamesCollisionList.join( ", " );
                int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
                                                    QObject::tr("SMESH_WRN_WARNING"),
                                                    QObject::tr("SMESH_BUT_YES"),
                                                    QObject::tr("SMESH_BUT_NO"),
                                                    QObject::tr("SMESH_BUT_CANCEL"), 0, 2);
 -              if (aRet == 0)
 +             MESSAGE("answer collision name " << aRet);
 +             if (aRet == 0) {
                  toOverwrite = true;
 +                isOkToWrite = true;
 +              }
                else if (aRet == 2)
                  is_ok = false;
              }
            }
          }
        }
 +      MESSAGE(" ****** end of file dialog loop, toOverwrite:" << toOverwrite << " isOkToWrite:" << isOkToWrite);
        toCreateGroups = fd->IsChecked(0);
        toFindOutDim   = fd->IsChecked(1);
        fieldSelWdg->GetSelectedFields();
  //           if ( SMESHGUI::automaticUpdate() )
  //             SMESH::UpdateView();
  //         }
 -        if ( isMED )
 +        if ( isMED && isOkToWrite)
          {
 +          MESSAGE("OK to write MED file "<< aFilename.toUtf8().constData());
            aMeshIter = aMeshList.begin();
            for( int aMeshIndex = 0; aMeshIter != aMeshList.end(); aMeshIter++, aMeshIndex++ )
            {
              const QString&            geoAssFields = aFieldList[ aMeshIndex ].second;
              const bool                   hasFields = ( fields.length() || !geoAssFields.isEmpty() );
              if ( !hasFields && aMeshOrGroup->_is_equivalent( aMeshItem ))
 -              aMeshItem->ExportToMEDX( aFilename.toUtf8().data(), toCreateGroups,
 -                                       aFormat, toOverwrite && aMeshIndex == 0, toFindOutDim );
 +              aMeshItem->ExportMED( aFilename.toUtf8().data(), toCreateGroups, aFormat,
 +                                    toOverwrite && aMeshIndex == 0, toFindOutDim );
              else
 -              aMeshItem->ExportPartToMED( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups,
 -                                          aFormat, toOverwrite && aMeshIndex == 0, toFindOutDim,
 +              aMeshItem->ExportPartToMED( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups, aFormat,
 +                                          toOverwrite && aMeshIndex == 0, toFindOutDim,
                                            fields, geoAssFields.toLatin1().data() );
            }
          }
        if ( selected.Extent() )
        {
          Handle(SALOME_InteractiveObject) anIObject = selected.First();
 -        _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 +        _PTR(Study) aStudy = SMESH::getStudy();
          _PTR(SObject) aSObj = aStudy->FindObjectID(anIObject->getEntry());
          if (aSObj) {
            if ( aStudy->GetUseCaseBuilder()->SortChildren( aSObj, true/*AscendingOrder*/ ) ) {
      }
    }
  
 -  void SetDisplayMode(int theCommandID, SMESHGUI_StudyId2MarkerMap& theMarkerMap)
 +  void SetDisplayMode(int theCommandID, VTK::MarkerMap& theMarkerMap)
    {
      SALOME_ListIO selected;
      SalomeApp_Application* app =
        return;
      }
  
 -    _PTR(Study) aStudy = appStudy->studyDS();
 -
      aSel->selectedObjects( selected );
  
      if ( selected.Extent() >= 1 )
              break;
          }
  
 -        SMESHGUI_PropertiesDlg dlg( theMarkerMap[ aStudy->StudyId() ], SMESHGUI::desktop() );
 +        SMESHGUI_PropertiesDlg dlg( theMarkerMap, SMESHGUI::desktop() );
          // nodes: color, marker
          dlg.setNodeColor( nodeColor );
          if( markerType != VTK::MT_USER )
            orientation3d    = dlg.orientation3d();
            shrinkCoef       = dlg.shrinkCoef() / 100.;
  
 -          // store point markers map that might be changed by the user
 -          theMarkerMap[ aStudy->StudyId() ] = dlg.customMarkers();
 +          // store point markers that might be changed by the user
 +          theMarkerMap = dlg.customMarkers();
  
            // set properties from dialog box to the presentations
            SALOME_ListIteratorOfListIO It( selected );
                anActor->SetMarkerStd( markerType, markerScale );
              }
              else {
 -              const VTK::MarkerMap& markerMap = theMarkerMap[ aStudy->StudyId() ];
 -              VTK::MarkerMap::const_iterator iter = markerMap.find( markerId );
 -              if ( iter != markerMap.end() )
 +              VTK::MarkerMap::const_iterator iter = theMarkerMap.find( markerId );
 +              if ( iter != theMarkerMap.end() )
                  anActor->SetMarkerTexture( markerId, iter->second.second );
              }
              // volumes: normal color, reversed color (delta)
    void Control( int theCommandID )
    {
      SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ));
 -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 +    _PTR(Study) aStudy = SMESH::getStudy();
  
      SALOME_ListIO selected;
      if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
              if ( !anIDSrc->_is_nil() ) {
                SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry());
                if (( !anActor && selected.Extent() == 1 ) &&
 -                  ( anActor = SMESH::CreateActor( aStudy, anIO->getEntry() )))
 +                  ( anActor = SMESH::CreateActor( anIO->getEntry() )))
                {
                  anActor->SetControlMode( aControl );
                  SMESH::DisplayActor( SMESH::GetCurrentVtkView(), anActor );
  
    QString CheckTypeObject(const Handle(SALOME_InteractiveObject) & theIO)
    {
 -    _PTR(Study)  aStudy = SMESH::GetActiveStudyDocument();
 +    _PTR(Study)  aStudy = SMESH::getStudy();
      _PTR(SObject) aSObj = aStudy->FindObjectID(theIO->getEntry());
      if (aSObj) {
        _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
@@@ -1850,7 -1848,7 +1850,7 @@@ void SMESHGUI::OnEditDelete(
    LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
    SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
  
 -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 +  _PTR(Study) aStudy = SMESH::getStudy();
    _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
    _PTR(GenericAttribute) anAttr;
    _PTR(AttributeIOR) anIOR;
      else if ( !aSubMesh->_is_nil() ) {                   // DELETE SUBMESH
        SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
        aMesh->RemoveSubMesh( aSubMesh );
 -
 -      _PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh);
 -      if (aMeshSO)
 -        SMESH::ModifiedMesh(aMeshSO, false, aMesh->NbNodes()==0);
      }
      else {
        Handle(SALOME_InteractiveObject) IObject = new SALOME_InteractiveObject
@@@ -2238,6 -2240,17 +2238,6 @@@ SMESHGUI* SMESHGUI::GetSMESHGUI(
      smeshMod = dynamic_cast<SMESHGUI*>( module );
    }
  
 -  if ( smeshMod && smeshMod->application() && smeshMod->application()->activeStudy() )
 -  {
 -    SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( smeshMod->application()->activeStudy() );
 -    if ( study )
 -    {
 -      _PTR(Study) aStudy = study->studyDS();
 -      if ( aStudy )
 -        GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
 -    }
 -  }
 -
    return smeshMod;
  }
  
@@@ -2410,27 -2423,36 +2410,27 @@@ bool SMESHGUI::DefineDlgPosition(QWidge
    return true;
  }
  
 -//=============================================================================
  /*!
 - *
 - */
 -//=============================================================================
 -static int isStudyLocked(_PTR(Study) theStudy){
 -  return theStudy->GetProperties()->IsLocked();
 -}
 -
 -static bool checkLock(_PTR(Study) theStudy) {
 -  if (isStudyLocked(theStudy)) {
 -    SUIT_MessageBox::warning( SMESHGUI::desktop(),
 -                              QObject::tr("WRN_WARNING"),
 -                              QObject::tr("WRN_STUDY_LOCKED") );
 + * \brief Verifies whether study of operation is locked
 +  * \param theMess - specifies whether message box must be shown if study is locked
 +  * \return State of study.
 +*
 +* Verifies whether study of operation is locked. If second parameter is TRUE and study
 +* is locked when corresponding message box appears
 +*/
 +bool SMESHGUI::isStudyLocked( bool theMessage )
 +{
 +  if ( SMESH::getStudy()->GetProperties()->IsLocked() )
 +  {
 +    if ( theMessage )
 +      SUIT_MessageBox::warning( SMESHGUI::desktop(),
 +                                QObject::tr( "WRN_WARNING" ),
 +                                QObject::tr( "WRN_STUDY_LOCKED" ) );
      return true;
    }
    return false;
  }
  
 -//=======================================================================
 -//function : CheckActiveStudyLocked
 -//purpose  :
 -//=======================================================================
 -
 -bool SMESHGUI::isActiveStudyLocked()
 -{
 -  _PTR(Study) aStudy = activeStudy()->studyDS();
 -  return checkLock( aStudy );
 -}
 -
  //=============================================================================
  /*!
   *
@@@ -2442,10 -2464,15 +2442,10 @@@ bool SMESHGUI::OnGUIEvent( int theComma
    if( !anApp )
      return false;
  
 -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
    SUIT_ResourceMgr* mgr = resourceMgr();
    if( !mgr )
      return false;
  
 -  if (CORBA::is_nil(GetSMESHGen()->GetCurrentStudy())) {
 -    GetSMESHGen()->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
 -  }
 -
    SUIT_ViewWindow* view = application()->desktop()->activeWindow();
    SVTK_ViewWindow* vtkwnd = dynamic_cast<SVTK_ViewWindow*>( view );
  
  
    switch (theCommandID) {
    case SMESHOp::OpDelete:
 -    if(checkLock(aStudy)) break;
 +    if(isStudyLocked()) break;
      OnEditDelete();
      break;
    case SMESHOp::OpImportDAT:
    case SMESHOp::OpPopupImportSAUV:
    case SMESHOp::OpPopupImportGMF:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        ::ImportMeshesFromFile(GetSMESHGen(),theCommandID);
        break;
      }
  
    case SMESHOp::OpUpdate:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        SUIT_OverrideCursor wc;
        try {
          OCC_CATCH_SIGNALS;
          }
  
          // PAL13338 + PAL15161 -->
 -        if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !checkLock(aStudy)) {
 +        if ( ( theCommandID==SMESHOp::OpShow || theCommandID==SMESHOp::OpShowOnly ) && !isStudyLocked()) {
            SMESH::UpdateView();
            SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
          }
  
    case SMESHOp::OpNode:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
  
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
      break;
    case SMESHOp::OpCopyMesh:
      {
 -      if (checkLock(aStudy)) break;
 +      if (isStudyLocked()) break;
        EmitSignalDeactivateDialog();
        ( new SMESHGUI_CopyMeshDlg( this ) )->show();
      }
      break;
    case SMESHOp::OpBuildCompoundMesh:
      {
 -      if (checkLock(aStudy)) break;
 +      if (isStudyLocked()) break;
        EmitSignalDeactivateDialog();
        ( new SMESHGUI_BuildCompoundDlg( this ) )->show();
      }
          break;
        }
  
 -      if ( checkLock( aStudy ) )
 +      if ( isStudyLocked() )
          break;
  
        /*Standard_Boolean aRes;
          break;
        }
  
 -      if ( checkLock( aStudy ) )
 +      if ( isStudyLocked() )
          break;
  
        EmitSignalDeactivateDialog();
      }
    case SMESHOp::OpSmoothing:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_SmoothingDlg( this ) )->show();
      }
    case SMESHOp::OpExtrusion:
      {
 -      if (checkLock(aStudy)) break;
 +      if (isStudyLocked()) break;
        if (vtkwnd) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_ExtrusionDlg ( this ) )->show();
      }
    case SMESHOp::OpExtrusionAlongAPath:
      {
 -      if (checkLock(aStudy)) break;
 +      if (isStudyLocked()) break;
        if (vtkwnd) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
      }
    case SMESHOp::OpRevolution:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_RevolutionDlg( this ) )->show();
      }
    case SMESHOp::OpPatternMapping:
      {
 -      if ( checkLock( aStudy ) )
 +      if ( isStudyLocked() )
          break;
        if ( vtkwnd )
        {
          break;
        }
  
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        EmitSignalDeactivateDialog();
        SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil();
  
          break;
        }
  
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        EmitSignalDeactivateDialog();
  
        LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
          // check if submesh is selected
          Handle(SALOME_InteractiveObject) IObject = selected.First();
          if (IObject->hasEntry()) {
 -          _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
 +          _PTR(SObject) aSObj = SMESH::getStudy()->FindObjectID(IObject->getEntry());
            if( aSObj ) {
              SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
              if (!aSubMesh->_is_nil()) {
          break;
        }
  
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        EmitSignalDeactivateDialog();
  
        LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
  
    case SMESHOp::OpAddElemGroupPopup:     // Add elements to group
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if (myState == 800) {
          SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
          if (aDlg) aDlg->onAdd();
  
    case SMESHOp::OpRemoveElemGroupPopup:  // Remove elements from group
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if (myState == 800) {
          SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
          if (aDlg) aDlg->onRemove();
          break;
        }
  
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        EmitSignalDeactivateDialog();
  
        LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
          break;
        }
  
 -      if ( checkLock( aStudy ) )
 +      if ( isStudyLocked() )
          break;
  
        EmitSignalDeactivateDialog();
  
      case SMESHOp::OpGroupUnderlyingElem: // Create groups of entities from existing groups of superior dimensions
      {
 -      if ( checkLock( aStudy ) )
 +      if ( isStudyLocked() )
          break;
  
        EmitSignalDeactivateDialog();
          break;
        }
  
 -      if ( checkLock( aStudy ) )
 +      if ( isStudyLocked() )
          break;
  
        EmitSignalDeactivateDialog();
  
    case SMESHOp::OpEditHypothesis:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
  
        LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
        SALOME_ListIO selected;
      }
    case SMESHOp::OpUnassign:                      // REMOVE HYPOTHESIS / ALGORITHMS
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        SUIT_OverrideCursor wc;
  
        LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
    case SMESHOp::OpPyramid:
    case SMESHOp::OpHexagonalPrism:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          SMDSAbs_EntityType type = SMDSEntity_Edge;
      }
    case SMESHOp::OpPolyhedron:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
    case SMESHOp::OpQuadraticHexahedron:
    case SMESHOp::OpTriQuadraticHexahedron:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          SMDSAbs_EntityType type = SMDSEntity_Last;
      }
    case SMESHOp::OpRemoveNodes:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_RemoveNodesDlg( this ) )->show();
      }
    case SMESHOp::OpRemoveElements:                                    // REMOVES ELEMENTS
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_RemoveElementsDlg( this ) )->show();
      }
    case SMESHOp::OpClearMesh: {
  
 -    if(checkLock(aStudy)) break;
 +    if(isStudyLocked()) break;
  
      SALOME_ListIO selected;
      if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
          if ( aMesh->NbNodes() == 0 ) // imported mesh is not empty
            SMESH::RemoveVisualObjectWithActors(IOS->getEntry(), true);
          _PTR(SObject) aMeshSObj = SMESH::FindSObject(aMesh);
 -        SMESH::ModifiedMesh( aMeshSObj, false, true);
          // hide groups and submeshes
          _PTR(ChildIterator) anIter =
 -          SMESH::GetActiveStudyDocument()->NewChildIterator( aMeshSObj );
 +          SMESH::getStudy()->NewChildIterator( aMeshSObj );
          for ( anIter->InitEx(true); anIter->More(); anIter->Next() )
          {
            _PTR(SObject) so = anIter->Value();
    }
    case SMESHOp::OpRemoveOrphanNodes:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        SALOME_ListIO selected;
        if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
          aSel->selectedObjects( selected );
      }
    case SMESHOp::OpRenumberingNodes:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
      }
    case SMESHOp::OpRenumberingElements:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
      }
    case SMESHOp::OpTranslation:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_TranslationDlg( this ) )->show();
      }
    case SMESHOp::OpRotation:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_RotationDlg( this ) )->show();
      }
    case SMESHOp::OpSymmetry:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if(vtkwnd) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_SymmetryDlg( this ) )->show();
      }
    case SMESHOp::OpScale:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_ScaleDlg( this ) )->show();
  
    case SMESHOp::OpOffset:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_OffsetDlg( this ) )->show();
  
    case SMESHOp::OpSewing:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if(vtkwnd) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_SewingDlg( this ) )->show();
      }
    case SMESHOp::OpMergeNodes:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if(vtkwnd) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_MergeDlg( this, 0 ) )->show();
      }
    case SMESHOp::OpMergeElements:
      {
 -      if (checkLock(aStudy)) break;
 +      if (isStudyLocked()) break;
        if (vtkwnd) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_MergeDlg( this, 1 ) )->show();
  
    case SMESHOp::OpDuplicateNodes:
      {
 -      if(checkLock(aStudy)) break;
 +      if(isStudyLocked()) break;
        if ( vtkwnd ) {
          EmitSignalDeactivateDialog();
          ( new SMESHGUI_DuplicateNodesDlg( this ) )->show();
@@@ -3807,7 -3835,7 +3807,7 @@@ void SMESHGUI::createPopupItem( const i
      popupMgr()->insert( action( id ), pId, 0 );
  
    QString lc = "$";        // VSR : instead of QtxPopupSelection::defEquality();
 -  QString dc = "selcount"; // VSR : insetad of QtxPopupSelection::defSelCountParam()
 +  QString dc = "selcount"; // VSR : instead of QtxPopupSelection::defSelCountParam()
    QString rule = "(%1) and (%2) and (%3)";
    rule = rule.arg( QString( "%1>0" ).arg( dc ) );
    if( clients.isEmpty() )
@@@ -4881,7 -4909,11 +4881,7 @@@ bool SMESHGUI::activateModule( SUIT_Stu
    action(SMESHOp::OpDelete)->setEnabled(true); // Delete: Key_Delete
  
    //  0020210. Make SMESH_Gen update meshes at switching GEOM->SMESH
 -  GetSMESHGen()->SetCurrentStudy(SALOMEDS::Study::_nil());
 -  if ( SalomeApp_Study* s = dynamic_cast<SalomeApp_Study*>( study )) {
 -    if ( _PTR(Study) aStudy = s->studyDS() )
 -      GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
 -  }
 +  GetSMESHGen()->UpdateStudy();
  
    // get all view currently opened in the study and connect their signals  to
    // the corresponding slots of the class.
@@@ -4914,7 -4946,7 +4914,7 @@@ void SMESHGUI::studyClosed( SUIT_Study
  {
    if( !s )
      return;
 -  SMESH::RemoveVisuData( s->id() );
 +  SMESH::RemoveVisuData();
    SalomeApp_Module::studyClosed( s );
  }
  
@@@ -4930,11 -4962,16 +4930,11 @@@ void SMESHGUI::OnGUIEvent(
  
  SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
  {
 -  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active
    if ( CORBA::is_nil( myComponentSMESH ) )
 -    {
 -      SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
 -      if ( aStudy )
 -        aGUI.myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
 -      return aGUI.myComponentSMESH;
 -    }
 -  if ( aStudy )
 -    myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy());
 +  {
 +    SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH
 +    return aGUI.myComponentSMESH;
 +  }
    return myComponentSMESH;
  }
  
@@@ -5100,6 -5137,11 +5100,11 @@@ void SMESHGUI::createPreferences(
    setPreferenceProperty( doubleNodesTol, "max", 1000000.0 );
    setPreferenceProperty( doubleNodesTol, "step", 0.0000001 );
  
+   /*
+   int cinc = addPreference(tr("PREF_CONTROLS_INCREMENT"), qaGroup, LightApp_Preferences::IntSpin, "SMESH", "controls_increment");
+   setPreferenceProperty( cinc, "min", 0 );
+   setPreferenceProperty( cinc, "max", 5 );
+   */
  
    int exportgroup = addPreference( tr( "PREF_GROUP_EXPORT" ), genTab );
    setPreferenceProperty( exportgroup, "columns", 2 );
    addPreference( tr( "PREF_ELEMENTS" ), precSelGroup, LightApp_Preferences::Double, "SMESH", "selection_precision_element" );
    addPreference( tr( "PREF_OBJECTS" ), precSelGroup, LightApp_Preferences::Double, "SMESH", "selection_precision_object" );
  
+   int sinc = addPreference(tr("PREF_SELECTION_INCREMENT"), selTab, LightApp_Preferences::IntSpin, "SMESH", "selection_increment");
+   setPreferenceProperty( sinc, "min", 0 );
+   setPreferenceProperty( sinc, "max", 5 );
    // Scalar Bar tab ------------------------------------------------------------------------
    int sbarTab = addPreference( tr( "SMESH_SCALARBAR" ) );
    int fontGr = addPreference( tr( "SMESH_FONT_SCALARBAR" ), sbarTab );
@@@ -5432,7 -5478,8 +5441,8 @@@ void SMESHGUI::preferencesChanged( cons
           name==        "highlight_color" ||
           name=="selection_precision_node"    ||
           name=="selection_precision_element" ||
-          name=="selection_precision_object"   )
+          name=="selection_precision_object"   ||
+        name=="selection_increment")
      {
        SMESH::UpdateSelectionProp( this );
      }
@@@ -5644,7 -5691,8 +5654,7 @@@ LightApp_Operation* SMESHGUI::createOpe
  
  void SMESHGUI::switchToOperation(int id)
  {
 -  if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() )
 -    activeStudy()->abortAllOperations();
 +  activeStudy()->abortAllOperations();
    startOperation( id );
  }
  
@@@ -5737,11 -5785,12 +5747,11 @@@ void SMESHGUI::storeVisualParameters (i
                                                               savePoint);
    _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
  
 -  // store map of custom markers
 -  const VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
 -  if( !aMarkerMap.empty() )
 +  // store custom markers
 +  if( !myMarkerMap.empty() )
    {
 -    VTK::MarkerMap::const_iterator anIter = aMarkerMap.begin();
 -    for( ; anIter != aMarkerMap.end(); anIter++ )
 +    VTK::MarkerMap::const_iterator anIter = myMarkerMap.begin();
 +    for( ; anIter != myMarkerMap.end(); anIter++ )
      {
        int anId = anIter->first;
        VTK::MarkerData aMarkerData = anIter->second;
@@@ -6089,7 -6138,8 +6099,7 @@@ void SMESHGUI::restoreVisualParameters 
                                                               savePoint);
    _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
  
 -  // restore map of custom markers and map of clipping planes
 -  VTK::MarkerMap& aMarkerMap = myMarkerMap[ studyDS->StudyId() ];
 +  // restore custom markers and map of clipping planes
    TPlaneDataMap aPlaneDataMap;
  
    std::vector<std::string> properties = ip->getProperties();
            aMarkerTexture.push_back( aChar.digitValue() );
        }
  
 -      aMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
 +      myMarkerMap[ anId ] = VTK::MarkerData( aMarkerFileName, aMarkerTexture );
      }
      else if( aPropertyType == "ClippingPlane" )
      {
  
      // Check that the entry corresponds to a real object in the Study
      // as the object may be deleted or modified after the visual state is saved.
 -    _PTR(SObject) so = studyDS->FindObjectID(entry.toLatin1().data());
 +    _PTR(SObject) so = studyDS->FindObjectID(entry.toUtf8().data());
      if (!so) continue; //Skip the not existent entry
  
      std::vector<std::string> paramNames = ip->getAllParameterNames( *entIt );
                  SMESH_Actor* aGeomAc = SMESH_Actor::SafeDownCast(ac);
                  if (aGeomAc->hasIO()) {
                    Handle(SALOME_InteractiveObject) io = aGeomAc->getIO();
 -                  if (io->hasEntry() && strcmp(io->getEntry(), entry.toLatin1().data()) == 0) {
 +                  if (io->hasEntry() && strcmp(io->getEntry(), entry.toUtf8().data()) == 0) {
                      isFound = true;
                      vtkActors.Bind(viewIndex, aGeomAc);
                    }
                      aSmeshActor->SetMarkerStd( (VTK::MarkerType)aParam1, (VTK::MarkerScale)aParam2 );
                    }
                    else if( data[0] == "custom" ) {
 -                    VTK::MarkerMap::const_iterator markerIt = aMarkerMap.find( aParam1 );
 -                    if( markerIt != aMarkerMap.end() ) {
 +                    VTK::MarkerMap::const_iterator markerIt = myMarkerMap.find( aParam1 );
 +                    if( markerIt != myMarkerMap.end() ) {
                        VTK::MarkerData aMarkerData = markerIt->second;
                        aSmeshActor->SetMarkerTexture( aParam1, aMarkerData.second );
                      }
@@@ -7014,7 -7064,7 +7024,7 @@@ void SMESHGUI::message( const QString& 
        // get study
        _PTR(Study) study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() )->studyDS();
        // get mesh name
 -      _PTR(SObject) obj = study->FindObjectID( entry.toLatin1().constData() );
 +      _PTR(SObject) obj = study->FindObjectID( entry.toUtf8().constData() );
        QString name;
        if ( obj )
          name = SMESH::fromUtf8(obj->GetName());
@@@ -7069,7 -7119,7 +7079,7 @@@ bool SMESHGUI::renameAllowed( const QSt
      return false;
  
    // check type to prevent renaming of inappropriate objects
 -  int aType = SMESHGUI_Selection::type(qPrintable(entry), SMESH::GetActiveStudyDocument());
 +  int aType = SMESHGUI_Selection::type(qPrintable(entry));
    if (aType == SMESH::MESH || aType == SMESH::GROUP ||
        aType == SMESH::SUBMESH || aType == SMESH::SUBMESH_COMPOUND ||
        aType == SMESH::SUBMESH_SOLID || aType == SMESH::SUBMESH_FACE ||
@@@ -7116,14 -7166,14 +7126,14 @@@ bool SMESHGUI::renameObject( const QStr
      if ( obj->FindAttribute(anAttr, "AttributeName") ) {
        aName = anAttr;
        // check type to prevent renaming of inappropriate objects
 -      int aType = SMESHGUI_Selection::type( qPrintable(entry), SMESH::GetActiveStudyDocument() );
 +      int aType = SMESHGUI_Selection::type( qPrintable(entry));
        if (aType == SMESH::MESH || aType == SMESH::GROUP ||
            aType == SMESH::SUBMESH || aType == SMESH::SUBMESH_COMPOUND ||
            aType == SMESH::SUBMESH_SOLID || aType == SMESH::SUBMESH_FACE ||
            aType == SMESH::SUBMESH_EDGE || aType == SMESH::SUBMESH_VERTEX ||
            aType == SMESH::HYPOTHESIS || aType == SMESH::ALGORITHM) {
          if ( !name.isEmpty() ) {
 -          SMESHGUI::GetSMESHGen()->SetName(obj->GetIOR().c_str(), qPrintable(name) );
 +          SMESHGUI::GetSMESHGen()->SetName(obj->GetIOR().c_str(), qUtf8Printable(name) );
  
            // update name of group object and its actor
            Handle(SALOME_InteractiveObject) IObject =
  
            SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
            if( !aGroupObject->_is_nil() ) {
 -            aGroupObject->SetName( qPrintable(name) );
 +            aGroupObject->SetName( qUtf8Printable(name) );
              if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( qPrintable(entry) ) )
 -              anActor->setName( qPrintable(name) );
 +              anActor->setName( qUtf8Printable(name) );
            }
            return true;
          }
index 5b4a50483c47f05874e33398d63149ad2b4227a4,ac471b318511730397ea3b093537c16183a05c96..b74d29e50b73237b8359e46843b9b364a6356a8d
@@@ -32,6 -32,7 +32,7 @@@
  #include "SMESHGUI_Utils.h"
  #include "SMDS_Mesh.hxx"
  #include "SMESH_Actor.h"
+ #include "SMESH_ActorProps.h"
  #include "SMESH_ActorUtils.h"
  #include "SMESH_CellLabelActor.h"
  #include "SMESH_ControlsDef.hxx"
@@@ -76,7 -77,7 +77,7 @@@
  
  namespace SMESH
  {
 -  typedef std::map<TKeyOfVisualObj,TVisualObjPtr> TVisualObjCont;
 +  typedef std::map<std::string,TVisualObjPtr> TVisualObjCont;
    static TVisualObjCont VISUAL_OBJ_CONT;
  
    //=============================================================================
        }
      }
      
 -    if (aViewManager ) {
 -      int aStudyId = aViewManager->study()->id();
 -      TVisualObjCont::key_type aKey(aStudyId,theEntry);
 -      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
 -      if(anIter != VISUAL_OBJ_CONT.end()) {
 -        // for unknown reason, object destructor is not called, so clear object manually
 -        anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
 -        anIter->second->GetUnstructuredGrid()->SetPoints(0);
 -      }
 -      VISUAL_OBJ_CONT.erase(aKey);
 +    TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(theEntry);
 +    if(anIter != VISUAL_OBJ_CONT.end()) {
 +      // for unknown reason, object destructor is not called, so clear object manually
 +      anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
 +      anIter->second->GetUnstructuredGrid()->SetPoints(0);
      }
 +    VISUAL_OBJ_CONT.erase(theEntry);
  
      if(actorRemoved)
        aStudy->setVisibilityState(theEntry, Qtx::HiddenState);
     */
    //================================================================================
  
 -  void RemoveVisuData(int studyID)
 +  void RemoveVisuData()
    {
      SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
        ( SUIT_Session::session()->activeApplication() );
      ViewManagerList viewMgrs = app->viewManagers();
      for ( int iM = 0; iM < viewMgrs.count(); ++iM ) {
        SUIT_ViewManager* aViewManager = viewMgrs.at( iM );
 -      if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() &&
 -           aViewManager->study()->id() == studyID ) {
 +      if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() ) {
          QVector<SUIT_ViewWindow*> views = aViewManager->getViews();
          for ( int iV = 0; iV < views.count(); ++iV ) {
            if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
      }
      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.begin();
      for ( ; anIter != VISUAL_OBJ_CONT.end(); ) {
 -      int curId = anIter->first.first;
 -      if ( curId == studyID ) {
 -        // for unknown reason, object destructor is not called, so clear object manually
 -        anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
 -        anIter->second->GetUnstructuredGrid()->SetPoints(0);
 -        VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
 -      }
 -      else {
 -        anIter++;
 -      }
 +      // for unknown reason, object destructor is not called, so clear object manually
 +      anIter->second->GetUnstructuredGrid()->SetCells(0,0,0,0,0);
 +      anIter->second->GetUnstructuredGrid()->SetPoints(0);
 +      VISUAL_OBJ_CONT.erase( anIter++ ); // anIter++ returns a copy of self before incrementing
      }
    }
  
     */
    //================================================================================
  
 -  TVisualObjPtr GetVisualObj(int theStudyId, const char* theEntry, bool nulData){
 +  TVisualObjPtr GetVisualObj(const char* theEntry, bool nulData){
      TVisualObjPtr aVisualObj;
 -    TVisualObjCont::key_type aKey(theStudyId,theEntry);
      try{
        OCC_CATCH_SIGNALS;
 -      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
 +      TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(theEntry);
        if(anIter != VISUAL_OBJ_CONT.end()){
          aVisualObj = anIter->second;
        }else{
          SalomeApp_Application* app =
            dynamic_cast<SalomeApp_Application*>( SMESHGUI::activeStudy()->application() );
 -        _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
 +        _PTR(Study) aStudy = SMESH::getStudy();
          _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
          if(aSObj){
            _PTR(GenericAttribute) anAttr;
                SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
                if(!aMesh->_is_nil()){
                  aVisualObj.reset(new SMESH_MeshObj(aMesh));
 -                TVisualObjCont::value_type aValue(aKey,aVisualObj);
 +                TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                  VISUAL_OBJ_CONT.insert(aValue);
                }
                //Try narrow to SMESH_Group interface
                  aFatherSObj = aFatherSObj->GetFather();
                  if(!aFatherSObj) return aVisualObj;
                  CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
 -                TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
 +                TVisualObjPtr aVisObj = GetVisualObj(anEntry.in());
                  if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
                    aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
 -                  TVisualObjCont::value_type aValue(aKey,aVisualObj);
 +                  TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                    VISUAL_OBJ_CONT.insert(aValue);
                  }
                }
                  aFatherSObj = aFatherSObj->GetFather();
                  if(!aFatherSObj) return aVisualObj;
                  CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
 -                TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
 +                TVisualObjPtr aVisObj = GetVisualObj(anEntry.in());
                  if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
                    aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
 -                  TVisualObjCont::value_type aValue(aKey,aVisualObj);
 +                  TVisualObjCont::value_type aValue(theEntry,aVisualObj);
                    VISUAL_OBJ_CONT.insert(aValue);
                  }
                }
        return NULL;
  
      if(!CORBA::is_nil(theObject)){
 -      _PTR(Study) aStudy = GetActiveStudyDocument();
 +      _PTR(Study) aStudy = getStudy();
        CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
        _PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
        if(aSObject){
    }
  
  
 -  SMESH_Actor* CreateActor(_PTR(Study) theStudy,
 -                           const char* theEntry,
 +  SMESH_Actor* CreateActor(const char* theEntry,
                             int theIsClear)
    {
      SMESH_Actor *anActor = NULL;
 -    CORBA::Long anId = theStudy->StudyId();
 -    if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
 -      _PTR(SObject) aSObj = theStudy->FindObjectID(theEntry);
 +    if(TVisualObjPtr aVisualObj = GetVisualObj(theEntry)){
 +      _PTR(SObject) aSObj = getStudy()->FindObjectID(theEntry);
        if(aSObj){
          _PTR(GenericAttribute) anAttr;
          if(aSObj->FindAttribute(anAttr,"AttributeName")){
          Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
          if(anIO->hasEntry()){
            std::string anEntry = anIO->getEntry();
 -          SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
 -          int aStudyId = aStudy->id();
 -          TVisualObjCont::key_type aKey(aStudyId,anEntry);
 -          VISUAL_OBJ_CONT.erase(aKey);
 +          VISUAL_OBJ_CONT.erase(anEntry);
          }
        }
        theActor->Delete();
              {
                //MESSAGE("---");
                SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
 -              _PTR(Study) aDocument = aStudy->studyDS();
 -              // Pass non-visual objects (hypotheses, etc.), return true in this case
 -              CORBA::Long anId = aDocument->StudyId();
                TVisualObjPtr aVisualObj;
 -              if ( (aVisualObj = GetVisualObj(anId,theEntry)) && aVisualObj->IsValid())
 +              if ( (aVisualObj = GetVisualObj(theEntry)) && aVisualObj->IsValid())
                {
 -                if ((anActor = CreateActor(aDocument,theEntry,true))) {
 +                if ((anActor = CreateActor(theEntry,true))) {
                    bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
                    DisplayActor(theWnd,anActor);
                    anActor->SetVisibility(true);
            if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
              if(anActor->hasIO())
                if (!Update(anActor->getIO(),anActor->GetVisibility()))
 -                break; // avoid multiple warinings if visu failed
 +                break; // avoid multiple warnings if visu failed
            }
          }
        }
          {
            Handle(SALOME_InteractiveObject) anIO = anIter.Value();
            if ( !Update( anIO, true ))
 -            break; // avoid multiple warinings if visu failed
 +            break; // avoid multiple warnings if visu failed
  
            if ( withChildrenOfSelected ) // update all visible children
            {
    bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
    {
      //MESSAGE("Update");
 -    _PTR(Study) aStudy = GetActiveStudyDocument();
 -    CORBA::Long anId = aStudy->StudyId();
 -    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
 +    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(theIO->getEntry())) {
        if ( theDisplay )
          UpdateView(SMESH::eDisplay,theIO->getEntry());
        return true;
    bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
    {
      //MESSAGE("UpdateNulData");
 -    _PTR(Study) aStudy = GetActiveStudyDocument();
 -    CORBA::Long anId = aStudy->StudyId();
 -    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
 +    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(theIO->getEntry(), true)) {
        if ( theDisplay )
          UpdateView(SMESH::eDisplay,theIO->getEntry());
        return true;
        return;
      }
  
+     SMESH_ActorProps::props()->reset();
      QColor
        aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
        aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
          aCollection->InitTraversal();
          while ( vtkActor *anAct = aCollection->GetNextActor() ) {
            if ( SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct) ) {
-             anActor->SetHighlightColor(aHiColor.red()/255.,
-                                        aHiColor.green()/255.,
-                                        aHiColor.blue()/255.);
-             anActor->SetPreHighlightColor(aPreColor.red()/255.,
-                                           aPreColor.green()/255.,
-                                           aPreColor.blue()/255.);
+           anActor->UpdateSelectionProps();
            }
          }
        }
    //================================================================================
    /*!
     * \brief Find all SMESH_Actor's in the View Window.
 -   * If actor constains Plot2d_Histogram object remove it from each Plot2d Viewer.
 +   * If actor contains Plot2d_Histogram object remove it from each Plot2d Viewer.
     */
    //================================================================================
  
index 7a5649fe08900d74b5b7a93a4a8a5b6d623bb7a5,4be7190ad244e7e3c38ebaefb79384d9ec12bba3..75d649a726f19b4b7b69f63efbe1a24faa1a52b6
          <source>MED_FILES_FILTER</source>
          <translation>MED files</translation>
      </message>
 +    <message>
 +        <source>SAUV_FILES_FILTER</source>
 +        <translation>SAUV files</translation>
 +    </message>
      <message>
          <source>IDEAS_FILES_FILTER</source>
          <translation>IDEAS files</translation>
@@@ -1800,6 -1796,13 +1800,6 @@@ Do you want to continue?</translation
          <source>SMESH_EXPORT_ONLY_GPOUP</source>
          <translation>You are going to export the group without its mesh.
  Do you want to continue?</translation>
 -    </message>
 -    <message>
 -        <source>SMESH_EXPORT_MED_V2_1</source>
 -        <translation>During export mesh with name - &quot;%1&quot; to MED 2.1
 -polygons and polyhedrons elements will be missed
 -For correct export use MED 2.2
 -Are you sure want to export to MED 2.1?</translation>
      </message>
      <message>
          <source>SMESH_EXPORT_MED_VERSION_COLLISION</source>
@@@ -4325,7 -4328,7 +4325,7 @@@ Use Display Entity menu command to sho
      </message>
      <message>
          <source>MEN_FILE_INFO</source>
 -        <translation>MED File Information</translation>
 +        <translation>File Information</translation>
      </message>
      <message>
          <source>SMESH_WRN_NO_APPROPRIATE_SELECTION</source>
@@@ -4827,6 -4830,10 +4827,10 @@@ Please, create VTK viewer and try again
          <source>PREF_OBJECTS</source>
          <translation>Objects</translation>
      </message>
+     <message>
+         <source>PREF_SELECTION_INCREMENT</source>
+         <translation>Elements width increment</translation>
+     </message>
      <message>
          <source>PREF_OBJECT_COLOR</source>
          <translation>Object color</translation>
index b26fe665c624a1d0e86736364749205b7d50bd3f,66a93961cf577cac27ea6c6cb5d4675ed4800a66..52b164b813ac0e18fcfc2fe668891d463e72c488
          <source>MED_FILES_FILTER</source>
          <translation>Fichiers MED</translation>
      </message>
 +    <message>
 +        <source>SAUV_FILES_FILTER</source>
 +        <translation>Fichiers SAUV</translation>
 +    </message>
      <message>
          <source>IDEAS_FILES_FILTER</source>
          <translation>Fichiers IDEAS</translation>
          <source>TEXT_FILES_FILTER</source>
          <translation>Fichiers TXT</translation>
      </message>
 -    <message>
 -        <source>MED_VX_FILES_FILTER</source>
 -        <translation>Fichiers MED %1</translation>
 -    </message>
      <message>
          <source>STL_FILES_FILTER</source>
          <translation>Fichiers STL</translation>
@@@ -1776,6 -1776,13 +1776,6 @@@ Voulez-vous continuer ?</translation
          <source>SMESH_EXPORT_ONLY_GPOUP</source>
          <translation>Vous allez export le groupe sans son maillage.
  Voulez-vous continuer ?</translation>
 -    </message>
 -    <message>
 -        <source>SMESH_EXPORT_MED_V2_1</source>
 -        <translation>Les éléments polygonaux et polyèdriques seront omis 
 -dans le cas d&apos;exportation du maillage &quot;%1&quot; à MED 2.1
 -Utilisez MED 2.2 pour l&apos;exportation correcte.
 -Voulez-vous effectuer l&apos;exportation à MED 2.1 ?</translation>
      </message>
      <message>
          <source>SMESH_EXPORT_MED_VERSION_COLLISION</source>
@@@ -4773,6 -4780,10 +4773,10 @@@ Ouvrez une fenêtre VTK et essayez de n
          <source>PREF_OBJECTS</source>
          <translation>Objets</translation>
      </message>
+     <message>
+         <source>PREF_SELECTION_INCREMENT</source>
+         <translation type="unfinished">Elements width increment</translation>
+     </message>
      <message>
          <source>PREF_OBJECT_COLOR</source>
          <translation>Couleur d&apos;objet</translation>
index c266cb993585fd281c4bea12543bcb1648828165,91e3a408d2f9be4d07c7f65a949fe917d321a3c2..3b32bdd8cc25aa6cb95703f43b3936094c5dfded
        <source>MED_FILES_FILTER</source>
        <translation>MEDファイル</translation>
      </message>
 +    <message>
 +        <source>SAUV_FILES_FILTER</source>
 +        <translation>SAUVファイル</translation>
 +    </message>
      <message>
        <source>IDEAS_FILES_FILTER</source>
        <translation>IDEAS ファイル</translation>
        <source>TEXT_FILES_FILTER</source>
        <translation>TXT ファイル</translation>
      </message>
 -    <message>
 -      <source>MED_VX_FILES_FILTER</source>
 -      <translation>ファイル MED %1</translation>
 -    </message>
      <message>
        <source>STL_FILES_FILTER</source>
        <translation>STL ファイル</translation>
        <source>SMESH_EXPORT_ONLY_GPOUP</source>
        <translation>そのメッシュなしでグループのエクスポートをしようとしています。続行しますか?</translation>
      </message>
 -    <message>
 -      <source>SMESH_EXPORT_MED_V2_1</source>
 -      <translation>多角形、多面体要素は正しいエクスポート用 MED 2.1 MED 2.2 にメッシュ '%' のエクスポートの場合省略されます。MED 2.1 をエクスポートしますか。</translation>
 -    </message>
      <message>
        <source>SMESH_EXPORT_MED_VERSION_COLLISION</source>
        <translation>ファイル「%1」MED バージョンは知られていないか、選択したバージョンと一致しません。ファイルを上書きしますか。</translation>
        <source>PREF_OBJECTS</source>
        <translation>オブジェクト</translation>
      </message>
+     <message>
+       <source>PREF_SELECTION_INCREMENT</source>
+       <translation type="unfinished">Elements width increment</translation>
+     </message>
      <message>
        <source>PREF_OBJECT_COLOR</source>
        <translation>オブジェクトの色</translation>