Call BreakLinks method

This commit is contained in:
vsv 2019-12-20 16:13:06 +03:00
parent b8ddb1330c
commit c47c00f480
2 changed files with 7 additions and 3 deletions

View 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();
}
}
}

View 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;
}