]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
untabify
authoreap <eap@opencascade.com>
Thu, 29 Oct 2009 08:34:30 +0000 (08:34 +0000)
committereap <eap@opencascade.com>
Thu, 29 Oct 2009 08:34:30 +0000 (08:34 +0000)
src/SMESHGUI/SMESHGUI.cxx

index 7691117906949a2f43d726e1863a1b24da288460..6b1a44efce90cce666ad446fda8427bb3ac8f27e 100644 (file)
 #include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
 
 // QT Includes
-#define         INCLUDE_MENUITEM_DEF
+#define  INCLUDE_MENUITEM_DEF
 #include <qpopupmenu.h>
 #include <qstring.h>
 #include <qwidget.h>
@@ -158,7 +158,7 @@ using namespace std;
   // Declarations
   //=============================================================
   void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh,
-                           int theCommandID);
+                            int theCommandID);
 
   void ExportMeshToFile(int theCommandID);
 
@@ -172,7 +172,7 @@ using namespace std;
   // Definitions
   //=============================================================
   void ImportMeshesFromFile( SMESH::SMESH_Gen_ptr theComponentMesh,
-                            int theCommandID )
+                             int theCommandID )
   {
     QStringList filter;
     string myExtension;
@@ -193,9 +193,9 @@ using namespace std;
       anInitialPath = QDir::currentDirPath();
 
     QStringList filenames = SUIT_FileDlg::getOpenFileNames( SMESHGUI::desktop(),
-                                                           anInitialPath,
-                                                           filter,
-                                                           QObject::tr( "SMESH_IMPORT_MESH" ) );
+                                                            anInitialPath,
+                                                            filter,
+                                                            QObject::tr( "SMESH_IMPORT_MESH" ) );
     if ( filenames.count() > 0 ) {
       SUIT_OverrideCursor wc;
       _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
@@ -203,58 +203,58 @@ using namespace std;
       QStringList errors;
       bool isEmpty = false;
       for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) {
-       QString filename = *it;
-       SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
-       try {
-         switch ( theCommandID ) {
-         case 111:
-           {
-             // DAT format (currently unsupported)
-             errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
-                            arg( QObject::tr( "SMESH_ERR_NOT_SUPPORTED_FORMAT" ) ) );
-             break;
-           }
-         case 112:
-           {
-             // UNV format
-             aMeshes->length( 1 );
-             aMeshes[0] = theComponentMesh->CreateMeshesFromUNV( filename.latin1() );
-             if ( aMeshes[0]->_is_nil() )
-               errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
-                              arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
-             break;
-           }
-         case 113:
-           {
-             // MED format
-             SMESH::DriverMED_ReadStatus res;
-             aMeshes = theComponentMesh->CreateMeshesFromMED( filename.latin1(), res );
-             if ( res != SMESH::DRS_OK ) {
-               errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
-                              arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ) ) ) );
-             }
-             break;
-           }
-         }
-       }
-       catch ( const SALOME::SALOME_Exception& S_ex ) {
-         errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
-                        arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
-       }
-
-       for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
-         _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
-         if ( aMeshSO ) {
-           _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
-           _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" );
-           aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" );
-           if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import
-             SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
-         }
-         else {
-           isEmpty = true;
-         }
-       }
+        QString filename = *it;
+        SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
+        try {
+          switch ( theCommandID ) {
+          case 111:
+            {
+              // DAT format (currently unsupported)
+              errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+                             arg( QObject::tr( "SMESH_ERR_NOT_SUPPORTED_FORMAT" ) ) );
+              break;
+            }
+          case 112:
+            {
+              // UNV format
+              aMeshes->length( 1 );
+              aMeshes[0] = theComponentMesh->CreateMeshesFromUNV( filename.latin1() );
+              if ( aMeshes[0]->_is_nil() )
+                errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+                               arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
+              break;
+            }
+          case 113:
+            {
+              // MED format
+              SMESH::DriverMED_ReadStatus res;
+              aMeshes = theComponentMesh->CreateMeshesFromMED( filename.latin1(), res );
+              if ( res != SMESH::DRS_OK ) {
+                errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+                               arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ) ) ) );
+              }
+              break;
+            }
+          }
+        }
+        catch ( const SALOME::SALOME_Exception& S_ex ) {
+          errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+                         arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
+        }
+
+        for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
+          _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
+          if ( aMeshSO ) {
+            _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+            _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" );
+            aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" );
+            if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import
+              SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
+          }
+          else {
+            isEmpty = true;
+          }
+        }
       }
 
       // update Object browser
@@ -262,18 +262,18 @@ using namespace std;
       
       // show Error message box if there were errors
       if ( errors.count() > 0 ) {
-       SUIT_MessageBox::error1( SMESHGUI::desktop(),
-                                QObject::tr( "SMESH_ERROR" ),
-                                QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ),
-                                QObject::tr( "SMESH_BUT_OK" ) );
+        SUIT_MessageBox::error1( SMESHGUI::desktop(),
+                                 QObject::tr( "SMESH_ERROR" ),
+                                 QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ),
+                                 QObject::tr( "SMESH_BUT_OK" ) );
       }
       
       // show warning message box, if some imported mesh is empty
       if ( isEmpty ) {
-         SUIT_MessageBox::warn1( SMESHGUI::desktop(),
-                                 QObject::tr( "SMESH_WRN_WARNING" ),
-                                 QObject::tr( "SMESH_DRS_SOME_EMPTY" ),
-                                 QObject::tr( "SMESH_BUT_OK" ) );
+          SUIT_MessageBox::warn1( SMESHGUI::desktop(),
+                                  QObject::tr( "SMESH_WRN_WARNING" ),
+                                  QObject::tr( "SMESH_DRS_SOME_EMPTY" ),
+                                  QObject::tr( "SMESH_BUT_OK" ) );
       }
     }
   }
@@ -511,7 +511,7 @@ using namespace std;
   }
 
   inline void InverseEntityMode(unsigned int& theOutputMode,
-                               unsigned int theMode)
+                                unsigned int theMode)
   {
     bool anIsNotPresent = ~theOutputMode & theMode;
     if(anIsNotPresent)
@@ -529,28 +529,28 @@ using namespace std;
     if(selected.Extent() >= 1){
       SALOME_ListIteratorOfListIO It( selected );
       for(; It.More(); It.Next()){
-       Handle(SALOME_InteractiveObject) IObject = It.Value();
-       if(IObject->hasEntry()){
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
-           unsigned int aMode = anActor->GetEntityMode();
-           switch(theCommandID){
-           case 217:
-             InverseEntityMode(aMode,SMESH_Actor::eEdges);
-             break;
-           case 218:
-             InverseEntityMode(aMode,SMESH_Actor::eFaces);
-             break;
-           case 219:
-             InverseEntityMode(aMode,SMESH_Actor::eVolumes);
-             break;
-           case 220:
-             aMode = SMESH_Actor::eAllEntity;
-             break;
-           }
-           if(aMode)
-             anActor->SetEntityMode(aMode);
-         }
-       }
+        Handle(SALOME_InteractiveObject) IObject = It.Value();
+        if(IObject->hasEntry()){
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
+            unsigned int aMode = anActor->GetEntityMode();
+            switch(theCommandID){
+            case 217:
+              InverseEntityMode(aMode,SMESH_Actor::eEdges);
+              break;
+            case 218:
+              InverseEntityMode(aMode,SMESH_Actor::eFaces);
+              break;
+            case 219:
+              InverseEntityMode(aMode,SMESH_Actor::eVolumes);
+              break;
+            case 220:
+              aMode = SMESH_Actor::eAllEntity;
+              break;
+            }
+            if(aMode)
+              anActor->SetEntityMode(aMode);
+          }
+        }
       }
     }
   }
