Salome HOME
Porting on OCCT 7.0 and Qt 5. Make compilable version.
[modules/hydro.git] / doc / salome / examples / h013_caseDigueManualMesh.py
index c59918d14efe64e9832f629f1b353948bee095f6..234958df88c038db6ac318db550b8c7368a2ceb9 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()
 
@@ -413,10 +417,10 @@ 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,  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)
 
 #----------------------
 # --- Meshing 
@@ -471,6 +475,7 @@ isDone = garonne_2.SetMeshOrder( [ [ subMesh_SectionsGaronne, subMesh_litMineur
 # --- compute mesh
 isDone = garonne_2.Compute()
 isDone = garonne_2.SplitQuadObject( garonne_2, 1 )
+isDone = garonne_2.ReorientObject( garonne_2 )
 
 # --- geometrical groups of edges
 #garonne_2_litMineur_Outer_1 = garonne_2.GroupOnGeom(garonne_2_litMineur_Outer,'garonne_2_litMineur_Outer',SMESH.EDGE)