salome.salome_init()
theStudy = salome.myStudy
+#----------------------
+# --- HYDRO
+#----------------------
+
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() )
Case_1.SetName( "Case_1" )
Case_1.SetAssignmentMode( HYDROData_CalculationCase.AUTOMATIC )
-Case_1.SetAssignmentLandCoverMode( HYDROData_CalculationCase.AUTOMATIC )
Case_1.AddGeometryObject( Immersible_zone_1 )
+case_geom_group = Immersible_zone_1.GetGroup( 0 );
+Case_1.AddGeometryGroup( case_geom_group );
Case_1.SetBoundaryPolyline( Polyline_1 )
# Start the algorithm of the partition and assignment
# Export of the calculation case
Case_1_entry = Case_1.Export( theStudy._get_StudyId() )
+#----------------------
+# --- Geometry
+#----------------------
+
# Get geometry shape and print debug information
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
+from salome.hydrotools.controls import controlGeomProps
geompy = geomBuilder.New(theStudy)
print "Geom shape:", Case_1_geom
print "Geom shape name:", Case_1_geom.GetName()
-props = geompy.BasicProperties(Case_1_geom)
-print " Wires length: ", props[0]
-print " Surface area: ", props[1]
-print " Volume : ", props[2]
-refLength = 1218.7373973
-refArea = 49697.2117918
-deltaLength = 2.0*abs((props[0] - refLength)/(props[0] + refLength))
-deltaArea = 2.0*abs((props[1] - refArea)/(props[1] + refArea))
-if deltaLength > 1e-7 or deltaArea > 1e-7 or props[2] != 0:
- print "While must be:"
- print " Wires length: ", refLength
- print " Surface area: ", refArea
- print " Volume : ", 0.
- raise ValueError("Bad length or area")
-
+#controlGeomProps(geompy, Case_1_geom, 1218.7373973, 49697.2117918)
+controlGeomProps(geompy, Case_1_geom, 1218.7373973, 49578.1516521)
+
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)