From: vsv Date: Fri, 20 Dec 2019 13:13:06 +0000 (+0300) Subject: Call BreakLinks method X-Git-Tag: V9_5_0a1~5^2~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c47c00f480879555202a9fc5403de887dad3ad99;p=modules%2Fsmesh.git Call BreakLinks method --- 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; }