CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
PROJECT(SalomeHYDRO C CXX)
-
-ADD_SUBDIRECTORY (src/HYDRO_tests)
-
INCLUDE(CMakeDependentOption)
# Ensure a proper linker behavior:
# User options
# ============
-# (some options may have already been defined in KERNEL)
+# (some options may have already been defined in KERNEL)
OPTION(SALOME_BUILD_DOC "Generate HYDRO documentation" ON)
OPTION(SALOME_BUILD_TESTS "Build HYDRO tests" ON)
# Mandatory products:
-FIND_PACKAGE(SalomePython REQUIRED)
-#FIND_PACKAGE(SalomePythonInterp REQUIRED)
-#FIND_PACKAGE(SalomePythonLibs REQUIRED)
+#FIND_PACKAGE(SalomePython REQUIRED)
+FIND_PACKAGE(SalomePythonInterp REQUIRED)
+FIND_PACKAGE(SalomePythonLibs REQUIRED)
FIND_PACKAGE(SalomeCAS REQUIRED)
FIND_PACKAGE(SalomeVTK REQUIRED)
FIND_PACKAGE(SalomeOmniORB REQUIRED)
IF(SALOME_BUILD_TESTS)
ENABLE_TESTING()
FIND_PACKAGE(SalomeCppUnit)
- SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
+ SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
ENDIF()
IF(SALOME_BUILD_DOC)
IF(SALOME_USE_MPI)
FIND_PACKAGE(SalomeMPI) # needed for doc generation by Sphinx
SALOME_LOG_OPTIONAL_PACKAGE(MPI SALOME_BUILD_DOC)
- ENDIF()
+ ENDIF()
FIND_PACKAGE(SalomeDoxygen)
FIND_PACKAGE(SalomeSphinx)
SALOME_LOG_OPTIONAL_PACKAGE(Doxygen SALOME_BUILD_DOC)
# Qt
IF(NOT SALOME_GUI_BUILD_WITH_QT5)
FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork QtTest)
- SET(QT_ROOT_DIR "${QT4_ROOT_DIR}")
+ SET(QT_ROOT_DIR "${QTDIR}")
SALOME_CONFIGURE_PREPARE(HYDROData HYDROGUI HYDROPy Qt4 PyQt4)
ELSE()
FIND_PACKAGE(SalomeQt5 REQUIRED)
- SET(QT_ROOT_DIR "${QT5_ROOT_DIR}")
+ SET(QT_ROOT_DIR "${QTDIR}")
SALOME_CONFIGURE_PREPARE(HYDROData HYDROGUI HYDROPy Qt5 PyQt5)
ENDIF()
# PyQt
IF(NOT SALOME_GUI_BUILD_WITH_QT5)
FIND_PACKAGE(SalomePyQt4 REQUIRED)
- SET(PYQT_ROOT_DIR "${PYQT4_ROOT_DIR}")
+ SET(PYQT_ROOT_DIR "${PYQT_ROOT_DIR}")
ELSE()
FIND_PACKAGE(SalomePyQt5 REQUIRED)
- SET(PYQT_ROOT_DIR "${PYQT5_ROOT_DIR}")
+ SET(PYQT_ROOT_DIR "${PYQT_ROOT_DIR}")
ENDIF()
# Detection summary:
SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs")
SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files")
SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers")
-SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
+SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
"Install path: SALOME scripts")
-SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
+SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
"Install path: SALOME script data")
-SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
+SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
"Install path: SALOME Python scripts")
SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff")
-SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
+SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
"Install path: SALOME Python shared modules")
-SET(SALOME_INSTALL_CMAKE_LOCAL adm/cmake CACHE PATH
- "Install path: local SALOME CMake files")
+SET(SALOME_INSTALL_CMAKE_LOCAL adm/cmake CACHE PATH
+ "Install path: local SALOME CMake files")
SET(SALOME_INSTALL_AMCONFIG_LOCAL adm/unix CACHE PATH
"Install path: local SALOME config files (obsolete, to be removed)")
SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
# Specific to HYDRO:
-SET(SALOME_HYDRO_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/hydro" CACHE PATH
+SET(SALOME_HYDRO_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/hydro" CACHE PATH
"Install path: SALOME HYDRO specific data")
-SET(SALOME_HYDRO_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/hydro" CACHE PATH
+SET(SALOME_HYDRO_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/hydro" CACHE PATH
"Install path: SALOME HYDRO scripts")
SET(SALOME_HYDRO_INSTALL_SAMPLES share/salome/hydrosamples CACHE PATH
"Install path: SALOME HYDRO samples")
SALOME_HYDRO_INSTALL_SAMPLES
)
-# Sources
+# Sources
# ========
ADD_SUBDIRECTORY (src/shapelib)
ADD_SUBDIRECTORY (src/HYDROData)
ADD_SUBDIRECTORY (src/HYDROGUI)
ADD_SUBDIRECTORY (src/HYDROPy)
ADD_SUBDIRECTORY (src/HYDROTools)
+ADD_SUBDIRECTORY (src/HYDRO_tests)
IF(SALOME_BUILD_DOC)
ADD_SUBDIRECTORY(doc)
ENDIF()
# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
-SET(_${PROJECT_NAME}_exposed_targets
+SET(_${PROJECT_NAME}_exposed_targets
shapelib HYDROData HYDROPy
)
ENDIF(SALOME_BUILD_TESTS)
IF(SALOME_BUILD_GUI)
- LIST(APPEND _${PROJECT_NAME}_exposed_targets
- HYDROGUI
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets
+ HYDROGUI
)
ENDIF(SALOME_BUILD_GUI)
SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}")
-SET(QT4_ROOT_DIR "${QT4_ROOT_DIR}")
-SET(PYQT4_ROOT_DIR "${PYQT4_ROOT_DIR}")
+SET(QTDIR "${QTDIR}")
+SET(PYQT_ROOT_DIR "${PYQT_ROOT_DIR}")
SET(CAS_ROOT_DIR "${CAS_ROOT_DIR}")
-
+
SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
-CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
+CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
- KERNEL_ROOT_DIR GUI_ROOT_DIR SIP_ROOT_DIR QT4_ROOT_DIR PYQT4_ROOT_DIR CAS_ROOT_DIR)
+ KERNEL_ROOT_DIR GUI_ROOT_DIR SIP_ROOT_DIR QTDIR PYQT_ROOT_DIR CAS_ROOT_DIR)
# - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?):
-# Get the relative path of the include directory so
+# Get the relative path of the include directory so
# we can register it in the generated configuration files:
#SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
-#CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in
+#CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in
# ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
# INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
-# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
+# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
# KERNEL_ROOT_DIR GUI_ROOT_DIR SIP_ROOT_DIR QT4_ROOT_DIR PYQT4_ROOT_DIR EXPAT_ROOT_DIR QSCINTILLA_ROOT_DIR)
WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME_UC}_VERSION}
COMPATIBILITY AnyNewerVersion)
-
+
# Install the CMake configuration files:
INSTALL(FILES
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}")
# Install the export set for use with the install-tree
-INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
+INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
FILE ${PROJECT_NAME}Targets.cmake)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
Case_1_entry = Case_1.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
print "Geom shape:", Case_1_geom
print "Geom shape name:", Case_1_geom.GetName()
-controlGeomProps(geompy, 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)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
geompy.addToStudyInFather( HYDRO_garonne_1, riveDroite, 'riveDroite' )
controlGeomProps(geompy, riveGauche, 29149.36918, 35948828.352061)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
print "Geom shape:", HYDRO_garonne_1
print "Geom shape name:", HYDRO_garonne_1.GetName()
-# --- manual definition: geometrical faces
+# --- manual definition: geometrical faces
[riveGauche,litMineur,riveDroite] = geompy.ExtractShapes(HYDRO_garonne_1, geompy.ShapeType["FACE"], True)
# --- manual definition: useful groups of edges
# --- basic properties control: edges length, surfaces
controlGeomProps(geompy, riveGauche, 29149.36918, 35948828.352061)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
-med_file = r'/garonne_1.med'
+med_file = r'/tmp/garonne_1.med'
try:
os.remove(med_file)
garonne_1.SetAutoColor( 1 )
garonne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(garonne_1, 1763, 180, 3360)
-controlSubMeshStats(litMineur_2, 48)
-controlSubMeshStats(riveDroite_1, 1360)
-controlSubMeshStats(riveGauche_1, 1952)
+#controlMeshStats(garonne_1, 1763, 180, 3360)
+#controlSubMeshStats(litMineur_2, 48)
+#controlSubMeshStats(riveDroite_1, 1360)
+#controlSubMeshStats(riveGauche_1, 1952)
+controlMeshStats(garonne_1, 3888, 475, 7597)
+controlSubMeshStats(litMineur_2, 2384)
+controlSubMeshStats(riveDroite_1, 2342)
+controlSubMeshStats(riveGauche_1, 2871)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_1_entry = garonne_1.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
print "Geom shape:", HYDRO_garonne_1
print "Geom shape name:", HYDRO_garonne_1.GetName()
-# --- manual definition: geometrical faces
+# --- manual definition: geometrical faces
[riveGauche,litMineur,riveDroite] = geompy.ExtractShapes(HYDRO_garonne_1, geompy.ShapeType["FACE"], True)
# --- manual definition: useful groups of edges
# --- basic properties control: edges length, surfaces
controlGeomProps(geompy, riveGauche, 29149.36918, 35948828.352061)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3263628.55399)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
-med_file = r'/garonne_1.med'
+med_file = r'/tmp/garonne_1.med'
try:
os.remove(med_file)
except OSError:
garonne_1.SetAutoColor( 1 )
garonne_1.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(garonne_1, 1763, 180, 3360)
-controlSubMeshStats(litMineur_2, 48)
-controlSubMeshStats(riveDroite_1, 1360)
-controlSubMeshStats(riveGauche_1, 1952)
+#controlMeshStats(garonne_1, 1763, 180, 3360)
+#controlSubMeshStats(litMineur_2, 48)
+#controlSubMeshStats(riveDroite_1, 1360)
+#controlSubMeshStats(riveGauche_1, 1952)
+controlMeshStats(garonne_1, 3888, 475, 7597)
+controlSubMeshStats(litMineur_2, 2384)
+controlSubMeshStats(riveDroite_1, 2342)
+controlSubMeshStats(riveGauche_1, 2871)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
#----------------------
-# --- Z interpolation with HYDRO
+# --- Z interpolation with HYDRO
#----------------------
from salome.hydrotools.interpolZ import interpolZ, createZfield2
riveDroite = 'garonne_1_riveDroite',
riveGauche = 'garonne_1_riveGauche',
)
-# --- value to use for Z when the node is not in a region (used to detect problems)
+# --- value to use for Z when the node is not in a region (used to detect problems)
zUndef = 90
# --- Z interpolation on the bathymety/altimetry on the mesh nodes
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_2_entry = garonne_2.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
geompy.addToStudyInFather( HYDRO_garonne_2, litMineur, 'litMineur' )
geompy.addToStudyInFather( HYDRO_garonne_2, riveDroite, 'riveDroite' )
-controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, riveGauche, 39493.270283, 35845790.613557)
controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_2_entry = garonne_2.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
geompy.UnionIDs(SectionsDigue, [46, 50])
geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' )
-# --- recreate subshapes already exported from HYDRO to get access from Python
+# --- recreate subshapes already exported from HYDRO to get access from Python
#garonne_2_domaineEtendu_Outer = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#geompy.UnionIDs(garonne_2_domaineEtendu_Outer, [4, 11, 17, 24, 26, 28, 14, 19, 20, 22, 31, 39, 41, 33, 35, 37])
#garonne_2_digue_Left_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#garonne_2_digue_Right_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#geompy.UnionIDs(garonne_2_digue_Right_Bank, [48])
-controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, riveGauche, 39493.270283, 35845790.613557)
controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
import SMESH, SALOMEDS
SectionsGaronne_3 = garonne_2.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.NODE)
-med_file = r'/garonne_2.med'
+med_file = r'/tmp/garonne_2.med'
try:
os.remove(med_file)
garonne_2.SetAutoColor( 1 )
garonne_2.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(garonne_2, 5247, 717, 10075)
+#controlMeshStats(garonne_2, 5247, 717, 10075)
+#controlSubMeshStats(litMineur_2, 2384)
+#controlSubMeshStats(riveDroite_1, 2348)
+#controlSubMeshStats(riveGauche_1, 5343)
+#controlSubMeshStats(digue_1, 0)
+controlMeshStats(garonne_2, 6190, 691, 12201)
controlSubMeshStats(litMineur_2, 2384)
-controlSubMeshStats(riveDroite_1, 2348)
-controlSubMeshStats(riveGauche_1, 5343)
-controlSubMeshStats(digue_1, 0)
+controlSubMeshStats(riveDroite_1, 2400)
+controlSubMeshStats(riveGauche_1, 6585)
+controlSubMeshStats(digue_1, 832)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
salome.salome_init()
theStudy = salome.myStudy
-
+
#----------------------
-# --- HYDRO
+# --- HYDRO
#----------------------
from HYDROPy import *
garonne_2_entry = garonne_2.Export( theStudy._get_StudyId() )
#----------------------
-# --- Geometry
+# --- Geometry
#----------------------
# Get geometry shape and print debug information
geompy.UnionIDs(SectionsDigue, [46, 50])
geompy.addToStudyInFather( HYDRO_garonne_2, SectionsDigue, 'SectionsDigue' )
-# --- recreate subshapes already exported from HYDRO to get access from Python
+# --- recreate subshapes already exported from HYDRO to get access from Python
#garonne_2_domaineEtendu_Outer = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#geompy.UnionIDs(garonne_2_domaineEtendu_Outer, [4, 11, 17, 24, 26, 28, 14, 19, 20, 22, 31, 39, 41, 33, 35, 37])
#garonne_2_digue_Left_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#garonne_2_digue_Right_Bank = geompy.CreateGroup(HYDRO_garonne_2, geompy.ShapeType["EDGE"])
#geompy.UnionIDs(garonne_2_digue_Right_Bank, [48])
-controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, riveGauche, 39489.5116033, 35889668.8348)
+#controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
+#controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
+#controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, riveGauche, 39493.270283, 35845790.613557)
controlGeomProps(geompy, digue, 10340.1424233, 102887.6201)
-controlGeomProps(geompy, litMineur, 30337.5484919, 3646827.74981)
-controlGeomProps(geompy, riveDroite, 32012.3432411, 26177085.4601)
+controlGeomProps(geompy, litMineur, 30337.548492, 3488480.304388)
+controlGeomProps(geompy, riveDroite, 32012.343241, 25998769.23615)
#----------------------
-# --- Meshing
+# --- Meshing
#----------------------
import SMESH, SALOMEDS
SectionsGaronne_3 = garonne_2.GroupOnGeom(SectionsGaronne,'SectionsGaronne',SMESH.NODE)
-med_file = r'/garonne_2.med'
+med_file = r'/tmp/garonne_2.med'
try:
os.remove(med_file)
garonne_2.SetAutoColor( 1 )
garonne_2.ExportMED( med_file, 0, SMESH.MED_V2_2, 1, None ,1)
-controlMeshStats(garonne_2, 5247, 717, 10075)
+#controlMeshStats(garonne_2, 5247, 717, 10075)
+#controlSubMeshStats(litMineur_2, 2384)
+#controlSubMeshStats(riveDroite_1, 2348)
+#controlSubMeshStats(riveGauche_1, 5343)
+#controlSubMeshStats(digue_1, 0)
+controlMeshStats(garonne_2, 6190, 691, 12201)
controlSubMeshStats(litMineur_2, 2384)
-controlSubMeshStats(riveDroite_1, 2348)
-controlSubMeshStats(riveGauche_1, 5343)
-controlSubMeshStats(digue_1, 0)
+controlSubMeshStats(riveDroite_1, 2400)
+controlSubMeshStats(riveGauche_1, 6585)
+controlSubMeshStats(digue_1, 832)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
#----------------------
-# --- Z interpolation with HYDRO
+# --- Z interpolation with HYDRO
#----------------------
from salome.hydrotools.interpolZ import interpolZ, createZfield2
riveGauche = 'garonne_2_riveGauche',
digue = 'garonne_2_digue',
)
-# --- value to use for Z when the node is not in a region (used to detect problems)
+# --- value to use for Z when the node is not in a region (used to detect problems)
zUndef = 90
# --- Z interpolation on the bathymety/altimetry on the mesh nodes
geompy.addToStudyInFather( HYDRO_casGaronne_1, piles, 'piles' )
# --- 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, 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)
###
### SMESH component
smesh.SetName(nbseg_litMineur_amont, 'nbseg_litMineur_amont')
smesh.SetName(sections_1, 'sections')
-med_file = r'/casGaronne_1.med'
+med_file = r'/tmp/casGaronne_1.med'
try:
os.remove(med_file)
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)
+#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, 4040)
-controlSubMeshStats(riveGauche_1, 4627)
+controlSubMeshStats(riveDroite_1, 3941)
+controlSubMeshStats(riveGauche_1, 4635)
if salome.sg.hasDesktop():
domaine_2 = relief.GroupOnGeom(domaine,'domaine',SMESH.NODE)
smesh.SetName(relief, 'relief')
-med_file = r'/relief.med'
+med_file = r'/tmp/relief.med'
try:
os.remove(med_file)
Handle(Geom_Plane) Pl = HYDROData_LCM_FaceClassifier::GetPlane(f);
Standard_Real u, v;
ElSLib::Parameters(Pl->Pln(), gp_Pnt(myP.X(), myP.Y(), 0.0), u, v);
-
TopAbs_State aState = class2d->Perform( gp_Pnt2d(u, v), Standard_False );
if (aState == TopAbs_IN)
NB.Update(MinPT.X(), MinPT.Y(), MaxPT.X(), MaxPT.Y() );
aTreeFiller.Add(i, NB);
- BRepTopAdaptor_FClass2d* aClass2d = new BRepTopAdaptor_FClass2d( F, 0 );
+ BRepTopAdaptor_FClass2d* aClass2d = new BRepTopAdaptor_FClass2d( F, 1E-7 );
aMapF2Class2d.Add(F, aClass2d);
fclass2dpointers.push_back(aClass2d);
}
include(../../CMake/Common.cmake)
+include(UsePyQt4)
# additional include directories
INCLUDE_DIRECTORIES(
SET(_link_LIBRARIES
${PYTHON_LIBRARIES}
HYDROData
-)
+)
# --- resources ---
HYDROData.sip
)
-SET(_sip_output_files
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPycmodule.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XY.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XYZ.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_AltitudeObject.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Application.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ArtificialObject.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Bathymetry.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_CalculationCase.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Channel.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Confluence.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Digue.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Document.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Entity.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IAltitudeObject.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IInterpolator.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Image.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ImmersibleZone.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IPolyline.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IProfilesInterpolator.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_LandCoverMap.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_NaturalObject.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Object.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ObstacleAltitude.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Polyline3D.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Profile.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ProfileUZ.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Region.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ShapesGroup.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_SplitShapesGroup.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Stream.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_StreamAltitude.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_StricklerTable.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XYZ.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence1800.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence2400.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence2600.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyTCollection_AsciiString.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPystdvector0100HYDROData_BathymetryAltitudePoint.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPystdvector1800.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPystdvector2400.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPystdvector2600.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_BathymetryAltitudePoint.cc
+SET(_add_SOURCES
+ sipHYDROPycmodule.cc
+ sipHYDROPygp_XY.cc
+ sipHYDROPygp_XYZ.cc
+ sipHYDROPyHYDROData_AltitudeObject.cc
+ sipHYDROPyHYDROData_Application.cc
+ sipHYDROPyHYDROData_ArtificialObject.cc
+ sipHYDROPyHYDROData_BathymetryAltitudePoint.cc
+ sipHYDROPyHYDROData_Bathymetry.cc
+ sipHYDROPyHYDROData_CalculationCase.cc
+ sipHYDROPyHYDROData_Channel.cc
+ sipHYDROPyHYDROData_Confluence.cc
+ sipHYDROPyHYDROData_Digue.cc
+ sipHYDROPyHYDROData_Document.cc
+ sipHYDROPyHYDROData_Entity.cc
+ sipHYDROPyHYDROData_IAltitudeObject.cc
+ sipHYDROPyHYDROData_IInterpolator.cc
+ sipHYDROPyHYDROData_Image.cc
+ sipHYDROPyHYDROData_ImmersibleZone.cc
+ sipHYDROPyHYDROData_IPolyline.cc
+ sipHYDROPyHYDROData_IProfilesInterpolator.cc
+ sipHYDROPyHYDROData_LandCoverMap.cc
+ sipHYDROPyHYDROData_NaturalObject.cc
+ sipHYDROPyHYDROData_Object.cc
+ sipHYDROPyHYDROData_ObstacleAltitude.cc
+ sipHYDROPyHYDROData_Obstacle.cc
+ sipHYDROPyHYDROData_Polyline3D.cc
+ sipHYDROPyHYDROData_PolylineXY.cc
+ sipHYDROPyHYDROData_Profile.cc
+ sipHYDROPyHYDROData_ProfileUZ.cc
+ sipHYDROPyHYDROData_Region.cc
+ sipHYDROPyHYDROData_River.cc
+ sipHYDROPyHYDROData_ShapesGroup.cc
+ sipHYDROPyHYDROData_SplitShapesGroup.cc
+ sipHYDROPyHYDROData_StreamAltitude.cc
+ sipHYDROPyHYDROData_Stream.cc
+ sipHYDROPyHYDROData_StricklerTable.cc
+ sipHYDROPyHYDROData_Zone.cc
+ sipHYDROPyNCollection_Sequence0100gp_XY.cc
+ sipHYDROPyNCollection_Sequence0100gp_XYZ.cc
+ sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc
+ sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc
+ sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc
+ sipHYDROPyNCollection_Sequence1800.cc
+ sipHYDROPyNCollection_Sequence2400.cc
+ sipHYDROPyNCollection_Sequence2600.cc
+ sipHYDROPystdvector0100HYDROData_BathymetryAltitudePoint.cc
+ sipHYDROPystdvector1800.cc
+ sipHYDROPystdvector2400.cc
+ sipHYDROPystdvector2600.cc
+ sipHYDROPyTCollection_AsciiString.cc
)
-ADD_CUSTOM_COMMAND(
- OUTPUT ${_sip_output_files}
- COMMAND ${SIP_EXECUTABLE} ${PYQT_SIPFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${_sip_input_file}
- MAIN_DEPENDENCY ${_sip_input_file}
-)
+# sources / sip wrappings
+PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_input_file} SOURCES ${_add_SOURCES})
+
+# sources / to compile
+SET(HYDROPy_SOURCES ${_sip_SOURCES})
+
+ADD_LIBRARY(HYDROPy ${HYDROPy_SOURCES})
-ADD_LIBRARY(HYDROPy ${_sip_output_files} )
TARGET_LINK_LIBRARIES(HYDROPy ${_link_LIBRARIES})
INSTALL(TARGETS HYDROPy EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
TestLib_Runner.h
)
-set(PROJECT_SOURCES
+set(PROJECT_SOURCES
test_HYDROData_Bathymetry.cxx
test_HYDROData_Channel.cxx
test_HYDROData_Document.cxx
TestLib_Runner.cxx
)
-add_definitions(
- -DLIGHT_MODE -DHYDRODATA_STATIC -DHYDROGUI_STATIC )
+add_definitions( -DLIGHT_MODE -DHYDRODATA_STATIC -DHYDROGUI_STATIC )
IF( ${WIN32} )
add_definitions( -DWNT -D__WIN32__ -D__x86__ -D_WIN64 -D_WIN32_WINNT=0x0400 -D__NT__ -D__OSVERSION__=4 )
ENDIF()
-SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT_DIR}/include )
+SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT}/include )
SET( CAS_INCLUDES $ENV{CASROOT}/inc )
-SET( QT_INCLUDES $ENV{QT4_ROOT_DIR}/include $ENV{QT4_ROOT_DIR}/include/QtCore $ENV{QT4_ROOT_DIR}/include/QtGui $ENV{QT4_ROOT_DIR}/include/QtTest )
+SET( QT_INCLUDES $ENV{QTDIR}/include $ENV{QTDIR}/include/QtCore $ENV{QTDIR}/include/QtGui $ENV{QTDIR}/include/QtTest )
SET( KERNEL_INCLUDES $ENV{KERNEL_ROOT_DIR}/include/salome )
SET( GUI_INCLUDES $ENV{GUI_ROOT_DIR}/include/salome )
SET( GEOM_INCLUDES $ENV{GEOM_ROOT_DIR}/include/salome )
ENDIF()
SET( CAS_LIBRARIES TKernel TKLCAF TKCAF TKCDF TKMath TKG2d TKG3d TKBRep TKGeomBase TKTopAlgo TKGeomAlgo TKBool TKShHealing TKXSBase TKOffset TKHLR TKBO TKV3d TKService TKMesh )
-link_directories( $ENV{QT4_ROOT_DIR}/lib )
+link_directories( $ENV{QTDIR}/lib )
IF( ${WIN32} )
SET( QT_LIBRARIES QtCored4 QtGuid4 QtTestd4 )
ELSE()
SET( QT_LIBRARIES QtCore QtGui QtTest )
ENDIF()
-link_directories( $ENV{CPPUNIT_ROOT_DIR}/lib )
+link_directories( $ENV{CPPUNIT_ROOT}/lib )
IF( ${WIN32} )
SET( CPPUNIT_LIBRARIES cppunitd )
ELSE()
link_directories( $ENV{KERNEL_ROOT_DIR}/lib/salome $ENV{GUI_ROOT_DIR}/lib/salome $ENV{GEOM_ROOT_DIR}/lib/salome )
SET( GUI_LIBRARIES ImageComposer qtx suit LightApp CAM OCCViewer )
-SET( GEOM_LIBRARIES CurveCreator GEOMUtils )
+SET( GEOM_LIBRARIES CurveCreator GEOMUtils GEOMUtils )
include_directories(
${CAS_INCLUDES}
source_group( "External files" FILES ${EXTERNAL_FILES} )
add_executable( HYDROData_tests ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${EXTERNAL_FILES} ${PROJECT_MOC_HEADERS} )
-target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib )
+target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib HYDROData )
-#IF( ${WIN32} )
-# add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" )
-#ENDIF()
-
-SET( INSTALL_BINS $ENV{HYDRO_ROOT_DIR}/bin/salome )
-INSTALL(TARGETS HYDROData_tests EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${INSTALL_BINS})
+INSTALL(TARGETS HYDROData_tests EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
p1.brep
p2.brep
p3.brep
- cc_int_w_1.png
+ cc_int_w_1.png
cc_int_w_2.png
cc_int_w_3.png
StreamDlg.png
# Application tests
-SET(TEST_INSTALL_DIRECTORY $ENV{HYDRO_ROOT_DIR}/bin/salome/test)
+SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_BINS}/test)
INSTALL(FILES ${REFERENCE_DATA} DESTINATION ${TEST_INSTALL_DIRECTORY})