Salome HOME
Another fix like previous one.
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i_1.cxx
index b0701ea596b22275ba4b38fcc0def7b32aea948f..a001e6a83d4513286831cadd7bfcda906e9f1e4d 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  : 
@@ -569,7 +588,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SALOMEDS::Study_ptr      theS
     }
     // Find submesh sub-tree tag
     long aRootTag;
-    char* aRootName = "";
+    const char* aRootName = "";
     switch ( theShapeObject->GetShapeType() ) {
     case GEOM::VERTEX:
       aRootTag  = GetSubMeshOnVertexTag();
@@ -655,7 +674,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
     }
     int aType = (int)theGroup->GetType();
     const char* aRootNames[] = {
-      "Compound Groups", "Groups of Nodes",
+      "Compound Groups", "Groups of Nodes", "Group of 0D Elements",
       "Groups of Edges", "Groups of Faces", "Groups of Volumes" };
 
     // Currently, groups with heterogenous content are not supported
@@ -665,7 +684,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
       // Find or create groups root
       SALOMEDS::SObject_var aRootSO = publish (theStudy, CORBA::Object::_nil(),
                                                aMeshSO, aRootTag, 0, false );
-      if ( aType < 5 )
+      if ( aType < 6 )
         SetName( aRootSO, aRootNames[aType] );
 
       // Add new group to corresponding sub-tree