+
+//=======================================================================
+//function : hasAlgo
+//purpose : return true if a mesh was computed with errors
+//=======================================================================
+
+bool SMESHGUI_Selection::hasErrors( int ind ) const
+{
+ if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh"))
+ {
+ _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toStdString() );
+ CORBA::Object_var obj = SMESH::SObjectToObject( meshSO );
+ SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj );
+ if ( !CORBA::is_nil( mesh ) )
+ {
+ SMESH::SMESH_Gen_var gen = SMESHGUI::GetSMESHGUI()->GetSMESHGen();
+ GEOM::GEOM_Object_var geom = mesh->GetShapeToMesh();
+ SMESH::compute_error_array_var compErrors = gen->GetComputeErrors( mesh, geom );
+ return compErrors->length();
+ }
+ }
+ return false;
+}
+
+//=======================================================================
+//function : isComputable
+//purpose : Return true if a [sub-]mesh does not have "computed" icon
+//=======================================================================
+
+bool SMESHGUI_Selection::isComputable( int ind ) const
+{
+ if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh" ||
+ myTypes[ind].startsWith("Mesh " )))
+ {
+ _PTR(GenericAttribute) attr;
+ if ( _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toStdString() ))
+ if ( meshSO->FindAttribute( attr, "AttributePixMap" ))
+ {
+ _PTR(AttributePixMap) pixmap = attr;
+ return ( pixmap->GetPixMap() != "ICON_SMESH_TREE_MESH" );
+ }
+ }
+ return false;
+}
+