@@ -595,12 +595,12 @@ using namespace std;
       _PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject);
       if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str()))
       {
-       if( aGroupObject->GetType() == SMESH::NODE )
-         anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
-       else if( aGroupObject->GetType() == SMESH::EDGE )
-         anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
-       else
-         anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+        if( aGroupObject->GetType() == SMESH::NODE )
+          anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
+        else if( aGroupObject->GetType() == SMESH::EDGE )
+          anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
+        else
+          anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
       }
     }
 
@@ -617,7 +617,7 @@ using namespace std;
       Handle(SALOME_InteractiveObject) anIObject = selected.First();
       SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIObject);
       if ( !aMesh->_is_nil() ) {
-       aMesh->SetAutoColor( false );
+        aMesh->SetAutoColor( false );
       }
     }
   }
@@ -640,124 +640,124 @@ using namespace std;
     if(selected.Extent() >= 1){
       switch(theCommandID){
       case 1134:{
-       SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
-       new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI(), "", false );
-       return;
+        SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+        new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI(), "", false );
+        return;
       }
       case 1133:{
-       SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
-       new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI(), "", false );
-       return;
+        SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+        new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI(), "", false );
+        return;
       }}
       SALOME_ListIteratorOfListIO It( selected );
       for(; It.More(); It.Next()){
-       Handle(SALOME_InteractiveObject) IObject = It.Value();
-       if(IObject->hasEntry()){
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
-           switch(theCommandID){
-           case 211:
-             anActor->SetRepresentation(SMESH_Actor::eEdge);
-             break;
-           case 212:
-             anActor->SetRepresentation(SMESH_Actor::eSurface);
-             break;
-           case 213:
-             if(anActor->IsShrunk())
-               anActor->UnShrink();
-             else
-               anActor->SetShrink();
-             break;
-           case 215:
-             anActor->SetRepresentation(SMESH_Actor::ePoint);
-             break;
-           case 1132:{
-             vtkFloatingPointType color[3];
-             anActor->GetSufaceColor(color[0], color[1], color[2]);
-             int c0 = int (color[0] * 255);
-             int c1 = int (color[1] * 255);
-             int c2 = int (color[2] * 255);
-             QColor c(c0, c1, c2);
-
-             vtkFloatingPointType edgecolor[3];
-             anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]);
-             c0 = int (edgecolor[0] * 255);
-             c1 = int (edgecolor[1] * 255);
-             c2 = int (edgecolor[2] * 255);
-             QColor e(c0, c1, c2);
-
-             vtkFloatingPointType backfacecolor[3];
-             anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]);
-             c0 = int (backfacecolor[0] * 255);
-             c1 = int (backfacecolor[1] * 255);
-             c2 = int (backfacecolor[2] * 255);
-             QColor b(c0, c1, c2);
-
-             vtkFloatingPointType nodecolor[3];
-             anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]);
-             c0 = int (nodecolor[0] * 255);
-             c1 = int (nodecolor[1] * 255);
-             c2 = int (nodecolor[2] * 255);
-             QColor n(c0, c1, c2);
-
-             int Edgewidth = (int)anActor->GetLineWidth();
-             if(Edgewidth == 0)
-               Edgewidth = 1;
-             int intValue = int(anActor->GetNodeSize());
-             vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
-
-             SMESHGUI_Preferences_ColorDlg *aDlg =
-               new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI(), "" );
-             aDlg->SetColor(1, c);
-             aDlg->SetColor(2, e);
-             aDlg->SetColor(3, n);
-             aDlg->SetColor(4, b);
-             aDlg->SetIntValue(1, Edgewidth);
-             aDlg->SetIntValue(2, intValue);
-             aDlg->SetIntValue(3, int(Shrink*100.));
-             if(aDlg->exec()){
-               QColor color = aDlg->GetColor(1);
-               QColor edgecolor = aDlg->GetColor(2);
-               QColor nodecolor = aDlg->GetColor(3);
-               QColor backfacecolor = aDlg->GetColor(4);
-               /* actor color and backface color */
-               anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255.,
-                                       vtkFloatingPointType (color.green()) / 255.,
-                                       vtkFloatingPointType (color.blue()) / 255.);
-               anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255.,
-                                           vtkFloatingPointType (backfacecolor.green()) / 255.,
-                                           vtkFloatingPointType (backfacecolor.blue()) / 255.);
-
-               /* edge color */
-               anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255.,
-                                     vtkFloatingPointType (edgecolor.green()) / 255.,
-                                     vtkFloatingPointType (edgecolor.blue()) / 255.);
-
-               /* Shrink factor and size edges */
-               anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.);
-               anActor->SetLineWidth(aDlg->GetIntValue(1));
-
-               /* Nodes color and size */
-               anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255.,
-                                     vtkFloatingPointType (nodecolor.green()) / 255.,
-                                     vtkFloatingPointType (nodecolor.blue()) / 255.);
-               anActor->SetNodeSize(aDlg->GetIntValue(2));
-
-               SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
-               if( !aGroupObject->_is_nil() )
-               {
-                 SALOMEDS::Color aColor;
-                 aColor.R = (float)color.red() / 255.0;
-                 aColor.G = (float)color.green() / 255.0;
-                 aColor.B = (float)color.blue() / 255.0;
-                 aGroupObject->SetColor( aColor );
-               }
-
-               delete aDlg;
-             }
-             break;
-           }}
-         }
-       }
+        Handle(SALOME_InteractiveObject) IObject = It.Value();
+        if(IObject->hasEntry()){
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
+            switch(theCommandID){
+            case 211:
+              anActor->SetRepresentation(SMESH_Actor::eEdge);
+              break;
+            case 212:
+              anActor->SetRepresentation(SMESH_Actor::eSurface);
+              break;
+            case 213:
+              if(anActor->IsShrunk())
+                anActor->UnShrink();
+              else
+                anActor->SetShrink();
+              break;
+            case 215:
+              anActor->SetRepresentation(SMESH_Actor::ePoint);
+              break;
+            case 1132:{
+              vtkFloatingPointType color[3];
+              anActor->GetSufaceColor(color[0], color[1], color[2]);
+              int c0 = int (color[0] * 255);
+              int c1 = int (color[1] * 255);
+              int c2 = int (color[2] * 255);
+              QColor c(c0, c1, c2);
+
+              vtkFloatingPointType edgecolor[3];
+              anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]);
+              c0 = int (edgecolor[0] * 255);
+              c1 = int (edgecolor[1] * 255);
+              c2 = int (edgecolor[2] * 255);
+              QColor e(c0, c1, c2);
+
+              vtkFloatingPointType backfacecolor[3];
+              anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]);
+              c0 = int (backfacecolor[0] * 255);
+              c1 = int (backfacecolor[1] * 255);
+              c2 = int (backfacecolor[2] * 255);
+              QColor b(c0, c1, c2);
+
+              vtkFloatingPointType nodecolor[3];
+              anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]);
+              c0 = int (nodecolor[0] * 255);
+              c1 = int (nodecolor[1] * 255);
+              c2 = int (nodecolor[2] * 255);
+              QColor n(c0, c1, c2);
+
+              int Edgewidth = (int)anActor->GetLineWidth();
+              if(Edgewidth == 0)
+                Edgewidth = 1;
+              int intValue = int(anActor->GetNodeSize());
+              vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
+
+              SMESHGUI_Preferences_ColorDlg *aDlg =
+                new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI(), "" );
+              aDlg->SetColor(1, c);
+              aDlg->SetColor(2, e);
+              aDlg->SetColor(3, n);
+              aDlg->SetColor(4, b);
+              aDlg->SetIntValue(1, Edgewidth);
+              aDlg->SetIntValue(2, intValue);
+              aDlg->SetIntValue(3, int(Shrink*100.));
+              if(aDlg->exec()){
+                QColor color = aDlg->GetColor(1);
+                QColor edgecolor = aDlg->GetColor(2);
+                QColor nodecolor = aDlg->GetColor(3);
+                QColor backfacecolor = aDlg->GetColor(4);
+                /* actor color and backface color */
+                anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255.,
+                                        vtkFloatingPointType (color.green()) / 255.,
+                                        vtkFloatingPointType (color.blue()) / 255.);
+                anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255.,
+                                            vtkFloatingPointType (backfacecolor.green()) / 255.,
+                                            vtkFloatingPointType (backfacecolor.blue()) / 255.);
+
+                /* edge color */
+                anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255.,
+                                      vtkFloatingPointType (edgecolor.green()) / 255.,
+                                      vtkFloatingPointType (edgecolor.blue()) / 255.);
+
+                /* Shrink factor and size edges */
+                anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.);
+                anActor->SetLineWidth(aDlg->GetIntValue(1));
+
+                /* Nodes color and size */
+                anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255.,
+                                      vtkFloatingPointType (nodecolor.green()) / 255.,
+                                      vtkFloatingPointType (nodecolor.blue()) / 255.);
+                anActor->SetNodeSize(aDlg->GetIntValue(2));
+
+                SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
+                if( !aGroupObject->_is_nil() )
+                {
+                  SALOMEDS::Color aColor;
+                  aColor.R = (float)color.red() / 255.0;
+                  aColor.G = (float)color.green() / 255.0;
+                  aColor.B = (float)color.blue() / 255.0;
+                  aGroupObject->SetColor( aColor );
+                }
+
+                delete aDlg;
+              }
+              break;
+            }}
+          }
+        }
       }
       SMESH::RepaintCurrentView();
     }
