Salome HOME
Fix sub-mesh creation by selection of mesh element + remove dead actors after BreakLink
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshOp.cxx
index 5d097f23b8819d66b704d513562b2daa6af07e09..36b530a391a342b0a4d0d9af2fece78bb2f98a2f 100644 (file)
@@ -338,10 +338,10 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
   myDlg->selectedObject(SMESHGUI_MeshDlg::Geom, aGEOMs);
 
   if (aGEOMs.count() > 0) {
-    GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
+    GEOM::GEOM_Gen_var geomGen = mainGeom->GetGen();
     if (geomGen->_is_nil()) return false;
 
-    GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
+    GEOM::GEOM_IGroupOperations_ptr op = geomGen->GetIGroupOperations();
     if (op->_is_nil()) return false;
 
     // check all selected shapes
@@ -1461,6 +1461,7 @@ void SMESHGUI_MeshOp::setFilteredAlgoData()
   updateHypoSets(); // it sets myAvailableHypData by curMeshType
 
   // restore current algorithms according to changed myAvailableHypData
+  algosAvailable.clear();
   for ( int dim = 0; dim <= 3; ++dim )
   {
     int algoIndex = myAvailableHypData[ dim ][ Algo ].indexOf( curAlgos[ dim ]);
@@ -1853,11 +1854,11 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
   else if (aGEOMs.count() > 1)
   {
     // create a GEOM group
-    GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
-    if (!geomGen->_is_nil()) {
-      GEOM::GEOM_IGroupOperations_wrap op =
-        geomGen->GetIGroupOperations();
-      if (!op->_is_nil()) {
+    GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen( mainGeom );
+    if ( !geomGen->_is_nil() ) {
+      GEOM::GEOM_IGroupOperations_ptr op = geomGen->GetIGroupOperations();
+      if ( !op->_is_nil() )
+      {
         // check and add all selected GEOM objects: they must be
         // a sub-shapes of the main GEOM and must be of one type
         int iSubSh = 0;
@@ -2329,7 +2330,7 @@ int SMESHGUI_MeshOp::find( const SMESH::SMESH_Hypothesis_var& theHyp,
   * \param theMess - Output parameter intended for returning error message
   * \retval bool  - TRUE if mesh is edited successfully, FALSE otherwise
  *
- * Assigns new name hypotheses and algoriths to the mesh or sub-mesh
+ * Assigns new name hypotheses and algorithms to the mesh or sub-mesh
  */
 //================================================================================
 bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess )