Salome HOME
0020210: EDF SMESH 976: Update of a smesh group after modification of the associated...
authoreap <eap@opencascade.com>
Fri, 3 Apr 2009 14:30:42 +0000 (14:30 +0000)
committereap <eap@opencascade.com>
Fri, 3 Apr 2009 14:30:42 +0000 (14:30 +0000)
+  static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
+                        const char*           thePixMap);

src/SMESH_I/SMESH_Gen_i.hxx
src/SMESH_I/SMESH_Gen_i_1.cxx

index 836e585c70004c0409cf23974689043074ae50d4..d10b59ef207a97b097625d25e718712d68e3675c 100644 (file)
@@ -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();
 
index b0701ea596b22275ba4b38fcc0def7b32aea948f..bb0b0c7052771b4096f744431d1911e538b41a99 100644 (file)
@@ -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  :