@@ -773,80 +773,80 @@ using namespace std;
     if( !selected.IsEmpty() ){
       Handle(SALOME_InteractiveObject) anIO = selected.First();
       if(!anIO.IsNull()){
-       QString aTitle;
-       SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
-       if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry())){
-         switch ( theCommandID ){
-         case 6001:
-           aTitle = QObject::tr( "LENGTH_EDGES" );
-           aControl = SMESH_Actor::eLength;
-           break;
-         case 6018:
-           aTitle = QObject::tr( "LENGTH2D_EDGES" );
-           aControl = SMESH_Actor::eLength2D;
-           break;
-         case 6002:
-           aTitle = QObject::tr( "FREE_EDGES" );
-           aControl = SMESH_Actor::eFreeEdges;
-           break;
-         case 6003:
-           aTitle = QObject::tr( "FREE_BORDERS" );
-           aControl = SMESH_Actor::eFreeBorders;
-           break;
-         case 6004:
-           aTitle = QObject::tr( "MULTI_BORDERS" );
-           aControl = SMESH_Actor::eMultiConnection;
-           break;
-         case 6019:
-           aTitle = QObject::tr( "MULTI2D_BORDERS" );
-           aControl = SMESH_Actor::eMultiConnection2D;
-           break;
-         case 6011:
-           aTitle = QObject::tr( "AREA_ELEMENTS" );
-           aControl = SMESH_Actor::eArea;
-           break;
-         case 6012:
-           aTitle = QObject::tr( "TAPER_ELEMENTS" );
-           aControl = SMESH_Actor::eTaper;
-           break;
-         case 6013:
-           aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" );
-           aControl = SMESH_Actor::eAspectRatio;
-           break;
-         case 6017:
-           aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" );
-           aControl = SMESH_Actor::eAspectRatio3D;
-           break;
-         case 6014:
-           aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" );
-           aControl = SMESH_Actor::eMinimumAngle;
-           break;
-         case 6015:
-           aTitle = QObject::tr( "WARP_ELEMENTS" );
-           aControl = SMESH_Actor::eWarping;
-           break;
-         case 6016:
-           aTitle = QObject::tr( "SKEW_ELEMENTS" );
-           aControl = SMESH_Actor::eSkew;
-           break;
-         case 6009:
-           aTitle = QObject::tr( "SMESH_VOLUME" );
-           aControl = SMESH_Actor::eVolume3D;
-           break;
-         }
-         anActor->SetControlMode(aControl);
-         anActor->GetScalarBarActor()->SetTitle(aTitle.latin1());
-         SMESH::RepaintCurrentView();
-       }
+        QString aTitle;
+        SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
+        if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry())){
+          switch ( theCommandID ){
+          case 6001:
+            aTitle = QObject::tr( "LENGTH_EDGES" );
+            aControl = SMESH_Actor::eLength;
+            break;
+          case 6018:
+            aTitle = QObject::tr( "LENGTH2D_EDGES" );
+            aControl = SMESH_Actor::eLength2D;
+            break;
+          case 6002:
+            aTitle = QObject::tr( "FREE_EDGES" );
+            aControl = SMESH_Actor::eFreeEdges;
+            break;
+          case 6003:
+            aTitle = QObject::tr( "FREE_BORDERS" );
+            aControl = SMESH_Actor::eFreeBorders;
+            break;
+          case 6004:
+            aTitle = QObject::tr( "MULTI_BORDERS" );
+            aControl = SMESH_Actor::eMultiConnection;
+            break;
+          case 6019:
+            aTitle = QObject::tr( "MULTI2D_BORDERS" );
+            aControl = SMESH_Actor::eMultiConnection2D;
+            break;
+          case 6011:
+            aTitle = QObject::tr( "AREA_ELEMENTS" );
+            aControl = SMESH_Actor::eArea;
+            break;
+          case 6012:
+            aTitle = QObject::tr( "TAPER_ELEMENTS" );
+            aControl = SMESH_Actor::eTaper;
+            break;
+          case 6013:
+            aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" );
+            aControl = SMESH_Actor::eAspectRatio;
+            break;
+          case 6017:
+            aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" );
+            aControl = SMESH_Actor::eAspectRatio3D;
+            break;
+          case 6014:
+            aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" );
+            aControl = SMESH_Actor::eMinimumAngle;
+            break;
+          case 6015:
+            aTitle = QObject::tr( "WARP_ELEMENTS" );
+            aControl = SMESH_Actor::eWarping;
+            break;
+          case 6016:
+            aTitle = QObject::tr( "SKEW_ELEMENTS" );
+            aControl = SMESH_Actor::eSkew;
+            break;
+          case 6009:
+            aTitle = QObject::tr( "SMESH_VOLUME" );
+            aControl = SMESH_Actor::eVolume3D;
+            break;
+          }
+          anActor->SetControlMode(aControl);
+          anActor->GetScalarBarActor()->SetTitle(aTitle.latin1());
+          SMESH::RepaintCurrentView();
+        }
       }
     }
   }
 
 
   bool CheckOIType(const Handle(SALOME_InteractiveObject) & theIO,
-                  MeshObjectType                           theType,
-                  const QString                            theInTypeName,
-                  QString &                                theOutTypeName)
+                   MeshObjectType                           theType,
+                   const QString                            theInTypeName,
+                   QString &                                theOutTypeName)
   {
     SMESH_TypeFilter aTypeFilter( theType );
     QString entry;
@@ -871,17 +871,17 @@ using namespace std;
       _PTR(SComponent) aSComp = aSObj->GetFatherComponent();
       CORBA::String_var anID = aSComp->GetID().c_str();
       if (!strcmp(anID.in(),theIO->getEntry()))
-       return "Component";
+        return "Component";
     }
 
     QString aTypeName;
     if (
-       CheckOIType ( theIO, HYPOTHESIS,    "Hypothesis", aTypeName ) ||
-       CheckOIType ( theIO, ALGORITHM,     "Algorithm",  aTypeName ) ||
-       CheckOIType ( theIO, MESH,          "Mesh",       aTypeName ) ||
-       CheckOIType ( theIO, SUBMESH,       "SubMesh",    aTypeName ) ||
-       CheckOIType ( theIO, GROUP,         "Group",      aTypeName )
-       )
+        CheckOIType ( theIO, HYPOTHESIS,    "Hypothesis", aTypeName ) ||
+        CheckOIType ( theIO, ALGORITHM,     "Algorithm",  aTypeName ) ||
+        CheckOIType ( theIO, MESH,          "Mesh",       aTypeName ) ||
+        CheckOIType ( theIO, SUBMESH,       "SubMesh",    aTypeName ) ||
+        CheckOIType ( theIO, GROUP,         "Group",      aTypeName )
+        )
       return aTypeName;
 
     return "NoType";
