###
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() )
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_Zone_1.SetColor( QColor( 64, 156, 192 ))
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_Zone_2.SetMergeType( HYDROData_Zone.Merge_Object )
+Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" )
+casGaronne_1_Zone_2.SetMergeObject( Cloud_02 )
+casGaronne_1_Zone_2.SetColor( QColor( 192, 183, 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_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_Zone_3.SetColor( QColor( 64, 183, 192 ))
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_Zone_4.SetMergeType( HYDROData_Zone.Merge_Object )
+Cloud_02 = hydro_doc.FindObjectByName( "Cloud_02" )
+casGaronne_1_Zone_4.SetMergeObject( Cloud_02 )
+casGaronne_1_Zone_4.SetColor( QColor( 64, 192, 162 ))
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_Zone_6.SetColor( QColor( 64, 192, 90 ))
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_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_Zone_5.SetColor( QColor( 64, 190, 192 ))
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_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_Zone_7.SetColor( QColor( 109, 192, 64 ))
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_Zone_8.SetColor( QColor( 192, 179, 64 ))
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_Zone_9.SetColor( QColor( 192, 75, 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_Zone_10.SetColor( QColor( 162, 192, 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_Zone_11.SetColor( QColor( 64, 192, 81 ))
casGaronne_1_pile4.AddZone( casGaronne_1_Zone_11 )
casGaronne_1_riveDroite.SetName( "casGaronne_1_riveDroite" )
casGaronne_1_aval.SetName( "casGaronne_1_aval" )
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])
+geompy.UnionIDs(sections, [28, 32, 52, 91])
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])
+geompy.UnionIDs(bordDroit, [4, 7, 9, 11, 13, 15, 23, 25])
bordGauche = geompy.CreateGroup(HYDRO_casGaronne_1, geompy.ShapeType["EDGE"])
-geompy.UnionIDs(bordGauche, [43, 45, 49, 47, 41, 35])
+geompy.UnionIDs(bordGauche, [35, 41, 43, 45, 47, 49])
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.UnionIDs(piles, [73,58,71,49,55,67,46,80,53,76,78,62,69,60,51,64])
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' )
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
+
+
casGaronne_1.SetAutoColor( 1 )
-casGaronne_1.ExportMED( r'/tmp/casGaronne_1.med', 0, SMESH.MED_V2_2, 1, None ,1)
+casGaronne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
controlMeshStats(casGaronne_1, 6985, 745, 13761)
-controlSubMeshStats(litMineur_pont_2, 185)
+controlSubMeshStats(litMineur_pont_2, 202)
controlSubMeshStats(litMineur_amont_2, 3000)
controlSubMeshStats(litMineur_aval_2, 2000)
controlSubMeshStats(riveDroite_1, 3941)