Salome HOME
Porting on OCCT 7.0 and Qt 5. Make compilable version.
[modules/hydro.git] / doc / salome / examples / h012_caseDigueManual.py
index 6026c53122a33e76a9a461d09870fdf06ac3684c..7bb8be11243da51e62a1a21f4e7966d5aa8585a8 100644 (file)
@@ -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 ) )
@@ -217,7 +219,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()
 
@@ -226,7 +229,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()
 
@@ -234,8 +238,8 @@ garonne_point_L93.Update()
 altitudeDigue = hydro_doc.CreateObject( KIND_PROFILE );
 altitudeDigue.SetName( "altitudeDigue" );
 
-profile_points = [ gp_XY( 1, 35 ),
-                   gp_XY( 6000, 40 ) ];
+profile_points = [ gp_XY( 1, 23 ),
+                   gp_XY( 5000, 25.5 ) ];
 altitudeDigue.SetParametricPoints( profile_points );
 
 altitudeDigue.Update();
@@ -258,7 +262,7 @@ axe3DDigue = hydro_doc.CreateObject( KIND_POLYLINE );
 axe3DDigue.SetName( "axe3DDigue" );
 
 axe3DDigue.SetPolylineXY( axeDigue );
-axe3DDigue.SetProfileUZ( sectionDigue.GetProfileUZ() );
+axe3DDigue.SetProfileUZ( altitudeDigue.GetProfileUZ() );
 
 axe3DDigue.Update();
 
@@ -342,7 +346,7 @@ garonne_2.SetBoundaryPolyline( domaine );
 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_Zone_1.SetMergeType( HYDROData_Zone.Merge_ZMAX )
+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" );
@@ -356,7 +360,7 @@ 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_6.SetMergeType( HYDROData_Zone.Merge_ZMIN )
+garonne_2_Zone_6.SetMergeType( HYDROData_Zone.Merge_ZMAX )
 garonne_2_digue.AddZone( garonne_2_Zone_6 );
 
 garonne_2_litMineur.SetName("garonne_2_litMineur")
@@ -391,10 +395,10 @@ geompy.addToStudyInFather( HYDRO_garonne_2, digue, 'digue' )
 geompy.addToStudyInFather( HYDRO_garonne_2, litMineur, 'litMineur' )
 geompy.addToStudyInFather( HYDRO_garonne_2, riveDroite, 'riveDroite' )
 
-controlGeomProps(geompy, riveGauche,  39493.270103, 35885901.558025)
-controlGeomProps(geompy, digue,       10343.900923,   103893.397004)
-controlGeomProps(geompy, litMineur,   30337.548492,  3646827.749809)
-controlGeomProps(geompy, riveDroite,  32012.343241, 26177085.460092)
+controlGeomProps(geompy, riveGauche,  39493.270283, 35845790.613557)
+controlGeomProps(geompy, digue,       10343.901103,   103037.738504)
+controlGeomProps(geompy, litMineur,   30337.548492,  3488480.304388)
+controlGeomProps(geompy, riveDroite,  32012.343241, 25998769.23615)
 
 if salome.sg.hasDesktop():
   salome.sg.updateObjBrowser(1)