@@ -900,10 +900,10 @@ using namespace std;
     SALOME_ListIteratorOfListIO It(selected);
     for (; It.More(); It.Next())
       {
-       Handle(SALOME_InteractiveObject) IObject = It.Value();
-       QString Type = CheckTypeObject(IObject);
-       if (Type.compare(RefType) != 0)
-         return "Heterogeneous Selection";
+        Handle(SALOME_InteractiveObject) IObject = It.Value();
+        QString Type = CheckTypeObject(IObject);
+        if (Type.compare(RefType) != 0)
+          return "Heterogeneous Selection";
       }
 
     return RefType;
@@ -931,17 +931,17 @@ using namespace std;
       QString cur = anIt.Value()->getComponentDataType();
       _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry());
       if (aSO) {
-       // check if object is reference
-       _PTR(SObject) aRefSObj;
-       aNameList.append("\n    - ");
-       if ( aSO->ReferencedObject( aRefSObj ) ) {
-         QString aRefName = aRefSObj->GetName();
-         aNameList.append( aRefName );
-         cur = aRefSObj->GetFatherComponent()->ComponentDataType();
-       }
-       else
-         aNameList.append(anIO->getName());
-       objectCount++;
+        // check if object is reference
+        _PTR(SObject) aRefSObj;
+        aNameList.append("\n    - ");
+        if ( aSO->ReferencedObject( aRefSObj ) ) {
+          QString aRefName = aRefSObj->GetName();
+          aNameList.append( aRefName );
+          cur = aRefSObj->GetFatherComponent()->ComponentDataType();
+        }
+        else
+          aNameList.append(anIO->getName());
+        objectCount++;
       }
 
       if( aParentComponent.isNull() )
@@ -955,17 +955,17 @@ using namespace std;
 
     if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() )  {
       SUIT_MessageBox::warn1 ( SMESHGUI::desktop(),
-                             QObject::tr("ERR_ERROR"),
-                             QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ),
-                             QObject::tr("BUT_OK") );
+                              QObject::tr("ERR_ERROR"),
+                              QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ),
+                              QObject::tr("BUT_OK") );
       return;
     }
     // VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
     if (SUIT_MessageBox::warn2
-       (SMESHGUI::desktop(),
-        QObject::tr("SMESH_WRN_WARNING"),
-        QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
-        QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), 1, 0, 0) != 1)
+        (SMESHGUI::desktop(),
+         QObject::tr("SMESH_WRN_WARNING"),
+         QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
+         QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), 1, 0, 0) != 1)
       return;
 
     SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
@@ -978,18 +978,18 @@ using namespace std;
     for(; It.More(); It.Next()){ // loop on selected IO's
       Handle(SALOME_InteractiveObject) IObject = It.Value();
       if(IObject->hasEntry()) {
-       _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
-
-       // disable removal of "SMESH" component object
-       if(aSO->FindAttribute(anAttr, "AttributeIOR")){
-         anIOR = anAttr;
-         if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) )
-           continue;
-       }
-       //Check the referenced object
-       _PTR(SObject) refobj;
-       if ( aSO && aSO->ReferencedObject( refobj ) )
-         aSO = refobj; // Delete main Object instead of reference
+        _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
+
+        // disable removal of "SMESH" component object
+        if(aSO->FindAttribute(anAttr, "AttributeIOR")){
+          anIOR = anAttr;
+          if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) )
+            continue;
+        }
+        //Check the referenced object
+        _PTR(SObject) refobj;
+        if ( aSO && aSO->ReferencedObject( refobj ) )
+          aSO = refobj; // Delete main Object instead of reference
 
         // put the whole hierarchy of sub-objects of the selected SO into a list and
         // then treat them all starting from the deepest objects (at list back)
@@ -1012,15 +1012,15 @@ using namespace std;
           string anEntry = SO->GetID();
 
           /** Erase graphical object **/
-         if(SO->FindAttribute(anAttr, "AttributeIOR")){
-           QPtrVector<SUIT_ViewWindow> aViews = vm->getViews();
-           for(int i = 0; i < nbSf; i++){
-             SUIT_ViewWindow *sf = aViews[i];
-             if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
-               SMESH::RemoveActor(sf,anActor);
-             }
-           }
-         }
+          if(SO->FindAttribute(anAttr, "AttributeIOR")){
+            QPtrVector<SUIT_ViewWindow> aViews = vm->getViews();
+            for(int i = 0; i < nbSf; i++){
+              SUIT_ViewWindow *sf = aViews[i];
+              if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
+                SMESH::RemoveActor(sf,anActor);
+              }
+            }
+          }
 
           /** Remove an object from data structures **/
           SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
@@ -1053,7 +1053,7 @@ using namespace std;
               //op->finish();
             }
           }
-       } /* listSO back loop */
+        } /* listSO back loop */
       } /* IObject->hasEntry() */
     } /* more/next */
     aStudyBuilder->CommitCommand();
@@ -1167,7 +1167,7 @@ SMESHGUI* SMESHGUI::GetSMESHGUI()
     {
       _PTR(Study) aStudy = study->studyDS();
       if ( aStudy )
-       GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
+        GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
     }
   }
 
