X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Selection.cxx;h=5abe5c5be61812c0d1b17777e7a921e28c191f5a;hp=d4b79054e6c4471eba61e351cedb3a3510685cb4;hb=9beb8d27644a2b0e2585bea7f990457a3d80d643;hpb=b8ddb1330cad42ad5381912dd267d1e39182daae diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index d4b79054e..5abe5c5be 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -613,9 +613,24 @@ 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; + if ( ind >= 0 && isReference(ind) ) { + QString aEntry = objectInfo(ind, OI_RefEntry).toString(); + if (!aEntry.isEmpty()) { + _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID( aEntry.toStdString()); + if (aSObject) { + _PTR(SObject) aFatherObj = aSObject->GetFather(); + if (aFatherObj) { + _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent(); + if (aComponent && aComponent->ComponentDataType() == "SMESH") { + QString aObjEntry = entry(ind); + _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString()); + GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface(aGeomSObject); + if (!aObject->_is_nil()) + return aObject->IsParametrical(); + } + } + } + } } return false; }