]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
dump zones color in calculation case
authorPaul RASCLE <paul.rascle@edf.fr>
Sat, 2 Jul 2016 21:24:32 +0000 (23:24 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Sat, 2 Jul 2016 21:24:32 +0000 (23:24 +0200)
doc/salome/examples/h016_pilesPontManualMesh.py
src/HYDROData/HYDROData_Region.cxx
src/HYDROPy/HYDROData_Entity.sip

index f075bc4f8066de427d364d714414046d797cd3c9..35a4e795b0fe3d911d9bb471481b7042caadc505 100644 (file)
@@ -962,47 +962,58 @@ casGaronne_1.SetBoundaryPolyline( domaine )
 casGaronne_1.Update()
 casGaronne_1_riveDroite = hydro_doc.FindObjectByName( "casGaronne_1_Reg_1" )
 casGaronne_1_Zone_1 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_1" )
+casGaronne_1_Zone_1.SetColor( QColor( 64, 192, 147 ))
 casGaronne_1_riveDroite.AddZone( casGaronne_1_Zone_1 )
 casGaronne_1_Zone_2 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_2" )
+casGaronne_1_Zone_2.SetColor( QColor( 111, 192, 64 ))
 casGaronne_1_riveDroite.AddZone( casGaronne_1_Zone_2 )
 casGaronne_1_aval = hydro_doc.FindObjectByName( "casGaronne_1_Reg_2" )
 casGaronne_1_Zone_3 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_3" )
 casGaronne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object )
 garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" )
 casGaronne_1_Zone_3.SetMergeObject( garonne_point_L93 )
+casGaronne_1_Zone_3.SetColor( QColor( 192, 183, 64 ))
 casGaronne_1_aval.AddZone( casGaronne_1_Zone_3 )
 casGaronne_1_riveGauche = hydro_doc.FindObjectByName( "casGaronne_1_Reg_3" )
 casGaronne_1_Zone_4 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_4" )
+casGaronne_1_Zone_4.SetColor( QColor( 158, 192, 64 ))
 casGaronne_1_riveGauche.AddZone( casGaronne_1_Zone_4 )
 casGaronne_1_Zone_6 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_6" )
+casGaronne_1_Zone_6.SetColor( QColor( 64, 192, 156 ))
 casGaronne_1_riveGauche.AddZone( casGaronne_1_Zone_6 )
 casGaronne_1_pont = hydro_doc.FindObjectByName( "casGaronne_1_Reg_4" )
 casGaronne_1_Zone_5 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_5" )
 casGaronne_1_Zone_5.SetMergeType( HYDROData_Zone.Merge_Object )
 garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" )
 casGaronne_1_Zone_5.SetMergeObject( garonne_point_L93 )
+casGaronne_1_Zone_5.SetColor( QColor( 192, 85, 64 ))
 casGaronne_1_pont.AddZone( casGaronne_1_Zone_5 )
 casGaronne_1_amont = hydro_doc.FindObjectByName( "casGaronne_1_Reg_5" )
 casGaronne_1_Zone_7 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_7" )
 casGaronne_1_Zone_7.SetMergeType( HYDROData_Zone.Merge_Object )
 garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" )
 casGaronne_1_Zone_7.SetMergeObject( garonne_point_L93 )
+casGaronne_1_Zone_7.SetColor( QColor( 64, 90, 192 ))
 casGaronne_1_amont.AddZone( casGaronne_1_Zone_7 )
 casGaronne_1_pile1 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_6" )
 casGaronne_1_Zone_8 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_8" )
 casGaronne_1_Zone_8.SetMergeType( HYDROData_Zone.Merge_ZMAX )
+casGaronne_1_Zone_8.SetColor( QColor( 64, 190, 192 ))
 casGaronne_1_pile1.AddZone( casGaronne_1_Zone_8 )
 casGaronne_1_pile2 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_7" )
 casGaronne_1_Zone_9 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_9" )
 casGaronne_1_Zone_9.SetMergeType( HYDROData_Zone.Merge_ZMAX )
+casGaronne_1_Zone_9.SetColor( QColor( 160, 192, 64 ))
 casGaronne_1_pile2.AddZone( casGaronne_1_Zone_9 )
 casGaronne_1_pile3 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_8" )
 casGaronne_1_Zone_10 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_10" )
 casGaronne_1_Zone_10.SetMergeType( HYDROData_Zone.Merge_ZMAX )
+casGaronne_1_Zone_10.SetColor( QColor( 192, 166, 64 ))
 casGaronne_1_pile3.AddZone( casGaronne_1_Zone_10 )
 casGaronne_1_pile4 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_9" )
 casGaronne_1_Zone_11 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_11" )
 casGaronne_1_Zone_11.SetMergeType( HYDROData_Zone.Merge_ZMAX )
+casGaronne_1_Zone_11.SetColor( QColor( 64, 192, 92 ))
 casGaronne_1_pile4.AddZone( casGaronne_1_Zone_11 )
 casGaronne_1_riveDroite.SetName( "casGaronne_1_riveDroite" )
 casGaronne_1_aval.SetName( "casGaronne_1_aval" )
index 0a0604d84e71dbcee638c651714de1a63149b205..698cfc944925502b5744e9ae3adc281bc39b5523 100644 (file)
@@ -44,6 +44,7 @@
 #include <ShapeUpgrade_UnifySameDomain.hxx>
 
 #include <QStringList>
+#include <QColor>
 
 //#define DEB_GET_REGION_SHAPE
 
@@ -433,9 +434,13 @@ QStringList HYDROData_Region::DumpToPython( const QString&       thePyScriptPath
                                                         .arg( aMergeObject->GetObjPyName() );
       }
     }
-
+    // set color
+    QColor zoneColor = aZone->GetColor(Qt::darkBlue);
+    aResList << QString( "%1.SetColor( QColor( %2, %3, %4 ))" )
+                 .arg( aZone->GetObjPyName() ).arg( zoneColor.red() ).arg( zoneColor.green() ).arg( zoneColor.blue() );
     // add zone
     setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aZone, "AddZone" );
+
   }
 
   return aResList;
index fda3ec35f600f2b261d308cce52eb00da927b7ba..4eae394f4e86a03f2095e38d41481646ffb62c6a 100644 (file)
@@ -256,7 +256,8 @@ public:
    */
   virtual void RemoveZLevel();
 
-
+   void SetColor( const QColor& theColor, const int theTag = 0 );
+   
 protected:
 
   /**