X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fexamples%2Fh016_pilesPontManualMesh.py;h=33b1e29e83ea8151c4cf356a42aaf297f7875cd6;hb=8f433a58abdb4526084746cde5f6479d7c62104b;hp=622a132c3b842f9e11e36eb76de66969f02c6637;hpb=8cf8dabb8cfca2c275851561307ab0c7371a0611;p=modules%2Fhydro.git diff --git a/doc/salome/examples/h016_pilesPontManualMesh.py b/doc/salome/examples/h016_pilesPontManualMesh.py index 622a132c..33b1e29e 100644 --- a/doc/salome/examples/h016_pilesPontManualMesh.py +++ b/doc/salome/examples/h016_pilesPontManualMesh.py @@ -18,10 +18,10 @@ theStudy = salome.myStudy ### 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() ) +hydro_doc = HYDROData_Document.Document() hydro_doc.SetLocalCS( 430000.000, 6350000.000 ) @@ -68,181 +68,181 @@ 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( "Pelouses et pâturages naturels", 1.0321 ) +Strickler_table_1.SetAttrValue( "Pelouses et pâturages naturels", "321" ) +Strickler_table_1.SetColor( "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( "Aéroports", 1.0124 ) +Strickler_table_1.SetAttrValue( "Aéroports", "124" ) +Strickler_table_1.SetColor( "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( "Systèmes culturaux et parcellaires complexes", 1.0242 ) +Strickler_table_1.SetAttrValue( "Systèmes culturaux et parcellaires complexes", "242" ) +Strickler_table_1.SetColor( "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( "Cultures annuelles associées à des cultures permanentes", 1.0241 ) +Strickler_table_1.SetAttrValue( "Cultures annuelles associées à des cultures permanentes", "241" ) +Strickler_table_1.SetColor( "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( "Forêt et végétation arbustive en mutation", 1.0324 ) +Strickler_table_1.SetAttrValue( "Forêt et végétation arbustive en mutation", "324" ) +Strickler_table_1.SetColor( "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( "Décharges", 1.0132 ) +Strickler_table_1.SetAttrValue( "Décharges", "132" ) +Strickler_table_1.SetColor( "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( "Végétation clairsemée", 1.0333 ) +Strickler_table_1.SetAttrValue( "Végétation clairsemée", "333" ) +Strickler_table_1.SetColor( "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( "Prairies et autres surfaces toujours en herbe à usage agricole", 1.0231 ) +Strickler_table_1.SetAttrValue( "Prairies et autres surfaces toujours en herbe à usage agricole", "231" ) +Strickler_table_1.SetColor( "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( "Périmètres irrigués en permanence", 1.0212 ) +Strickler_table_1.SetAttrValue( "Périmètres irrigués en permanence", "212" ) +Strickler_table_1.SetColor( "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( "Plans d'eau", 1.0512 ) +Strickler_table_1.SetAttrValue( "Plans d'eau", "512" ) +Strickler_table_1.SetColor( "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( "Territoires agroforestiers", 1.0244 ) +Strickler_table_1.SetAttrValue( "Territoires agroforestiers", "244" ) +Strickler_table_1.SetColor( "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( "Forêts mélangées", 1.0313 ) +Strickler_table_1.SetAttrValue( "Forêts mélangées", "313" ) +Strickler_table_1.SetColor( "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( "Glaciers et neiges éternelles", 1.0335 ) +Strickler_table_1.SetAttrValue( "Glaciers et neiges éternelles", "335" ) +Strickler_table_1.SetColor( "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( "Plages, dunes et sable", 1.0331 ) +Strickler_table_1.SetAttrValue( "Plages, dunes et sable", "331" ) +Strickler_table_1.SetColor( "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( "Zones incendiées", 1.0334 ) +Strickler_table_1.SetAttrValue( "Zones incendiées", "334" ) +Strickler_table_1.SetColor( "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( "Tissu urbain continu", 1.0111 ) +Strickler_table_1.SetAttrValue( "Tissu urbain continu", "111" ) +Strickler_table_1.SetColor( "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( "Chantiers", 1.0133 ) +Strickler_table_1.SetAttrValue( "Chantiers", "133" ) +Strickler_table_1.SetColor( "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( "Estuaires", 1.0522 ) +Strickler_table_1.SetAttrValue( "Estuaires", "522" ) +Strickler_table_1.SetColor( "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( "Marais maritimes", 1.0421 ) +Strickler_table_1.SetAttrValue( "Marais maritimes", "421" ) +Strickler_table_1.SetColor( "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( "Forêts de conifères", 1.0312 ) +Strickler_table_1.SetAttrValue( "Forêts de conifères", "312" ) +Strickler_table_1.SetColor( "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( "Surfaces essentiellement agricoles, interrompues par des espaces naturels importants", 1.0243 ) +Strickler_table_1.SetAttrValue( "Surfaces essentiellement agricoles, interrompues par des espaces naturels importants", "243" ) +Strickler_table_1.SetColor( "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( "Tourbières", 1.0412 ) +Strickler_table_1.SetAttrValue( "Tourbières", "412" ) +Strickler_table_1.SetColor( "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( "Extraction de matériaux", 1.0131 ) +Strickler_table_1.SetAttrValue( "Extraction de matériaux", "131" ) +Strickler_table_1.SetColor( "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( "Réseaux routier et ferroviaire et espaces associés", 1.0122 ) +Strickler_table_1.SetAttrValue( "Réseaux routier et ferroviaire et espaces associés", "122" ) +Strickler_table_1.SetColor( "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( "Mers et océans", 1.0523 ) +Strickler_table_1.SetAttrValue( "Mers et océans", "523" ) +Strickler_table_1.SetColor( "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( "Equipements sportifs et de loisirs", 1.0142 ) +Strickler_table_1.SetAttrValue( "Equipements sportifs et de loisirs", "142" ) +Strickler_table_1.SetColor( "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( "Forêts de feuillus", 1.0311 ) +Strickler_table_1.SetAttrValue( "Forêts de feuillus", "311" ) +Strickler_table_1.SetColor( "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( "Vergers et petits fruits", 1.0222 ) +Strickler_table_1.SetAttrValue( "Vergers et petits fruits", "222" ) +Strickler_table_1.SetColor( "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( "Végétation sclérophylle", 1.0323 ) +Strickler_table_1.SetAttrValue( "Végétation sclérophylle", "323" ) +Strickler_table_1.SetColor( "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( "Landes et broussailles", 1.0322 ) +Strickler_table_1.SetAttrValue( "Landes et broussailles", "322" ) +Strickler_table_1.SetColor( "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( "Tissu urbain discontinu", 1.0112 ) +Strickler_table_1.SetAttrValue( "Tissu urbain discontinu", "112" ) +Strickler_table_1.SetColor( "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( "Cours et voies d'eau", 1.0511 ) +Strickler_table_1.SetAttrValue( "Cours et voies d'eau", "511" ) +Strickler_table_1.SetColor( "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( "Oliveraies", 1.0223 ) +Strickler_table_1.SetAttrValue( "Oliveraies", "223" ) +Strickler_table_1.SetColor( "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( "Vignobles", 1.0221 ) +Strickler_table_1.SetAttrValue( "Vignobles", "221" ) +Strickler_table_1.SetColor( "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( "Rizières", 1.0213 ) +Strickler_table_1.SetAttrValue( "Rizières", "213" ) +Strickler_table_1.SetColor( "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( "Zones portuaires", 1.0123 ) +Strickler_table_1.SetAttrValue( "Zones portuaires", "123" ) +Strickler_table_1.SetColor( "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( "Zones industrielles ou commerciales et installations publiques", 1.0121 ) +Strickler_table_1.SetAttrValue( "Zones industrielles ou commerciales et installations publiques", "121" ) +Strickler_table_1.SetColor( "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( "Marais salants", 1.0422 ) +Strickler_table_1.SetAttrValue( "Marais salants", "422" ) +Strickler_table_1.SetColor( "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( "Marais intérieurs", 1.0411 ) +Strickler_table_1.SetAttrValue( "Marais intérieurs", "411" ) +Strickler_table_1.SetColor( "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( "Espaces verts urbains", 1.0141 ) +Strickler_table_1.SetAttrValue( "Espaces verts urbains", "141" ) +Strickler_table_1.SetColor( "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( "Lagunes littorales", 1.0521 ) +Strickler_table_1.SetAttrValue( "Lagunes littorales", "521" ) +Strickler_table_1.SetColor( "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( "Roches nues", 1.0332 ) +Strickler_table_1.SetAttrValue( "Roches nues", "332" ) +Strickler_table_1.SetColor( "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( "Terres arables hors périmètres d'irrigation", 1.0211 ) +Strickler_table_1.SetAttrValue( "Terres arables hors périmètres d'irrigation", "211" ) +Strickler_table_1.SetColor( "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.Set( "Zones intertidales", 1.0423 ) +Strickler_table_1.SetAttrValue( "Zones intertidales", "423" ) +Strickler_table_1.SetColor( "Zones intertidales", QColor( 166, 166, 230 ) ) Strickler_table_1.Update() @@ -924,116 +924,122 @@ pile4.Update() # Calculation case -casGaronne_1 = hydro_doc.CreateObject( KIND_CALCULATION ) -casGaronne_1.SetName( "casGaronne_1" ) - -casGaronne_1.SetAssignmentMode( HYDROData_CalculationCase.MANUAL ) -casGaronne_1.AddGeometryObject( domaineEtendu ) -casGaronne_1.AddGeometryObject( litMajeur ) -casGaronne_1.AddGeometryObject( litMineur_amont ) -casGaronne_1.AddGeometryObject( litMineur_aval ) -casGaronne_1.AddGeometryObject( litMineur_pont ) -casGaronne_1.AddGeometryObject( pile1 ) -casGaronne_1.AddGeometryObject( pile2 ) -casGaronne_1.AddGeometryObject( pile3 ) -casGaronne_1.AddGeometryObject( pile4 ) +garonne_1 = hydro_doc.CreateObject( KIND_CALCULATION ) +garonne_1.SetName( "garonne_1" ) + +garonne_1.SetAssignmentMode( HYDROData_CalculationCase.MANUAL ) +garonne_1.AddGeometryObject( domaineEtendu ) +garonne_1.AddGeometryObject( litMajeur ) +garonne_1.AddGeometryObject( litMineur_amont ) +garonne_1.AddGeometryObject( litMineur_aval ) +garonne_1.AddGeometryObject( litMineur_pont ) +garonne_1.AddGeometryObject( pile1 ) +garonne_1.AddGeometryObject( pile2 ) +garonne_1.AddGeometryObject( pile3 ) +garonne_1.AddGeometryObject( pile4 ) case_geom_group = domaineEtendu.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = litMajeur.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = litMineur_amont.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = litMineur_aval.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = litMineur_pont.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = pile1.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = pile2.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = pile3.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) +garonne_1.AddGeometryGroup( case_geom_group ) case_geom_group = pile4.GetGroup( 0 ) -casGaronne_1.AddGeometryGroup( case_geom_group ) -casGaronne_1.SetBoundaryPolyline( domaine ) +garonne_1.AddGeometryGroup( case_geom_group ) +garonne_1.SetBoundaryPolyline( domaine ) # Start the algorithm of the partition and assignment -casGaronne_1.Update() -casGaronne_1_riveDroite = hydro_doc.FindObjectByName( "casGaronne_1_Reg_1" ) -casGaronne_1_Zone_1 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_1" ) -casGaronne_1_Zone_1.SetColor( QColor( 64, 192, 147 )) -casGaronne_1_riveDroite.AddZone( casGaronne_1_Zone_1 ) -casGaronne_1_Zone_2 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_2" ) -casGaronne_1_Zone_2.SetColor( QColor( 111, 192, 64 )) -casGaronne_1_riveDroite.AddZone( casGaronne_1_Zone_2 ) -casGaronne_1_aval = hydro_doc.FindObjectByName( "casGaronne_1_Reg_2" ) -casGaronne_1_Zone_3 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_3" ) -casGaronne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) +garonne_1.Update() +garonne_1_riveDroite = hydro_doc.FindObjectByName( "garonne_1_Reg_1" ) +garonne_1_Zone_1 = hydro_doc.FindObjectByName( "garonne_1_Zone_1" ) +garonne_1_Zone_1.SetColor( QColor( 64, 156, 192 )) +garonne_1_riveDroite.AddZone( garonne_1_Zone_1 ) +garonne_1_Zone_2 = hydro_doc.FindObjectByName( "garonne_1_Zone_2" ) +garonne_1_Zone_2.SetMergeType( HYDROData_Zone.Merge_Object ) +Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" ) +garonne_1_Zone_2.SetMergeObject( Cloud_02 ) +garonne_1_Zone_2.SetColor( QColor( 192, 183, 64 )) +garonne_1_riveDroite.AddZone( garonne_1_Zone_2 ) +garonne_1_aval = hydro_doc.FindObjectByName( "garonne_1_Reg_2" ) +garonne_1_Zone_3 = hydro_doc.FindObjectByName( "garonne_1_Zone_3" ) +garonne_1_Zone_3.SetMergeType( HYDROData_Zone.Merge_Object ) garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" ) -casGaronne_1_Zone_3.SetMergeObject( garonne_point_L93 ) -casGaronne_1_Zone_3.SetColor( QColor( 192, 183, 64 )) -casGaronne_1_aval.AddZone( casGaronne_1_Zone_3 ) -casGaronne_1_riveGauche = hydro_doc.FindObjectByName( "casGaronne_1_Reg_3" ) -casGaronne_1_Zone_4 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_4" ) -casGaronne_1_Zone_4.SetColor( QColor( 158, 192, 64 )) -casGaronne_1_riveGauche.AddZone( casGaronne_1_Zone_4 ) -casGaronne_1_Zone_6 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_6" ) -casGaronne_1_Zone_6.SetColor( QColor( 64, 192, 156 )) -casGaronne_1_riveGauche.AddZone( casGaronne_1_Zone_6 ) -casGaronne_1_pont = hydro_doc.FindObjectByName( "casGaronne_1_Reg_4" ) -casGaronne_1_Zone_5 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_5" ) -casGaronne_1_Zone_5.SetMergeType( HYDROData_Zone.Merge_Object ) +garonne_1_Zone_3.SetMergeObject( garonne_point_L93 ) +garonne_1_Zone_3.SetColor( QColor( 64, 183, 192 )) +garonne_1_aval.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, 192, 162 )) +garonne_1_riveGauche.AddZone( garonne_1_Zone_4 ) +garonne_1_Zone_6 = hydro_doc.FindObjectByName( "garonne_1_Zone_6" ) +garonne_1_Zone_6.SetColor( QColor( 64, 192, 90 )) +garonne_1_riveGauche.AddZone( garonne_1_Zone_6 ) +garonne_1_pont = hydro_doc.FindObjectByName( "garonne_1_Reg_4" ) +garonne_1_Zone_5 = hydro_doc.FindObjectByName( "garonne_1_Zone_5" ) +garonne_1_Zone_5.SetMergeType( HYDROData_Zone.Merge_Object ) garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" ) -casGaronne_1_Zone_5.SetMergeObject( garonne_point_L93 ) -casGaronne_1_Zone_5.SetColor( QColor( 192, 85, 64 )) -casGaronne_1_pont.AddZone( casGaronne_1_Zone_5 ) -casGaronne_1_amont = hydro_doc.FindObjectByName( "casGaronne_1_Reg_5" ) -casGaronne_1_Zone_7 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_7" ) -casGaronne_1_Zone_7.SetMergeType( HYDROData_Zone.Merge_Object ) +garonne_1_Zone_5.SetMergeObject( garonne_point_L93 ) +garonne_1_Zone_5.SetColor( QColor( 64, 190, 192 )) +garonne_1_pont.AddZone( garonne_1_Zone_5 ) +garonne_1_amont = hydro_doc.FindObjectByName( "garonne_1_Reg_5" ) +garonne_1_Zone_7 = hydro_doc.FindObjectByName( "garonne_1_Zone_7" ) +garonne_1_Zone_7.SetMergeType( HYDROData_Zone.Merge_Object ) garonne_point_L93 = hydro_doc.FindObjectByName( "garonne_point_L93" ) -casGaronne_1_Zone_7.SetMergeObject( garonne_point_L93 ) -casGaronne_1_Zone_7.SetColor( QColor( 64, 90, 192 )) -casGaronne_1_amont.AddZone( casGaronne_1_Zone_7 ) -casGaronne_1_pile1 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_6" ) -casGaronne_1_Zone_8 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_8" ) -casGaronne_1_Zone_8.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -casGaronne_1_Zone_8.SetColor( QColor( 64, 190, 192 )) -casGaronne_1_pile1.AddZone( casGaronne_1_Zone_8 ) -casGaronne_1_pile2 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_7" ) -casGaronne_1_Zone_9 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_9" ) -casGaronne_1_Zone_9.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -casGaronne_1_Zone_9.SetColor( QColor( 160, 192, 64 )) -casGaronne_1_pile2.AddZone( casGaronne_1_Zone_9 ) -casGaronne_1_pile3 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_8" ) -casGaronne_1_Zone_10 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_10" ) -casGaronne_1_Zone_10.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -casGaronne_1_Zone_10.SetColor( QColor( 192, 166, 64 )) -casGaronne_1_pile3.AddZone( casGaronne_1_Zone_10 ) -casGaronne_1_pile4 = hydro_doc.FindObjectByName( "casGaronne_1_Reg_9" ) -casGaronne_1_Zone_11 = hydro_doc.FindObjectByName( "casGaronne_1_Zone_11" ) -casGaronne_1_Zone_11.SetMergeType( HYDROData_Zone.Merge_ZMAX ) -casGaronne_1_Zone_11.SetColor( QColor( 64, 192, 92 )) -casGaronne_1_pile4.AddZone( casGaronne_1_Zone_11 ) -casGaronne_1_riveDroite.SetName( "casGaronne_1_riveDroite" ) -casGaronne_1_aval.SetName( "casGaronne_1_aval" ) -casGaronne_1_riveGauche.SetName( "casGaronne_1_riveGauche" ) -casGaronne_1_pont.SetName( "casGaronne_1_pont" ) -casGaronne_1_amont.SetName( "casGaronne_1_amont" ) -casGaronne_1_pile1.SetName( "casGaronne_1_pile1" ) -casGaronne_1_pile2.SetName( "casGaronne_1_pile2" ) -casGaronne_1_pile3.SetName( "casGaronne_1_pile3" ) -casGaronne_1_pile4.SetName( "casGaronne_1_pile4" ) +garonne_1_Zone_7.SetMergeObject( garonne_point_L93 ) +garonne_1_Zone_7.SetColor( QColor( 109, 192, 64 )) +garonne_1_amont.AddZone( garonne_1_Zone_7 ) +garonne_1_pile1 = hydro_doc.FindObjectByName( "garonne_1_Reg_6" ) +garonne_1_Zone_8 = hydro_doc.FindObjectByName( "garonne_1_Zone_8" ) +garonne_1_Zone_8.SetMergeType( HYDROData_Zone.Merge_ZMAX ) +garonne_1_Zone_8.SetColor( QColor( 192, 179, 64 )) +garonne_1_pile1.AddZone( garonne_1_Zone_8 ) +garonne_1_pile2 = hydro_doc.FindObjectByName( "garonne_1_Reg_7" ) +garonne_1_Zone_9 = hydro_doc.FindObjectByName( "garonne_1_Zone_9" ) +garonne_1_Zone_9.SetMergeType( HYDROData_Zone.Merge_ZMAX ) +garonne_1_Zone_9.SetColor( QColor( 192, 75, 64 )) +garonne_1_pile2.AddZone( garonne_1_Zone_9 ) +garonne_1_pile3 = hydro_doc.FindObjectByName( "garonne_1_Reg_8" ) +garonne_1_Zone_10 = hydro_doc.FindObjectByName( "garonne_1_Zone_10" ) +garonne_1_Zone_10.SetMergeType( HYDROData_Zone.Merge_ZMAX ) +garonne_1_Zone_10.SetColor( QColor( 162, 192, 64 )) +garonne_1_pile3.AddZone( garonne_1_Zone_10 ) +garonne_1_pile4 = hydro_doc.FindObjectByName( "garonne_1_Reg_9" ) +garonne_1_Zone_11 = hydro_doc.FindObjectByName( "garonne_1_Zone_11" ) +garonne_1_Zone_11.SetMergeType( HYDROData_Zone.Merge_ZMAX ) +garonne_1_Zone_11.SetColor( QColor( 64, 192, 81 )) +garonne_1_pile4.AddZone( garonne_1_Zone_11 ) +garonne_1_riveDroite.SetName( "garonne_1_riveDroite" ) +garonne_1_aval.SetName( "garonne_1_aval" ) +garonne_1_riveGauche.SetName( "garonne_1_riveGauche" ) +garonne_1_pont.SetName( "garonne_1_pont" ) +garonne_1_amont.SetName( "garonne_1_amont" ) +garonne_1_pile1.SetName( "garonne_1_pile1" ) +garonne_1_pile2.SetName( "garonne_1_pile2" ) +garonne_1_pile3.SetName( "garonne_1_pile3" ) +garonne_1_pile4.SetName( "garonne_1_pile4" ) # Export of the calculation case -casGaronne_1_entry = casGaronne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() # Get geometry shape and print debug information import GEOM -print "Entry:", casGaronne_1_entry -HYDRO_casGaronne_1 = salome.IDToObject( str( casGaronne_1_entry ) ) -print "Geom shape:", HYDRO_casGaronne_1 -print "Geom shape name:", HYDRO_casGaronne_1.GetName() +print("Entry:", garonne_1_entry) +HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) +print("Geom shape:", HYDRO_garonne_1) +print("Geom shape name:", HYDRO_garonne_1.GetName()) ### @@ -1046,94 +1052,105 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) - -casGaronne_1_pile3_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_pile3_Outer, [68, 70, 66, 63]) -casGaronne_1_pile1_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_pile1_Outer, [77, 79, 75, 72]) -casGaronne_1_pile2_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_pile2_Outer, [57, 54, 59, 61]) -casGaronne_1_pile4_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_pile4_Outer, [84, 81, 86, 88]) -casGaronne_1_litMineur_amont_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_litMineur_amont_Outer, [21, 39]) -casGaronne_1_litMineur_aval_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_litMineur_aval_Outer, [17, 30]) -casGaronne_1_litMineur_pont_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_litMineur_pont_Outer, [52, 32, 19, 37]) -casGaronne_1_domaineEtendu_Outer = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(casGaronne_1_domaineEtendu_Outer, [28, 91, 13, 4, 7, 9, 11, 15, 23, 25, 35, 43, 41, 49, 47, 45]) -geomObj_1 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_1, [52, 32, 19, 37]) -geomObj_2 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_2, [57, 54, 59, 61]) -geomObj_3 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_3, [21, 39]) -geomObj_4 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_4, [17, 30]) -geomObj_5 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_5, [77, 79, 75, 72]) -geomObj_6 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_6, [84, 81, 86, 88]) -geomObj_7 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_7, [28, 91, 13, 4, 7, 9, 11, 15, 23, 25, 35, 43, 41, 49, 47, 45]) -geomObj_8 = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(geomObj_8, [68, 70, 66, 63]) -riveDroite = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(riveDroite, [2]) -riveGauche = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(riveGauche, [33]) -litMineur_aval = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_aval, [26]) -litMineur_pont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_pont, [50]) -litMineur_amont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(litMineur_amont, [89]) -sections = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(sections, [32, 91, 28, 52]) -amont = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(amont, [91]) -aval = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(aval, [28]) -bordDroit = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(bordDroit, [4, 7, 25, 9, 15, 23, 13, 11]) -bordGauche = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(bordGauche, [43, 45, 49, 47, 41, 35]) -piles = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(piles, [57, 75, 88, 68, 63, 59, 54, 77, 61, 86, 81, 66, 84, 72, 70, 79]) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_pile3_Outer, 'casGaronne_1_pile3_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_pile1_Outer, 'casGaronne_1_pile1_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_pile2_Outer, 'casGaronne_1_pile2_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_pile4_Outer, 'casGaronne_1_pile4_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_litMineur_amont_Outer, 'casGaronne_1_litMineur_amont_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_litMineur_aval_Outer, 'casGaronne_1_litMineur_aval_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_litMineur_pont_Outer, 'casGaronne_1_litMineur_pont_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, casGaronne_1_domaineEtendu_Outer, 'casGaronne_1_domaineEtendu_Outer' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, riveDroite, 'riveDroite' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, riveGauche, 'riveGauche' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, litMineur_aval, 'litMineur_aval' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, litMineur_pont, 'litMineur_pont' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, litMineur_amont, 'litMineur_amont' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, sections, 'sections' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, amont, 'amont' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, aval, 'aval' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, bordDroit, 'bordDroit' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, bordGauche, 'bordGauche' ) -geompy.addToStudyInFather( HYDRO_casGaronne_1, piles, 'piles' ) +geompy = geomBuilder.New() -# --- basic properties control: edges length, surfaces -#controlGeomProps(geompy, riveGauche, 29149.1353799, 35950762.8967) -#controlGeomProps(geompy, litMineur_aval, 7965.23431497, 938890.904721) -#controlGeomProps(geompy, litMineur_pont, 961.8255222, 19618.0787789) -#controlGeomProps(geompy, litMineur_amont, 22635.6212065, 2548509.17447) -#controlGeomProps(geompy, riveDroite, 32012.2241814, 26188706.2202) -controlGeomProps(geompy, riveGauche, 29149.1353799, 35949580.6716) -controlGeomProps(geompy, litMineur_aval, 7965.23431497, 935955.786347) -controlGeomProps(geompy, litMineur_pont, 961.8255222, 19618.016847) -controlGeomProps(geompy, litMineur_amont, 22635.6212065, 2531409.65041) -controlGeomProps(geompy, riveDroite, 32012.2241814, 25998085.6892) +[garonne_riveDroite,garonne_aval,garonne_riveGauche,garonne_pont,garonne_amont] = geompy.SubShapeAll(HYDRO_garonne_1, geompy.ShapeType["FACE"]) +# --- basic properties control: edges length, surfaces +controlGeomProps(geompy, garonne_riveGauche, 29149.1353799, 35949580.6716) +controlGeomProps(geompy, garonne_aval, 7965.23431497, 935955.786347) +controlGeomProps(geompy, garonne_pont, 961.8255222, 19618.016847) +controlGeomProps(geompy, garonne_amont, 22635.6212065, 2531409.65041) +controlGeomProps(geompy, garonne_riveDroite, 32012.2241814, 25998085.6892) + +# --- manual identification of all useful edge groups (boundary conditions) + +allEdgesIds = geompy.SubShapeAllIDs(HYDRO_garonne_1, geompy.ShapeType["EDGE"]) +print("allEdgesIds", allEdgesIds) + +(isDone, ClosedFreeBoundary, OpenFreeBoundary) = geompy.GetFreeBoundary(HYDRO_garonne_1) +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[0], "OuterFreeBoundary") +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[1], "pilesPont1") +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[2], "pilesPont2") +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[3], "pilesPont3") +geompy.addToStudyInFather(HYDRO_garonne_1, ClosedFreeBoundary[4], "pilesPont4") + +freeBoundary = geompy.ExtractShapes(ClosedFreeBoundary[0], geompy.ShapeType["EDGE"], True) +freeBoundaryIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, freeBoundary[i]) for i in range(len(freeBoundary)) ] +print("freeBoundaryIds", freeBoundaryIds) + +edgesPile1 = geompy.ExtractShapes(ClosedFreeBoundary[1], geompy.ShapeType["EDGE"], True) +edgesPile2 = geompy.ExtractShapes(ClosedFreeBoundary[2], geompy.ShapeType["EDGE"], True) +edgesPile3 = geompy.ExtractShapes(ClosedFreeBoundary[3], geompy.ShapeType["EDGE"], True) +edgesPile4 = geompy.ExtractShapes(ClosedFreeBoundary[4], geompy.ShapeType["EDGE"], True) +pilesPont1Ids = [ geompy.GetSubShapeID(HYDRO_garonne_1, edgesPile1[i]) for i in range(len(edgesPile1)) ] +pilesPont2Ids = [ geompy.GetSubShapeID(HYDRO_garonne_1, edgesPile2[i]) for i in range(len(edgesPile2)) ] +pilesPont3Ids = [ geompy.GetSubShapeID(HYDRO_garonne_1, edgesPile3[i]) for i in range(len(edgesPile3)) ] +pilesPont4Ids = [ geompy.GetSubShapeID(HYDRO_garonne_1, edgesPile4[i]) for i in range(len(edgesPile4)) ] +pilesPontIds = pilesPont1Ids + pilesPont2Ids + pilesPont3Ids + pilesPont4Ids +print("pilesPontIds", pilesPontIds) + +[garonne_aval_droite] = geompy.GetSharedShapesMulti([garonne_riveDroite, garonne_aval], geompy.ShapeType["EDGE"], True) +[garonne_aval_gauche] = geompy.GetSharedShapesMulti([garonne_riveGauche, garonne_aval], geompy.ShapeType["EDGE"], True) +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_aval_droite, "garonne_aval_droite") +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_aval_gauche, "garonne_aval_gauche") +[garonne_amont_droite] = geompy.GetSharedShapesMulti([garonne_riveDroite, garonne_amont], geompy.ShapeType["EDGE"], True) +[garonne_amont_gauche] = geompy.GetSharedShapesMulti([garonne_riveGauche, garonne_amont], geompy.ShapeType["EDGE"], True) +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_amont_droite, "garonne_amont_droite") +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_amont_gauche, "garonne_amont_gauche") +[garonne_pont_droite] = geompy.GetSharedShapesMulti([garonne_riveDroite, garonne_pont], geompy.ShapeType["EDGE"], True) +[garonne_pont_gauche] = geompy.GetSharedShapesMulti([garonne_riveGauche, garonne_pont], geompy.ShapeType["EDGE"], True) +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_pont_droite, "garonne_pont_droite") +geompy.addToStudyInFather(HYDRO_garonne_1, garonne_pont_gauche, "garonne_pont_gauche") +rives = [garonne_aval_droite, garonne_aval_gauche, garonne_amont_droite, garonne_amont_gauche, garonne_pont_droite, garonne_pont_gauche] +rivesIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, rives[i]) for i in range(len(rives)) ] +print("rivesIds", rivesIds) + +edges_garonne_aval = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_aval], geompy.ShapeType["EDGE"], True) +edges_garonne_amont = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_amont], geompy.ShapeType["EDGE"], True) +edges_garonne_pont = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_pont], geompy.ShapeType["EDGE"], True) +edges_riveGauche = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_riveGauche], geompy.ShapeType["EDGE"], True) +edges_riveDroite = geompy.GetSharedShapesMulti([HYDRO_garonne_1, garonne_riveDroite], geompy.ShapeType["EDGE"], True) +edges_garonne_avalIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_garonne_aval[i]) for i in range(len(edges_garonne_aval)) ] +edges_garonne_amontIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_garonne_amont[i]) for i in range(len(edges_garonne_amont)) ] +edges_garonne_pontIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_garonne_pont[i]) for i in range(len(edges_garonne_pont)) ] +edges_riveGaucheIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_riveGauche[i]) for i in range(len(edges_riveGauche)) ] +edges_riveDroiteIds = [ geompy.GetSubShapeID(HYDRO_garonne_1, edges_riveDroite[i]) for i in range(len(edges_riveDroite)) ] + +print("edges_garonne_amontIds", edges_garonne_amontIds) +print("edges_garonne_avalIds", edges_garonne_avalIds) +print("edges_garonne_pontIds", edges_garonne_pontIds) +print("edges_riveGaucheIds", edges_riveGaucheIds) +print("edges_riveDroiteIds", edges_riveDroiteIds) + +edges_litMineurIds = edges_garonne_amontIds +for edge in edges_garonne_avalIds: + edges_litMineurIds.append(edge) +for edge in edges_garonne_pontIds: + if edge not in edges_litMineurIds and edge not in pilesPontIds: + edges_litMineurIds.append(edge) + +sectionsIds = [Id for Id in edges_litMineurIds if Id not in rivesIds] +print("sectionsIds", sectionsIds) +SectionsGaronne = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"]) +geompy.UnionIDs(SectionsGaronne, sectionsIds) +geompy.addToStudyInFather(HYDRO_garonne_1, SectionsGaronne, "SectionsGaronne") + +bordGaucheDomaineIds = [Id for Id in freeBoundaryIds if Id in edges_riveGaucheIds] +bordDroiteDomaineIds = [Id for Id in freeBoundaryIds if Id in edges_riveDroiteIds] +print("bordGaucheDomaineIds", bordGaucheDomaineIds) +print("bordDroiteDomaineIds", bordDroiteDomaineIds) +bordGaucheDomaine = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"]) +geompy.UnionIDs(bordGaucheDomaine, bordGaucheDomaineIds) +geompy.addToStudyInFather(HYDRO_garonne_1, bordGaucheDomaine, "bordGaucheDomaine") +bordDroiteDomaine = geompy.CreateGroup(HYDRO_garonne_1, geompy.ShapeType["EDGE"]) +geompy.UnionIDs(bordDroiteDomaine, bordDroiteDomaineIds) +geompy.addToStudyInFather(HYDRO_garonne_1, bordDroiteDomaine, "bordDroiteDomaine") + +amont = geompy.GetEdgeNearPoint(HYDRO_garonne_1, geompy.MakeVertex(46757.861314, 25833.234752, 0)) +aval = geompy.GetEdgeNearPoint(HYDRO_garonne_1, geompy.MakeVertex(39078.979127, 32588.627279, 0)) +geompy.addToStudyInFather(HYDRO_garonne_1, amont, "amont") +geompy.addToStudyInFather(HYDRO_garonne_1, aval, "aval") ### ### SMESH component ### @@ -1141,11 +1158,12 @@ controlGeomProps(geompy, riveDroite, 32012.2241814, 25998085.6892) import SMESH, SALOMEDS from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats +import tempfile -smesh = smeshBuilder.New(theStudy) -casGaronne_1 = smesh.Mesh(HYDRO_casGaronne_1) -NETGEN_2D = casGaronne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D) -NETGEN_2D_Parameters_1 = NETGEN_2D.Parameters() +smesh = smeshBuilder.New() +garonne_1 = smesh.Mesh(HYDRO_garonne_1) +NETGEN_1D_2D = garonne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D) +NETGEN_2D_Parameters_1 = NETGEN_1D_2D.Parameters() NETGEN_2D_Parameters_1.SetMaxSize( 200 ) NETGEN_2D_Parameters_1.SetSecondOrder( 0 ) NETGEN_2D_Parameters_1.SetOptimize( 1 ) @@ -1154,23 +1172,21 @@ NETGEN_2D_Parameters_1.SetMinSize( 50 ) NETGEN_2D_Parameters_1.SetUseSurfaceCurvature( 1 ) NETGEN_2D_Parameters_1.SetFuseEdges( 1 ) NETGEN_2D_Parameters_1.SetQuadAllowed( 0 ) -Regular_1D = casGaronne_1.Segment(geom=litMineur_aval) -litMineur_aval_1 = Regular_1D.GetSubMesh() -nbseg_litMineur_aval = Regular_1D.NumberOfSegments(100) -QuadFromMedialAxis_1D2D = casGaronne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=litMineur_aval) -nbseg_litMineur_amont = smesh.CreateHypothesis('NumberOfSegments') -nbseg_litMineur_amont.SetNumberOfSegments( 150 ) -Regular_1D_1 = casGaronne_1.Segment(geom=litMineur_amont) -litMineur_amont_1 = Regular_1D_1.GetSubMesh() -nbSeg_litMineur_amont = Regular_1D_1.NumberOfSegments(150) -QuadFromMedialAxis_1D2D_1 = casGaronne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=litMineur_amont) -Regular_1D_2 = casGaronne_1.Segment(geom=sections) -sections_1 = Regular_1D_2.GetSubMesh() -nbseg_sections = Regular_1D_2.NumberOfSegments(10) -isDone = casGaronne_1.SetMeshOrder( [ [ sections_1, litMineur_aval_1, litMineur_amont_1 ] ]) -NETGEN_2D_1 = casGaronne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D,geom=litMineur_pont) -litMineur_pont_1 = NETGEN_2D_1.GetSubMesh() -NETGEN_2D_Parameters_2 = NETGEN_2D_1.Parameters() +Regular_1D = garonne_1.Segment(geom=garonne_aval) +garonne_aval_1 = Regular_1D.GetSubMesh() +Number_of_Segments_1 = Regular_1D.NumberOfSegments(100) +QuadFromMedialAxis_1D2D = garonne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=garonne_aval) +Regular_1D_1 = garonne_1.Segment(geom=garonne_amont) +garonne_amont_1 = Regular_1D_1.GetSubMesh() +Number_of_Segments_2 = Regular_1D_1.NumberOfSegments(150) +QuadFromMedialAxis_1D2D_1 = garonne_1.Quadrangle(algo=smeshBuilder.QUAD_MA_PROJ,geom=garonne_amont) +Regular_1D_2 = garonne_1.Segment(geom=SectionsGaronne) +sections = Regular_1D_2.GetSubMesh() +Number_of_Segments_3 = Regular_1D_2.NumberOfSegments(10) +isDone = garonne_1.SetMeshOrder( [ [ sections, garonne_aval_1, garonne_amont_1 ] ]) +NETGEN_1D_2D_1 = garonne_1.Triangle(algo=smeshBuilder.NETGEN_1D2D,geom=garonne_pont) +garonne_pont_1 = NETGEN_1D_2D_1.GetSubMesh() +NETGEN_2D_Parameters_2 = NETGEN_1D_2D_1.Parameters() NETGEN_2D_Parameters_2.SetMaxSize( 50 ) NETGEN_2D_Parameters_2.SetSecondOrder( 0 ) NETGEN_2D_Parameters_2.SetOptimize( 1 ) @@ -1179,74 +1195,90 @@ NETGEN_2D_Parameters_2.SetMinSize( 10 ) NETGEN_2D_Parameters_2.SetUseSurfaceCurvature( 1 ) NETGEN_2D_Parameters_2.SetFuseEdges( 1 ) NETGEN_2D_Parameters_2.SetQuadAllowed( 0 ) -isDone = casGaronne_1.SetMeshOrder( [ [ sections_1, litMineur_aval_1, litMineur_amont_1, litMineur_pont_1 ] ]) -isDone = casGaronne_1.Compute() -isDone = casGaronne_1.SplitQuadObject( casGaronne_1, 1 ) - - -riveDroite_1 = casGaronne_1.GroupOnGeom(riveDroite,'riveDroite',SMESH.FACE) -riveGauche_1 = casGaronne_1.GroupOnGeom(riveGauche,'riveGauche',SMESH.FACE) -litMineur_aval_2 = casGaronne_1.GroupOnGeom(litMineur_aval,'litMineur_aval',SMESH.FACE) -litMineur_pont_2 = casGaronne_1.GroupOnGeom(litMineur_pont,'litMineur_pont',SMESH.FACE) -litMineur_amont_2 = casGaronne_1.GroupOnGeom(litMineur_amont,'litMineur_amont',SMESH.FACE) -riveDroite_2 = casGaronne_1.GroupOnGeom(riveDroite,'riveDroite',SMESH.NODE) -riveGauche_2 = casGaronne_1.GroupOnGeom(riveGauche,'riveGauche',SMESH.NODE) -litMineur_aval_3 = casGaronne_1.GroupOnGeom(litMineur_aval,'litMineur_aval',SMESH.NODE) -litMineur_pont_3 = casGaronne_1.GroupOnGeom(litMineur_pont,'litMineur_pont',SMESH.NODE) -litMineur_amont_3 = casGaronne_1.GroupOnGeom(litMineur_amont,'litMineur_amont',SMESH.NODE) -sections_2 = casGaronne_1.GroupOnGeom(sections,'sections',SMESH.EDGE) -amont_1 = casGaronne_1.GroupOnGeom(amont,'amont',SMESH.EDGE) -aval_1 = casGaronne_1.GroupOnGeom(aval,'aval',SMESH.EDGE) -bordDroit_1 = casGaronne_1.GroupOnGeom(bordDroit,'bordDroit',SMESH.EDGE) -bordGauche_1 = casGaronne_1.GroupOnGeom(bordGauche,'bordGauche',SMESH.EDGE) -piles_1 = casGaronne_1.GroupOnGeom(piles,'piles',SMESH.EDGE) -sections_3 = casGaronne_1.GroupOnGeom(sections,'sections',SMESH.NODE) -amont_2 = casGaronne_1.GroupOnGeom(amont,'amont',SMESH.NODE) -aval_2 = casGaronne_1.GroupOnGeom(aval,'aval',SMESH.NODE) -bordDroit_2 = casGaronne_1.GroupOnGeom(bordDroit,'bordDroit',SMESH.NODE) -bordGauche_2 = casGaronne_1.GroupOnGeom(bordGauche,'bordGauche',SMESH.NODE) -piles_2 = casGaronne_1.GroupOnGeom(piles,'piles',SMESH.NODE) +isDone = garonne_1.SetMeshOrder( [ [ sections, garonne_aval_1, garonne_amont_1, garonne_pont_1 ] ]) +isDone = garonne_1.Compute() +isDone = garonne_1.SplitQuadObject( garonne_1, 1 ) + +# --- geometrical groups of faces + +garonne_riveDroite_2 = garonne_1.GroupOnGeom(garonne_riveDroite,'garonne_riveDroite',SMESH.FACE) +garonne_aval_2 = garonne_1.GroupOnGeom(garonne_aval,'garonne_aval',SMESH.FACE) +garonne_riveGauche_2 = garonne_1.GroupOnGeom(garonne_riveGauche,'garonne_riveGauche',SMESH.FACE) +garonne_pont_2 = garonne_1.GroupOnGeom(garonne_pont,'garonne_pont',SMESH.FACE) +garonne_amont_2 = garonne_1.GroupOnGeom(garonne_amont,'garonne_amont',SMESH.FACE) + +# --- geometrical groups of edges + +ClosedFreeBoundary_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[0],'ClosedFreeBoundary',SMESH.EDGE) +garonne_amont_droite_2 = garonne_1.GroupOnGeom(garonne_amont_droite,'garonne_amont_droite',SMESH.EDGE) +garonne_amont_gauche_2 = garonne_1.GroupOnGeom(garonne_amont_gauche,'garonne_amont_gauche',SMESH.EDGE) +garonne_aval_droite_2 = garonne_1.GroupOnGeom(garonne_aval_droite,'garonne_aval_droite',SMESH.EDGE) +garonne_aval_gauche_2 = garonne_1.GroupOnGeom(garonne_aval_gauche,'garonne_aval_gauche',SMESH.EDGE) +garonne_pont_droite_2 = garonne_1.GroupOnGeom(garonne_pont_droite,'garonne_pont_droite',SMESH.EDGE) +garonne_pont_gauche_2 = garonne_1.GroupOnGeom(garonne_pont_gauche,'garonne_pont_gauche',SMESH.EDGE) +SectionsGaronne_1 = garonne_1.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.EDGE) +bordGaucheDomaine_1 = garonne_1.GroupOnGeom(bordGaucheDomaine,'bordGaucheDomaine',SMESH.EDGE) +bordDroiteDomaine_1 = garonne_1.GroupOnGeom(bordDroiteDomaine,'bordDroiteDomaine',SMESH.EDGE) +amont_1 = garonne_1.GroupOnGeom(amont,'amont',SMESH.EDGE) +aval_1 = garonne_1.GroupOnGeom(aval,'aval',SMESH.EDGE) +pilePont1_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[1],'pilePont1',SMESH.EDGE) +pilePont2_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[2],'pilePont2',SMESH.EDGE) +pilePont3_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[3],'pilePont3',SMESH.EDGE) +pilePont4_1 = garonne_1.GroupOnGeom(ClosedFreeBoundary[4],'pilePont4',SMESH.EDGE) + +# --- geometrical groups of nodes + +garonne_amont_3 = garonne_1.GroupOnGeom(garonne_amont,'garonne_amont',SMESH.NODE) +garonne_aval_3 = garonne_1.GroupOnGeom(garonne_aval,'garonne_aval',SMESH.NODE) +garonne_pont_3 = garonne_1.GroupOnGeom(garonne_pont,'garonne_pont',SMESH.NODE) +garonne_riveDroite_3 = garonne_1.GroupOnGeom(garonne_riveDroite,'garonne_riveDroite',SMESH.NODE) +garonne_riveGauche_3 = garonne_1.GroupOnGeom(garonne_riveGauche,'garonne_riveGauche',SMESH.NODE) +ClosedFreeBoundary_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[0],'ClosedFreeBoundary',SMESH.NODE) +garonne_amont_droite_2 = garonne_1.GroupOnGeom(garonne_amont_droite,'garonne_amont_droite',SMESH.NODE) +garonne_amont_gauche_2 = garonne_1.GroupOnGeom(garonne_amont_gauche,'garonne_amont_gauche',SMESH.NODE) +garonne_aval_droite_2 = garonne_1.GroupOnGeom(garonne_aval_droite,'garonne_aval_droite',SMESH.NODE) +garonne_aval_gauche_2 = garonne_1.GroupOnGeom(garonne_aval_gauche,'garonne_aval_gauche',SMESH.NODE) +garonne_pont_droite_2 = garonne_1.GroupOnGeom(garonne_pont_droite,'garonne_pont_droite',SMESH.NODE) +garonne_pont_gauche_2 = garonne_1.GroupOnGeom(garonne_pont_gauche,'garonne_pont_gauche',SMESH.NODE) +SectionsGaronne_2 = garonne_1.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.NODE) +bordGaucheDomaine_2 = garonne_1.GroupOnGeom(bordGaucheDomaine,'bordGaucheDomaine',SMESH.NODE) +bordDroiteDomaine_2 = garonne_1.GroupOnGeom(bordDroiteDomaine,'bordDroiteDomaine',SMESH.NODE) +amont_2 = garonne_1.GroupOnGeom(amont,'amont',SMESH.NODE) +aval_2 = garonne_1.GroupOnGeom(aval,'aval',SMESH.NODE) +pilePont1_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[1],'pilePont1',SMESH.NODE) +pilePont2_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[2],'pilePont2',SMESH.NODE) +pilePont3_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[3],'pilePont3',SMESH.NODE) +pilePont4_2 = garonne_1.GroupOnGeom(ClosedFreeBoundary[4],'pilePont4',SMESH.NODE) ## Set names of Mesh objects +smesh.SetName(NETGEN_1D_2D.GetAlgorithm(), 'NETGEN 1D-2D') smesh.SetName(QuadFromMedialAxis_1D2D.GetAlgorithm(), 'QuadFromMedialAxis_1D2D') smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D') -smesh.SetName(NETGEN_2D.GetAlgorithm(), 'NETGEN_2D') -smesh.SetName(casGaronne_1.GetMesh(), 'casGaronne_1') -smesh.SetName(litMineur_pont_1, 'litMineur_pont') -smesh.SetName(litMineur_amont_1, 'litMineur_amont') -smesh.SetName(litMineur_aval_1, 'litMineur_aval') -smesh.SetName(nbSeg_litMineur_amont, 'nbSeg_litMineur_amont') -smesh.SetName(nbseg_sections, 'nbseg_sections') -smesh.SetName(NETGEN_2D_Parameters_2, 'NETGEN 2D Parameters_2') +smesh.SetName(Number_of_Segments_1, 'Number of Segments_1') +smesh.SetName(Number_of_Segments_2, 'Number of Segments_2') smesh.SetName(NETGEN_2D_Parameters_1, 'NETGEN 2D Parameters_1') -smesh.SetName(nbseg_litMineur_aval, 'nbseg_litMineur_aval') -smesh.SetName(nbseg_litMineur_amont, 'nbseg_litMineur_amont') -smesh.SetName(sections_1, 'sections') - -med_file = r'/tmp/casGaronne_1.med' - -try: - os.remove(med_file) -except OSError: - pass +smesh.SetName(Number_of_Segments_3, 'Number of Segments_3') +smesh.SetName(NETGEN_2D_Parameters_2, 'NETGEN 2D Parameters_2') +smesh.SetName(garonne_aval_1, 'submesh_garonne_aval') +smesh.SetName(garonne_pont_1, 'submesh_garonne_pont') +smesh.SetName(garonne_amont_1, 'submesh_garonne_amont') +smesh.SetName(garonne_1.GetMesh(), 'submesh_garonne_1') +smesh.SetName(sections, 'submesh_sections') -casGaronne_1.SetAutoColor( 1 ) -casGaronne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1) -#controlMeshStats(casGaronne_1, 7040, 746, 13871) -#controlSubMeshStats(litMineur_pont_2, 204) -#controlSubMeshStats(litMineur_amont_2, 3000) -#controlSubMeshStats(litMineur_aval_2, 2000) -#controlSubMeshStats(riveDroite_1, 4040) -#controlSubMeshStats(riveGauche_1, 4627) -controlMeshStats(casGaronne_1, 6985, 745, 13761) -controlSubMeshStats(litMineur_pont_2, 185) -controlSubMeshStats(litMineur_amont_2, 3000) -controlSubMeshStats(litMineur_aval_2, 2000) -controlSubMeshStats(riveDroite_1, 3941) -controlSubMeshStats(riveGauche_1, 4635) +garonne_1.SetAutoColor( 1 ) +tmpdir = tempfile.mkdtemp() +print("tmpdir=",tmpdir) +fichierMaillage = os.path.join(tmpdir, 'garonne_1.med') +garonne_1.ExportMED(fichierMaillage, 0, SMESH.MED_V2_2, 1, None ,1) +controlMeshStats(garonne_1, 6985, 745, 13761) +controlSubMeshStats(garonne_pont_2, 202) +controlSubMeshStats(garonne_amont_2, 3000) +controlSubMeshStats(garonne_aval_2, 2000) +controlSubMeshStats(garonne_riveDroite_2, 3941) +controlSubMeshStats(garonne_riveGauche_2, 4635) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser()