]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
python dump SetColor() only if the color changes
authoreap <eap@opencascade.com>
Thu, 3 Nov 2011 14:07:53 +0000 (14:07 +0000)
committereap <eap@opencascade.com>
Thu, 3 Nov 2011 14:07:53 +0000 (14:07 +0000)
src/SMESH_I/SMESH_Group_i.cxx

index 2399b77fe9f96b81563d62aee204b9fdf4d53eca..8aa34cd9aaddc0a1aa12b8734fc0d62c79d07902 100644 (file)
@@ -582,8 +582,12 @@ void SMESH_GroupBase_i::SetColor(const SALOMEDS::Color& color)
   if (aGroupDS)
   {
     Quantity_Color aQColor( color.R, color.G, color.B, Quantity_TOC_RGB );
-    aGroupDS->SetColor(aQColor);
-    TPythonDump()<<_this()<<".SetColor( SALOMEDS.Color( "<<color.R<<", "<<color.G<<", "<<color.B<<" ))";
+    Quantity_Color oldColor = aGroupDS->GetColor();
+    if ( oldColor != aQColor )
+    {
+      aGroupDS->SetColor(aQColor);
+      TPythonDump()<<_this()<<".SetColor( SALOMEDS.Color( "<<color.R<<", "<<color.G<<", "<<color.B<<" ))";
+    }
   }
 }