- QMap<int,int> modeMap;
- _PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
- return QVariant( modeMap.size() > 1 );
+ _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
+ GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
+ return !shape->_is_nil();
+ }
+ return false;
+}
+
+//=======================================================================
+//function : canBreakLink
+//purpose : returns true if selected object is a Shaper object and it can break link
+//=======================================================================
+
+bool SMESHGUI_Selection::canBreakLink( int ind ) const
+{
+ if ( ind >= 0 && ind < myTypes.count()) {
+ if (isReference(ind)) {
+ SUIT_DataOwner* aOwn = myOwners.at(ind);
+ LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>(aOwn);
+ QString aEntry = sowner->entry();
+ _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID(aEntry.toStdString());
+ _PTR(SObject) aFatherObj = aSObject->GetFather();
+ _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent();
+ if (aComponent->ComponentDataType() == "SMESH") {
+ QString aObjEntry = entry(ind);
+ _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString());
+ GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aGeomSObject);
+ if (!aObject->_is_nil())
+ return aObject->IsParametrical();
+ }
+ }