Salome HOME
fix problem with nodes/elements IDS
authorptv <ptv@opencascade.com>
Fri, 6 Feb 2009 12:12:50 +0000 (12:12 +0000)
committerptv <ptv@opencascade.com>
Fri, 6 Feb 2009 12:12:50 +0000 (12:12 +0000)
src/Controls/SMESH_Controls.cxx

index 45e9f79ea7c6ac98b2796f3a7e1e56bfc2133155..8ba13a8f1f4e0727d548282be267cb69b4fbe571 100644 (file)
@@ -1877,10 +1877,13 @@ void GroupColor::SetMesh( const SMDS_Mesh* theMesh )
     if ( myType != SMDSAbs_All && myType != (SMDSAbs_ElementType)aGrp->GetType() )
       continue;
 
-    // add elements IDS into control
-    int aSize = aGrp->Extent();
-    for (int i = 0; i < aSize; i++)
-      myIDs.insert( aGrp->GetID(i+1) );
+    SMDSAbs_ElementType aGrpElType = (SMDSAbs_ElementType)aGrp->GetType();
+    if ( myType == aGrpElType || (myType == SMDSAbs_All && aGrpElType != SMDSAbs_Node) ) {
+      // add elements IDS into control
+      int aSize = aGrp->Extent();
+      for (int i = 0; i < aSize; i++)
+        myIDs.insert( aGrp->GetID(i+1) );
+    }
   }
 }