X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=6117d454742e8c3c4bb6ef369673f683e770e2f8;hb=59fe51ff7f83a733aee46ecad7adb391bc4323bf;hp=5e4bba536096ae18e05d66867cc03b59ae236f84;hpb=ab494e654ae6e3b7cc7c272dc09f8aedc6ffddae;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 5e4bba536..6117d4547 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -731,6 +731,25 @@ void SMESH_Gen_i::UpdateStudy() } } +//================================================================================ +/*! + * \brief Return true if mesh has ICON_SMESH_TREE_GEOM_MODIF icon + */ +//================================================================================ + +bool SMESH_Gen_i::isGeomModifIcon( SMESH::SMESH_Mesh_ptr mesh ) +{ + SALOMEDS::SObject_wrap so = ObjectToSObject( mesh ); + SALOMEDS::GenericAttribute_wrap attr; + if ( ! so->_is_nil() && so->FindAttribute( attr.inout(), "AttributePixMap" )) + { + SALOMEDS::AttributePixMap_wrap pm = attr; + CORBA::String_var ico = pm->GetPixMap(); + return ( strcmp( ico.in(), "ICON_SMESH_TREE_GEOM_MODIF" ) == 0 ); + } + return false; +} + //================================================================================= // function : hasObjectInfo() // purpose : shows if module provides information for its objects @@ -756,18 +775,9 @@ char* SMESH_Gen_i::getObjectInfo( const char* entry ) SALOMEDS::SObject_wrap so = getStudyServant()->FindObjectID( entry ); CORBA::Object_var obj = SObjectToObject( so ); SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( obj ); - if ( !mesh->_is_nil() ) + if ( isGeomModifIcon( mesh )) { - SALOMEDS::GenericAttribute_wrap attr; - if ( so->FindAttribute( attr.inout(), "AttributePixMap" )) - { - SALOMEDS::AttributePixMap_wrap pm = attr; - CORBA::String_var ico = pm->GetPixMap(); - if ( strcmp( ico.in(), "ICON_SMESH_TREE_GEOM_MODIF" ) == 0 ) - { - txt << "The geometry was changed and the mesh needs to be recomputed"; - } - } + txt << "The geometry was changed and the mesh needs to be recomputed"; } if ( txt.empty() ) @@ -2019,7 +2029,10 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, SMESH_Mesh_i* meshServant = SMESH::DownCast( theMesh ); ASSERT( meshServant ); if ( meshServant ) { - meshServant->Load(); + if ( isGeomModifIcon( theMesh )) + meshServant->Clear(); + else + meshServant->Load(); // NPAL16168: "geometrical group edition from a submesh don't modify mesh computation" meshServant->CheckGeomModif(); // get local TopoDS_Shape