Salome HOME
correction test case H015
[modules/hydro.git] / doc / salome / examples / h014_caseDigueManualInterpolZ.py
index c5782efd2273f34713b0ff1bb9efbd48d2ce2fd8..d5469b30eaf4a6474a04e52da3f8490f880158f2 100644 (file)
@@ -14,8 +14,8 @@ theStudy = salome.myStudy
 #----------------------
 
 from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
 
 hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
 
@@ -344,24 +344,42 @@ garonne_2.SetBoundaryPolyline( domaine );
 
 # Start the algorithm of the partition and assignment
 garonne_2.Update();
-garonne_2_litMineur = hydro_doc.FindObjectByName( "garonne_2_Reg_1" );
-garonne_2_Zone_1 = hydro_doc.FindObjectByName( "garonne_2_Zone_1" );
+
+garonne_2_litMineur = hydro_doc.FindObjectByName( "garonne_2_Reg_1" )
+garonne_2_Zone_1 = hydro_doc.FindObjectByName( "garonne_2_Zone_1" )
 garonne_2_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN )
-garonne_2_litMineur.AddZone( garonne_2_Zone_1 );
-garonne_2_riveDroite = hydro_doc.FindObjectByName( "garonne_2_Reg_2" );
-garonne_2_Zone_2 = hydro_doc.FindObjectByName( "garonne_2_Zone_2" );
-garonne_2_riveDroite.AddZone( garonne_2_Zone_2 );
-garonne_2_Zone_3 = hydro_doc.FindObjectByName( "garonne_2_Zone_3" );
-garonne_2_riveDroite.AddZone( garonne_2_Zone_3 );
-garonne_2_riveGauche = hydro_doc.FindObjectByName( "garonne_2_Reg_3" );
-garonne_2_Zone_4 = hydro_doc.FindObjectByName( "garonne_2_Zone_4" );
-garonne_2_riveGauche.AddZone( garonne_2_Zone_4 );
-garonne_2_Zone_5 = hydro_doc.FindObjectByName( "garonne_2_Zone_5" );
-garonne_2_riveGauche.AddZone( garonne_2_Zone_5 );
-garonne_2_digue = hydro_doc.FindObjectByName( "garonne_2_Reg_4" );
-garonne_2_Zone_6 = hydro_doc.FindObjectByName( "garonne_2_Zone_6" );
+garonne_2_Zone_1.SetColor( QColor( 192, 137, 64 ))
+garonne_2_litMineur.AddZone( garonne_2_Zone_1 )
+
+garonne_2_riveDroite = hydro_doc.FindObjectByName( "garonne_2_Reg_2" )
+garonne_2_Zone_2 = hydro_doc.FindObjectByName( "garonne_2_Zone_2" )
+garonne_2_Zone_2.SetColor( QColor( 64, 192, 98 ))
+garonne_2_riveDroite.AddZone( garonne_2_Zone_2 )
+
+garonne_2_Zone_3 = hydro_doc.FindObjectByName( "garonne_2_Zone_3" )
+garonne_2_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object )
+Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" )
+garonne_2_Zone_3.SetMergeObject( Cloud_02 )
+garonne_2_Zone_3.SetColor( QColor( 64, 66, 192 ))
+garonne_2_riveDroite.AddZone( garonne_2_Zone_3 )
+
+garonne_2_riveGauche = hydro_doc.FindObjectByName( "garonne_2_Reg_3" )
+garonne_2_Zone_4 = hydro_doc.FindObjectByName( "garonne_2_Zone_4" )
+garonne_2_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object )
+Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" )
+garonne_2_Zone_4.SetMergeObject( Cloud_02 )
+garonne_2_Zone_4.SetColor( QColor( 64, 192, 164 ))
+garonne_2_riveGauche.AddZone( garonne_2_Zone_4 )
+
+garonne_2_Zone_5 = hydro_doc.FindObjectByName( "garonne_2_Zone_5" )
+garonne_2_Zone_5.SetColor( QColor( 192, 149, 64 ))
+garonne_2_riveGauche.AddZone( garonne_2_Zone_5 )
+
+garonne_2_digue = hydro_doc.FindObjectByName( "garonne_2_Reg_4" )
+garonne_2_Zone_6 = hydro_doc.FindObjectByName( "garonne_2_Zone_6" )
 garonne_2_Zone_6.SetMergeType( HYDROData_Zone.Merge_ZMAX )
-garonne_2_digue.AddZone( garonne_2_Zone_6 );
+garonne_2_Zone_6.SetColor( QColor( 64, 192, 177 ))
+garonne_2_digue.AddZone( garonne_2_Zone_6 )
 
 garonne_2_litMineur.SetName("garonne_2_litMineur")
 garonne_2_riveDroite.SetName("garonne_2_riveDroite")
@@ -396,11 +414,11 @@ geompy.addToStudyInFather( HYDRO_garonne_2, litMineur, 'litMineur' )
 geompy.addToStudyInFather( HYDRO_garonne_2, riveDroite, 'riveDroite' )
 
 SectionsGaronne = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(SectionsGaronne, [4, 11])
+geompy.UnionIDs(SectionsGaronne, [7, 9])
 geompy.addToStudyInFather( HYDRO_garonne_2, SectionsGaronne, 'SectionsGaronne' )
 
 SectionsDigue = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(SectionsDigue, [46, 50])
+geompy.UnionIDs(SectionsDigue, [40, 35])
 geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' )
 
 # --- recreate subshapes already exported from HYDRO to get access from Python
@@ -417,12 +435,8 @@ geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' )
 #garonne_2_digue_Right_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
 #geompy.UnionIDs(garonne_2_digue_Right_Bank, [48])
 
-#controlGeomProps(geompy, riveGauche,  39489.5116033, 35889668.8348)
-#controlGeomProps(geompy, digue,       10340.1424233,   102887.6201)
-#controlGeomProps(geompy, litMineur,   30337.5484919,  3646827.74981)
-#controlGeomProps(geompy, riveDroite,  32012.3432411,  26177085.4601)
-controlGeomProps(geompy, riveGauche,  39493.270283, 35845790.613557)
-controlGeomProps(geompy, digue,       10340.1424233,   102887.6201)
+controlGeomProps(geompy, riveGauche,  39490.835288, 35845737.590926)
+controlGeomProps(geompy, digue,       10341.466108,   103090.760662)
 controlGeomProps(geompy, litMineur,   30337.548492,  3488480.304388)
 controlGeomProps(geompy, riveDroite,  32012.343241, 25998769.23615)
 
@@ -560,7 +574,7 @@ zUndef = 90
 
 # --- Z interpolation on the bathymety/altimetry on the mesh nodes
 statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef)
-refstatz = {'riveDroite': (10.88, 32.47999954), 'riveGauche': (7.72, 71.38999939), 'litMineur': (2.06, 25.41), 'digue': (14.10,27.09)}
+refstatz = {'riveDroite': (10.88, 32.61), 'riveGauche': (7.72, 71.86, 0.5), 'litMineur': (2.06, 25.41), 'digue': (14.10,27.09)}
 controlStatZ(statz, refstatz)
 
 # --- add a field on nodes of type double with z values, named "BOTTOM"