From 8f433a58abdb4526084746cde5f6479d7c62104b Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Wed, 22 May 2019 15:59:33 +0200 Subject: [PATCH] Python test scripts, first pass --- doc/salome/examples/h001_importImage.py | 4 ++-- doc/salome/examples/h002_importImage.py | 4 ++-- doc/salome/examples/h003_changeLCS.py | 4 ++-- doc/salome/examples/h004_importBathyXYZ.py | 4 ++-- doc/salome/examples/h005_importImageBad.py | 4 ++-- doc/salome/examples/h006_importBathyXYZBad.py | 4 ++-- doc/salome/examples/h007_createPolySplineClosed.py | 4 ++-- doc/salome/examples/h008_simpleCase.py | 8 ++++---- doc/salome/examples/h009_normalCaseManual.py | 8 ++++---- doc/salome/examples/h010_normalCaseManualMesh.py | 10 +++++----- doc/salome/examples/h011_normalCaseManualInterpolZ.py | 10 +++++----- doc/salome/examples/h012_caseDigueManual.py | 8 ++++---- doc/salome/examples/h013_caseDigueManualMesh.py | 10 +++++----- doc/salome/examples/h014_caseDigueManualInterpolZ.py | 10 +++++----- doc/salome/examples/h015_normalCaseManualTelemac.py | 10 +++++----- doc/salome/examples/h016_pilesPontManualMesh.py | 10 +++++----- doc/salome/examples/h017_interpolationLineaire.py | 10 +++++----- doc/salome/examples/h018_streamInterpolation.py | 10 +++++----- .../h019_normalCaseManualInterpolZStrickler.py | 10 +++++----- 19 files changed, 71 insertions(+), 71 deletions(-) diff --git a/doc/salome/examples/h001_importImage.py b/doc/salome/examples/h001_importImage.py index 4c33e30e..9b6bb351 100644 --- a/doc/salome/examples/h001_importImage.py +++ b/doc/salome/examples/h001_importImage.py @@ -13,7 +13,7 @@ from HYDROPy 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( 0, 0 ) @@ -33,4 +33,4 @@ garonne_ign_01.SetGlobalPoints( 1, garonne_ign_01.Update() if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h002_importImage.py b/doc/salome/examples/h002_importImage.py index d67dc5a7..52d94fa7 100644 --- a/doc/salome/examples/h002_importImage.py +++ b/doc/salome/examples/h002_importImage.py @@ -13,7 +13,7 @@ from HYDROPy 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( 0, 0 ) @@ -55,4 +55,4 @@ garonne_ign_02.SetTrsfReferenceImage( garonne_ign_01 ) garonne_ign_02.Update() if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h003_changeLCS.py b/doc/salome/examples/h003_changeLCS.py index f7cf5285..3fff5a70 100644 --- a/doc/salome/examples/h003_changeLCS.py +++ b/doc/salome/examples/h003_changeLCS.py @@ -13,7 +13,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -55,4 +55,4 @@ garonne_ign_02.SetTrsfReferenceImage( garonne_ign_01 ) garonne_ign_02.Update() if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h004_importBathyXYZ.py b/doc/salome/examples/h004_importBathyXYZ.py index c4041bc1..79a96e4c 100644 --- a/doc/salome/examples/h004_importBathyXYZ.py +++ b/doc/salome/examples/h004_importBathyXYZ.py @@ -13,7 +13,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -27,4 +27,4 @@ if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))): Cloud_02.Update() if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h005_importImageBad.py b/doc/salome/examples/h005_importImageBad.py index 86340d7c..9a271c5e 100644 --- a/doc/salome/examples/h005_importImageBad.py +++ b/doc/salome/examples/h005_importImageBad.py @@ -13,7 +13,7 @@ from HYDROPy 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( 0, 0 ) @@ -26,4 +26,4 @@ if ret: raise ValueError('loading problem not detected: return value should be null') if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h006_importBathyXYZBad.py b/doc/salome/examples/h006_importBathyXYZBad.py index a5dae4f5..88d3418d 100644 --- a/doc/salome/examples/h006_importBathyXYZBad.py +++ b/doc/salome/examples/h006_importBathyXYZBad.py @@ -13,7 +13,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -27,4 +27,4 @@ if ret: raise ValueError('loading problem not detected: return value should be null') if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h007_createPolySplineClosed.py b/doc/salome/examples/h007_createPolySplineClosed.py index c3e8c9b9..c3896b68 100644 --- a/doc/salome/examples/h007_createPolySplineClosed.py +++ b/doc/salome/examples/h007_createPolySplineClosed.py @@ -10,7 +10,7 @@ from HYDROPy 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( 0, 0 ) @@ -39,4 +39,4 @@ Polyline_1.Update() if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h008_simpleCase.py b/doc/salome/examples/h008_simpleCase.py index 2516d228..fa21720e 100644 --- a/doc/salome/examples/h008_simpleCase.py +++ b/doc/salome/examples/h008_simpleCase.py @@ -14,7 +14,7 @@ from HYDROPy 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( 0, 0 ) @@ -63,7 +63,7 @@ Case_1.SetBoundaryPolyline( Polyline_1 ) Case_1.Update() # Export of the calculation case -Case_1_entry = Case_1.Export( theStudy._get_StudyId() ) +Case_1_entry = Case_1.Export() #---------------------- # --- Geometry @@ -76,7 +76,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", Case_1_entry) Case_1_geom = salome.IDToObject( str( Case_1_entry ) ) @@ -87,4 +87,4 @@ print("Geom shape name:", Case_1_geom.GetName()) controlGeomProps(geompy, Case_1_geom, 1218.7373973, 49578.1516521) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h009_normalCaseManual.py b/doc/salome/examples/h009_normalCaseManual.py index e87547a6..11c19003 100644 --- a/doc/salome/examples/h009_normalCaseManual.py +++ b/doc/salome/examples/h009_normalCaseManual.py @@ -17,7 +17,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -307,7 +307,7 @@ garonne_1_riveDroite.SetName( "garonne_1_riveDroite" ) garonne_1_riveGauche.SetName( "garonne_1_riveGauche" ) # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() #---------------------- # --- Geometry @@ -320,7 +320,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", garonne_1_entry) HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) @@ -387,4 +387,4 @@ geompy.addToStudyInFather(HYDRO_garonne_1, amont, "amont") geompy.addToStudyInFather(HYDRO_garonne_1, aval, "aval") if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h010_normalCaseManualMesh.py b/doc/salome/examples/h010_normalCaseManualMesh.py index 0be82903..cda2c4ea 100644 --- a/doc/salome/examples/h010_normalCaseManualMesh.py +++ b/doc/salome/examples/h010_normalCaseManualMesh.py @@ -17,7 +17,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -306,7 +306,7 @@ garonne_1_riveDroite.SetName("garonne_1_riveDroite") garonne_1_riveGauche.SetName("garonne_1_riveGauche") # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() #---------------------- # --- Geometry @@ -319,7 +319,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", garonne_1_entry) HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) @@ -396,7 +396,7 @@ from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats import tempfile -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() # --- algorithms and hypothesis garonne_1 = smesh.Mesh(HYDRO_garonne_1) @@ -473,4 +473,4 @@ controlSubMeshStats(riveDroite_1, 2342) controlSubMeshStats(riveGauche_1, 2871) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h011_normalCaseManualInterpolZ.py b/doc/salome/examples/h011_normalCaseManualInterpolZ.py index 74701e82..8ac73adc 100644 --- a/doc/salome/examples/h011_normalCaseManualInterpolZ.py +++ b/doc/salome/examples/h011_normalCaseManualInterpolZ.py @@ -17,7 +17,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -306,7 +306,7 @@ garonne_1_riveDroite.SetName("garonne_1_riveDroite") garonne_1_riveGauche.SetName("garonne_1_riveGauche") # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() #---------------------- # --- Geometry @@ -319,7 +319,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", garonne_1_entry) HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) @@ -396,7 +396,7 @@ from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats import tempfile -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() # --- algorithms and hypothesis garonne_1 = smesh.Mesh(HYDRO_garonne_1) @@ -473,7 +473,7 @@ controlSubMeshStats(riveDroite_1, 2342) controlSubMeshStats(riveGauche_1, 2871) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() #---------------------- # --- Z interpolation with HYDRO diff --git a/doc/salome/examples/h012_caseDigueManual.py b/doc/salome/examples/h012_caseDigueManual.py index 873594af..b33e6c3e 100644 --- a/doc/salome/examples/h012_caseDigueManual.py +++ b/doc/salome/examples/h012_caseDigueManual.py @@ -17,7 +17,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -387,7 +387,7 @@ garonne_1_riveGauche.SetName("garonne_1_riveGauche") garonne_1_digue.SetName("garonne_1_digue") # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() #---------------------- # --- Geometry @@ -400,7 +400,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", garonne_1_entry) HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) @@ -477,4 +477,4 @@ geompy.UnionIDs(SectionsDigue, [geompy.GetSubShapeID(HYDRO_garonne_1, amontDigue geompy.addToStudyInFather( HYDRO_garonne_1, SectionsDigue, 'SectionsDigue' ) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h013_caseDigueManualMesh.py b/doc/salome/examples/h013_caseDigueManualMesh.py index 48f1e692..a21a2800 100644 --- a/doc/salome/examples/h013_caseDigueManualMesh.py +++ b/doc/salome/examples/h013_caseDigueManualMesh.py @@ -17,7 +17,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -387,7 +387,7 @@ garonne_1_riveGauche.SetName("garonne_1_riveGauche") garonne_1_digue.SetName("garonne_1_digue") # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() #---------------------- # --- Geometry @@ -400,7 +400,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", garonne_1_entry) HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) @@ -486,7 +486,7 @@ from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats import tempfile -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() # --- algorithms and hypothesis garonne_1 = smesh.Mesh(HYDRO_garonne_1) @@ -585,4 +585,4 @@ controlSubMeshStats(riveGauche_1, 6585) controlSubMeshStats(digue_1, 832) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h014_caseDigueManualInterpolZ.py b/doc/salome/examples/h014_caseDigueManualInterpolZ.py index 09b302c2..8f24d1dc 100644 --- a/doc/salome/examples/h014_caseDigueManualInterpolZ.py +++ b/doc/salome/examples/h014_caseDigueManualInterpolZ.py @@ -17,7 +17,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -387,7 +387,7 @@ garonne_1_riveGauche.SetName("garonne_1_riveGauche") garonne_1_digue.SetName("garonne_1_digue") # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() #---------------------- # --- Geometry @@ -400,7 +400,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", garonne_1_entry) HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) @@ -486,7 +486,7 @@ from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats import tempfile -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() # --- algorithms and hypothesis garonne_1 = smesh.Mesh(HYDRO_garonne_1) @@ -585,7 +585,7 @@ controlSubMeshStats(riveGauche_1, 6585) controlSubMeshStats(digue_1, 832) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() #---------------------- # --- Z interpolation with HYDRO #---------------------- diff --git a/doc/salome/examples/h015_normalCaseManualTelemac.py b/doc/salome/examples/h015_normalCaseManualTelemac.py index b780ce91..66c70cad 100644 --- a/doc/salome/examples/h015_normalCaseManualTelemac.py +++ b/doc/salome/examples/h015_normalCaseManualTelemac.py @@ -17,7 +17,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -306,7 +306,7 @@ garonne_1_riveDroite.SetName("garonne_1_riveDroite") garonne_1_riveGauche.SetName("garonne_1_riveGauche") # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() #---------------------- # --- Geometry @@ -319,7 +319,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", garonne_1_entry) HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) @@ -396,7 +396,7 @@ from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats import tempfile -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() # --- algorithms and hypothesis garonne_1 = smesh.Mesh(HYDRO_garonne_1) @@ -480,7 +480,7 @@ controlSubMeshStats(riveDroite_1, 2342) controlSubMeshStats(riveGauche_1, 2871) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() #---------------------- # --- Z interpolation with HYDRO diff --git a/doc/salome/examples/h016_pilesPontManualMesh.py b/doc/salome/examples/h016_pilesPontManualMesh.py index ca9c5a59..33b1e29e 100644 --- a/doc/salome/examples/h016_pilesPontManualMesh.py +++ b/doc/salome/examples/h016_pilesPontManualMesh.py @@ -21,7 +21,7 @@ from HYDROPy 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 ) @@ -1032,7 +1032,7 @@ garonne_1_pile3.SetName( "garonne_1_pile3" ) garonne_1_pile4.SetName( "garonne_1_pile4" ) # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() # Get geometry shape and print debug information import GEOM @@ -1052,7 +1052,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() [garonne_riveDroite,garonne_aval,garonne_riveGauche,garonne_pont,garonne_amont] = geompy.SubShapeAll(HYDRO_garonne_1, geompy.ShapeType["FACE"]) @@ -1160,7 +1160,7 @@ from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats import tempfile -smesh = smeshBuilder.New(theStudy) +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() @@ -1281,4 +1281,4 @@ controlSubMeshStats(garonne_riveDroite_2, 3941) controlSubMeshStats(garonne_riveGauche_2, 4635) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h017_interpolationLineaire.py b/doc/salome/examples/h017_interpolationLineaire.py index 4942e521..647a3d28 100644 --- a/doc/salome/examples/h017_interpolationLineaire.py +++ b/doc/salome/examples/h017_interpolationLineaire.py @@ -17,7 +17,7 @@ from HYDROPy 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 ) @@ -260,7 +260,7 @@ etude_Reg_1.AddZone( etude_Zone_1 ) etude_Reg_1.SetName( "etude_Reg_1" ) # Export of the calculation case -etude_entry = etude.Export( theStudy._get_StudyId() ) +etude_entry = etude.Export() # Get geometry shape and print debug information import GEOM @@ -280,7 +280,7 @@ import math import SALOMEDS -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() etude_domaine_Outer = geompy.CreateGroup(HYDRO_etude_1, geompy.ShapeType["EDGE"]) geompy.UnionIDs(etude_domaine_Outer, [3, 6, 8, 10]) @@ -296,7 +296,7 @@ geompy.addToStudyInFather( HYDRO_etude_1, domaine, 'domaine' ) import SMESH, SALOMEDS from salome.smesh import smeshBuilder -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() relief = smesh.Mesh(HYDRO_etude_1) NETGEN_2D = relief.Triangle(algo=smeshBuilder.NETGEN_1D2D) NETGEN_2D_Parameters_1 = NETGEN_2D.Parameters() @@ -336,7 +336,7 @@ smesh.SetName(NETGEN_2D_Parameters_1, 'NETGEN 2D Parameters_1') if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() #---------------------- # --- Z interpolation with HYDRO diff --git a/doc/salome/examples/h018_streamInterpolation.py b/doc/salome/examples/h018_streamInterpolation.py index 0e90dccd..490f667d 100644 --- a/doc/salome/examples/h018_streamInterpolation.py +++ b/doc/salome/examples/h018_streamInterpolation.py @@ -21,7 +21,7 @@ from HYDROPy 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( 0.000, 0.000 ) @@ -332,7 +332,7 @@ Reg_litMineur.SetName( "Reg_litMineur" ) Reg_riveDroite.SetName( "Reg_riveDroite" ) # Export of the calculation case -Case_1_entry = Case_1.Export( theStudy._get_StudyId() ) +Case_1_entry = Case_1.Export() #---------------------- # --- Geometry @@ -350,7 +350,7 @@ HYDRO_Case_1 = salome.IDToObject( str( Case_1_entry ) ) print("Geom shape:", HYDRO_Case_1) print("Geom shape name:", HYDRO_Case_1.GetName()) -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() # --- manual definition: geometrical faces [riveGauche,litMineur,riveDroite] = geompy.SubShapeAll(HYDRO_Case_1, geompy.ShapeType["FACE"]) @@ -404,7 +404,7 @@ import SMESH, SALOMEDS from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() # --- algorithms and hypothesis plaine = smesh.Mesh(HYDRO_Case_1) @@ -507,4 +507,4 @@ controlStatZ(statz, refstatz) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() diff --git a/doc/salome/examples/h019_normalCaseManualInterpolZStrickler.py b/doc/salome/examples/h019_normalCaseManualInterpolZStrickler.py index 09b6897d..bc63856b 100644 --- a/doc/salome/examples/h019_normalCaseManualInterpolZStrickler.py +++ b/doc/salome/examples/h019_normalCaseManualInterpolZStrickler.py @@ -17,7 +17,7 @@ from HYDROPy 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, 6.35e+06 ) @@ -596,7 +596,7 @@ garonne_1_riveDroite.SetName("garonne_1_riveDroite") garonne_1_riveGauche.SetName("garonne_1_riveGauche") # Export of the calculation case -garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() ) +garonne_1_entry = garonne_1.Export() #---------------------- # --- Geometry @@ -609,7 +609,7 @@ import math import SALOMEDS from salome.hydrotools.controls import controlGeomProps -geompy = geomBuilder.New(theStudy) +geompy = geomBuilder.New() print("Entry:", garonne_1_entry) HYDRO_garonne_1 = salome.IDToObject( str( garonne_1_entry ) ) @@ -687,7 +687,7 @@ from salome.smesh import smeshBuilder from salome.hydrotools.controls import controlMeshStats, controlSubMeshStats import tempfile -smesh = smeshBuilder.New(theStudy) +smesh = smeshBuilder.New() # --- algorithms and hypothesis garonne_1 = smesh.Mesh(HYDRO_garonne_1) @@ -764,7 +764,7 @@ controlSubMeshStats(riveDroite_1, 2342) controlSubMeshStats(riveGauche_1, 2871) if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() #---------------------- # --- Z interpolation with HYDRO -- 2.39.2