From c47c00f480879555202a9fc5403de887dad3ad99 Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 20 Dec 2019 16:13:06 +0300 Subject: [PATCH] Call BreakLinks method --- src/SMESHGUI/SMESHGUI.cxx | 4 +++- src/SMESHGUI/SMESHGUI_Selection.cxx | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 5a3747d0c..776e7653c 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -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(aSObj); + if (!aObject->_is_nil()) + aObject->BreakLinks(); } } } diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index d4b79054e..c79334554 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -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(aSObject); + if (!aObject->_is_nil()) + return aObject->IsParametrical(); } return false; } -- 2.39.2