From d05cce1e6e4d3336b2aad291e5e2be6b5c854205 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 3 Apr 2009 14:30:54 +0000 Subject: [PATCH] 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); --- src/SMESH_I/SMESH_Gen_i.hxx | 3 +++ src/SMESH_I/SMESH_Gen_i_1.cxx | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) 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 : -- 2.39.2