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:54 +0000 (14:30 +0000)
committereap <eap@opencascade.com>
Fri, 3 Apr 2009 14:30:54 +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 591ca8bcc7434d9320864bb6cf271566dd9a1983..0e2823458f6dbf545df17ad60f4e5044f23dccf6 100644 (file)
@@ -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();
 
index cfdd8fb07eb1d4b904978d35ea2594d79fceea9f..c309e87a61be532c556978e5a2f46bdac0d70aba 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  :