Salome HOME
correction test case H015
[modules/hydro.git] / doc / salome / examples / h009_normalCaseManual.py
index b1d8dfa160d7f6cf17fcc106ccd93b49cd853c9c..aefe53ed9cd72ce337967627f8cbe1ac6db4aafd 100644 (file)
@@ -8,14 +8,14 @@ import salome
 
 salome.salome_init()
 theStudy = salome.myStudy
-  
+
 #----------------------
-# --- HYDRO 
+# --- HYDRO
 #----------------------
 
 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() )
 
@@ -27,7 +27,8 @@ garonne_ign_01.SetName( "garonne_ign_01" )
 garonne_ign_01.SetZLevel( 0 )
 
 
-garonne_ign_01.LoadImage(os.path.join(HYDRO_SAMPLES, "garonne_ign_01.png" ))
+if not(garonne_ign_01.LoadImage(os.path.join(HYDRO_SAMPLES, "garonne_ign_01.png" ))):
+  raise ValueError('problem while loading image')
 
 garonne_ign_01.SetLocalPoints( QPoint( 40, 817 ),
                                QPoint( 1325, 85 ) )
@@ -44,7 +45,8 @@ garonne_ign_02.SetName( "garonne_ign_02" )
 garonne_ign_02.SetZLevel( 1 )
 
 
-garonne_ign_02.LoadImage( os.path.join(HYDRO_SAMPLES, "garonne_ign_02.png" ))
+if not(garonne_ign_02.LoadImage( os.path.join(HYDRO_SAMPLES, "garonne_ign_02.png" ))):
+  raise ValueError('problem while loading image')
 
 garonne_ign_02.SetLocalPoints( QPoint( 1389, 447 ),
                                QPoint( 784, 481 ) )
@@ -197,7 +199,8 @@ Cloud_02 = hydro_doc.CreateObject( KIND_BATHYMETRY )
 Cloud_02.SetName( "Cloud_02" )
 
 Cloud_02.SetAltitudesInverted( 0 )
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+  raise ValueError('problem while loading bathymetry')
 
 Cloud_02.Update()
 
@@ -206,7 +209,8 @@ garonne_point_L93 = hydro_doc.CreateObject( KIND_BATHYMETRY )
 garonne_point_L93.SetName( "garonne_point_L93" )
 
 garonne_point_L93.SetAltitudesInverted( 0 )
-garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))
+if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
+  raise ValueError('problem while loading bathymetry')
 
 garonne_point_L93.Update()
 
@@ -264,33 +268,49 @@ garonne_1.AddGeometryGroup( case_geom_group )
 case_geom_group = litMajeur.GetGroup( 0 )
 garonne_1.AddGeometryGroup( case_geom_group )
 garonne_1.SetBoundaryPolyline( domaine )
+#garonne_1.SetStricklerTable( Strickler_table_1 )
 
 # Start the algorithm of the partition and assignment
 garonne_1.Update()
 garonne_1_litMineur = hydro_doc.FindObjectByName( "garonne_1_Reg_1" )
 garonne_1_Zone_1 = hydro_doc.FindObjectByName( "garonne_1_Zone_1" )
 garonne_1_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMIN )
+garonne_1_Zone_1.SetColor( QColor( 192, 113, 64 ))
 garonne_1_litMineur.AddZone( garonne_1_Zone_1 )
+
 garonne_1_riveDroite = hydro_doc.FindObjectByName( "garonne_1_Reg_2" )
 garonne_1_Zone_2 = hydro_doc.FindObjectByName( "garonne_1_Zone_2" )
+garonne_1_Zone_2.SetColor( QColor( 141, 192, 64 ))
 garonne_1_riveDroite.AddZone( garonne_1_Zone_2 )
+
 garonne_1_Zone_3 = hydro_doc.FindObjectByName( "garonne_1_Zone_3" )
+garonne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object )
+Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" )
+garonne_1_Zone_3.SetMergeObject( Cloud_02 )
+garonne_1_Zone_3.SetColor( QColor( 64, 192, 77 ))
 garonne_1_riveDroite.AddZone( garonne_1_Zone_3 )
+
 garonne_1_riveGauche = hydro_doc.FindObjectByName( "garonne_1_Reg_3" )
 garonne_1_Zone_4 = hydro_doc.FindObjectByName( "garonne_1_Zone_4" )
+garonne_1_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object )
+Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" )
+garonne_1_Zone_4.SetMergeObject( Cloud_02 )
+garonne_1_Zone_4.SetColor( QColor( 64, 75, 192 ))
 garonne_1_riveGauche.AddZone( garonne_1_Zone_4 )
+
 garonne_1_Zone_5 = hydro_doc.FindObjectByName( "garonne_1_Zone_5" )
+garonne_1_Zone_5.SetColor( QColor( 64, 192, 77 ))
 garonne_1_riveGauche.AddZone( garonne_1_Zone_5 )
 
-garonne_1_litMineur.SetName("garonne_1_litMineur")
-garonne_1_riveDroite.SetName("garonne_1_riveDroite")
-garonne_1_riveGauche.SetName("garonne_1_riveGauche")
+garonne_1_litMineur.SetName( "garonne_1_litMineur" )
+garonne_1_riveDroite.SetName( "garonne_1_riveDroite" )
+garonne_1_riveGauche.SetName( "garonne_1_riveGauche" )
 
 # Export of the calculation case
 garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() )
 
 #----------------------
-# --- Geometry 
+# --- Geometry
 #----------------------
 
 # Get geometry shape and print debug information
@@ -321,9 +341,11 @@ geompy.addToStudyInFather( HYDRO_garonne_1, riveGauche, 'riveGauche' )
 geompy.addToStudyInFather( HYDRO_garonne_1, litMineur, 'litMineur' )
 geompy.addToStudyInFather( HYDRO_garonne_1, riveDroite, 'riveDroite' )
 
-controlGeomProps(geompy, riveGauche,  29149.36918,  35992556.454929)
-controlGeomProps(geompy, litMineur,   30337.548492,  3646827.749809)
-controlGeomProps(geompy, riveDroite,  32012.343241, 26177085.460092)
+controlGeomProps(geompy, riveGauche,  29149.36918,  35948828.352061)
+#controlGeomProps(geompy, litMineur,   30337.5484919,  3263628.55399)
+#controlGeomProps(geompy, riveDroite,  32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur,   30337.548492,  3488480.304388)
+controlGeomProps(geompy, riveDroite,  32012.343241, 25998769.23615)
 
 if salome.sg.hasDesktop():
   salome.sg.updateObjBrowser(1)