From: eap Date: Fri, 3 Apr 2009 14:30:42 +0000 (+0000) Subject: 0020210: EDF SMESH 976: Update of a smesh group after modification of the associated... X-Git-Tag: V5_1_2rc1~67 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=908ed4f2a285deec72b4407f7ab3979c306f1ca8;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 836e585c7..d10b59ef2 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -464,6 +464,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 b0701ea59..bb0b0c705 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 :