--- /dev/null
+# -*- coding: utf-8 -*-
+
+###
+### This file is generated automatically by SALOME v7.8.0 with dump python functionality
+###
+
+import sys
+import salome
+
+salome.salome_init()
+theStudy = salome.myStudy
+
+import salome_notebook
+notebook = salome_notebook.NoteBook(theStudy)
+sys.path.insert( 0, r'/local00/home/B27118/projets/salome_hydro/bugs/V780H2016')
+
+###
+### HYDRO component
+###
+
+from HYDROPy import *
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
+
+hydro_doc.SetLocalCS( 0.000, 0.000 )
+
+Strickler_table_1 = hydro_doc.CreateObject( KIND_STRICKLER_TABLE )
+Strickler_table_1.SetName( "Strickler table_1" )
+
+Strickler_table_1.SetAttrName( "CODE_06" )
+
+Strickler_table_1.Set( u"Pelouses et pâturages naturels", 1.0321 )
+Strickler_table_1.SetAttrValue( u"Pelouses et pâturages naturels", "321" )
+Strickler_table_1.SetColor( u"Pelouses et pâturages naturels", QColor( 204, 242, 77 ) )
+
+Strickler_table_1.Set( u"Aéroports", 1.0124 )
+Strickler_table_1.SetAttrValue( u"Aéroports", "124" )
+Strickler_table_1.SetColor( u"Aéroports", QColor( 230, 204, 230 ) )
+
+Strickler_table_1.Set( u"Systèmes culturaux et parcellaires complexes", 1.0242 )
+Strickler_table_1.SetAttrValue( u"Systèmes culturaux et parcellaires complexes", "242" )
+Strickler_table_1.SetColor( u"Systèmes culturaux et parcellaires complexes", QColor( 255, 230, 77 ) )
+
+Strickler_table_1.Set( u"Cultures annuelles associées à des cultures permanentes", 1.0241 )
+Strickler_table_1.SetAttrValue( u"Cultures annuelles associées à des cultures permanentes", "241" )
+Strickler_table_1.SetColor( u"Cultures annuelles associées à des cultures permanentes", QColor( 255, 230, 166 ) )
+
+Strickler_table_1.Set( u"Forêt et végétation arbustive en mutation", 1.0324 )
+Strickler_table_1.SetAttrValue( u"Forêt et végétation arbustive en mutation", "324" )
+Strickler_table_1.SetColor( u"Forêt et végétation arbustive en mutation", QColor( 166, 242, 0 ) )
+
+Strickler_table_1.Set( u"Décharges", 1.0132 )
+Strickler_table_1.SetAttrValue( u"Décharges", "132" )
+Strickler_table_1.SetColor( u"Décharges", QColor( 166, 77, 0 ) )
+
+Strickler_table_1.Set( u"Végétation clairsemée", 1.0333 )
+Strickler_table_1.SetAttrValue( u"Végétation clairsemée", "333" )
+Strickler_table_1.SetColor( u"Végétation clairsemée", QColor( 204, 255, 204 ) )
+
+Strickler_table_1.Set( u"Prairies et autres surfaces toujours en herbe à usage agricole", 1.0231 )
+Strickler_table_1.SetAttrValue( u"Prairies et autres surfaces toujours en herbe à usage agricole", "231" )
+Strickler_table_1.SetColor( u"Prairies et autres surfaces toujours en herbe à usage agricole", QColor( 230, 230, 77 ) )
+
+Strickler_table_1.Set( u"Périmètres irrigués en permanence", 1.0212 )
+Strickler_table_1.SetAttrValue( u"Périmètres irrigués en permanence", "212" )
+Strickler_table_1.SetColor( u"Périmètres irrigués en permanence", QColor( 255, 255, 0 ) )
+
+Strickler_table_1.Set( u"Plans d'eau", 1.0512 )
+Strickler_table_1.SetAttrValue( u"Plans d'eau", "512" )
+Strickler_table_1.SetColor( u"Plans d'eau", QColor( 128, 242, 230 ) )
+
+Strickler_table_1.Set( u"Territoires agroforestiers", 1.0244 )
+Strickler_table_1.SetAttrValue( u"Territoires agroforestiers", "244" )
+Strickler_table_1.SetColor( u"Territoires agroforestiers", QColor( 242, 204, 166 ) )
+
+Strickler_table_1.Set( u"Forêts mélangées", 1.0313 )
+Strickler_table_1.SetAttrValue( u"Forêts mélangées", "313" )
+Strickler_table_1.SetColor( u"Forêts mélangées", QColor( 77, 255, 0 ) )
+
+Strickler_table_1.Set( u"Glaciers et neiges éternelles", 1.0335 )
+Strickler_table_1.SetAttrValue( u"Glaciers et neiges éternelles", "335" )
+Strickler_table_1.SetColor( u"Glaciers et neiges éternelles", QColor( 166, 230, 204 ) )
+
+Strickler_table_1.Set( u"Plages, dunes et sable", 1.0331 )
+Strickler_table_1.SetAttrValue( u"Plages, dunes et sable", "331" )
+Strickler_table_1.SetColor( u"Plages, dunes et sable", QColor( 230, 230, 230 ) )
+
+Strickler_table_1.Set( u"Zones incendiées", 1.0334 )
+Strickler_table_1.SetAttrValue( u"Zones incendiées", "334" )
+Strickler_table_1.SetColor( u"Zones incendiées", QColor( 0, 0, 0 ) )
+
+Strickler_table_1.Set( u"Tissu urbain continu", 1.0111 )
+Strickler_table_1.SetAttrValue( u"Tissu urbain continu", "111" )
+Strickler_table_1.SetColor( u"Tissu urbain continu", QColor( 230, 0, 77 ) )
+
+Strickler_table_1.Set( u"Chantiers", 1.0133 )
+Strickler_table_1.SetAttrValue( u"Chantiers", "133" )
+Strickler_table_1.SetColor( u"Chantiers", QColor( 255, 77, 255 ) )
+
+Strickler_table_1.Set( u"Estuaires", 1.0522 )
+Strickler_table_1.SetAttrValue( u"Estuaires", "522" )
+Strickler_table_1.SetColor( u"Estuaires", QColor( 166, 255, 230 ) )
+
+Strickler_table_1.Set( u"Marais maritimes", 1.0421 )
+Strickler_table_1.SetAttrValue( u"Marais maritimes", "421" )
+Strickler_table_1.SetColor( u"Marais maritimes", QColor( 204, 204, 255 ) )
+
+Strickler_table_1.Set( u"Forêts de conifères", 1.0312 )
+Strickler_table_1.SetAttrValue( u"Forêts de conifères", "312" )
+Strickler_table_1.SetColor( u"Forêts de conifères", QColor( 0, 166, 0 ) )
+
+Strickler_table_1.Set( u"Surfaces essentiellement agricoles, interrompues par des espaces naturels importants", 1.0243 )
+Strickler_table_1.SetAttrValue( u"Surfaces essentiellement agricoles, interrompues par des espaces naturels importants", "243" )
+Strickler_table_1.SetColor( u"Surfaces essentiellement agricoles, interrompues par des espaces naturels importants", QColor( 230, 204, 77 ) )
+
+Strickler_table_1.Set( u"Tourbières", 1.0412 )
+Strickler_table_1.SetAttrValue( u"Tourbières", "412" )
+Strickler_table_1.SetColor( u"Tourbières", QColor( 77, 77, 255 ) )
+
+Strickler_table_1.Set( u"Extraction de matériaux", 1.0131 )
+Strickler_table_1.SetAttrValue( u"Extraction de matériaux", "131" )
+Strickler_table_1.SetColor( u"Extraction de matériaux", QColor( 166, 0, 204 ) )
+
+Strickler_table_1.Set( u"Réseaux routier et ferroviaire et espaces associés", 1.0122 )
+Strickler_table_1.SetAttrValue( u"Réseaux routier et ferroviaire et espaces associés", "122" )
+Strickler_table_1.SetColor( u"Réseaux routier et ferroviaire et espaces associés", QColor( 204, 0, 0 ) )
+
+Strickler_table_1.Set( u"Mers et océans", 1.0523 )
+Strickler_table_1.SetAttrValue( u"Mers et océans", "523" )
+Strickler_table_1.SetColor( u"Mers et océans", QColor( 230, 242, 255 ) )
+
+Strickler_table_1.Set( u"Equipements sportifs et de loisirs", 1.0142 )
+Strickler_table_1.SetAttrValue( u"Equipements sportifs et de loisirs", "142" )
+Strickler_table_1.SetColor( u"Equipements sportifs et de loisirs", QColor( 255, 230, 255 ) )
+
+Strickler_table_1.Set( u"Forêts de feuillus", 1.0311 )
+Strickler_table_1.SetAttrValue( u"Forêts de feuillus", "311" )
+Strickler_table_1.SetColor( u"Forêts de feuillus", QColor( 128, 255, 0 ) )
+
+Strickler_table_1.Set( u"Vergers et petits fruits", 1.0222 )
+Strickler_table_1.SetAttrValue( u"Vergers et petits fruits", "222" )
+Strickler_table_1.SetColor( u"Vergers et petits fruits", QColor( 242, 166, 77 ) )
+
+Strickler_table_1.Set( u"Végétation sclérophylle", 1.0323 )
+Strickler_table_1.SetAttrValue( u"Végétation sclérophylle", "323" )
+Strickler_table_1.SetColor( u"Végétation sclérophylle", QColor( 166, 230, 77 ) )
+
+Strickler_table_1.Set( u"Landes et broussailles", 1.0322 )
+Strickler_table_1.SetAttrValue( u"Landes et broussailles", "322" )
+Strickler_table_1.SetColor( u"Landes et broussailles", QColor( 166, 255, 128 ) )
+
+Strickler_table_1.Set( u"Tissu urbain discontinu", 1.0112 )
+Strickler_table_1.SetAttrValue( u"Tissu urbain discontinu", "112" )
+Strickler_table_1.SetColor( u"Tissu urbain discontinu", QColor( 255, 0, 0 ) )
+
+Strickler_table_1.Set( u"Cours et voies d'eau", 1.0511 )
+Strickler_table_1.SetAttrValue( u"Cours et voies d'eau", "511" )
+Strickler_table_1.SetColor( u"Cours et voies d'eau", QColor( 0, 204, 242 ) )
+
+Strickler_table_1.Set( u"Oliveraies", 1.0223 )
+Strickler_table_1.SetAttrValue( u"Oliveraies", "223" )
+Strickler_table_1.SetColor( u"Oliveraies", QColor( 230, 166, 0 ) )
+
+Strickler_table_1.Set( u"Vignobles", 1.0221 )
+Strickler_table_1.SetAttrValue( u"Vignobles", "221" )
+Strickler_table_1.SetColor( u"Vignobles", QColor( 230, 128, 0 ) )
+
+Strickler_table_1.Set( u"Rizières", 1.0213 )
+Strickler_table_1.SetAttrValue( u"Rizières", "213" )
+Strickler_table_1.SetColor( u"Rizières", QColor( 230, 230, 0 ) )
+
+Strickler_table_1.Set( u"Zones portuaires", 1.0123 )
+Strickler_table_1.SetAttrValue( u"Zones portuaires", "123" )
+Strickler_table_1.SetColor( u"Zones portuaires", QColor( 230, 204, 204 ) )
+
+Strickler_table_1.Set( u"Zones industrielles ou commerciales et installations publiques", 1.0121 )
+Strickler_table_1.SetAttrValue( u"Zones industrielles ou commerciales et installations publiques", "121" )
+Strickler_table_1.SetColor( u"Zones industrielles ou commerciales et installations publiques", QColor( 204, 77, 242 ) )
+
+Strickler_table_1.Set( u"Marais salants", 1.0422 )
+Strickler_table_1.SetAttrValue( u"Marais salants", "422" )
+Strickler_table_1.SetColor( u"Marais salants", QColor( 230, 230, 255 ) )
+
+Strickler_table_1.Set( u"Marais intérieurs", 1.0411 )
+Strickler_table_1.SetAttrValue( u"Marais intérieurs", "411" )
+Strickler_table_1.SetColor( u"Marais intérieurs", QColor( 166, 166, 255 ) )
+
+Strickler_table_1.Set( u"Espaces verts urbains", 1.0141 )
+Strickler_table_1.SetAttrValue( u"Espaces verts urbains", "141" )
+Strickler_table_1.SetColor( u"Espaces verts urbains", QColor( 255, 166, 255 ) )
+
+Strickler_table_1.Set( u"Lagunes littorales", 1.0521 )
+Strickler_table_1.SetAttrValue( u"Lagunes littorales", "521" )
+Strickler_table_1.SetColor( u"Lagunes littorales", QColor( 0, 255, 166 ) )
+
+Strickler_table_1.Set( u"Roches nues", 1.0332 )
+Strickler_table_1.SetAttrValue( u"Roches nues", "332" )
+Strickler_table_1.SetColor( u"Roches nues", QColor( 204, 204, 204 ) )
+
+Strickler_table_1.Set( u"Terres arables hors périmètres d'irrigation", 1.0211 )
+Strickler_table_1.SetAttrValue( u"Terres arables hors périmètres d'irrigation", "211" )
+Strickler_table_1.SetColor( u"Terres arables hors périmètres d'irrigation", QColor( 255, 255, 168 ) )
+
+Strickler_table_1.Set( u"Zones intertidales", 1.0423 )
+Strickler_table_1.SetAttrValue( u"Zones intertidales", "423" )
+Strickler_table_1.SetColor( u"Zones intertidales", QColor( 166, 166, 230 ) )
+
+
+Strickler_table_1.Update()
+
+axe = hydro_doc.CreateObject( KIND_POLYLINEXY )
+axe.SetName( "axe" )
+
+axe.SetZLevel( 0 )
+
+axe.AddSection( "Section_1", 1, 0 )
+axe.AddPoint( 0, gp_XY( 107.09, -10.91 ) )
+axe.AddPoint( 0, gp_XY( 102.60, 39.37 ) )
+axe.AddPoint( 0, gp_XY( 70.28, 83.06 ) )
+axe.AddPoint( 0, gp_XY( 28.39, 106.10 ) )
+axe.AddPoint( 0, gp_XY( -14.11, 109.99 ) )
+
+axe.Update()
+
+
+domain = hydro_doc.CreateObject( KIND_POLYLINEXY )
+domain.SetName( "domain" )
+
+domain.SetZLevel( 3 )
+
+domain.AddSection( "Section_1", 0, 1 )
+domain.AddPoint( 0, gp_XY( 0.46, 0.37 ) )
+domain.AddPoint( 0, gp_XY( 125.71, 0.18 ) )
+domain.AddPoint( 0, gp_XY( 109.60, 112.58 ) )
+domain.AddPoint( 0, gp_XY( 1.03, 123.51 ) )
+
+domain.Update()
+
+
+bathyFlat = hydro_doc.CreateObject( KIND_BATHYMETRY )
+bathyFlat.SetName( "bathyFlat" )
+
+bathyFlat.SetAltitudesInverted( 0 )
+if not(bathyFlat.ImportFromFile( "/local00/home/B27118/projets/salome_hydro/bugs/V780H2016/bathyFlat.xyz" )):
+ raise ValueError('problem while loading bathymetry')
+
+bathyFlat.Update()
+
+profiles = hydro_doc.CreateObject( KIND_PROFILE )
+profiles.SetName( "profiles" )
+badProfilesIds=[]
+isToProject=True
+nbp = profiles.ImportFromFile(hydro_doc, "/local00/home/B27118/projets/salome_hydro/V780H2016/modules/src/HYDRO/doc/salome/examples/profilsStream.xyz", badProfilesIds, isToProject)
+print "nombre profils: " , nbp
+if not(nbp):
+ raise ValueError('problem while loading profiles')
+#profiles.Update()
+
+nomsprofs = ["Profile_%d"%i for i in range(1,nbp+1)]
+seqProfs = hydro_doc.FindObjectsByNames(nomsprofs)
+
+
+plaine = hydro_doc.CreateObject( KIND_IMMERSIBLE_ZONE )
+plaine.SetName( "plaine" )
+
+plaine.SetZLevel( 1 )
+
+plaine.SetFillingColor( QColor( 185, 171, 101, 255 ) )
+
+plaine.SetAltitudeObject( bathyFlat )
+plaine.SetPolyline( domain )
+
+plaine.Update()
+
+
+Stream_1 = hydro_doc.CreateObject( KIND_STREAM )
+Stream_1.SetName( "Stream_1" )
+
+Stream_1.SetZLevel( 2 )
+
+Stream_1.SetHydraulicAxis( axe )
+for profil in seqProfs:
+ Stream_1.AddProfile(profil)
+
+Stream_1.SetDDZ( 0.200 )
+Stream_1.SetSpatialStep( 0.5 )
+
+Stream_1.Update()
+
+
+# Calculation case
+Case_1 = hydro_doc.CreateObject( KIND_CALCULATION )
+Case_1.SetName( "Case_1" )
+
+Case_1.SetAssignmentMode( HYDROData_CalculationCase.MANUAL )
+Case_1.AddGeometryObject( plaine )
+Case_1.AddGeometryObject( Stream_1 )
+
+case_geom_group = plaine.GetGroup( 0 )
+Case_1.AddGeometryGroup( case_geom_group )
+case_geom_group = Stream_1.GetGroup( 2 )
+Case_1.AddGeometryGroup( case_geom_group )
+case_geom_group = Stream_1.GetGroup( 0 )
+Case_1.AddGeometryGroup( case_geom_group )
+case_geom_group = Stream_1.GetGroup( 3 )
+Case_1.AddGeometryGroup( case_geom_group )
+case_geom_group = Stream_1.GetGroup( 1 )
+Case_1.AddGeometryGroup( case_geom_group )
+Case_1.SetBoundaryPolyline( domain )
+Case_1.SetStricklerTable( Strickler_table_1 )
+
+# Start the algorithm of the partition and assignment
+Case_1.Update()
+riveGauche = hydro_doc.FindObjectByName( "Case_1_Reg_1" )
+Case_1_Zone_1 = hydro_doc.FindObjectByName( "Case_1_Zone_1" )
+Case_1_Zone_1.SetColor( QColor( 156, 192, 64 ))
+riveGauche.AddZone( Case_1_Zone_1 )
+litMineur = hydro_doc.FindObjectByName( "Case_1_Reg_2" )
+Case_1_Zone_2 = hydro_doc.FindObjectByName( "Case_1_Zone_2" )
+Case_1_Zone_2.SetMergeType( HYDROData_Zone.Merge_Object )
+Stream_1_Altitude_1 = hydro_doc.FindObjectByName( "Stream_1_Altitude_1" )
+Case_1_Zone_2.SetMergeObject( Stream_1_Altitude_1 )
+Case_1_Zone_2.SetColor( QColor( 64, 75, 192 ))
+litMineur.AddZone( Case_1_Zone_2 )
+riveDroite = hydro_doc.FindObjectByName( "Case_1_Reg_3" )
+Case_1_Zone_3 = hydro_doc.FindObjectByName( "Case_1_Zone_3" )
+Case_1_Zone_3.SetColor( QColor( 192, 109, 64 ))
+riveDroite.AddZone( Case_1_Zone_3 )
+riveGauche.SetName( "riveGauche" )
+litMineur.SetName( "litMineur" )
+riveDroite.SetName( "riveDroite" )
+
+# Export of the calculation case
+Case_1_entry = Case_1.Export( theStudy._get_StudyId() )
+
+# Get geometry shape and print debug information
+import GEOM
+print "Entry:", Case_1_entry
+HYDRO_Case_1 = salome.IDToObject( str( Case_1_entry ) )
+print "Geom shape:", HYDRO_Case_1
+print "Geom shape name:", HYDRO_Case_1.GetName()
+
+
+###
+### GEOM component
+###
+
+import GEOM
+from salome.geom import geomBuilder
+import math
+import SALOMEDS
+
+
+geompy = geomBuilder.New(theStudy)
+
+#geomObj_1 = geompy.RestoreShape("") # the shape string has not been dump for performance reason
+#[geomObj_2,geomObj_3,geomObj_4] = geompy.SubShapeAll(geomObj_1, geompy.ShapeType["FACE"])
+geomObj_5 = geompy.CreateGroup(geomObj_1, geompy.ShapeType["EDGE"])
+geompy.UnionIDs(geomObj_5, [4, 12, 19, 23, 25, 21, 14, 9])
+HYDRO_Case_1 = geompy.RestoreShape("") # the shape string has not been dump for performance reason
+[riveGauche,litMineur,riveDroite] = geompy.SubShapeAll(HYDRO_Case_1, geompy.ShapeType["FACE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["VERTEX"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["VERTEX"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+#listSubShapeIDs = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+Case_1_plaine_Outer = geompy.CreateGroup(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+geompy.UnionIDs(Case_1_plaine_Outer, [4, 12, 19, 23, 25, 21, 14, 9])
+sections = geompy.CreateGroup(HYDRO_Case_1, geompy.ShapeType["EDGE"])
+geompy.UnionIDs(sections, [14, 12])
+geompy.addToStudy( HYDRO_Case_1, 'HYDRO_Case_1' )
+geompy.addToStudyInFather( HYDRO_Case_1, riveGauche, 'riveGauche' )
+geompy.addToStudyInFather( HYDRO_Case_1, litMineur, 'litMineur' )
+geompy.addToStudyInFather( HYDRO_Case_1, riveDroite, 'riveDroite' )
+geompy.addToStudyInFather( HYDRO_Case_1, Case_1_plaine_Outer, 'Case_1_plaine_Outer' )
+geompy.addToStudyInFather( HYDRO_Case_1, sections, 'sections' )
+
+###
+### SMESH component
+###
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+
+smesh = smeshBuilder.New(theStudy)
+plaine = smesh.Mesh(HYDRO_Case_1)
+NETGEN_2D = plaine.Triangle(algo=smeshBuilder.NETGEN_1D2D)
+NETGEN_2D_Parameters_1 = NETGEN_2D.Parameters()
+NETGEN_2D_Parameters_1.SetMaxSize( 10 )
+NETGEN_2D_Parameters_1.SetSecondOrder( 0 )
+NETGEN_2D_Parameters_1.SetOptimize( 1 )
+NETGEN_2D_Parameters_1.SetFineness( 3 )
+NETGEN_2D_Parameters_1.SetMinSize( 1 )
+NETGEN_2D_Parameters_1.SetUseSurfaceCurvature( 1 )
+NETGEN_2D_Parameters_1.SetFuseEdges( 1 )
+NETGEN_2D_Parameters_1.SetQuadAllowed( 0 )
+Regular_1D = plaine.Segment(geom=litMineur)
+litMineur_1 = Regular_1D.GetSubMesh()
+Local_Length_1 = Regular_1D.LocalLength(3,None,1e-07)
+QuadFromMedialAxis_1D2D = plaine.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=litMineur)
+Regular_1D_1 = plaine.Segment(geom=sections)
+sections_1 = Regular_1D_1.GetSubMesh()
+Nb_Segments_1 = Regular_1D_1.NumberOfSegments(20)
+isDone = plaine.SetMeshOrder( [ [ sections_1, litMineur_1 ] ])
+
+isDone = plaine.Compute()
+isDone = plaine.SplitQuadObject( plaine, 1 )
+
+riveGauche_1 = plaine.GroupOnGeom(riveGauche,'riveGauche',SMESH.FACE)
+litMineur_2 = plaine.GroupOnGeom(litMineur,'litMineur',SMESH.FACE)
+riveDroite_1 = plaine.GroupOnGeom(riveDroite,'riveDroite',SMESH.FACE)
+Case_1_plaine_Outer_1 = plaine.GroupOnGeom(Case_1_plaine_Outer,'Case_1_plaine_Outer',SMESH.EDGE)
+sections_2 = plaine.GroupOnGeom(sections,'sections',SMESH.EDGE)
+riveGauche_2 = plaine.GroupOnGeom(riveGauche,'riveGauche',SMESH.NODE)
+litMineur_3 = plaine.GroupOnGeom(litMineur,'litMineur',SMESH.NODE)
+riveDroite_2 = plaine.GroupOnGeom(riveDroite,'riveDroite',SMESH.NODE)
+Case_1_plaine_Outer_2 = plaine.GroupOnGeom(Case_1_plaine_Outer,'Case_1_plaine_Outer',SMESH.NODE)
+sections_3 = plaine.GroupOnGeom(sections,'sections',SMESH.NODE)
+smesh.SetName(plaine, 'plaine')
+
+try:
+ plaine.ExportMED( r'/local00/home/B27118/projets/salome_hydro/bugs/V780H2016/plaine.med', 0, SMESH.MED_V2_2, 1, None ,1)
+except:
+ print 'ExportToMEDX() failed. Invalid file name?'
+
+#controlMeshStats(plaine, 6190, 691, 12201)
+#controlSubMeshStats(litMineur_2, 2384)
+#controlSubMeshStats(riveDroite_1, 2400)
+#controlSubMeshStats(riveGauche_1, 6585)
+
+#----------------------
+# --- Z interpolation with HYDRO
+#----------------------
+
+from salome.hydrotools.interpolZ import interpolZ, createZfield2
+from salome.hydrotools.controls import controlStatZ
+
+# --- case name in HYDRO
+nomCas = 'Case_1'
+
+# --- med file 2D(x,y) of the case produced by SMESH
+fichierMaillage = med_file
+
+# --- dictionary [med group name] = region name
+dicoGroupeRegion= dict(litMineur = 'litMineur',
+ riveDroite = 'riveDroite',
+ riveGauche = 'riveGauche',
+ )
+# --- value to use for Z when the node is not in a region (used to detect problems)
+zUndef = 110
+
+# --- 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)}
+controlStatZ(statz, refstatz)
+
+# --- add a field on nodes of type double with z values, named "BOTTOM"
+createZfield2(fichierMaillage)
+
+
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser(1)