Salome HOME
Dump to python corrected.
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.cxx
index 797973eaef0d0f273a94d6efdcd6db55ca93602e..af16992f00e20e3650b3aad5bf2602def70de7b9 100644 (file)
@@ -527,9 +527,25 @@ void HYDROData_Entity::setPythonReferenceObject( MapOfTreatedObjects&
 
   if ( anIsToSetObject )
   {
+    QString anObjName = GetObjPyName();
     theScript << QString( "%1.%2( %3 );" )
-                 .arg( GetObjPyName() ).arg( theMethod ).arg( aRefObjName );
+                 .arg( anObjName ).arg( theMethod ).arg( aRefObjName );
   }
 }
 
+void HYDROData_Entity::setPythonObjectColor( QStringList&         theScript,
+                                             const QColor&        theColor,
+                                             const QColor&        theDefaultColor,
+                                             const QString&       theMethod ) const
+{
+  if ( theColor == theDefaultColor )
+    return; //Do not set the color for object if it like default
+
+  QString anObjName = GetObjPyName();
+  theScript << QString( "%1.%2( QColor( %3, %4, %5, %6 ) );" )
+              .arg( anObjName ).arg( theMethod )
+              .arg( theColor.red()  ).arg( theColor.green() )
+              .arg( theColor.blue() ).arg( theColor.alpha() );
+}
+