@@ -1319,9 +1319,9 @@ static int isStudyLocked(_PTR(Study) theStudy){
 static bool checkLock(_PTR(Study) theStudy) {
   if (isStudyLocked(theStudy)) {
     SUIT_MessageBox::warn1 ( SMESHGUI::desktop(),
-                          QObject::tr("WRN_WARNING"),
-                          QObject::tr("WRN_STUDY_LOCKED"),
-                          QObject::tr("BUT_OK") );
+                           QObject::tr("WRN_WARNING"),
+                           QObject::tr("WRN_STUDY_LOCKED"),
+                           QObject::tr("BUT_OK") );
     return true;
   }
   return false;
@@ -1363,13 +1363,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   //QAction* act = action( theCommandID );
 
-  switch (theCommandID)        {
-  case 33:                                     // DELETE
+  switch (theCommandID) {
+  case 33:                                      // DELETE
     if(checkLock(aStudy)) break;
     OnEditDelete();
     break;
 
-  case 113:                                    // IMPORT
+  case 113:                                     // IMPORT
   case 112:
   case 111:
     {
@@ -1396,7 +1396,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       }
       break;
     }
-  case 122:                                    // EXPORT MED
+  case 122:                                     // EXPORT MED
   case 121:
   case 123:
   case 124:
@@ -1409,7 +1409,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 200:                                    // SCALAR BAR
+  case 200:                                     // SCALAR BAR
     {
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
       SALOME_ListIO selected;
@@ -1417,12 +1417,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         aSel->selectedObjects( selected );
 
       if( selected.Extent() ) {
-       Handle(SALOME_InteractiveObject) anIO = selected.First();
-       if( anIO->hasEntry() ) {
-         if( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
-           anActor->SetControlMode( SMESH_Actor::eNone );
-         }
-       }
+        Handle(SALOME_InteractiveObject) anIO = selected.First();
+        if( anIO->hasEntry() ) {
+          if( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
+            anActor->SetControlMode( SMESH_Actor::eNone );
+          }
+        }
       }
       break;
     }
@@ -1461,7 +1461,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     ::SetDisplayEntity(theCommandID);
   break;
 
-  case 214:                                    // UPDATE
+  case 214:                                     // UPDATE
     {
       if(checkLock(aStudy)) break;
       try {
@@ -1484,15 +1484,15 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 300:                                    // ERASE
-  case 301:                                    // DISPLAY
-  case 302:                                    // DISPLAY ONLY
+  case 300:                                     // ERASE
+  case 301:                                     // DISPLAY
+  case 302:                                     // DISPLAY ONLY
     {
       SMESH::EDisplaing anAction;
       switch (theCommandID) {
-      case 300:        anAction = SMESH::eErase; break;
-      case 301:        anAction = SMESH::eDisplay; break;
-      case 302:        anAction = SMESH::eDisplayOnly; break;
+      case 300: anAction = SMESH::eErase; break;
+      case 301: anAction = SMESH::eDisplay; break;
+      case 302: anAction = SMESH::eDisplayOnly; break;
       }
 
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -1501,7 +1501,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         aSel->selectedObjects( sel_objects );
 
       if( theCommandID==302 )
-       startOperation( myEraseAll );
+        startOperation( myEraseAll );
 
       extractContainers( sel_objects, to_process );
 
@@ -1536,29 +1536,29 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       }
 
       if (anAction == SMESH::eErase) {
-       SALOME_ListIO l1;
-       aSel->setSelectedObjects( l1 );
+        SALOME_ListIO l1;
+        aSel->setSelectedObjects( l1 );
       }
       else
-       aSel->setSelectedObjects( to_process );
+        aSel->setSelectedObjects( to_process );
 
       break;
     }
 
-  case 400:                                    // NODES
+  case 400:                                     // NODES
     {
       if(checkLock(aStudy)) break;
 
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
+        EmitSignalDeactivateDialog();
 
-       new SMESHGUI_NodesDlg(this);
+        new SMESHGUI_NodesDlg(this);
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"),
-                             tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"),
+                              tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -1573,7 +1573,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     break;
   }
 
-  case 406:                                    // MOVE NODE
+  case 406:                                     // MOVE NODE
     {
       if ( !vtkwnd )
       {
@@ -1587,7 +1587,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 701:                                    // COMPUTE MESH
+  case 701:                                     // COMPUTE MESH
     {
       if (checkLock(aStudy)) break;
 
@@ -1671,13 +1671,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_SmoothingDlg( this );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_SmoothingDlg( this );
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -1685,10 +1685,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if (checkLock(aStudy)) break;
       if (vtkwnd) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_ExtrusionDlg ( this );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_ExtrusionDlg ( this );
       } else {
-       SUIT_MessageBox::warn1(desktop(),
+        SUIT_MessageBox::warn1(desktop(),
                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
                                tr("SMESH_BUT_OK"));
       }
@@ -1698,13 +1698,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_RevolutionDlg( this );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_RevolutionDlg( this );
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -1718,9 +1718,9 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         new SMESHGUI_MeshPatternDlg( this );
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -1728,10 +1728,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if (checkLock(aStudy)) break;
       if (vtkwnd) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_ExtrusionAlongPathDlg( this );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_ExtrusionAlongPathDlg( this );
       } else {
-       SUIT_MessageBox::warn1(desktop(),
+        SUIT_MessageBox::warn1(desktop(),
                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
                                tr("SMESH_BUT_OK"));
       }
@@ -1742,13 +1742,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     startOperation( 417 );
       /*      if (checkLock(aStudy)) break;
       if (vtkwnd) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_ConvToQuadDlg();
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_ConvToQuadDlg();
       } else {
-       SUIT_MessageBox::warn1(desktop(),
+        SUIT_MessageBox::warn1(desktop(),
                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
                                tr("SMESH_BUT_OK"));
-                              }*/
+                               }*/
       break;
     }
   case 806:                                     // CREATE GEO GROUP
@@ -1776,7 +1776,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       int nbSel = selected.Extent();
       if (nbSel == 1) {
-       // check if mesh is selected
+        // check if mesh is selected
         aMesh = SMESH::GetMeshByIO( selected.First() );
       }
       SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", aMesh);
@@ -1803,47 +1803,47 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       int nbSel = selected.Extent();
       if (nbSel == 1) {
-       // check if submesh is selected
-       Handle(SALOME_InteractiveObject) IObject = selected.First();
-       if (IObject->hasEntry()) {
-         _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
-         if( aSObj ) {
-           SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
-           if (!aSubMesh->_is_nil()) {
-             try {
-               SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
-               // get submesh elements list by types
-               SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
-               SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
-               SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
-               SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
-               // create group for each type o elements
-               QString aName = IObject->getName();
-               if (aNodes->length() > 0) {
-                 SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes");
-                 aGroup->Add(aNodes.inout());
-               }
-               if (aEdges->length() > 0) {
-                 SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges");
-                 aGroup->Add(aEdges.inout());
-               }
-               if (aFaces->length() > 0) {
-                 SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces");
-                 aGroup->Add(aFaces.inout());
-               }
-               if (aVolumes->length() > 0) {
-                 SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
-                 aGroup->Add(aVolumes.inout());
-               }
-               updateObjBrowser();
-
-             }
+        // check if submesh is selected
+        Handle(SALOME_InteractiveObject) IObject = selected.First();
+        if (IObject->hasEntry()) {
+          _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
+          if( aSObj ) {
+            SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
+            if (!aSubMesh->_is_nil()) {
+              try {
+                SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
+                // get submesh elements list by types
+                SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
+                SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
+                SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
+                SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
+                // create group for each type o elements
+                QString aName = IObject->getName();
+                if (aNodes->length() > 0) {
+                  SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes");
+                  aGroup->Add(aNodes.inout());
+                }
+                if (aEdges->length() > 0) {
+                  SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges");
+                  aGroup->Add(aEdges.inout());
+                }
+                if (aFaces->length() > 0) {
+                  SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces");
+                  aGroup->Add(aFaces.inout());
+                }
+                if (aVolumes->length() > 0) {
+                  SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
+                  aGroup->Add(aVolumes.inout());
+                }
+                updateObjBrowser();
+
+              }
               catch(const SALOME::SALOME_Exception & S_ex){
-               SalomeApp_Tools::QtCatchCorbaException(S_ex);
-             }
-           }
-         }
-       }
+                SalomeApp_Tools::QtCatchCorbaException(S_ex);
+              }
+            }
+          }
+        }
       }
       else if(nbSel==0) {
         SUIT_MessageBox::warn1(desktop(),
@@ -1878,16 +1878,16 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         SMESH::SMESH_GroupBase_var aGroup =
           SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(It.Value());
         if (!aGroup->_is_nil()) {
-         nbSelectedGroups++;
+          nbSelectedGroups++;
           SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", aGroup);
           aDlg->show();
-       }
+        }
       }
       if (nbSelectedGroups == 0)
-       {
-         SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", SMESH::SMESH_GroupBase::_nil());
-         aDlg->show();
-       }
+        {
+          SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", SMESH::SMESH_GroupBase::_nil());
+          aDlg->show();
+        }
       break;
     }
 
@@ -1895,8 +1895,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if (myState == 800) {
-       SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
-       if (aDlg) aDlg->onAdd();
+        SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
+        if (aDlg) aDlg->onAdd();
       }
       break;
     }
@@ -1905,8 +1905,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if (myState == 800) {
-       SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
-       if (aDlg) aDlg->onRemove();
+        SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
+        if (aDlg) aDlg->onRemove();
       }
       break;
     }
