Salome HOME
IPAL54678: TC-9.5.0: Sub-mesh priority: not all sub-meshes are displayed in the dialog
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshOp.cxx
index ed9e8d63c57f7e81e6ccad65349251c2d78494c5..f143b01368028d22786f5fbffe3f0f18907da481 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -349,7 +349,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
     GEOM::GEOM_Gen_var geomGen = mainGeom->GetGen();
     if (geomGen->_is_nil()) return false;
 
-    GEOM::GEOM_IGroupOperations_ptr op = geomGen->GetIGroupOperations();
+    GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
     if (op->_is_nil()) return false;
 
     // check all selected shapes
@@ -1913,6 +1913,7 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName )
   if ( aHypoSet->toUseCommonSize() && !getAverageSize( myAverageSize ))
     return;
 
+  int maxDim = -1;
   for ( int isAlgo = 1; isAlgo >= 0; --isAlgo )
     for ( aHypoSet->init( isAlgo, setType ); aHypoSet->more(); aHypoSet->next() )
     {
@@ -1930,6 +1931,7 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName )
         {
           setCurrentHyp( myDim, Algo, index );
           onAlgoSelected( index, myDim );
+          maxDim = Max( maxDim, myDim );
         }
       }
       else
@@ -1963,6 +1965,9 @@ void SMESHGUI_MeshOp::onHypoSet( const QString& theSetName )
       }
     }
 
+  if ( maxDim > 0 )
+    myDlg->setCurrentTab( maxDim );
+
   return;
 }
 
@@ -2140,7 +2145,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
     // create a GEOM group
     GEOM::GEOM_Gen_var geomGen = mainGeom->GetGen();
     if ( !geomGen->_is_nil() ) {
-      GEOM::GEOM_IGroupOperations_ptr op = geomGen->GetIGroupOperations();
+      GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
       if ( !op->_is_nil() )
       {
         // check and add all selected GEOM objects: they must be