From: Paul RASCLE Date: Tue, 3 Jan 2017 14:03:50 +0000 (+0100) Subject: add test on stream X-Git-Tag: Salome_8_3_Hydro_1_1rc1~63^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cb890fc20e239d522bee9d2071344703bc807402;p=modules%2Fhydro.git add test on stream --- diff --git a/doc/salome/examples/CMakeLists.txt b/doc/salome/examples/CMakeLists.txt index 5c89302e..c9c143f6 100644 --- a/doc/salome/examples/CMakeLists.txt +++ b/doc/salome/examples/CMakeLists.txt @@ -37,6 +37,7 @@ SET(EXAMPLES_TESTS h015_normalCaseManualTelemac.py h016_pilesPontManualMesh.py h017_interpolationLineaire.py + h018_streamInterpolation.py ) SET(HYDRO_SAMPLES @@ -50,6 +51,8 @@ SET(HYDRO_SAMPLES garonne_profiles.sx garonne_profiles.xyz lignedo_lambert93.xyz + profilsStream.sx + profilsStream.xyz lignedo.sx ) diff --git a/doc/salome/examples/h018_streamInterpolation.py b/doc/salome/examples/h018_streamInterpolation.py new file mode 100644 index 00000000..600f51e7 --- /dev/null +++ b/doc/salome/examples/h018_streamInterpolation.py @@ -0,0 +1,475 @@ +# -*- 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) diff --git a/doc/salome/examples/profilsStream.sx b/doc/salome/examples/profilsStream.sx new file mode 100644 index 00000000..963c215f --- /dev/null +++ b/doc/salome/examples/profilsStream.sx @@ -0,0 +1,618 @@ +C Generated by HYDRO Module +C +B P +CN Profile_1 +CP 0 0 +CP 100.000 0.000 120.000 0.000 +CP 2 + 0.000 0.000 100.000 + 0.400 0.000 99.000 + 0.800 0.000 98.000 + 1.200 0.000 97.000 + 1.600 0.000 96.000 + 2.000 0.000 95.000 + 2.400 0.000 94.000 + 2.800 0.000 93.000 + 3.200 0.000 92.000 + 3.600 0.000 91.000 + 4.000 0.000 90.000 + 4.400 0.000 90.250 + 4.800 0.000 90.500 + 5.200 0.000 90.750 + 5.600 0.000 91.000 + 6.000 0.000 91.250 + 6.400 0.000 91.500 + 6.800 0.000 91.750 + 7.200 0.000 92.000 + 7.600 0.000 92.250 + 8.000 0.000 92.500 + 8.400 0.000 92.750 + 8.800 0.000 93.000 + 9.200 0.000 93.250 + 9.600 0.000 93.500 + 10.000 0.000 93.750 + 10.400 0.000 94.000 + 10.800 0.000 94.250 + 11.200 0.000 94.500 + 11.600 0.000 94.750 + 12.000 0.000 95.000 + 12.400 0.000 95.250 + 12.800 0.000 95.500 + 13.200 0.000 95.750 + 13.600 0.000 96.000 + 14.000 0.000 96.250 + 14.400 0.000 96.500 + 14.800 0.000 96.750 + 15.200 0.000 97.000 + 15.600 0.000 97.250 + 16.000 0.000 97.500 + 16.400 0.000 97.750 + 16.800 0.000 98.000 + 17.200 0.000 98.250 + 17.600 0.000 98.500 + 18.000 0.000 98.750 + 18.400 0.000 99.000 + 18.800 0.000 99.250 + 19.200 0.000 99.500 + 19.600 0.000 99.750 + 20.000 0.000 100.000 +B P +CN Profile_2 +CP 0 0 +CP 98.769 15.643 118.523 18.772 +CP 2 + 0.000 0.000 100.000 + 0.400 0.000 99.154 + 0.800 0.000 98.308 + 1.200 0.000 97.462 + 1.600 0.000 96.615 + 2.000 0.000 95.769 + 2.400 0.000 94.923 + 2.799 0.000 94.077 + 3.199 0.000 93.231 + 3.600 0.000 92.385 + 4.000 0.000 91.538 + 4.400 0.000 90.692 + 4.800 0.000 89.846 + 5.200 0.000 89.000 + 5.600 0.000 89.297 + 6.000 0.000 89.595 + 6.400 0.000 89.892 + 6.800 0.000 90.189 + 7.200 0.000 90.486 + 7.600 0.000 90.784 + 8.000 0.000 91.081 + 8.399 0.000 91.378 + 8.799 0.000 91.676 + 9.200 0.000 91.973 + 9.600 0.000 92.270 + 10.000 0.000 92.568 + 10.400 0.000 92.865 + 10.800 0.000 93.162 + 11.200 0.000 93.459 + 11.600 0.000 93.757 + 12.000 0.000 94.054 + 12.400 0.000 94.351 + 12.800 0.000 94.649 + 13.200 0.000 94.946 + 13.600 0.000 95.243 + 14.000 0.000 95.541 + 14.400 0.000 95.838 + 14.800 0.000 96.135 + 15.200 0.000 96.432 + 15.600 0.000 96.730 + 16.000 0.000 97.027 + 16.400 0.000 97.324 + 16.800 0.000 97.622 + 17.200 0.000 97.919 + 17.600 0.000 98.216 + 18.000 0.000 98.514 + 18.400 0.000 98.811 + 18.799 0.000 99.108 + 19.199 0.000 99.405 + 19.600 0.000 99.703 + 20.000 0.000 100.000 +B P +CN Profile_3 +CP 0 0 +CP 95.106 30.902 114.127 37.082 +CP 2 + 0.000 0.000 100.000 + 0.399 0.000 99.250 + 0.799 0.000 98.500 + 1.200 0.000 97.750 + 1.599 0.000 97.000 + 2.000 0.000 96.250 + 2.399 0.000 95.500 + 2.800 0.000 94.750 + 3.200 0.000 94.000 + 3.599 0.000 93.250 + 4.000 0.000 92.500 + 4.399 0.000 91.750 + 4.800 0.000 91.000 + 5.200 0.000 90.250 + 5.600 0.000 89.500 + 6.000 0.000 88.750 + 6.399 0.000 88.000 + 6.800 0.000 88.353 + 7.199 0.000 88.706 + 7.600 0.000 89.059 + 8.000 0.000 89.412 + 8.400 0.000 89.765 + 8.800 0.000 90.118 + 9.199 0.000 90.471 + 9.600 0.000 90.824 + 9.999 0.000 91.176 + 10.400 0.000 91.529 + 10.799 0.000 91.882 + 11.199 0.000 92.235 + 11.600 0.000 92.588 + 11.999 0.000 92.941 + 12.400 0.000 93.294 + 12.799 0.000 93.647 + 13.200 0.000 94.000 + 13.599 0.000 94.353 + 13.999 0.000 94.706 + 14.400 0.000 95.059 + 14.799 0.000 95.412 + 15.200 0.000 95.765 + 15.599 0.000 96.118 + 16.000 0.000 96.471 + 16.400 0.000 96.824 + 16.799 0.000 97.176 + 17.200 0.000 97.529 + 17.599 0.000 97.882 + 18.000 0.000 98.235 + 18.400 0.000 98.588 + 18.800 0.000 98.941 + 19.200 0.000 99.294 + 19.599 0.000 99.647 + 20.000 0.000 100.000 +B P +CN Profile_4 +CP 0 0 +CP 89.101 45.399 106.921 54.479 +CP 2 + 0.000 0.000 100.000 + 0.400 0.000 99.316 + 0.799 0.000 98.632 + 1.200 0.000 97.947 + 1.599 0.000 97.263 + 2.000 0.000 96.579 + 2.400 0.000 95.895 + 2.799 0.000 95.211 + 3.200 0.000 94.526 + 3.599 0.000 93.842 + 4.000 0.000 93.158 + 4.400 0.000 92.474 + 4.799 0.000 91.789 + 5.200 0.000 91.105 + 5.599 0.000 90.421 + 6.000 0.000 89.737 + 6.400 0.000 89.053 + 6.799 0.000 88.368 + 7.200 0.000 87.684 + 7.599 0.000 87.000 + 8.000 0.000 87.419 + 8.400 0.000 87.839 + 8.800 0.000 88.258 + 9.200 0.000 88.677 + 9.599 0.000 89.097 + 10.000 0.000 89.516 + 10.400 0.000 89.935 + 10.800 0.000 90.355 + 11.200 0.000 90.774 + 11.599 0.000 91.194 + 12.000 0.000 91.613 + 12.400 0.000 92.032 + 12.800 0.000 92.452 + 13.200 0.000 92.871 + 13.599 0.000 93.290 + 14.000 0.000 93.710 + 14.400 0.000 94.129 + 14.800 0.000 94.548 + 15.200 0.000 94.968 + 15.599 0.000 95.387 + 16.000 0.000 95.806 + 16.399 0.000 96.226 + 16.800 0.000 96.645 + 17.200 0.000 97.065 + 17.599 0.000 97.484 + 18.000 0.000 97.903 + 18.399 0.000 98.323 + 18.800 0.000 98.742 + 19.200 0.000 99.161 + 19.599 0.000 99.581 + 20.000 0.000 100.000 +B P +CN Profile_5 +CP 0 0 +CP 80.902 58.779 97.082 70.534 +CP 2 + 0.000 0.000 100.000 + 0.399 0.000 99.364 + 0.800 0.000 98.727 + 1.200 0.000 98.091 + 1.599 0.000 97.455 + 2.000 0.000 96.818 + 2.399 0.000 96.182 + 2.799 0.000 95.545 + 3.200 0.000 94.909 + 3.600 0.000 94.273 + 4.000 0.000 93.636 + 4.399 0.000 93.000 + 4.800 0.000 92.364 + 5.200 0.000 91.727 + 5.599 0.000 91.091 + 5.999 0.000 90.455 + 6.399 0.000 89.818 + 6.799 0.000 89.182 + 7.200 0.000 88.545 + 7.599 0.000 87.909 + 8.000 0.000 87.273 + 8.399 0.000 86.636 + 8.799 0.000 86.000 + 9.200 0.000 86.500 + 9.599 0.000 87.000 + 9.999 0.000 87.500 + 10.399 0.000 88.000 + 10.800 0.000 88.500 + 11.200 0.000 89.000 + 11.599 0.000 89.500 + 12.000 0.000 90.000 + 12.400 0.000 90.500 + 12.799 0.000 91.000 + 13.200 0.000 91.500 + 13.599 0.000 92.000 + 14.000 0.000 92.500 + 14.400 0.000 93.000 + 14.800 0.000 93.500 + 15.200 0.000 94.000 + 15.599 0.000 94.500 + 15.999 0.000 95.000 + 16.400 0.000 95.500 + 16.799 0.000 96.000 + 17.199 0.000 96.500 + 17.599 0.000 97.000 + 18.000 0.000 97.500 + 18.400 0.000 98.000 + 18.799 0.000 98.500 + 19.200 0.000 99.000 + 19.599 0.000 99.500 + 19.999 0.000 100.000 +B P +CN Profile_6 +CP 0 0 +CP 70.711 70.711 84.853 84.853 +CP 2 + 0.000 0.000 100.000 + 0.400 0.000 99.400 + 0.799 0.000 98.800 + 1.199 0.000 98.200 + 1.599 0.000 97.600 + 2.000 0.000 97.000 + 2.400 0.000 96.400 + 2.800 0.000 95.800 + 3.199 0.000 95.200 + 3.599 0.000 94.600 + 3.999 0.000 94.000 + 4.400 0.000 93.400 + 4.800 0.000 92.800 + 5.200 0.000 92.200 + 5.599 0.000 91.600 + 5.999 0.000 91.000 + 6.399 0.000 90.400 + 6.800 0.000 89.800 + 7.200 0.000 89.200 + 7.600 0.000 88.600 + 8.000 0.000 88.000 + 8.399 0.000 87.400 + 8.799 0.000 86.800 + 9.199 0.000 86.200 + 9.600 0.000 85.600 + 10.000 0.000 85.000 + 10.400 0.000 85.600 + 10.799 0.000 86.200 + 11.199 0.000 86.800 + 11.599 0.000 87.400 + 12.000 0.000 88.000 + 12.400 0.000 88.600 + 12.800 0.000 89.200 + 13.199 0.000 89.800 + 13.599 0.000 90.400 + 13.999 0.000 91.000 + 14.400 0.000 91.600 + 14.800 0.000 92.200 + 15.200 0.000 92.800 + 15.600 0.000 93.400 + 15.999 0.000 94.000 + 16.399 0.000 94.600 + 16.799 0.000 95.200 + 17.200 0.000 95.800 + 17.600 0.000 96.400 + 18.000 0.000 97.000 + 18.399 0.000 97.600 + 18.799 0.000 98.200 + 19.199 0.000 98.800 + 19.600 0.000 99.400 + 20.000 0.000 100.000 +B P +CN Profile_7 +CP 0 0 +CP 58.779 80.902 70.534 97.082 +CP 2 + 0.000 0.000 100.000 + 0.399 0.000 99.429 + 0.800 0.000 98.857 + 1.200 0.000 98.286 + 1.599 0.000 97.714 + 2.000 0.000 97.143 + 2.399 0.000 96.571 + 2.799 0.000 96.000 + 3.200 0.000 95.429 + 3.600 0.000 94.857 + 4.000 0.000 94.286 + 4.399 0.000 93.714 + 4.800 0.000 93.143 + 5.200 0.000 92.571 + 5.599 0.000 92.000 + 5.999 0.000 91.429 + 6.399 0.000 90.857 + 6.799 0.000 90.286 + 7.200 0.000 89.714 + 7.599 0.000 89.143 + 8.000 0.000 88.571 + 8.399 0.000 88.000 + 8.799 0.000 87.429 + 9.200 0.000 86.857 + 9.599 0.000 86.286 + 9.999 0.000 85.714 + 10.399 0.000 85.143 + 10.800 0.000 84.571 + 11.200 0.000 84.000 + 11.599 0.000 84.727 + 12.000 0.000 85.455 + 12.400 0.000 86.182 + 12.799 0.000 86.909 + 13.200 0.000 87.636 + 13.599 0.000 88.364 + 14.000 0.000 89.091 + 14.400 0.000 89.818 + 14.800 0.000 90.545 + 15.200 0.000 91.273 + 15.599 0.000 92.000 + 15.999 0.000 92.727 + 16.400 0.000 93.455 + 16.799 0.000 94.182 + 17.199 0.000 94.909 + 17.599 0.000 95.636 + 18.000 0.000 96.364 + 18.400 0.000 97.091 + 18.799 0.000 97.818 + 19.200 0.000 98.545 + 19.599 0.000 99.273 + 19.999 0.000 100.000 +B P +CN Profile_8 +CP 0 0 +CP 45.399 89.101 54.479 106.921 +CP 2 + 0.000 0.000 100.000 + 0.400 0.000 99.452 + 0.799 0.000 98.903 + 1.200 0.000 98.355 + 1.599 0.000 97.806 + 2.000 0.000 97.258 + 2.400 0.000 96.710 + 2.799 0.000 96.161 + 3.200 0.000 95.613 + 3.599 0.000 95.065 + 4.000 0.000 94.516 + 4.400 0.000 93.968 + 4.799 0.000 93.419 + 5.200 0.000 92.871 + 5.599 0.000 92.323 + 6.000 0.000 91.774 + 6.400 0.000 91.226 + 6.799 0.000 90.677 + 7.200 0.000 90.129 + 7.599 0.000 89.581 + 8.000 0.000 89.032 + 8.400 0.000 88.484 + 8.800 0.000 87.935 + 9.200 0.000 87.387 + 9.599 0.000 86.839 + 10.000 0.000 86.290 + 10.400 0.000 85.742 + 10.800 0.000 85.194 + 11.200 0.000 84.645 + 11.599 0.000 84.097 + 12.000 0.000 83.548 + 12.400 0.000 83.000 + 12.800 0.000 83.895 + 13.200 0.000 84.789 + 13.599 0.000 85.684 + 14.000 0.000 86.579 + 14.400 0.000 87.474 + 14.800 0.000 88.368 + 15.200 0.000 89.263 + 15.599 0.000 90.158 + 16.000 0.000 91.053 + 16.399 0.000 91.947 + 16.800 0.000 92.842 + 17.200 0.000 93.737 + 17.599 0.000 94.632 + 18.000 0.000 95.526 + 18.399 0.000 96.421 + 18.800 0.000 97.316 + 19.200 0.000 98.211 + 19.599 0.000 99.105 + 20.000 0.000 100.000 +B P +CN Profile_9 +CP 0 0 +CP 30.902 95.106 37.082 114.127 +CP 2 + 0.000 0.000 100.000 + 0.399 0.000 99.471 + 0.799 0.000 98.941 + 1.200 0.000 98.412 + 1.599 0.000 97.882 + 2.000 0.000 97.353 + 2.399 0.000 96.824 + 2.800 0.000 96.294 + 3.200 0.000 95.765 + 3.599 0.000 95.235 + 4.000 0.000 94.706 + 4.399 0.000 94.176 + 4.800 0.000 93.647 + 5.200 0.000 93.118 + 5.600 0.000 92.588 + 6.000 0.000 92.059 + 6.399 0.000 91.529 + 6.800 0.000 91.000 + 7.199 0.000 90.471 + 7.600 0.000 89.941 + 8.000 0.000 89.412 + 8.400 0.000 88.882 + 8.800 0.000 88.353 + 9.199 0.000 87.824 + 9.600 0.000 87.294 + 9.999 0.000 86.765 + 10.400 0.000 86.235 + 10.799 0.000 85.706 + 11.199 0.000 85.176 + 11.600 0.000 84.647 + 11.999 0.000 84.118 + 12.400 0.000 83.588 + 12.799 0.000 83.059 + 13.200 0.000 82.529 + 13.599 0.000 82.000 + 13.999 0.000 83.125 + 14.400 0.000 84.250 + 14.799 0.000 85.375 + 15.200 0.000 86.500 + 15.599 0.000 87.625 + 16.000 0.000 88.750 + 16.400 0.000 89.875 + 16.799 0.000 91.000 + 17.200 0.000 92.125 + 17.599 0.000 93.250 + 18.000 0.000 94.375 + 18.400 0.000 95.500 + 18.800 0.000 96.625 + 19.200 0.000 97.750 + 19.599 0.000 98.875 + 20.000 0.000 100.000 +B P +CN Profile_10 +CP 0 0 +CP 15.643 98.769 18.772 118.523 +CP 2 + 0.000 0.000 100.000 + 0.400 0.000 99.486 + 0.800 0.000 98.973 + 1.200 0.000 98.459 + 1.600 0.000 97.946 + 2.000 0.000 97.432 + 2.400 0.000 96.919 + 2.799 0.000 96.405 + 3.199 0.000 95.892 + 3.600 0.000 95.378 + 4.000 0.000 94.865 + 4.400 0.000 94.351 + 4.800 0.000 93.838 + 5.200 0.000 93.324 + 5.600 0.000 92.811 + 6.000 0.000 92.297 + 6.400 0.000 91.784 + 6.800 0.000 91.270 + 7.200 0.000 90.757 + 7.600 0.000 90.243 + 8.000 0.000 89.730 + 8.399 0.000 89.216 + 8.799 0.000 88.703 + 9.200 0.000 88.189 + 9.600 0.000 87.676 + 10.000 0.000 87.162 + 10.400 0.000 86.649 + 10.800 0.000 86.135 + 11.200 0.000 85.622 + 11.600 0.000 85.108 + 12.000 0.000 84.595 + 12.400 0.000 84.081 + 12.800 0.000 83.568 + 13.200 0.000 83.054 + 13.600 0.000 82.541 + 14.000 0.000 82.027 + 14.400 0.000 81.514 + 14.800 0.000 81.000 + 15.200 0.000 82.462 + 15.600 0.000 83.923 + 16.000 0.000 85.385 + 16.400 0.000 86.846 + 16.800 0.000 88.308 + 17.200 0.000 89.769 + 17.600 0.000 91.231 + 18.000 0.000 92.692 + 18.400 0.000 94.154 + 18.799 0.000 95.615 + 19.199 0.000 97.077 + 19.600 0.000 98.538 + 20.000 0.000 100.000 +B P +CN Profile_11 +CP 0 0 +CP 0.000 100.000 0.000 120.000 +CP 2 + 0.000 0.000 100.000 + 0.400 0.000 99.500 + 0.800 0.000 99.000 + 1.200 0.000 98.500 + 1.600 0.000 98.000 + 2.000 0.000 97.500 + 2.400 0.000 97.000 + 2.800 0.000 96.500 + 3.200 0.000 96.000 + 3.600 0.000 95.500 + 4.000 0.000 95.000 + 4.400 0.000 94.500 + 4.800 0.000 94.000 + 5.200 0.000 93.500 + 5.600 0.000 93.000 + 6.000 0.000 92.500 + 6.400 0.000 92.000 + 6.800 0.000 91.500 + 7.200 0.000 91.000 + 7.600 0.000 90.500 + 8.000 0.000 90.000 + 8.400 0.000 89.500 + 8.800 0.000 89.000 + 9.200 0.000 88.500 + 9.600 0.000 88.000 + 10.000 0.000 87.500 + 10.400 0.000 87.000 + 10.800 0.000 86.500 + 11.200 0.000 86.000 + 11.600 0.000 85.500 + 12.000 0.000 85.000 + 12.400 0.000 84.500 + 12.800 0.000 84.000 + 13.200 0.000 83.500 + 13.600 0.000 83.000 + 14.000 0.000 82.500 + 14.400 0.000 82.000 + 14.800 0.000 81.500 + 15.200 0.000 81.000 + 15.600 0.000 80.500 + 16.000 0.000 80.000 + 16.400 0.000 82.000 + 16.800 0.000 84.000 + 17.200 0.000 86.000 + 17.600 0.000 88.000 + 18.000 0.000 90.000 + 18.400 0.000 92.000 + 18.800 0.000 94.000 + 19.200 0.000 96.000 + 19.600 0.000 98.000 + 20.000 0.000 100.000 diff --git a/doc/salome/examples/profilsStream.xyz b/doc/salome/examples/profilsStream.xyz new file mode 100644 index 00000000..f8ea6826 --- /dev/null +++ b/doc/salome/examples/profilsStream.xyz @@ -0,0 +1,571 @@ + 100.000 0.000 100.000 + 100.400 0.000 99.000 + 100.800 0.000 98.000 + 101.200 0.000 97.000 + 101.600 0.000 96.000 + 102.000 0.000 95.000 + 102.400 0.000 94.000 + 102.800 0.000 93.000 + 103.200 0.000 92.000 + 103.600 0.000 91.000 + 104.000 0.000 90.000 + 104.400 0.000 90.250 + 104.800 0.000 90.500 + 105.200 0.000 90.750 + 105.600 0.000 91.000 + 106.000 0.000 91.250 + 106.400 0.000 91.500 + 106.800 0.000 91.750 + 107.200 0.000 92.000 + 107.600 0.000 92.250 + 108.000 0.000 92.500 + 108.400 0.000 92.750 + 108.800 0.000 93.000 + 109.200 0.000 93.250 + 109.600 0.000 93.500 + 110.000 0.000 93.750 + 110.400 0.000 94.000 + 110.800 0.000 94.250 + 111.200 0.000 94.500 + 111.600 0.000 94.750 + 112.000 0.000 95.000 + 112.400 0.000 95.250 + 112.800 0.000 95.500 + 113.200 0.000 95.750 + 113.600 0.000 96.000 + 114.000 0.000 96.250 + 114.400 0.000 96.500 + 114.800 0.000 96.750 + 115.200 0.000 97.000 + 115.600 0.000 97.250 + 116.000 0.000 97.500 + 116.400 0.000 97.750 + 116.800 0.000 98.000 + 117.200 0.000 98.250 + 117.600 0.000 98.500 + 118.000 0.000 98.750 + 118.400 0.000 99.000 + 118.800 0.000 99.250 + 119.200 0.000 99.500 + 119.600 0.000 99.750 + 120.000 0.000 100.000 + + 98.769 15.643 100.000 + 99.164 15.706 99.154 + 99.559 15.769 98.308 + 99.954 15.831 97.462 + 100.349 15.894 96.615 + 100.744 15.956 95.769 + 101.139 16.019 94.923 + 101.534 16.081 94.077 + 101.929 16.144 93.231 + 102.325 16.207 92.385 + 102.720 16.269 91.538 + 103.115 16.332 90.692 + 103.510 16.394 89.846 + 103.905 16.457 89.000 + 104.300 16.519 89.297 + 104.695 16.582 89.595 + 105.090 16.645 89.892 + 105.485 16.707 90.189 + 105.880 16.770 90.486 + 106.275 16.832 90.784 + 106.670 16.895 91.081 + 107.065 16.957 91.378 + 107.460 17.020 91.676 + 107.856 17.083 91.973 + 108.251 17.145 92.270 + 108.646 17.208 92.568 + 109.041 17.270 92.865 + 109.436 17.333 93.162 + 109.831 17.396 93.459 + 110.226 17.458 93.757 + 110.621 17.521 94.054 + 111.016 17.583 94.351 + 111.411 17.646 94.649 + 111.806 17.708 94.946 + 112.201 17.771 95.243 + 112.596 17.834 95.541 + 112.992 17.896 95.838 + 113.387 17.959 96.135 + 113.782 18.021 96.432 + 114.177 18.084 96.730 + 114.572 18.146 97.027 + 114.967 18.209 97.324 + 115.362 18.272 97.622 + 115.757 18.334 97.919 + 116.152 18.397 98.216 + 116.547 18.459 98.514 + 116.942 18.522 98.811 + 117.337 18.584 99.108 + 117.732 18.647 99.405 + 118.128 18.710 99.703 + 118.523 18.772 100.000 + + 95.106 30.902 100.000 + 95.486 31.025 99.250 + 95.866 31.149 98.500 + 96.247 31.273 97.750 + 96.627 31.396 97.000 + 97.008 31.520 96.250 + 97.388 31.643 95.500 + 97.769 31.767 94.750 + 98.149 31.891 94.000 + 98.529 32.014 93.250 + 98.910 32.138 92.500 + 99.290 32.261 91.750 + 99.671 32.385 91.000 + 100.051 32.509 90.250 + 100.432 32.632 89.500 + 100.812 32.756 88.750 + 101.192 32.879 88.000 + 101.573 33.003 88.353 + 101.953 33.127 88.706 + 102.334 33.250 89.059 + 102.714 33.374 89.412 + 103.095 33.497 89.765 + 103.475 33.621 90.118 + 103.855 33.745 90.471 + 104.236 33.868 90.824 + 104.616 33.992 91.176 + 104.997 34.115 91.529 + 105.377 34.239 91.882 + 105.757 34.363 92.235 + 106.138 34.486 92.588 + 106.518 34.610 92.941 + 106.899 34.734 93.294 + 107.279 34.857 93.647 + 107.660 34.981 94.000 + 108.040 35.104 94.353 + 108.420 35.228 94.706 + 108.801 35.352 95.059 + 109.181 35.475 95.412 + 109.562 35.599 95.765 + 109.942 35.722 96.118 + 110.323 35.846 96.471 + 110.703 35.970 96.824 + 111.083 36.093 97.176 + 111.464 36.217 97.529 + 111.844 36.340 97.882 + 112.225 36.464 98.235 + 112.605 36.588 98.588 + 112.986 36.711 98.941 + 113.366 36.835 99.294 + 113.746 36.958 99.647 + 114.127 37.082 100.000 + + 89.101 45.399 100.000 + 89.457 45.581 99.316 + 89.813 45.762 98.632 + 90.170 45.944 97.947 + 90.526 46.125 97.263 + 90.883 46.307 96.579 + 91.239 46.489 95.895 + 91.595 46.670 95.211 + 91.952 46.852 94.526 + 92.308 47.033 93.842 + 92.665 47.215 93.158 + 93.021 47.397 92.474 + 93.377 47.578 91.789 + 93.734 47.760 91.105 + 94.090 47.941 90.421 + 94.447 48.123 89.737 + 94.803 48.305 89.053 + 95.159 48.486 88.368 + 95.516 48.668 87.684 + 95.872 48.849 87.000 + 96.229 49.031 87.419 + 96.585 49.213 87.839 + 96.942 49.394 88.258 + 97.298 49.576 88.677 + 97.654 49.757 89.097 + 98.011 49.939 89.516 + 98.367 50.121 89.935 + 98.724 50.302 90.355 + 99.080 50.484 90.774 + 99.436 50.665 91.194 + 99.793 50.847 91.613 + 100.149 51.029 92.032 + 100.506 51.210 92.452 + 100.862 51.392 92.871 + 101.218 51.573 93.290 + 101.575 51.755 93.710 + 101.931 51.937 94.129 + 102.288 52.118 94.548 + 102.644 52.300 94.968 + 103.000 52.481 95.387 + 103.357 52.663 95.806 + 103.713 52.844 96.226 + 104.070 53.026 96.645 + 104.426 53.208 97.065 + 104.782 53.389 97.484 + 105.139 53.571 97.903 + 105.495 53.752 98.323 + 105.852 53.934 98.742 + 106.208 54.116 99.161 + 106.564 54.297 99.581 + 106.921 54.479 100.000 + + 80.902 58.779 100.000 + 81.225 59.014 99.364 + 81.549 59.249 98.727 + 81.873 59.484 98.091 + 82.196 59.719 97.455 + 82.520 59.954 96.818 + 82.843 60.189 96.182 + 83.167 60.424 95.545 + 83.491 60.659 94.909 + 83.814 60.895 94.273 + 84.138 61.130 93.636 + 84.461 61.365 93.000 + 84.785 61.600 92.364 + 85.109 61.835 91.727 + 85.432 62.070 91.091 + 85.756 62.305 90.455 + 86.079 62.540 89.818 + 86.403 62.775 89.182 + 86.727 63.011 88.545 + 87.050 63.246 87.909 + 87.374 63.481 87.273 + 87.697 63.716 86.636 + 88.021 63.951 86.000 + 88.345 64.186 86.500 + 88.668 64.421 87.000 + 88.992 64.656 87.500 + 89.315 64.891 88.000 + 89.639 65.127 88.500 + 89.963 65.362 89.000 + 90.286 65.597 89.500 + 90.610 65.832 90.000 + 90.934 66.067 90.500 + 91.257 66.302 91.000 + 91.581 66.537 91.500 + 91.904 66.772 92.000 + 92.228 67.008 92.500 + 92.552 67.243 93.000 + 92.875 67.478 93.500 + 93.199 67.713 94.000 + 93.522 67.948 94.500 + 93.846 68.183 95.000 + 94.170 68.418 95.500 + 94.493 68.653 96.000 + 94.817 68.888 96.500 + 95.140 69.124 97.000 + 95.464 69.359 97.500 + 95.788 69.594 98.000 + 96.111 69.829 98.500 + 96.435 70.064 99.000 + 96.758 70.299 99.500 + 97.082 70.534 100.000 + + 70.711 70.711 100.000 + 70.994 70.994 99.400 + 71.276 71.276 98.800 + 71.559 71.559 98.200 + 71.842 71.842 97.600 + 72.125 72.125 97.000 + 72.408 72.408 96.400 + 72.691 72.691 95.800 + 72.973 72.973 95.200 + 73.256 73.256 94.600 + 73.539 73.539 94.000 + 73.822 73.822 93.400 + 74.105 74.105 92.800 + 74.388 74.388 92.200 + 74.670 74.670 91.600 + 74.953 74.953 91.000 + 75.236 75.236 90.400 + 75.519 75.519 89.800 + 75.802 75.802 89.200 + 76.085 76.085 88.600 + 76.368 76.368 88.000 + 76.650 76.650 87.400 + 76.933 76.933 86.800 + 77.216 77.216 86.200 + 77.499 77.499 85.600 + 77.782 77.782 85.000 + 78.065 78.065 85.600 + 78.347 78.347 86.200 + 78.630 78.630 86.800 + 78.913 78.913 87.400 + 79.196 79.196 88.000 + 79.479 79.479 88.600 + 79.762 79.762 89.200 + 80.044 80.044 89.800 + 80.327 80.327 90.400 + 80.610 80.610 91.000 + 80.893 80.893 91.600 + 81.176 81.176 92.200 + 81.459 81.459 92.800 + 81.742 81.742 93.400 + 82.024 82.024 94.000 + 82.307 82.307 94.600 + 82.590 82.590 95.200 + 82.873 82.873 95.800 + 83.156 83.156 96.400 + 83.439 83.439 97.000 + 83.721 83.721 97.600 + 84.004 84.004 98.200 + 84.287 84.287 98.800 + 84.570 84.570 99.400 + 84.853 84.853 100.000 + + 58.779 80.902 100.000 + 59.014 81.225 99.429 + 59.249 81.549 98.857 + 59.484 81.873 98.286 + 59.719 82.196 97.714 + 59.954 82.520 97.143 + 60.189 82.843 96.571 + 60.424 83.167 96.000 + 60.659 83.491 95.429 + 60.895 83.814 94.857 + 61.130 84.138 94.286 + 61.365 84.461 93.714 + 61.600 84.785 93.143 + 61.835 85.109 92.571 + 62.070 85.432 92.000 + 62.305 85.756 91.429 + 62.540 86.079 90.857 + 62.775 86.403 90.286 + 63.011 86.727 89.714 + 63.246 87.050 89.143 + 63.481 87.374 88.571 + 63.716 87.697 88.000 + 63.951 88.021 87.429 + 64.186 88.345 86.857 + 64.421 88.668 86.286 + 64.656 88.992 85.714 + 64.891 89.315 85.143 + 65.127 89.639 84.571 + 65.362 89.963 84.000 + 65.597 90.286 84.727 + 65.832 90.610 85.455 + 66.067 90.934 86.182 + 66.302 91.257 86.909 + 66.537 91.581 87.636 + 66.772 91.904 88.364 + 67.008 92.228 89.091 + 67.243 92.552 89.818 + 67.478 92.875 90.545 + 67.713 93.199 91.273 + 67.948 93.522 92.000 + 68.183 93.846 92.727 + 68.418 94.170 93.455 + 68.653 94.493 94.182 + 68.888 94.817 94.909 + 69.124 95.140 95.636 + 69.359 95.464 96.364 + 69.594 95.788 97.091 + 69.829 96.111 97.818 + 70.064 96.435 98.545 + 70.299 96.758 99.273 + 70.534 97.082 100.000 + + 45.399 89.101 100.000 + 45.581 89.457 99.452 + 45.762 89.813 98.903 + 45.944 90.170 98.355 + 46.125 90.526 97.806 + 46.307 90.883 97.258 + 46.489 91.239 96.710 + 46.670 91.595 96.161 + 46.852 91.952 95.613 + 47.033 92.308 95.065 + 47.215 92.665 94.516 + 47.397 93.021 93.968 + 47.578 93.377 93.419 + 47.760 93.734 92.871 + 47.941 94.090 92.323 + 48.123 94.447 91.774 + 48.305 94.803 91.226 + 48.486 95.159 90.677 + 48.668 95.516 90.129 + 48.849 95.872 89.581 + 49.031 96.229 89.032 + 49.213 96.585 88.484 + 49.394 96.942 87.935 + 49.576 97.298 87.387 + 49.757 97.654 86.839 + 49.939 98.011 86.290 + 50.121 98.367 85.742 + 50.302 98.724 85.194 + 50.484 99.080 84.645 + 50.665 99.436 84.097 + 50.847 99.793 83.548 + 51.029 100.149 83.000 + 51.210 100.506 83.895 + 51.392 100.862 84.789 + 51.573 101.218 85.684 + 51.755 101.575 86.579 + 51.937 101.931 87.474 + 52.118 102.288 88.368 + 52.300 102.644 89.263 + 52.481 103.000 90.158 + 52.663 103.357 91.053 + 52.844 103.713 91.947 + 53.026 104.070 92.842 + 53.208 104.426 93.737 + 53.389 104.782 94.632 + 53.571 105.139 95.526 + 53.752 105.495 96.421 + 53.934 105.852 97.316 + 54.116 106.208 98.211 + 54.297 106.564 99.105 + 54.479 106.921 100.000 + + 30.902 95.106 100.000 + 31.025 95.486 99.471 + 31.149 95.866 98.941 + 31.273 96.247 98.412 + 31.396 96.627 97.882 + 31.520 97.008 97.353 + 31.643 97.388 96.824 + 31.767 97.769 96.294 + 31.891 98.149 95.765 + 32.014 98.529 95.235 + 32.138 98.910 94.706 + 32.261 99.290 94.176 + 32.385 99.671 93.647 + 32.509 100.051 93.118 + 32.632 100.432 92.588 + 32.756 100.812 92.059 + 32.879 101.192 91.529 + 33.003 101.573 91.000 + 33.127 101.953 90.471 + 33.250 102.334 89.941 + 33.374 102.714 89.412 + 33.497 103.095 88.882 + 33.621 103.475 88.353 + 33.745 103.855 87.824 + 33.868 104.236 87.294 + 33.992 104.616 86.765 + 34.115 104.997 86.235 + 34.239 105.377 85.706 + 34.363 105.757 85.176 + 34.486 106.138 84.647 + 34.610 106.518 84.118 + 34.734 106.899 83.588 + 34.857 107.279 83.059 + 34.981 107.660 82.529 + 35.104 108.040 82.000 + 35.228 108.420 83.125 + 35.352 108.801 84.250 + 35.475 109.181 85.375 + 35.599 109.562 86.500 + 35.722 109.942 87.625 + 35.846 110.323 88.750 + 35.970 110.703 89.875 + 36.093 111.083 91.000 + 36.217 111.464 92.125 + 36.340 111.844 93.250 + 36.464 112.225 94.375 + 36.588 112.605 95.500 + 36.711 112.986 96.625 + 36.835 113.366 97.750 + 36.958 113.746 98.875 + 37.082 114.127 100.000 + + 15.643 98.769 100.000 + 15.706 99.164 99.486 + 15.769 99.559 98.973 + 15.831 99.954 98.459 + 15.894 100.349 97.946 + 15.956 100.744 97.432 + 16.019 101.139 96.919 + 16.081 101.534 96.405 + 16.144 101.929 95.892 + 16.207 102.325 95.378 + 16.269 102.720 94.865 + 16.332 103.115 94.351 + 16.394 103.510 93.838 + 16.457 103.905 93.324 + 16.519 104.300 92.811 + 16.582 104.695 92.297 + 16.645 105.090 91.784 + 16.707 105.485 91.270 + 16.770 105.880 90.757 + 16.832 106.275 90.243 + 16.895 106.670 89.730 + 16.957 107.065 89.216 + 17.020 107.460 88.703 + 17.083 107.856 88.189 + 17.145 108.251 87.676 + 17.208 108.646 87.162 + 17.270 109.041 86.649 + 17.333 109.436 86.135 + 17.396 109.831 85.622 + 17.458 110.226 85.108 + 17.521 110.621 84.595 + 17.583 111.016 84.081 + 17.646 111.411 83.568 + 17.708 111.806 83.054 + 17.771 112.201 82.541 + 17.834 112.596 82.027 + 17.896 112.992 81.514 + 17.959 113.387 81.000 + 18.021 113.782 82.462 + 18.084 114.177 83.923 + 18.146 114.572 85.385 + 18.209 114.967 86.846 + 18.272 115.362 88.308 + 18.334 115.757 89.769 + 18.397 116.152 91.231 + 18.459 116.547 92.692 + 18.522 116.942 94.154 + 18.584 117.337 95.615 + 18.647 117.732 97.077 + 18.710 118.128 98.538 + 18.772 118.523 100.000 + + 0.000 100.000 100.000 + 0.000 100.400 99.500 + 0.000 100.800 99.000 + 0.000 101.200 98.500 + 0.000 101.600 98.000 + 0.000 102.000 97.500 + 0.000 102.400 97.000 + 0.000 102.800 96.500 + 0.000 103.200 96.000 + 0.000 103.600 95.500 + 0.000 104.000 95.000 + 0.000 104.400 94.500 + 0.000 104.800 94.000 + 0.000 105.200 93.500 + 0.000 105.600 93.000 + 0.000 106.000 92.500 + 0.000 106.400 92.000 + 0.000 106.800 91.500 + 0.000 107.200 91.000 + 0.000 107.600 90.500 + 0.000 108.000 90.000 + 0.000 108.400 89.500 + 0.000 108.800 89.000 + 0.000 109.200 88.500 + 0.000 109.600 88.000 + 0.000 110.000 87.500 + 0.000 110.400 87.000 + 0.000 110.800 86.500 + 0.000 111.200 86.000 + 0.000 111.600 85.500 + 0.000 112.000 85.000 + 0.000 112.400 84.500 + 0.000 112.800 84.000 + 0.000 113.200 83.500 + 0.000 113.600 83.000 + 0.000 114.000 82.500 + 0.000 114.400 82.000 + 0.000 114.800 81.500 + 0.000 115.200 81.000 + 0.000 115.600 80.500 + 0.000 116.000 80.000 + 0.000 116.400 82.000 + 0.000 116.800 84.000 + 0.000 117.200 86.000 + 0.000 117.600 88.000 + 0.000 118.000 90.000 + 0.000 118.400 92.000 + 0.000 118.800 94.000 + 0.000 119.200 96.000 + 0.000 119.600 98.000 + 0.000 120.000 100.000 \ No newline at end of file diff --git a/src/HYDROPy/HYDROData_Stream.sip b/src/HYDROPy/HYDROData_Stream.sip index f271ea5d..f6890ad3 100644 --- a/src/HYDROPy/HYDROData_Stream.sip +++ b/src/HYDROPy/HYDROData_Stream.sip @@ -40,7 +40,7 @@ public: /** * Returns true if given polyline can be used as stream axis. */ - static bool IsValidAsAxis( HYDROData_PolylineXY theAxis ) + static bool IsValidAsAxis( HYDROData_PolylineXY theAxis ) [bool ( const Handle_HYDROData_PolylineXY& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = @@ -53,7 +53,7 @@ public: } %End -public: +public: // Public methods to work with Stream data fields /** @@ -80,12 +80,12 @@ public: [Handle_HYDROData_PolylineXY ()]; %MethodCode Handle(HYDROData_PolylineXY) aRef; - + Py_BEGIN_ALLOW_THREADS - aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() : + aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() : sipCpp->GetHydraulicAxis(); Py_END_ALLOW_THREADS - + sipRes = (HYDROData_PolylineXY*)createPointer( aRef ); %End @@ -150,15 +150,15 @@ public: [Handle_HYDROData_Polyline3D ()]; %MethodCode Handle(HYDROData_Polyline3D) aRef; - + Py_BEGIN_ALLOW_THREADS - aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetBottomPolyline() : + aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetBottomPolyline() : sipCpp->GetBottomPolyline(); Py_END_ALLOW_THREADS - + sipRes = (HYDROData_Polyline3D*)createPointer( aRef ); %End - + /** * Sets reference bottom polyline object for stream. */ @@ -183,9 +183,19 @@ public: */ virtual bool Interpolate( HYDROData_IProfilesInterpolator* theInterpolator ); + /** + * Set vertical slicing step for profiles interpolation. + */ + void SetDDZ( double theDDZ ); + + /** + * Set horizontal step for profiles interpolation. + */ + void SetSpatialStep( double theSpatialStep ); + protected: /** - * Creates new object in the internal data structure. Use higher level objects + * Creates new object in the internal data structure. Use higher level objects * to create objects with real content. */ HYDROData_Stream();