@@ -1954,7 +1954,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 900:                                    // MESH INFOS
+  case 900:                                     // MESH INFOS
     {
       EmitSignalDeactivateDialog();
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -1966,8 +1966,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         SALOME_ListIO IOs;
         SALOME_ListIteratorOfListIO It (selected);
         for ( ; It.More(); It.Next() ) {
-         IOs.Clear(); IOs.Append( It.Value() );
-         aSel->setSelectedObjects( IOs );
+          IOs.Clear(); IOs.Append( It.Value() );
+          aSel->setSelectedObjects( IOs );
           new SMESHGUI_MeshInfosDlg(this, "", false);
         }
         // restore selection
@@ -1978,7 +1978,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 902:                                    // STANDARD MESH INFOS
+  case 902:                                     // STANDARD MESH INFOS
     {
       EmitSignalDeactivateDialog();
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -1990,27 +1990,27 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         SALOME_ListIO IOs;
         SALOME_ListIteratorOfListIO It (selected);
         for ( ; It.More(); It.Next() ) {
-         IOs.Clear();
-         IOs.Append( It.Value() );
-         aSel->setSelectedObjects( IOs );
+          IOs.Clear();
+          IOs.Append( It.Value() );
+          aSel->setSelectedObjects( IOs );
           new SMESHGUI_StandardMeshInfosDlg( this, "", false);
         }
         // restore selection
-       aSel->setSelectedObjects( selected );
+        aSel->setSelectedObjects( selected );
       }
       else
         new SMESHGUI_StandardMeshInfosDlg( this, "", false);
       break;
     }
 
-  case 903:                                    // WHAT IS
+  case 903:                                     // WHAT IS
     {
       EmitSignalDeactivateDialog();
       new SMESHGUI_WhatIsDlg( this, "", false);
       break;
     }
 
-  case 1100:                                   // EDIT HYPOTHESIS
+  case 1100:                                    // EDIT HYPOTHESIS
     {
       if(checkLock(aStudy)) break;
 
@@ -2023,7 +2023,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       if (nbSel == 1) {
         Handle(SALOME_InteractiveObject) anIObject = selected.First();
-       SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::IObjectToInterface<SMESH::SMESH_Hypothesis>(anIObject);
+        SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::IObjectToInterface<SMESH::SMESH_Hypothesis>(anIObject);
 
         /* Look for all mesh objects that have this hypothesis affected in order to flag as ModifiedMesh */
         /* At end below '...->updateObjBrowser(true)' will change icon of mesh objects                   */
@@ -2046,7 +2046,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 1101:                                   // RENAME
+  case 1101:                                    // RENAME
     {
       if ( checkLock( aStudy ) )
         break;
@@ -2109,7 +2109,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 1102:                                   // REMOVE HYPOTHESIS / ALGORITHMS
+  case 1102:                                    // REMOVE HYPOTHESIS / ALGORITHMS
     {
       if(checkLock(aStudy)) break;
       SUIT_OverrideCursor wc;
@@ -2121,8 +2121,8 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
       SALOME_ListIteratorOfListIO It(selected);
       for (int i = 0; It.More(); It.Next(), i++) {
-       Handle(SALOME_InteractiveObject) IObject = It.Value();
-       SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
+        Handle(SALOME_InteractiveObject) IObject = It.Value();
+        SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
       }
       SALOME_ListIO l1;
       aSel->setSelectedObjects( l1 );
@@ -2130,16 +2130,16 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       break;
     }
 
-  case 401:                                    // GEOM::EDGE
-  case 4021:                                   // TRIANGLE
-  case 4022:                                   // QUAD
-  case 4023:                                   // POLYGON
-  case 4031:                                   // TETRA
-  case 4032:                                   // HEXA
+  case 401:                                     // GEOM::EDGE
+  case 4021:                                    // TRIANGLE
+  case 4022:                                    // QUAD
+  case 4023:                                    // POLYGON
+  case 4031:                                    // TETRA
+  case 4032:                                    // HEXA
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
+        EmitSignalDeactivateDialog();
         SMDSAbs_ElementType type    = SMDSAbs_Edge;
         int                 nbNodes = 2;
         switch (theCommandID) {
@@ -2149,34 +2149,34 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
           type = SMDSAbs_Face; nbNodes = 4; break;
         case 4031:                                      // TETRA
           type = SMDSAbs_Volume; nbNodes = 4; break;
-       case 4023:                                      // POLYGON
-         type = SMDSAbs_Face; nbNodes = 5; break;     // 5 - identificator for POLYGON
+        case 4023:                                      // POLYGON
+          type = SMDSAbs_Face; nbNodes = 5; break;     // 5 - identificator for POLYGON
         case 4032:                                      // HEXA
           type = SMDSAbs_Volume; nbNodes = 8; break;
-       case 4033:                                      // POLYHEDRE
-         type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE
+        case 4033:                                      // POLYHEDRE
+          type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE
         default:;
         }
-       new SMESHGUI_AddMeshElementDlg( this, "", type, nbNodes);
+        new SMESHGUI_AddMeshElementDlg( this, "", type, nbNodes);
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
-  case 4033:                                   // POLYHEDRON
+  case 4033:                                    // POLYHEDRON
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_CreatePolyhedralVolumeDlg(this, "", FALSE );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_CreatePolyhedralVolumeDlg(this, "", FALSE );
       }
       else {
-       SUIT_MessageBox::warn1(SMESHGUI::desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(SMESHGUI::desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -2190,63 +2190,63 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       int type;
-
-       switch (theCommandID) {
-       case 4034:
-         type = QUAD_EDGE; break;
-       case 4035:
-         type = QUAD_TRIANGLE; break;
-       case 4036:
-         type = QUAD_QUADRANGLE; break;
-       case 4037:
-         type = QUAD_TETRAHEDRON; break;
-       case 4038:
-         type = QUAD_PYRAMID; break;
-       case 4039:
-         type = QUAD_PENTAHEDRON; break;
-       case 4040:
-         type = QUAD_HEXAHEDRON;
-         break;
-       default:;
-       }
-        new SMESHGUI_AddQuadraticElementDlg( this, type );
+        EmitSignalDeactivateDialog();
+        int type;
+
+        switch (theCommandID) {
+        case 4034:
+          type = QUAD_EDGE; break;
+        case 4035:
+          type = QUAD_TRIANGLE; break;
+        case 4036:
+          type = QUAD_QUADRANGLE; break;
+        case 4037:
+          type = QUAD_TETRAHEDRON; break;
+        case 4038:
+          type = QUAD_PYRAMID; break;
+        case 4039:
+          type = QUAD_PENTAHEDRON; break;
+        case 4040:
+          type = QUAD_HEXAHEDRON;
+          break;
+        default:;
+        }
+         new SMESHGUI_AddQuadraticElementDlg( this, type );
       }
       else {
-       SUIT_MessageBox::warn1(SMESHGUI::desktop(),
-                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                              tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(SMESHGUI::desktop(),
+                               tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                               tr("SMESH_BUT_OK"));
       }
       break;
     }
-  case 4041:                                   // REMOVES NODES
+  case 4041:                                    // REMOVES NODES
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_RemoveNodesDlg(this);
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_RemoveNodesDlg(this);
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
-  case 4042:                                   // REMOVES ELEMENTS
+  case 4042:                                    // REMOVES ELEMENTS
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_RemoveElementsDlg(this);
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_RemoveElementsDlg(this);
       }
       else
-       {
-         SUIT_MessageBox::warn1(desktop(),
-                               tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                               tr("SMESH_BUT_OK"));
-       }
+        {
+          SUIT_MessageBox::warn1(desktop(),
+                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                                tr("SMESH_BUT_OK"));
+        }
       break;
     }
   case 4043: {                                // CLEAR_MESH
@@ -2280,56 +2280,56 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
         }
       }
       catch (const SALOME::SALOME_Exception& S_ex){
-       wc.suspend();
-       SalomeApp_Tools::QtCatchCorbaException(S_ex);
-       wc.resume();
+        wc.suspend();
+        SalomeApp_Tools::QtCatchCorbaException(S_ex);
+        wc.resume();
       }
     }
     SMESH::UpdateView();
     updateObjBrowser();
     break;
   }
