Salome HOME
Call BreakLinks method
authorvsv <vsv@opencascade.com>
Fri, 20 Dec 2019 13:13:06 +0000 (16:13 +0300)
committervsv <vsv@opencascade.com>
Fri, 20 Dec 2019 13:13:06 +0000 (16:13 +0300)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_Selection.cxx

index 5a3747d0ca34696eb8f3af68b23e371305b18f2e..776e7653ceda3727929c207ed060b5496865ea68 100644 (file)
@@ -1400,7 +1400,9 @@ namespace
             QObject::tr("MSG_BREAK_SHAPER_LINK").arg(aName.c_str()),
             SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No);
           if (aRes == SUIT_MessageBox::Yes) {
-            // Remove link here
+            GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aSObj);
+            if (!aObject->_is_nil())
+              aObject->BreakLinks();
           }
         }
       }
index d4b79054e6c4471eba61e351cedb3a3510685cb4..c7933455469e33d5890a6c6f92524354a85de287 100644 (file)
@@ -614,8 +614,10 @@ bool SMESHGUI_Selection::hasGeomReference( int ind ) const
 bool SMESHGUI_Selection::canBreakLink( int ind ) const
 {
   if ( ind >= 0 && ind < myTypes.count()) {
-    _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
-    return true;
+    _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
+    GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aSObject);
+    if (!aObject->_is_nil())
+      return aObject->IsParametrical();
   }
   return false;
 }