]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug Bug IPAL16080
authorapo <apo@opencascade.com>
Fri, 1 Jun 2007 13:05:54 +0000 (13:05 +0000)
committerapo <apo@opencascade.com>
Fri, 1 Jun 2007 13:05:54 +0000 (13:05 +0000)
 - IOLS. Impossible to display and edit presentations created in 3x

src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_ScalarMap_i.cc

index a9a19426d6dbae2d8218a2bcf8880d53cc3f0bfd..679dd5d7c61ccd0daf63eb9f9e9c9d275ce49ea3 100644 (file)
@@ -259,6 +259,17 @@ VISU::GaussPoints_i
   if(!TSuperClass::Restore(theSObject, theMap))
     return NULL;
 
+  // Check if the icon needs to be updated, update if necessary
+  SALOMEDS::Study_var aStudy = theSObject->GetStudy();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+  SALOMEDS::GenericAttribute_var anAttr = 
+    aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributePixMap");
+  SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+
+  CORBA::String_var aPixMapName = aPixmap->GetPixMap();
+  if(strcmp(GetIconName(), aPixMapName.in()) != 0)
+    aPixmap->SetPixMap(GetIconName());
+
   SetIsActiveLocalScalarBar(Storable::FindValue(theMap,"myIsActiveLocalScalarBar").toInt());
   SetIsDispGlobalScalarBar(Storable::FindValue(theMap,"myIsDispGlobalScalarBar").toInt());
   SetBiColor(Storable::FindValue(theMap,"myIsBiColor").toInt());
index 5d621843e9c0ee033a0c0ccb66b9118baba39b07..58996e3f9bb65e244efc4ada3f72af6b1064c1fb 100644 (file)
@@ -256,17 +256,31 @@ VISU::ScalarMap_i
 
   UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt());
 
-  QString aGeomNames = VISU::Storable::FindValue(theMap, "myGeomNameList");
-  QStringList aGeomNameList = QStringList::split("|", aGeomNames);
-  int aNbOfGroups = aGeomNameList.count();
-  if(aNbOfGroups > 0){
-    RemoveAllGeom();
-    for(int aGroupNum = 0; aGroupNum < aNbOfGroups; aGroupNum++){
-      QString aGroupName = aGeomNameList[aGroupNum];
-      AddMeshOnGroup(aGroupName.latin1());
+  bool anIsExists;
+  QString aGeomNames = VISU::Storable::FindValue(theMap, "myGeomNameList", &anIsExists);
+  if(anIsExists){
+    QStringList aGeomNameList = QStringList::split("|", aGeomNames);
+    int aNbOfGroups = aGeomNameList.count();
+    if(aNbOfGroups > 0){
+      RemoveAllGeom();
+      for(int aGroupNum = 0; aGroupNum < aNbOfGroups; aGroupNum++){
+       QString aGroupName = aGeomNameList[aGroupNum];
+       AddMeshOnGroup(aGroupName.latin1());
+      }
     }
   }
 
+  // Check if the icon needs to be updated, update if necessary
+  SALOMEDS::Study_var aStudy = theSObject->GetStudy();
+  SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+  SALOMEDS::GenericAttribute_var anAttr = 
+    aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributePixMap");
+  SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+
+  CORBA::String_var aPixMapName = aPixmap->GetPixMap();
+  if(strcmp(GetIconName(), aPixMapName.in()) != 0)
+    aPixmap->SetPixMap(GetIconName());
+
   return this;
 }