-  case 4051:                                   // RENUMBERING NODES
+  case 4051:                                    // RENUMBERING NODES
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_RenumberingDlg( this, "", 0);
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_RenumberingDlg( this, "", 0);
       }
       else
-       {
-         SUIT_MessageBox::warn1(desktop(),
-                               tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                               tr("SMESH_BUT_OK"));
-       }
+        {
+          SUIT_MessageBox::warn1(desktop(),
+                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                                tr("SMESH_BUT_OK"));
+        }
       break;
     }
-  case 4052:                                   // RENUMBERING ELEMENTS
+  case 4052:                                    // RENUMBERING ELEMENTS
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_RenumberingDlg( this, "", 1);
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_RenumberingDlg( this, "", 1);
       }
       else
-       {
-         SUIT_MessageBox::warn1(desktop(),
-                               tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                               tr("SMESH_BUT_OK"));
-       }
+        {
+          SUIT_MessageBox::warn1(desktop(),
+                                tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                                tr("SMESH_BUT_OK"));
+        }
       break;
     }
   case 4061:                                   // TRANSLATION
     {
       if(checkLock(aStudy)) break;
       if ( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_TranslationDlg( this );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_TranslationDlg( this );
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -2337,13 +2337,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if( vtkwnd ) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_RotationDlg( this );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_RotationDlg( this );
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -2351,13 +2351,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if(vtkwnd) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_SymmetryDlg( this );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_SymmetryDlg( this );
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -2365,13 +2365,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if(vtkwnd) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_SewingDlg( this );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_SewingDlg( this );
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -2379,13 +2379,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if(checkLock(aStudy)) break;
       if(vtkwnd) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_EditMeshDlg( this, 0 );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_EditMeshDlg( this, 0 );
       }
       else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -2393,12 +2393,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
     {
       if (checkLock(aStudy)) break;
       if (vtkwnd) {
-       EmitSignalDeactivateDialog();
-       new SMESHGUI_EditMeshDlg( this, 1 );
+        EmitSignalDeactivateDialog();
+        new SMESHGUI_EditMeshDlg( this, 1 );
       } else {
-       SUIT_MessageBox::warn1(desktop(),
-                             tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
-                             tr("SMESH_BUT_OK"));
+        SUIT_MessageBox::warn1(desktop(),
+                              tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+                              tr("SMESH_BUT_OK"));
       }
       break;
     }
@@ -2425,7 +2425,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
   }
   break;
 
-  case 6017:                                   // CONTROLS
+  case 6017:                                    // CONTROLS
   case 6016:
   case 6015:
   case 6014:
@@ -2445,29 +2445,29 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       SALOME_ListIO selected; mgr->selectedObjects( selected );
 
       if ( selected.Extent() == 1 && selected.First()->hasEntry() ) {
-       _PTR(SObject) SO = aStudy->FindObjectID( selected.First()->getEntry() );
-       if ( SO ) {
-         CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
-         SMESH::SMESH_Mesh_var      aMesh    = SMESH::SMESH_Mesh::_narrow( aObject );
-         SMESH::SMESH_subMesh_var   aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
-         SMESH::SMESH_GroupBase_var aGroup   = SMESH::SMESH_GroupBase::_narrow( aObject );
-         if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) {
-           ::Control( theCommandID );
-           break;
-         }
-       }
+        _PTR(SObject) SO = aStudy->FindObjectID( selected.First()->getEntry() );
+        if ( SO ) {
+          CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
+          SMESH::SMESH_Mesh_var      aMesh    = SMESH::SMESH_Mesh::_narrow( aObject );
+          SMESH::SMESH_subMesh_var   aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
+          SMESH::SMESH_GroupBase_var aGroup   = SMESH::SMESH_GroupBase::_narrow( aObject );
+          if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) {
+            ::Control( theCommandID );
+            break;
+          }
+        }
       }
       SUIT_MessageBox::warn1(desktop(),
-                           tr( "SMESH_WRN_WARNING" ),
-                           tr( "SMESH_BAD_SELECTION" ),
-                           tr( "SMESH_BUT_OK" ) );
+                            tr( "SMESH_WRN_WARNING" ),
+                            tr( "SMESH_BAD_SELECTION" ),
+                            tr( "SMESH_BUT_OK" ) );
       break;
     }
     else {
       SUIT_MessageBox::warn1(desktop(),
-                           tr( "SMESH_WRN_WARNING" ),
-                           tr( "NOT_A_VTK_VIEWER" ),
-                           tr( "SMESH_BUT_OK" ) );
+                            tr( "SMESH_WRN_WARNING" ),
+                            tr( "NOT_A_VTK_VIEWER" ),
+                            tr( "SMESH_BUT_OK" ) );
     }
     break;
   case 9010:
