From: eap Date: Fri, 3 Apr 2009 14:30:54 +0000 (+0000) Subject: 0020210: EDF SMESH 976: Update of a smesh group after modification of the associated... X-Git-Tag: V4_1_5rc1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d05cce1e6e4d3336b2aad291e5e2be6b5c854205;p=modules%2Fsmesh.git 0020210: EDF SMESH 976: Update of a smesh group after modification of the associated geom group + static void SetPixMap(SALOMEDS::SObject_ptr theSObject, + const char* thePixMap); --- diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 591ca8bcc..0e2823458 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -439,6 +439,9 @@ public: const char* theName, const char* theDefaultName = 0); + static void SetPixMap(SALOMEDS::SObject_ptr theSObject, + const char* thePixMap); + // Get study context StudyContext* GetCurrentStudyContext(); diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index cfdd8fb07..c309e87a6 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -298,6 +298,25 @@ void SMESH_Gen_i::SetName(SALOMEDS::SObject_ptr theSObject, } } +//======================================================================= +//function : SetPixMap +//purpose : +//======================================================================= + +void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject, + const char* thePixMap) +{ + if ( !theSObject->_is_nil() && thePixMap && strlen( thePixMap )) + { + SALOMEDS::Study_var aStudy = theSObject->GetStudy(); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + SALOMEDS::GenericAttribute_var anAttr = + aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributePixMap" ); + SALOMEDS::AttributePixMap_var aPMAttr = SALOMEDS::AttributePixMap::_narrow( anAttr ); + aPMAttr->SetPixMap( thePixMap ); + } +} + //======================================================================= //function : addReference //purpose :