salome.salome_init()
theStudy = salome.myStudy
+#----------------------
+# --- HYDRO
+#----------------------
+
from HYDROPy import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
-def controlGeomProps(geomShape, refLength, refArea):
- props = geompy.BasicProperties(geomShape)
- print " Wires length: ", props[0]
- print " Surface area: ", props[1]
- print " Volume : ", props[2]
- 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")
-
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
hydro_doc.SetLocalCS( 0, 0 )
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()
-controlGeomProps(Case_1_geom, 1218.7373973, 49697.2117918)
-
+#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)