@@ -2478,11 +2478,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       SALOME_ListIteratorOfListIO it(selected);
       for(; it.More(); it.Next()) {
         Handle(SALOME_InteractiveObject) anIObject = it.Value();
-       if(anIObject->hasEntry()) {
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
-           anActor->SetPointsLabeled( !anActor->GetPointsLabeled() );
-         }
-       }
+        if(anIObject->hasEntry()) {
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
+            anActor->SetPointsLabeled( !anActor->GetPointsLabeled() );
+          }
+        }
       }
       break;
     }
@@ -2491,12 +2491,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
       LightApp_SelectionMgr* mgr = selectionMgr();
       SALOME_ListIO selected; mgr->selectedObjects( selected );
 
-      if (selected.Extent() == 1)      {
-       Handle(SALOME_InteractiveObject) anIObject = selected.First();
-       if(anIObject->hasEntry())
-         if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
-           anActor->SetCellsLabeled( !anActor->GetCellsLabeled() );
-         }
+      if (selected.Extent() == 1)       {
+        Handle(SALOME_InteractiveObject) anIObject = selected.First();
+        if(anIObject->hasEntry())
+          if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
+            anActor->SetCellsLabeled( !anActor->GetCellsLabeled() );
+          }
       }
       break;
     }
@@ -2583,7 +2583,7 @@ void SMESHGUI::createPopupItem( const int id,
                                 const QString& clients,
                                 const QString& types,
                                 const QString& theRule,
-                               const int pId )
+                                const int pId )
 {
   int parentId = pId;
   if( pId!=-1 )
@@ -2954,22 +2954,22 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   myRules.clear();
   QString OB = "'ObjectBrowser'",
-         View = "'" + SVTK_Viewer::Type() + "'",
-         pat = "'%1'",
-         mesh    = pat.arg( SMESHGUI_Selection::typeName( MESH ) ),
-         group   = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ),
-         hypo    = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ),
-         algo    = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ),
-         elems   = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
+          View = "'" + SVTK_Viewer::Type() + "'",
+          pat = "'%1'",
+          mesh    = pat.arg( SMESHGUI_Selection::typeName( MESH ) ),
+          group   = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ),
+          hypo    = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ),
+          algo    = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ),
+          elems   = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
                        arg( SMESHGUI_Selection::typeName( SUBMESH_VERTEX ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ).
-                      arg( SMESHGUI_Selection::typeName( SUBMESH ) ),
+                       arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ).
+                       arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ).
+                       arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ).
+                       arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ).
+                       arg( SMESHGUI_Selection::typeName( SUBMESH ) ),
           subMesh = elems,
-         mesh_group = mesh + " " + subMesh + " " + group,
-         hyp_alg = hypo + " " + algo;
+          mesh_group = mesh + " " + subMesh + " " + group,
+          hyp_alg = hypo + " " + algo;
 
   // popup for object browser
 
@@ -3226,7 +3226,7 @@ void SMESHGUI::initialize( CAM_Application* app )
   popupMgr()->insert( separator(), -1, -1 );
 
   connect( application(), SIGNAL( viewManagerActivated( SUIT_ViewManager* ) ),
-          this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
+           this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
 }
 
 //================================================================================
@@ -3351,7 +3351,7 @@ void SMESHGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QStrin
     if ( obj ) {
       QString aName = QString( obj->GetName().c_str() );
       while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of Popup
-         aName.remove( (aName.length() - 1), 1 );
+          aName.remove( (aName.length() - 1), 1 );
       title = aName;
     }
   }
@@ -3552,57 +3552,57 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
     if( name=="selection_object_color" || name=="selection_element_color" ||
         name=="selection_width" || name=="highlight_color" || name=="highlight_width" ||
         name=="selection_precision_node" || name=="selection_precision_element" ||
-       name=="selection_precision_object")
+        name=="selection_precision_object")
       SMESH::UpdateSelectionProp( this );
     else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){
       sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1);
       sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW);
       if(sbX1+sbW > aTol){
-       aWarning = "Origin and Size Vertical: X+Width > 1\n";
-       sbX1=0.01;
-       sbW=0.05;
-       aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1);
-       aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW);
+        aWarning = "Origin and Size Vertical: X+Width > 1\n";
+        sbX1=0.01;
+        sbW=0.05;
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW);
       }
     }
     else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){
       sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1);
       sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH);
       if(sbY1+sbH > aTol){
-       aWarning = "Origin and Size Vertical: Y+Height > 1\n";
-       aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1);
-       aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH);
+        aWarning = "Origin and Size Vertical: Y+Height > 1\n";
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH);
       }
     }
     else if(name ==  QString("scalar_bar_horizontal_x") || name ==  QString("scalar_bar_horizontal_width")){
       sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1);
       sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW);
       if(sbX1+sbW > aTol){
-       aWarning = "Origin and Size Horizontal: X+Width > 1\n";
-       sbX1=0.01;
-       sbW=0.05;
-       aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1);
-       aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW);
+        aWarning = "Origin and Size Horizontal: X+Width > 1\n";
+        sbX1=0.01;
+        sbW=0.05;
+        aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW);
       }
     }
     else if(name ==  QString("scalar_bar_horizontal_y") || name ==  QString("scalar_bar_horizontal_height")){
       sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1);
       sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH);
       if(sbY1+sbH > aTol){
-       aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
-       sbY1=0.01;
-       sbH=0.05;
-       aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1);
-       aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH);
+        aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
+        sbY1=0.01;
+        sbH=0.05;
+        aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1);
+        aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH);
       }
     }
 
     if(aWarning.size() != 0){
       aWarning += "The default values are applied instead.";
       SUIT_MessageBox::warn1(SMESHGUI::desktop(),
-                            QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
-                            QObject::tr(aWarning.c_str()),
-                            QObject::tr("SMESH_BUT_OK"));
+                             QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
+                             QObject::tr(aWarning.c_str()),
+                             QObject::tr("SMESH_BUT_OK"));
     }
   }
 }
@@ -3735,7 +3735,7 @@ SALOMEDS::Color SMESHGUI::getUniqueColor( const QValueList<SALOMEDS::Color>& the
     {
       aTolerance /= 2;
       if( aTolerance < 1 )
-       break;
+        break;
     }
     //cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<< endl;
 
@@ -3756,9 +3756,9 @@ SALOMEDS::Color SMESHGUI::getUniqueColor( const QValueList<SALOMEDS::Color>& the
       //cout << h << " ";
       if( abs( h - aHue ) < aTolerance )
       {
-       ok = false;
-       //cout << "break (diff = " << abs( h - aHue ) << ")";
-       break;
+        ok = false;
+        //cout << "break (diff = " << abs( h - aHue ) << ")";
+        break;
       }
     }
     //cout << endl;