X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i_1.cxx;h=a2577de8bfe8428074df27ed729c3049ec4deca4;hb=498e1712b4f1a11a3aa3c999b5af5b3eeed9f3d4;hp=d7d61bcafd70381b50a07fb5ca2d8194e28289cd;hpb=d245f797f1b69aca678fa372391275d7042faa10;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index d7d61bcaf..a2577de8b 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -40,7 +40,9 @@ #include #include #include -#include +#include "SALOMEDS_Study_i.hxx" +#include "SALOME_KernelServices.hxx" +#include "SALOME_ModuleCatalog_impl.hxx" #include #include @@ -215,7 +217,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(CORBA::Object_ptr theObject) //======================================================================= SALOMEDS::Study_var SMESH_Gen_i::getStudyServant() { - return SALOMEDS::Study::_duplicate(KERNEL::getStudyServant()); + return SALOMEDS::Study::_duplicate(KERNEL::getStudyServantSA()); } //======================================================================= @@ -503,10 +505,9 @@ static void addReference (SALOMEDS::SObject_ptr theSObject, */ //============================================================================= -SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObject, +SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr /*theSObject*/, CORBA::Object_ptr theIOR, const char* theName) - throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); SALOMEDS::SObject_wrap aSO; @@ -588,8 +589,7 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent() // If component for this SMESH engine does not exist in the study, create it - SALOME_ModuleCatalog::ModuleCatalog_var aCat = - SALOME_ModuleCatalog::ModuleCatalog::_narrow( GetNS()->Resolve("/Kernel/ModulCatalog") ); + SALOME_ModuleCatalog::ModuleCatalog_var aCat = KERNEL::getModuleComponentServantSA(); if ( CORBA::is_nil( aCat ) ) return father._retn(); @@ -1009,8 +1009,23 @@ void SMESH_Gen_i::UpdateIcons( SMESH::SMESH_Mesh_ptr theMesh ) { SMESH::array_of_ElementType_var elemTypes = idSrc->GetTypes(); isEmpty = ( elemTypes->length() == 0 ); + + if ( !isEmpty ) + { + // check if all sub-shapes of sub-mesh on group are computed + // (pb: "Compute sub-mesh" menu is missing if a sub-mesh is partially computed) + SMESH::SMESH_subMesh_var subMesh = SMESH::SMESH_subMesh::_narrow( obj ); + if ( !subMesh->_is_nil() ) + if ( SMESH_subMesh* sm = mesh_i->GetImpl().GetSubMeshContaining( subMesh->GetId() )) + if ( sm->IsComputedPartially() ) + { + SetPixMap( so, "ICON_SMESH_TREE_MESH_PARTIAL" ); + continue; + } + } } } + if ( isEmpty ) SetPixMap( so, "ICON_SMESH_TREE_MESH_WARN"); else if ( !isGroup ) @@ -1019,8 +1034,9 @@ void SMESH_Gen_i::UpdateIcons( SMESH::SMESH_Mesh_ptr theMesh ) SetPixMap( so, "ICON_SMESH_TREE_GROUP_ON_FILTER" ); else SetPixMap( so, "ICON_SMESH_TREE_GROUP" ); - } - } + + } // loop on sub-meshes or groups + } // loop on roots } //=======================================================================