From b5d0c5154ce4ecfa439da0a1395dbaa1e4c1e7d2 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 30 Jan 2017 15:49:26 +0100 Subject: [PATCH] merge BR_PORTING_OCCT_7 --- CMakeLists.txt | 19 ++++- bin/hydro_setenv.py | 1 + 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 +- .../examples/h007_createPolySplineClosed.py | 4 +- doc/salome/examples/h008_simpleCase.py | 4 +- doc/salome/examples/h009_normalCaseManual.py | 4 +- .../examples/h010_normalCaseManualMesh.py | 4 +- .../h011_normalCaseManualInterpolZ.py | 4 +- doc/salome/examples/h012_caseDigueManual.py | 4 +- .../examples/h013_caseDigueManualMesh.py | 4 +- .../examples/h014_caseDigueManualInterpolZ.py | 4 +- .../examples/h015_normalCaseManualTelemac.py | 4 +- .../examples/h016_pilesPontManualMesh.py | 4 +- .../examples/h017_interpolationLineaire.py | 4 +- .../examples/h018_streamInterpolation.py | 8 +- doc/salome/gui/HYDRO/CMakeLists.txt | 2 - doc/salome/tui/HYDRO/CMakeLists.txt | 2 - src/HYDROData/HYDROData_AltitudeObject.cxx | 1 - src/HYDROData/HYDROData_AltitudeObject.h | 6 +- src/HYDROData/HYDROData_Application.cxx | 1 - src/HYDROData/HYDROData_Application.h | 5 +- src/HYDROData/HYDROData_ArtificialObject.cxx | 1 - src/HYDROData/HYDROData_ArtificialObject.h | 5 +- src/HYDROData/HYDROData_Bathymetry.cxx | 9 +- src/HYDROData/HYDROData_Bathymetry.h | 9 +- src/HYDROData/HYDROData_CalculationCase.cxx | 7 +- src/HYDROData/HYDROData_CalculationCase.h | 25 +++--- src/HYDROData/HYDROData_Channel.cxx | 2 +- src/HYDROData/HYDROData_Channel.h | 11 +-- src/HYDROData/HYDROData_ChannelAltitude.cxx | 1 - src/HYDROData/HYDROData_ChannelAltitude.h | 4 +- src/HYDROData/HYDROData_Confluence.cxx | 1 - src/HYDROData/HYDROData_Confluence.h | 4 +- src/HYDROData/HYDROData_DTM.cxx | 58 +++++++------ src/HYDROData/HYDROData_DTM.h | 51 ++++++------ src/HYDROData/HYDROData_Digue.cxx | 1 - src/HYDROData/HYDROData_Digue.h | 4 +- src/HYDROData/HYDROData_Document.cxx | 11 ++- src/HYDROData/HYDROData_Document.h | 11 +-- src/HYDROData/HYDROData_DummyObject3D.cxx | 1 - src/HYDROData/HYDROData_DummyObject3D.h | 6 +- src/HYDROData/HYDROData_Entity.cxx | 35 ++++---- src/HYDROData/HYDROData_Entity.h | 31 +++---- src/HYDROData/HYDROData_IAltitudeObject.cxx | 1 - src/HYDROData/HYDROData_IAltitudeObject.h | 7 +- src/HYDROData/HYDROData_IPolyline.cxx | 1 - src/HYDROData/HYDROData_IPolyline.h | 14 ++-- src/HYDROData/HYDROData_Image.cxx | 1 - src/HYDROData/HYDROData_Image.h | 4 +- src/HYDROData/HYDROData_ImmersibleZone.cxx | 1 - src/HYDROData/HYDROData_ImmersibleZone.h | 6 +- src/HYDROData/HYDROData_LCM_FaceClassifier.h | 2 +- src/HYDROData/HYDROData_LandCover.cxx | 1 - src/HYDROData/HYDROData_LandCoverMap.cxx | 15 ++-- src/HYDROData/HYDROData_LandCoverMap.h | 14 ++-- src/HYDROData/HYDROData_NaturalObject.cxx | 1 - src/HYDROData/HYDROData_NaturalObject.h | 5 +- src/HYDROData/HYDROData_Object.cxx | 3 +- src/HYDROData/HYDROData_Object.h | 10 +-- src/HYDROData/HYDROData_Obstacle.cxx | 1 - src/HYDROData/HYDROData_Obstacle.h | 4 +- src/HYDROData/HYDROData_ObstacleAltitude.cxx | 1 - src/HYDROData/HYDROData_ObstacleAltitude.h | 4 +- src/HYDROData/HYDROData_OperationsFactory.h | 4 +- src/HYDROData/HYDROData_Polyline3D.cxx | 1 - src/HYDROData/HYDROData_Polyline3D.h | 8 +- src/HYDROData/HYDROData_PolylineOperator.h | 4 +- src/HYDROData/HYDROData_PolylineXY.cxx | 1 - src/HYDROData/HYDROData_PolylineXY.h | 4 +- src/HYDROData/HYDROData_PriorityQueue.h | 2 +- src/HYDROData/HYDROData_Profile.cxx | 1 - src/HYDROData/HYDROData_Profile.h | 6 +- src/HYDROData/HYDROData_ProfileUZ.cxx | 3 +- src/HYDROData/HYDROData_ProfileUZ.h | 9 +- src/HYDROData/HYDROData_Projection.cxx | 1 - src/HYDROData/HYDROData_Projection.h | 4 +- src/HYDROData/HYDROData_Region.cxx | 4 +- src/HYDROData/HYDROData_Region.h | 10 +-- src/HYDROData/HYDROData_River.cxx | 1 - src/HYDROData/HYDROData_River.h | 4 +- src/HYDROData/HYDROData_ShapeFile.cxx | 54 ++++++------ src/HYDROData/HYDROData_ShapeFile.h | 38 +++++---- src/HYDROData/HYDROData_ShapesGroup.cxx | 1 - src/HYDROData/HYDROData_ShapesGroup.h | 8 +- src/HYDROData/HYDROData_ShapesTool.h | 4 +- src/HYDROData/HYDROData_SinusX.cxx | 13 +-- src/HYDROData/HYDROData_SinusX.h | 14 ++-- src/HYDROData/HYDROData_SplitShapesGroup.cxx | 1 - src/HYDROData/HYDROData_SplitShapesGroup.h | 5 +- src/HYDROData/HYDROData_SplitToZonesTool.h | 2 +- src/HYDROData/HYDROData_Stream.cxx | 58 +++++++------ src/HYDROData/HYDROData_Stream.h | 27 +++--- src/HYDROData/HYDROData_StreamAltitude.cxx | 2 +- src/HYDROData/HYDROData_StreamAltitude.h | 4 +- src/HYDROData/HYDROData_StricklerTable.cxx | 1 - src/HYDROData/HYDROData_StricklerTable.h | 6 +- src/HYDROData/HYDROData_Tool.h | 11 ++- src/HYDROData/HYDROData_TopoCurve.h | 2 +- src/HYDROData/HYDROData_VisualState.cxx | 1 - src/HYDROData/HYDROData_VisualState.h | 4 +- src/HYDROData/HYDROData_Zone.cxx | 4 +- src/HYDROData/HYDROData_Zone.h | 7 +- src/HYDROGUI/CMakeLists.txt | 7 +- src/HYDROGUI/HYDROGUI_AISShape.cxx | 5 +- src/HYDROGUI/HYDROGUI_AISShape.h | 4 +- src/HYDROGUI/HYDROGUI_AISTrihedron.cxx | 6 +- src/HYDROGUI/HYDROGUI_AISTrihedron.h | 7 +- src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_CalculationDlg.cxx | 2 +- src/HYDROGUI/HYDROGUI_CalculationOp.cxx | 6 +- src/HYDROGUI/HYDROGUI_DataBrowser.cxx | 2 +- src/HYDROGUI/HYDROGUI_DataModel.cxx | 28 +++---- src/HYDROGUI/HYDROGUI_DataObject.cxx | 2 +- src/HYDROGUI/HYDROGUI_ExportFileOp.cxx | 14 ++-- src/HYDROGUI/HYDROGUI_ExportFileOp.h | 4 - src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx | 8 +- src/HYDROGUI/HYDROGUI_ImagePrs.cxx | 19 +---- src/HYDROGUI/HYDROGUI_ImagePrs.h | 4 +- .../HYDROGUI_ImportLandCoverMapDlg.cxx | 4 +- .../HYDROGUI_ImportLandCoverMapOp.cxx | 7 +- .../HYDROGUI_ImportObstacleFromFileOp.cxx | 8 +- src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx | 6 +- src/HYDROGUI/HYDROGUI_ImportPolylineOp.h | 4 +- src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx | 6 +- src/HYDROGUI/HYDROGUI_ImportSinusXOp.h | 4 +- src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx | 11 ++- src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h | 11 ++- src/HYDROGUI/HYDROGUI_ListModel.cxx | 26 +++--- src/HYDROGUI/HYDROGUI_ListModel.h | 3 +- src/HYDROGUI/HYDROGUI_Module.h | 2 +- src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx | 83 +++++++++++++------ src/HYDROGUI/HYDROGUI_OCCDisplayer.h | 12 ++- src/HYDROGUI/HYDROGUI_OCCSelector.h | 4 +- src/HYDROGUI/HYDROGUI_Operation.cxx | 2 +- src/HYDROGUI/HYDROGUI_Operation.h | 8 +- src/HYDROGUI/HYDROGUI_Polyline.cxx | 1 - src/HYDROGUI/HYDROGUI_Polyline.h | 6 +- src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx | 1 - src/HYDROGUI/HYDROGUI_PriorityWidget.cxx | 10 +-- src/HYDROGUI/HYDROGUI_Shape.cxx | 11 ++- src/HYDROGUI/HYDROGUI_Shape.h | 2 +- src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx | 22 ++--- src/HYDROGUI/HYDROGUI_ShapeBathymetry.h | 14 ++-- src/HYDROGUI/HYDROGUI_ShapeImage.cxx | 17 ++-- src/HYDROGUI/HYDROGUI_ShapeImage.h | 10 +-- src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx | 12 +-- src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h | 6 +- src/HYDROGUI/HYDROGUI_StreamOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx | 18 ++-- src/HYDROGUI/HYDROGUI_StricklerTableDlg.h | 7 +- .../HYDROGUI_StricklerTypeComboBox.cxx | 2 +- src/HYDROGUI/HYDROGUI_Tool.cxx | 4 +- src/HYDROGUI/HYDROGUI_Tool.h | 18 ++-- src/HYDROGUI/HYDROGUI_Tool2.cxx | 2 +- src/HYDROGUI/HYDROGUI_Tool2.h | 6 +- src/HYDROGUI/HYDROGUI_UpdateObjectOp.h | 4 +- src/HYDROGUI/HYDROGUI_VTKPrs.cxx | 2 +- src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx | 3 +- src/HYDROGUI/HYDROGUI_ZLayers.cxx | 10 +-- src/HYDROGUI/HYDROGUI_ZLayers.h | 18 ++-- src/HYDROGUI/HYDROGUI_ZLayers2.cxx | 10 ++- src/HYDROGUI/HYDROGUI_Zone.cxx | 3 +- src/HYDROPy/CMakeLists.txt | 19 ++--- src/HYDROPy/HYDROData_CalculationCase.sip | 44 +++++----- src/HYDROPy/HYDROData_Channel.sip | 8 +- src/HYDROPy/HYDROData_Document.sip | 9 +- src/HYDROPy/HYDROData_Entity.sip | 4 +- src/HYDROPy/HYDROData_IInterpolator.sip | 4 +- src/HYDROPy/HYDROData_Image.sip | 15 ++-- src/HYDROPy/HYDROData_ImmersibleZone.sip | 4 +- src/HYDROPy/HYDROData_LandCoverMap.sip | 8 +- src/HYDROPy/HYDROData_Object.sip | 8 +- src/HYDROPy/HYDROData_Polyline3D.sip | 14 ++-- src/HYDROPy/HYDROData_Profile.sip | 6 +- src/HYDROPy/HYDROData_Region.sip | 4 +- src/HYDROPy/HYDROData_SequenceOfObjects.sip | 12 +-- src/HYDROPy/HYDROData_Stream.sip | 12 +-- src/HYDROPy/HYDROData_Zone.sip | 16 ++-- src/HYDROTools/controls.py | 3 +- src/HYDROTools/interpolZ.py | 3 +- src/HYDRO_tests/Basics_OCCTVersion.hxx | 51 ------------ src/HYDRO_tests/CMakeLists.txt | 6 +- src/HYDRO_tests/ExternalFiles.cmake | 5 +- src/HYDRO_tests/TestViewer.cxx | 34 +++----- src/HYDRO_tests/TestViewer.h | 13 +-- src/HYDRO_tests/test_HYDROData_Bathymetry.h | 1 - src/HYDRO_tests/test_HYDROData_CalcCase.cxx | 1 - src/HYDRO_tests/test_HYDROData_DTM.cxx | 22 ++--- .../test_HYDROData_LandCoverMap.cxx | 1 - src/HYDRO_tests/test_HYDROData_Main.cxx | 2 +- src/HYDRO_tests/test_HYDROData_Profile.h | 1 - src/HYDRO_tests/test_HYDROData_Stream.cxx | 3 +- src/HYDRO_tests/test_HYDROGUI_ListModel.cxx | 6 +- src/HYDRO_tests/test_HYDROGUI_Shape.cxx | 4 +- 200 files changed, 786 insertions(+), 932 deletions(-) delete mode 100644 src/HYDRO_tests/Basics_OCCTVersion.hxx diff --git a/CMakeLists.txt b/CMakeLists.txt index 8196042c..176582e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,17 @@ IF(WIN32) ADD_DEFINITIONS(-DWNT) ENDIF(WIN32) + +# Common CMake macros +# =================== +SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files") +IF(EXISTS ${CONFIGURATION_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake") + INCLUDE(SalomeMacros) +ELSE() + MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !") +ENDIF() + # Find KERNEL # ============== SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") @@ -127,21 +138,21 @@ FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt4 # Qt IF(NOT SALOME_GUI_BUILD_WITH_QT5) FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork QtTest) - SET(QT_ROOT_DIR "${QTDIR}") + SET(QT_ROOT_DIR "${QT4_ROOT_DIR}") SALOME_CONFIGURE_PREPARE(HYDROData HYDROGUI HYDROPy Qt4 PyQt4) ELSE() FIND_PACKAGE(SalomeQt5 REQUIRED) - SET(QT_ROOT_DIR "${QTDIR}") + SET(QT_ROOT_DIR "${QT5_ROOT_DIR}") 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 "${PYQT_ROOT_DIR}") + SET(PYQT_ROOT_DIR "${PYQT4_ROOT_DIR}") ELSE() FIND_PACKAGE(SalomePyQt5 REQUIRED) - SET(PYQT_ROOT_DIR "${PYQT_ROOT_DIR}") + SET(PYQT_ROOT_DIR "${PYQT5_ROOT_DIR}") ENDIF() # Detection summary: diff --git a/bin/hydro_setenv.py b/bin/hydro_setenv.py index 866a0f2d..a0077dd4 100644 --- a/bin/hydro_setenv.py +++ b/bin/hydro_setenv.py @@ -5,4 +5,5 @@ import os def set_env( args ): os.environ["SALOME_MODULES_ORDER"] = "HYDRO,GEOM,SMESH" + os.environ["GEOM_IGNORE_RESTORE_SHAPE"] = "2" pass diff --git a/doc/salome/examples/h001_importImage.py b/doc/salome/examples/h001_importImage.py index 6c072bff..4c33e30e 100644 --- a/doc/salome/examples/h001_importImage.py +++ b/doc/salome/examples/h001_importImage.py @@ -10,8 +10,8 @@ salome.salome_init() theStudy = salome.myStudy 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() ) diff --git a/doc/salome/examples/h002_importImage.py b/doc/salome/examples/h002_importImage.py index efa0ead5..d67dc5a7 100644 --- a/doc/salome/examples/h002_importImage.py +++ b/doc/salome/examples/h002_importImage.py @@ -10,8 +10,8 @@ salome.salome_init() theStudy = salome.myStudy 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() ) diff --git a/doc/salome/examples/h003_changeLCS.py b/doc/salome/examples/h003_changeLCS.py index be02467e..f7cf5285 100644 --- a/doc/salome/examples/h003_changeLCS.py +++ b/doc/salome/examples/h003_changeLCS.py @@ -10,8 +10,8 @@ salome.salome_init() theStudy = salome.myStudy 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() ) diff --git a/doc/salome/examples/h004_importBathyXYZ.py b/doc/salome/examples/h004_importBathyXYZ.py index 369a7e37..c4041bc1 100644 --- a/doc/salome/examples/h004_importBathyXYZ.py +++ b/doc/salome/examples/h004_importBathyXYZ.py @@ -10,8 +10,8 @@ salome.salome_init() theStudy = salome.myStudy 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() ) diff --git a/doc/salome/examples/h005_importImageBad.py b/doc/salome/examples/h005_importImageBad.py index d2e6887c..86340d7c 100644 --- a/doc/salome/examples/h005_importImageBad.py +++ b/doc/salome/examples/h005_importImageBad.py @@ -10,8 +10,8 @@ salome.salome_init() theStudy = salome.myStudy 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() ) diff --git a/doc/salome/examples/h006_importBathyXYZBad.py b/doc/salome/examples/h006_importBathyXYZBad.py index d41226e4..a5dae4f5 100644 --- a/doc/salome/examples/h006_importBathyXYZBad.py +++ b/doc/salome/examples/h006_importBathyXYZBad.py @@ -10,8 +10,8 @@ salome.salome_init() theStudy = salome.myStudy 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() ) diff --git a/doc/salome/examples/h007_createPolySplineClosed.py b/doc/salome/examples/h007_createPolySplineClosed.py index e7969884..c3e8c9b9 100644 --- a/doc/salome/examples/h007_createPolySplineClosed.py +++ b/doc/salome/examples/h007_createPolySplineClosed.py @@ -7,8 +7,8 @@ salome.salome_init() theStudy = salome.myStudy 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() ) diff --git a/doc/salome/examples/h008_simpleCase.py b/doc/salome/examples/h008_simpleCase.py index fb2bb073..c714049e 100644 --- a/doc/salome/examples/h008_simpleCase.py +++ b/doc/salome/examples/h008_simpleCase.py @@ -11,8 +11,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/examples/h009_normalCaseManual.py b/doc/salome/examples/h009_normalCaseManual.py index 5cf5c72f..2efd145b 100644 --- a/doc/salome/examples/h009_normalCaseManual.py +++ b/doc/salome/examples/h009_normalCaseManual.py @@ -14,8 +14,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/examples/h010_normalCaseManualMesh.py b/doc/salome/examples/h010_normalCaseManualMesh.py index db0e6ff5..34fb00c5 100644 --- a/doc/salome/examples/h010_normalCaseManualMesh.py +++ b/doc/salome/examples/h010_normalCaseManualMesh.py @@ -14,8 +14,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/examples/h011_normalCaseManualInterpolZ.py b/doc/salome/examples/h011_normalCaseManualInterpolZ.py index 647a8b20..4414c2c2 100644 --- a/doc/salome/examples/h011_normalCaseManualInterpolZ.py +++ b/doc/salome/examples/h011_normalCaseManualInterpolZ.py @@ -14,8 +14,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/examples/h012_caseDigueManual.py b/doc/salome/examples/h012_caseDigueManual.py index 372767d4..e67b5c3e 100644 --- a/doc/salome/examples/h012_caseDigueManual.py +++ b/doc/salome/examples/h012_caseDigueManual.py @@ -14,8 +14,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/examples/h013_caseDigueManualMesh.py b/doc/salome/examples/h013_caseDigueManualMesh.py index 6e005cbf..27b128c1 100644 --- a/doc/salome/examples/h013_caseDigueManualMesh.py +++ b/doc/salome/examples/h013_caseDigueManualMesh.py @@ -14,8 +14,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/examples/h014_caseDigueManualInterpolZ.py b/doc/salome/examples/h014_caseDigueManualInterpolZ.py index ce536cfe..6d6435a6 100644 --- a/doc/salome/examples/h014_caseDigueManualInterpolZ.py +++ b/doc/salome/examples/h014_caseDigueManualInterpolZ.py @@ -14,8 +14,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/examples/h015_normalCaseManualTelemac.py b/doc/salome/examples/h015_normalCaseManualTelemac.py index 6c3fc2d9..af484a0a 100644 --- a/doc/salome/examples/h015_normalCaseManualTelemac.py +++ b/doc/salome/examples/h015_normalCaseManualTelemac.py @@ -14,8 +14,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/examples/h016_pilesPontManualMesh.py b/doc/salome/examples/h016_pilesPontManualMesh.py index 622a132c..cd432ccd 100644 --- a/doc/salome/examples/h016_pilesPontManualMesh.py +++ b/doc/salome/examples/h016_pilesPontManualMesh.py @@ -18,8 +18,8 @@ theStudy = salome.myStudy ### 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() ) diff --git a/doc/salome/examples/h017_interpolationLineaire.py b/doc/salome/examples/h017_interpolationLineaire.py index 47ccfa5b..471471e1 100644 --- a/doc/salome/examples/h017_interpolationLineaire.py +++ b/doc/salome/examples/h017_interpolationLineaire.py @@ -14,8 +14,8 @@ theStudy = salome.myStudy ### 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() ) diff --git a/doc/salome/examples/h018_streamInterpolation.py b/doc/salome/examples/h018_streamInterpolation.py index 572bbf81..f606b7dc 100644 --- a/doc/salome/examples/h018_streamInterpolation.py +++ b/doc/salome/examples/h018_streamInterpolation.py @@ -5,6 +5,10 @@ HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYD import sys import salome +import os +HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO") + + salome.salome_init() theStudy = salome.myStudy @@ -14,8 +18,8 @@ theStudy = salome.myStudy #---------------------- 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() ) diff --git a/doc/salome/gui/HYDRO/CMakeLists.txt b/doc/salome/gui/HYDRO/CMakeLists.txt index 6aeba5ef..469bb233 100644 --- a/doc/salome/gui/HYDRO/CMakeLists.txt +++ b/doc/salome/gui/HYDRO/CMakeLists.txt @@ -17,8 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake) - SALOME_CONFIGURE_FILE(doxyfile.in doxyfile) SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html) diff --git a/doc/salome/tui/HYDRO/CMakeLists.txt b/doc/salome/tui/HYDRO/CMakeLists.txt index d24ba5cf..04dae647 100644 --- a/doc/salome/tui/HYDRO/CMakeLists.txt +++ b/doc/salome/tui/HYDRO/CMakeLists.txt @@ -20,8 +20,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake) - SALOME_CONFIGURE_FILE(doxyfile.in doxyfile) ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE}) diff --git a/src/HYDROData/HYDROData_AltitudeObject.cxx b/src/HYDROData/HYDROData_AltitudeObject.cxx index 0286c1e3..6a28d989 100644 --- a/src/HYDROData/HYDROData_AltitudeObject.cxx +++ b/src/HYDROData/HYDROData_AltitudeObject.cxx @@ -24,7 +24,6 @@ #define _DEVDEBUG_ #include "HYDRO_trace.hxx" -IMPLEMENT_STANDARD_HANDLE(HYDROData_AltitudeObject, HYDROData_IAltitudeObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_AltitudeObject, HYDROData_IAltitudeObject) HYDROData_AltitudeObject::HYDROData_AltitudeObject() diff --git a/src/HYDROData/HYDROData_AltitudeObject.h b/src/HYDROData/HYDROData_AltitudeObject.h index 5770be48..554b982c 100644 --- a/src/HYDROData/HYDROData_AltitudeObject.h +++ b/src/HYDROData/HYDROData_AltitudeObject.h @@ -23,8 +23,6 @@ #include "HYDROData_IAltitudeObject.h" -DEFINE_STANDARD_HANDLE(HYDROData_AltitudeObject, HYDROData_IAltitudeObject) - /**\class HYDROData_AltitudeObject * \brief Class that stores/retreives information about the Altitude. @@ -33,7 +31,6 @@ DEFINE_STANDARD_HANDLE(HYDROData_AltitudeObject, HYDROData_IAltitudeObject) class HYDROData_AltitudeObject : public HYDROData_IAltitudeObject { protected: - /** * Enumeration of tags corresponding to the persistent object parameters. */ @@ -43,8 +40,7 @@ protected: }; public: - - DEFINE_STANDARD_RTTI(HYDROData_AltitudeObject); + DEFINE_STANDARD_RTTIEXT(HYDROData_AltitudeObject, HYDROData_IAltitudeObject); /** * Returns the kind of this object. diff --git a/src/HYDROData/HYDROData_Application.cxx b/src/HYDROData/HYDROData_Application.cxx index 1a93490f..04a0e18b 100644 --- a/src/HYDROData/HYDROData_Application.cxx +++ b/src/HYDROData/HYDROData_Application.cxx @@ -20,7 +20,6 @@ #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_Application,TDocStd_Application) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Application,TDocStd_Application) static HYDROData_Application* TheApplication = new HYDROData_Application; diff --git a/src/HYDROData/HYDROData_Application.h b/src/HYDROData/HYDROData_Application.h index f1564243..37eb02c2 100644 --- a/src/HYDROData/HYDROData_Application.h +++ b/src/HYDROData/HYDROData_Application.h @@ -52,7 +52,7 @@ public: // Redefined OCAF methods HYDRODATA_EXPORT HYDROData_Application(); // CASCADE RTTI - DEFINE_STANDARD_RTTI(HYDROData_Application) + DEFINE_STANDARD_RTTIEXT(HYDROData_Application, TDocStd_Application) private: //! Returns document by its study ID, if document doesn't exists return null @@ -74,7 +74,4 @@ private: friend class HYDROData_Document; // to manipulate documents of application }; -// Define handle class -DEFINE_STANDARD_HANDLE(HYDROData_Application,TDocStd_Application) - #endif diff --git a/src/HYDROData/HYDROData_ArtificialObject.cxx b/src/HYDROData/HYDROData_ArtificialObject.cxx index 80a47654..23565d5a 100644 --- a/src/HYDROData/HYDROData_ArtificialObject.cxx +++ b/src/HYDROData/HYDROData_ArtificialObject.cxx @@ -18,7 +18,6 @@ #include "HYDROData_ArtificialObject.h" -IMPLEMENT_STANDARD_HANDLE(HYDROData_ArtificialObject,HYDROData_Object) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ArtificialObject,HYDROData_Object) HYDROData_ArtificialObject::HYDROData_ArtificialObject( Geometry theGeometry ) diff --git a/src/HYDROData/HYDROData_ArtificialObject.h b/src/HYDROData/HYDROData_ArtificialObject.h index dc91253b..459a2b7b 100644 --- a/src/HYDROData/HYDROData_ArtificialObject.h +++ b/src/HYDROData/HYDROData_ArtificialObject.h @@ -21,9 +21,6 @@ #include -DEFINE_STANDARD_HANDLE(HYDROData_ArtificialObject, HYDROData_Object) - - /**\class HYDROData_ArtificialObject * \brief The artificial objects are objects created or planned for creation by human. * @@ -40,7 +37,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_ArtificialObject); + DEFINE_STANDARD_RTTIEXT(HYDROData_ArtificialObject, HYDROData_Object); protected: diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index 742acbd5..2e6ac1cc 100644 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -60,7 +60,6 @@ const int BLOCK_SIZE = 1000; -IMPLEMENT_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject) //HYDROData_QuadtreeNode* HYDROData_Bathymetry::myQuadtree = 0; @@ -610,7 +609,7 @@ bool HYDROData_Bathymetry::ImportFromFiles( const QStringList& theFileNames ) } // Convert from global to local CS - Handle_HYDROData_Document aDoc = HYDROData_Document::Document( myLab ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myLab ); HYDROData_Bathymetry::AltitudePoints::iterator anIter = AllPoints.begin(), aLast = AllPoints.end(); for ( ; anIter!=aLast; ++anIter ) { @@ -786,11 +785,11 @@ bool HYDROData_Bathymetry::importFromASCFile( QFile& theFile, } -Handle_HYDROData_PolylineXY HYDROData_Bathymetry::CreateBoundaryPolyline() const +Handle(HYDROData_PolylineXY) HYDROData_Bathymetry::CreateBoundaryPolyline() const { Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab ); - Handle_HYDROData_PolylineXY aResult = - Handle_HYDROData_PolylineXY::DownCast( aDocument->CreateObject( KIND_POLYLINEXY ) ); + Handle(HYDROData_PolylineXY) aResult = + Handle(HYDROData_PolylineXY)::DownCast( aDocument->CreateObject( KIND_POLYLINEXY ) ); if( aResult.IsNull() ) return aResult; diff --git a/src/HYDROData/HYDROData_Bathymetry.h b/src/HYDROData/HYDROData_Bathymetry.h index 8a0d8504..60568473 100644 --- a/src/HYDROData/HYDROData_Bathymetry.h +++ b/src/HYDROData/HYDROData_Bathymetry.h @@ -25,13 +25,11 @@ class QFile; class gp_XYZ; class gp_XY; -class Handle_HYDROData_PolylineXY; +class HYDROData_PolylineXY; class HYDROData_QuadtreeNode; class vtkPolyData; class vtkIdList; -DEFINE_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject) - /**\class HYDROData_Bathymetry * \brief Class that stores/retreives information about the Bathymetry. @@ -67,8 +65,7 @@ protected: }; public: - - DEFINE_STANDARD_RTTI(HYDROData_Bathymetry); + DEFINE_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject); /** * Returns the kind of this object. Must be redefined in all objects of known type. @@ -157,7 +154,7 @@ public: HYDRODATA_EXPORT virtual bool ImportFromFile( const QString& theFileName ); - HYDRODATA_EXPORT Handle_HYDROData_PolylineXY CreateBoundaryPolyline() const; + HYDRODATA_EXPORT Handle(HYDROData_PolylineXY) CreateBoundaryPolyline() const; HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy ); diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index c224cd7d..89fc176b 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -85,7 +85,6 @@ #define _DEVDEBUG_ #include "HYDRO_trace.hxx" -IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity) HYDROData_CalculationCase::HYDROData_CalculationCase() @@ -1162,7 +1161,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var const TopoDS_Shape& aShape = aShToName.FindKey(i); if ( aShape.IsNull() ) continue; - + SH2M.Bind(aShape, TopTools_ListOfShape()); TopTools_ListOfShape& LM = SH2M.ChangeFind(aShape); if ( aShape.ShapeType() == TopAbs_FACE || aShape.ShapeType() == TopAbs_SHELL ) @@ -1179,6 +1178,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var LM.Append(anExp.Current()); } anExp.Init( aShape, TopAbs_FACE, TopAbs_SHELL ); + for (; anExp.More(); anExp.Next() ) { aSewing.Add( anExp.Current() ); LM.Append(anExp.Current()); @@ -1213,8 +1213,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var #ifdef DEB_CALCULATION BRepTools::Write(aSewedShape ,"Sew.brep"); -#endif - // Publish the sewed shape +#endif // Publish the sewed shape QString aName = EXPORT_NAME; GEOM::GEOM_Object_ptr aMainShape = HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( theGeomEngine, theStudy, aSewedShape, aFacesToNameModif, aName, theGeomObjEntry ); diff --git a/src/HYDROData/HYDROData_CalculationCase.h b/src/HYDROData/HYDROData_CalculationCase.h index 458d6e8a..ad8a5609 100644 --- a/src/HYDROData/HYDROData_CalculationCase.h +++ b/src/HYDROData/HYDROData_CalculationCase.h @@ -44,20 +44,16 @@ class gp_XY; class TopoDS_Shape; class TopoDS_Shell; -class TopTools_ListOfShape; - -class Handle(HYDROData_Object); -class Handle(HYDROData_Region); -class Handle(HYDROData_Zone); -class Handle(HYDROData_PolylineXY); -class Handle(HYDROData_ShapesGroup); -class Handle(HYDROData_SplitShapesGroup); -class Handle(HYDROData_Document); -class Handle(HYDROData_StricklerTable); -class Handle(HYDROData_LandCoverMap); - -DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity) +class HYDROData_Object; +class HYDROData_Region; +class HYDROData_Zone; +class HYDROData_PolylineXY; +class HYDROData_ShapesGroup; +class HYDROData_SplitShapesGroup; +class HYDROData_Document; +class HYDROData_StricklerTable; +class HYDROData_LandCoverMap; /**\class HYDROData_CalculationCase * \brief Calculation case is defined by selection of Geometry objects with or without �Zone of water�. @@ -109,8 +105,7 @@ public: }; public: - - DEFINE_STANDARD_RTTI(HYDROData_CalculationCase); + DEFINE_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx index 09ba1c64..526589c5 100644 --- a/src/HYDROData/HYDROData_Channel.cxx +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -54,6 +54,7 @@ #include #include +#include #include #include @@ -70,7 +71,6 @@ #define _DEVDEBUG_ #include "HYDRO_trace.hxx" -IMPLEMENT_STANDARD_HANDLE(HYDROData_Channel,HYDROData_ArtificialObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Channel,HYDROData_ArtificialObject) diff --git a/src/HYDROData/HYDROData_Channel.h b/src/HYDROData/HYDROData_Channel.h index f55bfc1d..3ba6e2c9 100644 --- a/src/HYDROData/HYDROData_Channel.h +++ b/src/HYDROData/HYDROData_Channel.h @@ -24,12 +24,8 @@ #include #include -class Handle(HYDROData_Polyline3D); -class Handle(HYDROData_Profile); -class TopTools_SequenceOfShape; -class TopTools_ListOfShape; - -DEFINE_STANDARD_HANDLE(HYDROData_Channel, HYDROData_ArtificialObject) +class HYDROData_Polyline3D; +class HYDROData_Profile; /**\class HYDROData_Channel * \brief @@ -62,8 +58,7 @@ protected: }; public: - - DEFINE_STANDARD_RTTI(HYDROData_Channel); + DEFINE_STANDARD_RTTIEXT(HYDROData_Channel, HYDROData_ArtificialObject); public: diff --git a/src/HYDROData/HYDROData_ChannelAltitude.cxx b/src/HYDROData/HYDROData_ChannelAltitude.cxx index 92d4d2fe..ba2c7587 100644 --- a/src/HYDROData/HYDROData_ChannelAltitude.cxx +++ b/src/HYDROData/HYDROData_ChannelAltitude.cxx @@ -53,7 +53,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject) HYDROData_ChannelAltitude::HYDROData_ChannelAltitude() diff --git a/src/HYDROData/HYDROData_ChannelAltitude.h b/src/HYDROData/HYDROData_ChannelAltitude.h index 480e14fc..d65582e5 100644 --- a/src/HYDROData/HYDROData_ChannelAltitude.h +++ b/src/HYDROData/HYDROData_ChannelAltitude.h @@ -23,8 +23,6 @@ #include "HYDROData_IAltitudeObject.h" -DEFINE_STANDARD_HANDLE(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject) - /**\class HYDROData_ChannelAltitude * \brief Class that stores/retrieves information about the Channel altitude. @@ -44,7 +42,7 @@ protected: public: - DEFINE_STANDARD_RTTI(HYDROData_ChannelAltitude); + DEFINE_STANDARD_RTTIEXT(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject); /** * Returns the kind of this object. diff --git a/src/HYDROData/HYDROData_Confluence.cxx b/src/HYDROData/HYDROData_Confluence.cxx index d40c9a17..da02c935 100644 --- a/src/HYDROData/HYDROData_Confluence.cxx +++ b/src/HYDROData/HYDROData_Confluence.cxx @@ -24,7 +24,6 @@ #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_Confluence,HYDROData_NaturalObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Confluence,HYDROData_NaturalObject) diff --git a/src/HYDROData/HYDROData_Confluence.h b/src/HYDROData/HYDROData_Confluence.h index e96a6a9a..13fdee49 100644 --- a/src/HYDROData/HYDROData_Confluence.h +++ b/src/HYDROData/HYDROData_Confluence.h @@ -21,8 +21,6 @@ #include "HYDROData_NaturalObject.h" -DEFINE_STANDARD_HANDLE(HYDROData_Confluence, HYDROData_NaturalObject) - /**\class HYDROData_Confluence * \brief * @@ -39,7 +37,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Confluence); + DEFINE_STANDARD_RTTIEXT(HYDROData_Confluence, HYDROData_NaturalObject); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_DTM.cxx b/src/HYDROData/HYDROData_DTM.cxx index 6678a8b9..e8663739 100644 --- a/src/HYDROData/HYDROData_DTM.cxx +++ b/src/HYDROData/HYDROData_DTM.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -60,7 +59,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE( HYDROData_DTM, HYDROData_Bathymetry ) IMPLEMENT_STANDARD_RTTIEXT( HYDROData_DTM, HYDROData_Bathymetry ) HYDROData_DTM::CurveUZ::CurveUZ( double theXCurv, const gp_Vec2d& theProfileDir, double theDeltaZ ) @@ -186,7 +184,7 @@ void HYDROData_DTM::PointsToEdge(const AltitudePoints& pnts, TopoDS_Edge& E ) anInterpolator.Perform() ; if (anInterpolator.IsDone()) { - Handle(Geom_Curve) C = anInterpolator.Curve(); + Handle(Geom_BSplineCurve) C = anInterpolator.Curve(); E = BRepBuilderAPI_MakeEdge(C).Edge(); } } @@ -286,7 +284,7 @@ void HYDROData_DTM::CreateProfilesFromDTM (const HYDROData_SequenceOfObjects& In int aLower = InpProfiles.Lower(), anUpper = InpProfiles.Upper(); size_t n = anUpper - aLower + 1; - std::vector profiles; + std::vector profiles; profiles.reserve( n ); for( int i=aLower; i<=anUpper; i++ ) { @@ -351,7 +349,7 @@ bool HYDROData_DTM::GetPlanarFaceFromBanks( const TopoDS_Edge& LB, const TopoDS_ return !res; } -void HYDROData_DTM::CreateProfiles(const std::vector& theProfiles, +void HYDROData_DTM::CreateProfiles(const std::vector& theProfiles, double theDDZ, double theSpatialStep, AltitudePoints& theOutLeft, @@ -408,7 +406,7 @@ void HYDROData_DTM::CreateProfiles(const std::vector& -void HYDROData_DTM::GetProperties( const Handle_HYDROData_Profile& theProfile, +void HYDROData_DTM::GetProperties( const Handle(HYDROData_Profile)& theProfile, gp_Pnt& theLowestPoint, gp_Vec2d& theDir, double& theZMin, double& theZMax ) { @@ -476,7 +474,7 @@ Handle(Geom2d_Curve) CurveTo2D( const Handle(Geom_Curve)& theCurve, aLast2d = To2D( aLastPnt, theTr, theUMin, theUMax ); gp_Vec2d dir( aFirst2d, aLast2d ); - Handle_Geom2d_Line aLine2d = new Geom2d_Line( aFirst2d, gp_Dir2d( dir.X(), dir.Y() ) ); + Handle(Geom2d_Line) aLine2d = new Geom2d_Line( aFirst2d, gp_Dir2d( dir.X(), dir.Y() ) ); return new Geom2d_TrimmedCurve( aLine2d, 0, aLast2d.Distance( aFirst2d ) ); } @@ -497,8 +495,8 @@ Handle(Geom2d_Curve) CurveTo2D( const Handle(Geom_Curve)& theCurve, #include #include -bool IsCooriented( const Handle_HYDROData_Profile& theProfile1, - const Handle_HYDROData_Profile& theProfile2 ) +bool IsCooriented( const Handle(HYDROData_Profile)& theProfile1, + const Handle(HYDROData_Profile)& theProfile2 ) { if( theProfile1==theProfile2 ) return true; @@ -513,15 +511,15 @@ bool IsCooriented( const Handle_HYDROData_Profile& theProfile1, GCE2d_MakeSegment s2(rp1, rp2); Geom2dAPI_InterCurveCurve inter; - inter.Init(s1, s2); + inter.Init(s1.Value(), s2.Value()); if (inter.NbPoints() == 0) return true; else return false; } -Handle_Geom2d_BSplineCurve HYDROData_DTM::CreateHydraulicAxis( - const std::vector& theProfiles, +Handle(Geom2d_BSplineCurve) HYDROData_DTM::CreateHydraulicAxis( + const std::vector& theProfiles, std::vector& theDistances ) { size_t n = theProfiles.size(); @@ -538,8 +536,8 @@ Handle_Geom2d_BSplineCurve HYDROData_DTM::CreateHydraulicAxis( theProfiles[0]->Update(); for( size_t i = 1; i < n; i++ ) { - Handle_HYDROData_Profile aProfile = theProfiles[i]; - Handle_HYDROData_Profile aPrevProfile = theProfiles[i-1]; + Handle(HYDROData_Profile) aProfile = theProfiles[i]; + Handle(HYDROData_Profile) aPrevProfile = theProfiles[i-1]; if( !IsCooriented( aProfile, aPrevProfile ) ) { @@ -555,8 +553,8 @@ Handle_Geom2d_BSplineCurve HYDROData_DTM::CreateHydraulicAxis( // Stage 2. Calculate normals so that each normal "points" to the next profile for( size_t i = 0; i < n; i++ ) { - Handle_HYDROData_Profile aProfile = theProfiles[i]; - Handle_HYDROData_Profile aNextProfile = i==n-1 ? theProfiles[i-1] : theProfiles[i+1]; + Handle(HYDROData_Profile) aProfile = theProfiles[i]; + Handle(HYDROData_Profile) aNextProfile = i==n-1 ? theProfiles[i-1] : theProfiles[i+1]; gp_Pnt aLowest; gp_Vec2d aNormal; @@ -611,11 +609,11 @@ Handle_Geom2d_BSplineCurve HYDROData_DTM::CreateHydraulicAxis( return aResult; } -std::vector HYDROData_DTM::ProfileToParametric( - const Handle_HYDROData_Profile& theProfile, +std::vector HYDROData_DTM::ProfileToParametric( + const Handle(HYDROData_Profile)& theProfile, double& theUMin, double& theUMax, gp_Vec2d& theDir ) { - std::vector curves; + std::vector curves; // Transformation of the coordinate systems gp_Pnt aLowest; @@ -673,7 +671,7 @@ bool CalcMidWidth( const std::set& intersections, double& theMid, double return true; } -void HYDROData_DTM::ProfileDiscretization( const Handle_HYDROData_Profile& theProfile, +void HYDROData_DTM::ProfileDiscretization( const Handle(HYDROData_Profile)& theProfile, double theXCurv, double theMinZ, double theMaxZ, double theDDZ, CurveUZ& theMidPointCurve, CurveUZ& theWidthCurve, @@ -686,7 +684,7 @@ void HYDROData_DTM::ProfileDiscretization( const Handle_HYDROData_Profile& thePr aVMax = 1000000; gp_Vec2d aProfileDir; - std::vector curves = ProfileToParametric( theProfile, aUMin, aUMax, aProfileDir ); + std::vector curves = ProfileToParametric( theProfile, aUMin, aUMax, aProfileDir ); size_t n = curves.size(); if( n==0 ) @@ -719,7 +717,7 @@ void HYDROData_DTM::ProfileDiscretization( const Handle_HYDROData_Profile& thePr std::set intersections; for( size_t i = 0; i < n; i++ ) { - Handle_Geom2d_Curve aCurve = curves[i]; + Handle(Geom2d_Curve) aCurve = curves[i]; Geom2dAPI_InterCurveCurve anIntersect( aCurve, aLine, theTolerance ); for( int k=1, m=anIntersect.NbPoints(); k<=m; k++ ) intersections.insert( anIntersect.Point( k ).X() ); @@ -765,7 +763,7 @@ void HYDROData_DTM::Interpolate( const CurveUZ& theCurveA, const CurveUZ& theCur theInterpolation.push_back( theCurveB ); } #include -void HYDROData_DTM::CurveTo3D( const Handle_Geom2d_BSplineCurve& theHydraulicAxis, +void HYDROData_DTM::CurveTo3D( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis, const CurveUZ& theMidCurve, const CurveUZ& theWidthCurve, AltitudePoints& thePoints ) { @@ -825,10 +823,10 @@ inline double min( double a, double b ) #include std::vector HYDROData_DTM::Interpolate - ( const Handle_Geom2d_BSplineCurve& theHydraulicAxis, - const Handle_HYDROData_Profile& theProfileA, + ( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis, + const Handle(HYDROData_Profile)& theProfileA, double theXCurvA, - const Handle_HYDROData_Profile& theProfileB, + const Handle(HYDROData_Profile)& theProfileB, double theXCurvB, double theDDZ, int theNbSteps, bool isAddSecond, int& inter_nb_1, int& inter_nb_2) @@ -872,7 +870,7 @@ std::vector HYDROData_DTM::Interpolate } HYDROData_Bathymetry::AltitudePoints HYDROData_DTM::Interpolate - ( const std::vector& theProfiles, + ( const std::vector& theProfiles, double theDDZ, double theSpatialStep, AltitudePoints& theLeft, AltitudePoints& theRight, @@ -885,7 +883,7 @@ HYDROData_Bathymetry::AltitudePoints HYDROData_DTM::Interpolate return points; std::vector distances; - Handle_Geom2d_BSplineCurve aHydraulicAxis = CreateHydraulicAxis( theProfiles, distances ); + Handle(Geom2d_BSplineCurve) aHydraulicAxis = CreateHydraulicAxis( theProfiles, distances ); if( aHydraulicAxis.IsNull() ) return points; @@ -940,7 +938,7 @@ HYDROData_Bathymetry::AltitudePoints HYDROData_DTM::Interpolate return points; } -int HYDROData_DTM::EstimateNbPoints( const std::vector& theProfiles, +int HYDROData_DTM::EstimateNbPoints( const std::vector& theProfiles, double theDDZ, double theSpatialStep ) { size_t n = theProfiles.size(); @@ -950,7 +948,7 @@ int HYDROData_DTM::EstimateNbPoints( const std::vector return 1 << 20; std::vector distances; - Handle_Geom2d_BSplineCurve aHydraulicAxis = CreateHydraulicAxis( theProfiles, distances ); + Handle(Geom2d_BSplineCurve) aHydraulicAxis = CreateHydraulicAxis( theProfiles, distances ); if( aHydraulicAxis.IsNull() ) return 0; diff --git a/src/HYDROData/HYDROData_DTM.h b/src/HYDROData/HYDROData_DTM.h index a283f9ce..7f2de733 100644 --- a/src/HYDROData/HYDROData_DTM.h +++ b/src/HYDROData/HYDROData_DTM.h @@ -20,25 +20,28 @@ #define HYDROData_DTM_HeaderFile #include "HYDROData_Bathymetry.h" +#include "HYDROData_Profile.h" + +#include + +#include +#include +#include + +#include +#include +#include + #include #include -#include -class Handle_HYDROData_Profile; -class Handle_Geom2d_BSplineCurve; -class Handle_Geom2d_Curve; class gp_Pnt; class gp_Vec2d; class TopoDS_Edge; class TopoDS_Wire; class TopoDS_Face; class TopoDS_Compound; -class Handle_Geom_Plane; -class TopTools_IndexedMapOfOrientedShape; -class TopTools_DataMapOfShapeListOfShape; -class TopTools_SequenceOfShape; -DEFINE_STANDARD_HANDLE( HYDROData_DTM, HYDROData_Bathymetry ) /**\class HYDROData_DTM * \brief Class that represents the Digital Terrain Model @@ -64,7 +67,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI( HYDROData_DTM ); + DEFINE_STANDARD_RTTIEXT( HYDROData_DTM, HYDROData_Bathymetry ); HYDRODATA_EXPORT HYDROData_SequenceOfObjects GetProfiles() const; HYDRODATA_EXPORT void SetProfiles( const HYDROData_SequenceOfObjects& ); @@ -111,26 +114,26 @@ protected: HYDRODATA_EXPORT HYDROData_DTM(); virtual HYDRODATA_EXPORT ~HYDROData_DTM(); - static Handle_Geom2d_BSplineCurve CreateHydraulicAxis( - const std::vector& theProfiles, + static Handle(Geom2d_BSplineCurve) CreateHydraulicAxis( + const std::vector& theProfiles, std::vector& theDistances ); - static std::vector ProfileToParametric( const Handle_HYDROData_Profile& theProfile, - double& theUMin, double& theUMax, - gp_Vec2d& theDir ); + static std::vector ProfileToParametric( const Handle(HYDROData_Profile)& theProfile, + double& theUMin, double& theUMax, + gp_Vec2d& theDir ); - static void GetProperties( const Handle_HYDROData_Profile& theProfile, + static void GetProperties( const Handle(HYDROData_Profile)& theProfile, gp_Pnt& theLowestPoint, gp_Vec2d& theDir, double& theZMin, double& theZMax ); - static void ProfileDiscretization( const Handle_HYDROData_Profile& theProfile, + static void ProfileDiscretization( const Handle(HYDROData_Profile)& theProfile, double theXCurv, double theMinZ, double theMaxZ, double theDDZ, CurveUZ& theMidPointCurve, CurveUZ& theWidthCurve, int& intersection_nb, double theTolerance = 1E-6 ); - static void CurveTo3D( const Handle_Geom2d_BSplineCurve& theHydraulicAxis, + static void CurveTo3D( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis, const CurveUZ& theMidCurve, const CurveUZ& theWidthCurve, AltitudePoints& thePoints ); @@ -139,15 +142,15 @@ protected: bool isAddSecond ); static std::vector Interpolate - ( const Handle_Geom2d_BSplineCurve& theHydraulicAxis, - const Handle_HYDROData_Profile& theProfileA, + ( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis, + const Handle(HYDROData_Profile)& theProfileA, double theXCurvA, - const Handle_HYDROData_Profile& theProfileB, + const Handle(HYDROData_Profile)& theProfileB, double theXCurvB, double theDDZ, int theNbSteps, bool isAddSecond, int& inter_nb_1, int& inter_nb_2 ); - static AltitudePoints Interpolate( const std::vector& theProfiles, + static AltitudePoints Interpolate( const std::vector& theProfiles, double theDDZ, double theSpatialStep, AltitudePoints& theLeft, AltitudePoints& theRight, @@ -168,7 +171,7 @@ protected: const AltitudePoints& right, const std::vector& main_profiles); - static void CreateProfiles(const std::vector& theProfiles, + static void CreateProfiles(const std::vector& theProfiles, double theDDZ, double theSpatialStep, AltitudePoints& theOutLeft, @@ -189,7 +192,7 @@ protected: //static bool Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF, //TopTools_SequenceOfShape* Boundr = NULL, std::set ind = std::set() ); - static int EstimateNbPoints( const std::vector& theProfiles, + static int EstimateNbPoints( const std::vector& theProfiles, double theDDZ, double theSpatialStep ); void GetPresentationShapes( TopoDS_Shape& Out3dPres, diff --git a/src/HYDROData/HYDROData_Digue.cxx b/src/HYDROData/HYDROData_Digue.cxx index 4ba967ac..a102026f 100644 --- a/src/HYDROData/HYDROData_Digue.cxx +++ b/src/HYDROData/HYDROData_Digue.cxx @@ -25,7 +25,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_Digue,HYDROData_Channel) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Digue,HYDROData_Channel) diff --git a/src/HYDROData/HYDROData_Digue.h b/src/HYDROData/HYDROData_Digue.h index c72abf39..f05e03fa 100644 --- a/src/HYDROData/HYDROData_Digue.h +++ b/src/HYDROData/HYDROData_Digue.h @@ -21,8 +21,6 @@ #include "HYDROData_Channel.h" -DEFINE_STANDARD_HANDLE(HYDROData_Digue, HYDROData_Channel) - /**\class HYDROData_Digue * \brief * @@ -39,7 +37,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Digue); + DEFINE_STANDARD_RTTIEXT(HYDROData_Digue, HYDROData_Channel); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_Document.cxx b/src/HYDROData/HYDROData_Document.cxx index 5e38d577..2fee31c3 100644 --- a/src/HYDROData/HYDROData_Document.cxx +++ b/src/HYDROData/HYDROData_Document.cxx @@ -37,7 +37,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_Document,MMgt_TShared) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Document,MMgt_TShared) #define PYTHON_DOC_NAME "hydro_doc" @@ -54,8 +53,8 @@ static const gp_Pnt2d DEFAULT_LOCAL_CS( 0, 0 ); using namespace std; -typedef QMap MapOfOrdered; -typedef QMap MapOfUnordered; +typedef QMap MapOfOrdered; +typedef QMap MapOfUnordered; Handle(HYDROData_Document) HYDROData_Document::Document(const int theStudyID) { @@ -314,8 +313,8 @@ QStringList HYDROData_Document::DumpToPython( const QString& thePyScriptPath, QStringList aResScript; aResScript << QString( "from HYDROPy import *" ); - aResScript << QString( "from PyQt4.QtCore import *" ); - aResScript << QString( "from PyQt4.QtGui import *" ); + aResScript << QString( "from PyQt5.QtCore import *" ); + aResScript << QString( "from PyQt5.QtGui import *" ); if ( theIsMultiFile ) { @@ -483,7 +482,7 @@ void HYDROData_Document::SetObjectsLayerOrder( const HYDROData_SequenceOfObjects } } -void HYDROData_Document::Show( const Handle_HYDROData_Entity& theObject ) +void HYDROData_Document::Show( const Handle(HYDROData_Entity)& theObject ) { HYDROData_SequenceOfObjects anOrder; anOrder.Append( theObject ); diff --git a/src/HYDROData/HYDROData_Document.h b/src/HYDROData/HYDROData_Document.h index 6e164226..c342ec3b 100644 --- a/src/HYDROData/HYDROData_Document.h +++ b/src/HYDROData/HYDROData_Document.h @@ -24,8 +24,8 @@ class HYDROData_InterpolatorsFactory; class HYDROData_IProfilesInterpolator; -class Handle(HYDROData_StricklerTable); -class Handle(HYDROData_LandCoverMap); +class HYDROData_StricklerTable; +class HYDROData_LandCoverMap; class QFile; class gp_Pnt2d; @@ -46,8 +46,6 @@ enum Data_DocError { DocError_UnknownProblem ///< problem has unknown nature }; -DEFINE_STANDARD_HANDLE(HYDROData_Document, MMgt_TShared) - /**\class HYDROData_Document * * \brief Document for internal data structure of any object storage. Corresponds to the SALOME study. @@ -60,8 +58,7 @@ DEFINE_STANDARD_HANDLE(HYDROData_Document, MMgt_TShared) class HYDROData_Document : public MMgt_TShared { public: - - DEFINE_STANDARD_RTTI(HYDROData_Document); + DEFINE_STANDARD_RTTIEXT(HYDROData_Document, MMgt_TShared); //! Returns the existing document or creates new if it is not exist HYDRODATA_EXPORT static Handle(HYDROData_Document) Document(const int theStudyID); @@ -144,7 +141,7 @@ public: //! Show object at the top of other model objects. If the object //! already has the z-level parameter then nothing will be done. - HYDRODATA_EXPORT void Show( const Handle_HYDROData_Entity& theObject ); + HYDRODATA_EXPORT void Show( const Handle(HYDROData_Entity)& theObject ); //! Show sequence of objects at the top of other model objects. //! The objects from the sequence will be sorted alphabetically at first. diff --git a/src/HYDROData/HYDROData_DummyObject3D.cxx b/src/HYDROData/HYDROData_DummyObject3D.cxx index fbc4851d..56a90fdc 100644 --- a/src/HYDROData/HYDROData_DummyObject3D.cxx +++ b/src/HYDROData/HYDROData_DummyObject3D.cxx @@ -25,7 +25,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_DummyObject3D,HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_DummyObject3D,HYDROData_Entity) HYDROData_DummyObject3D::HYDROData_DummyObject3D() diff --git a/src/HYDROData/HYDROData_DummyObject3D.h b/src/HYDROData/HYDROData_DummyObject3D.h index a649e41e..c944fc01 100644 --- a/src/HYDROData/HYDROData_DummyObject3D.h +++ b/src/HYDROData/HYDROData_DummyObject3D.h @@ -21,9 +21,7 @@ #include -DEFINE_STANDARD_HANDLE(HYDROData_DummyObject3D, HYDROData_Entity) - -class Handle(HYDROData_Object); +class HYDROData_Object; class TopoDS_Shape; /**\class HYDROData_DummyObject3D @@ -42,7 +40,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_DummyObject3D); + DEFINE_STANDARD_RTTIEXT(HYDROData_DummyObject3D, HYDROData_Entity); public: diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index 5a055f78..31ae1a67 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -43,25 +43,24 @@ #include "HYDRO_trace.hxx" HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects() - : NCollection_Sequence() + : NCollection_Sequence() { } HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const HYDROData_SequenceOfObjects& theSequence ) - : NCollection_Sequence( theSequence ) + : NCollection_Sequence( theSequence ) { } -HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const NCollection_Sequence& theSequence ) - : NCollection_Sequence( theSequence ) +HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const NCollection_Sequence& theSequence ) + : NCollection_Sequence( theSequence ) { } -IMPLEMENT_STANDARD_HANDLE(HYDROData_Entity,MMgt_TShared) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Entity,MMgt_TShared) // is equal function for unique object mapping -bool IsEqual(const Handle_HYDROData_Entity& theObj1, const Handle_HYDROData_Entity& theObj2) +bool IsEqual(const Handle(HYDROData_Entity)& theObj1, const Handle(HYDROData_Entity)& theObj2) { if ( !theObj1.IsNull() && !theObj2.IsNull() ) return theObj1->Label() == theObj2->Label(); @@ -303,7 +302,7 @@ HYDROData_SequenceOfObjects HYDROData_Entity::GetAllReferenceObjects() const return HYDROData_SequenceOfObjects(); } -Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const +bool HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const { theLevel = -1; @@ -314,11 +313,11 @@ Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const if ( aLabel.FindAttribute( TDataStd_Integer::GetID(), anIntVal ) ) { theLevel = anIntVal->Get(); - return Standard_True; + return true; } } - return Standard_False; + return false; } void HYDROData_Entity::SetZLevel( const Standard_Integer& theLevel ) @@ -335,7 +334,7 @@ void HYDROData_Entity::RemoveZLevel() void HYDROData_Entity::SetLabel( const TDF_Label& theLabel ) { - myLab = theLabel; + myLab = theLabel; } void HYDROData_Entity::SaveByteArray( const int theTag, @@ -383,7 +382,7 @@ int HYDROData_Entity::NbReferenceObjects( const int theTag ) const return aRefs.IsNull() ? 0 : aRefs->Extent(); } -bool HYDROData_Entity::HasReference( const Handle_HYDROData_Entity& theObj, +bool HYDROData_Entity::HasReference( const Handle(HYDROData_Entity)& theObj, const int theTag ) const { if ( theObj.IsNull() ) @@ -404,7 +403,7 @@ bool HYDROData_Entity::HasReference( const Handle_HYDROData_Entity& theObj, return false; } -void HYDROData_Entity::AddReferenceObject( const Handle_HYDROData_Entity& theObj, +void HYDROData_Entity::AddReferenceObject( const Handle(HYDROData_Entity)& theObj, const int theTag ) { if ( theObj.IsNull() ) @@ -414,7 +413,7 @@ void HYDROData_Entity::AddReferenceObject( const Handle_HYDROData_Entity& theObj aRefs->Append( theObj->Label() ); } -void HYDROData_Entity::SetReferenceObject( const Handle_HYDROData_Entity& theObj, +void HYDROData_Entity::SetReferenceObject( const Handle(HYDROData_Entity)& theObj, const int theTag, const int theIndex ) { @@ -448,7 +447,7 @@ void HYDROData_Entity::SetReferenceObject( const Handle_HYDROData_Entity& theObj } } -void HYDROData_Entity::InsertReferenceObject( const Handle_HYDROData_Entity& theObj, +void HYDROData_Entity::InsertReferenceObject( const Handle(HYDROData_Entity)& theObj, const int theTag, const int theBeforeIndex ) { @@ -841,3 +840,11 @@ int HYDROData_Entity::GetInteger( int theTag, int theDefValue ) const return anAttr->Get(); } + +bool HYDROData_Entity::CompareLabels(const Handle(HYDROData_Entity)& theOtherObj) +{ + if ( !theOtherObj.IsNull() ) + return this->Label() == theOtherObj->Label(); + return false; +} + diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index 37bdcc66..593f5855 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -24,12 +24,13 @@ #include #include #include +#include class QColor; class QVariant; class QStringList; -class Handle(TDataStd_ReferenceList); -class Handle_HYDROData_Entity; +class TDataStd_ReferenceList; +class HYDROData_Entity; class TopoDS_Shape; ///! Kind of an object in a document @@ -68,22 +69,20 @@ const ObjectKind KIND_LAND_COVER_MAP = 29; const ObjectKind KIND_DTM = 30; const ObjectKind KIND_LAST = KIND_LAND_COVER_MAP; -DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared) - class MapOfTreatedObjects : public QMap { }; -class HYDRODATA_EXPORT HYDROData_SequenceOfObjects : public NCollection_Sequence +class HYDRODATA_EXPORT HYDROData_SequenceOfObjects : public NCollection_Sequence { public: HYDROData_SequenceOfObjects(); HYDROData_SequenceOfObjects( const HYDROData_SequenceOfObjects& ); - HYDROData_SequenceOfObjects( const NCollection_Sequence& ); + HYDROData_SequenceOfObjects( const NCollection_Sequence& ); }; ///! Is Equal for HYDROData_Entity mapping -HYDRODATA_EXPORT bool IsEqual(const Handle_HYDROData_Entity& theObj1, const Handle_HYDROData_Entity& theObj2); +HYDRODATA_EXPORT bool IsEqual(const Handle(HYDROData_Entity)& theObj1, const Handle(HYDROData_Entity)& theObj2); /**\class HYDROData_Entity * \brief Generic class of any object in the data model. @@ -120,7 +119,7 @@ public: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Entity); + DEFINE_STANDARD_RTTIEXT(HYDROData_Entity, MMgt_TShared); /** * Returns the kind of this object. Must be redefined in all objects of known type. @@ -243,7 +242,7 @@ public: /** * Returns the z-level for object presentation, -1 if no z-level. */ - HYDRODATA_EXPORT virtual Standard_Boolean GetZLevel( Standard_Integer& theLevel ) const; + HYDRODATA_EXPORT virtual bool GetZLevel( Standard_Integer& theLevel ) const; /** * Set the z-level for object presentation. @@ -335,7 +334,7 @@ protected: * \param theObj pointer to reference object * \param theTag tag of a label to store attribute (for 0 this is myLab) */ - bool HasReference( const Handle_HYDROData_Entity& theObj, + bool HasReference( const Handle(HYDROData_Entity)& theObj, const int theTag = 0 ) const; /** @@ -343,7 +342,7 @@ protected: * \param theObj pointer to reference object * \param theTag tag of a label to store attribute (for 0 this is myLab) */ - void AddReferenceObject( const Handle_HYDROData_Entity& theObj, + void AddReferenceObject( const Handle(HYDROData_Entity)& theObj, const int theTag = 0 ); /** @@ -355,7 +354,7 @@ protected: - if less than zero then prepend to the list - indexing starts from 0 */ - void SetReferenceObject( const Handle_HYDROData_Entity& theObj, + void SetReferenceObject( const Handle(HYDROData_Entity)& theObj, const int theTag = 0, const int theIndex = 0 ); @@ -368,7 +367,7 @@ protected: - if less than zero then prepend to the list - indexing starts from 0 */ - void InsertReferenceObject( const Handle_HYDROData_Entity& theObj, + void InsertReferenceObject( const Handle(HYDROData_Entity)& theObj, const int theTag = 0, const int theBeforeIndex = 0 ); @@ -387,7 +386,7 @@ protected: * - indexing starts from 0 * \returns pointer to reference object or NULL if label is not set */ - Handle_HYDROData_Entity GetReferenceObject( const int theTag = 0, + Handle(HYDROData_Entity) GetReferenceObject( const int theTag = 0, const int theIndex = 0 ) const; HYDROData_SequenceOfObjects GetReferenceObjects( const int theTag = 0 ) const; @@ -412,6 +411,10 @@ protected: * \param theTag tag of a label that keeps the attribute (for 0 this is myLab) */ void ClearReferenceObjects( const int theTag = 0 ); + +public: + + virtual bool CompareLabels(const Handle(HYDROData_Entity)& theOtherObj); protected: diff --git a/src/HYDROData/HYDROData_IAltitudeObject.cxx b/src/HYDROData/HYDROData_IAltitudeObject.cxx index 86ecdf4f..6bad46d3 100644 --- a/src/HYDROData/HYDROData_IAltitudeObject.cxx +++ b/src/HYDROData/HYDROData_IAltitudeObject.cxx @@ -20,7 +20,6 @@ #define INVALID_ALTITUDE_VALUE -9999.0 -IMPLEMENT_STANDARD_HANDLE(HYDROData_IAltitudeObject, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_IAltitudeObject, HYDROData_Entity) HYDROData_IAltitudeObject::HYDROData_IAltitudeObject() diff --git a/src/HYDROData/HYDROData_IAltitudeObject.h b/src/HYDROData/HYDROData_IAltitudeObject.h index a6d36589..638a1b78 100644 --- a/src/HYDROData/HYDROData_IAltitudeObject.h +++ b/src/HYDROData/HYDROData_IAltitudeObject.h @@ -23,8 +23,6 @@ class gp_XY; -DEFINE_STANDARD_HANDLE(HYDROData_IAltitudeObject, HYDROData_Entity) - /**\class HYDROData_IAltitudeObject * \briefThe base class for all altitude objects in the HYDRO module. @@ -43,15 +41,14 @@ protected: }; public: - - DEFINE_STANDARD_RTTI(HYDROData_IAltitudeObject); + DEFINE_STANDARD_RTTIEXT(HYDROData_IAltitudeObject, HYDROData_Entity); /** * Returns the kind of this object. Must be redefined in all objects of known type. */ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const = 0; -public: +public: // Public methods to work with altitudes. /** diff --git a/src/HYDROData/HYDROData_IPolyline.cxx b/src/HYDROData/HYDROData_IPolyline.cxx index adc76d3b..42d68480 100644 --- a/src/HYDROData/HYDROData_IPolyline.cxx +++ b/src/HYDROData/HYDROData_IPolyline.cxx @@ -27,7 +27,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_IPolyline, HYDROData_Entity) HYDROData_IPolyline::HYDROData_IPolyline() diff --git a/src/HYDROData/HYDROData_IPolyline.h b/src/HYDROData/HYDROData_IPolyline.h index 88f54780..afb307cb 100644 --- a/src/HYDROData/HYDROData_IPolyline.h +++ b/src/HYDROData/HYDROData_IPolyline.h @@ -21,15 +21,12 @@ #include "HYDROData_Entity.h" - -DEFINE_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity) - class gp_XY; class TopoDS_Shape; -class Handle(TDataStd_RealList); -class Handle(TDataStd_ExtStringList); -class Handle(TDataStd_BooleanList); -class Handle(TDataStd_IntegerList); +class TDataStd_RealList; +class TDataStd_ExtStringList; +class TDataStd_BooleanList; +class TDataStd_IntegerList; /**\class HYDROData_IPolyline @@ -38,7 +35,6 @@ class Handle(TDataStd_IntegerList); class HYDROData_IPolyline : public HYDROData_Entity { public: - enum SectionType{ SECTION_POLYLINE = 0, SECTION_SPLINE = 1 }; typedef gp_XY Point; @@ -58,7 +54,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_IPolyline); + DEFINE_STANDARD_RTTIEXT(HYDROData_IPolyline, HYDROData_Entity); public: diff --git a/src/HYDROData/HYDROData_Image.cxx b/src/HYDROData/HYDROData_Image.cxx index 9cabbc12..74c278b4 100644 --- a/src/HYDROData/HYDROData_Image.cxx +++ b/src/HYDROData/HYDROData_Image.cxx @@ -49,7 +49,6 @@ static const Standard_GUID GUID_SELF_SPLIT("997995aa-5c19-40bf-9a60-ab4b70ad04d8 static const Standard_GUID GUID_HAS_LOCAL_POINTS("FD8841AA-FC44-42fa-B6A7-0F682CCC6F27"); static const Standard_GUID GUID_HAS_GLOBAL_POINTS("330D0E81-742D-4ea3-92D4-484877CFA7C1"); -IMPLEMENT_STANDARD_HANDLE(HYDROData_Image, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Image, HYDROData_Entity) HYDROData_Image::HYDROData_Image() diff --git a/src/HYDROData/HYDROData_Image.h b/src/HYDROData/HYDROData_Image.h index 5a25af9e..5be02dee 100644 --- a/src/HYDROData/HYDROData_Image.h +++ b/src/HYDROData/HYDROData_Image.h @@ -32,8 +32,6 @@ #pragma warning ( default: 4251 ) #endif -DEFINE_STANDARD_HANDLE(HYDROData_Image, HYDROData_Entity) - /**\class HYDROData_Image * \brief Class that stores/retreives information about the image. * @@ -68,7 +66,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Image); + DEFINE_STANDARD_RTTIEXT(HYDROData_Image, HYDROData_Entity); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_ImmersibleZone.cxx b/src/HYDROData/HYDROData_ImmersibleZone.cxx index 83f2ab99..6d0ed150 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.cxx +++ b/src/HYDROData/HYDROData_ImmersibleZone.cxx @@ -51,7 +51,6 @@ //#define HYDRODATA_IMZONE_DEB 1 -IMPLEMENT_STANDARD_HANDLE(HYDROData_ImmersibleZone,HYDROData_NaturalObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ImmersibleZone,HYDROData_NaturalObject) diff --git a/src/HYDROData/HYDROData_ImmersibleZone.h b/src/HYDROData/HYDROData_ImmersibleZone.h index 3e4d6e84..cae0e08b 100644 --- a/src/HYDROData/HYDROData_ImmersibleZone.h +++ b/src/HYDROData/HYDROData_ImmersibleZone.h @@ -21,9 +21,7 @@ #include -DEFINE_STANDARD_HANDLE(HYDROData_ImmersibleZone, HYDROData_NaturalObject) - -class Handle(HYDROData_PolylineXY); +class HYDROData_PolylineXY; /**\class HYDROData_ImmersibleZone * \brief @@ -42,7 +40,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_ImmersibleZone); + DEFINE_STANDARD_RTTIEXT(HYDROData_ImmersibleZone, HYDROData_NaturalObject); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_LCM_FaceClassifier.h b/src/HYDROData/HYDROData_LCM_FaceClassifier.h index 30e78886..2096e8ce 100644 --- a/src/HYDROData/HYDROData_LCM_FaceClassifier.h +++ b/src/HYDROData/HYDROData_LCM_FaceClassifier.h @@ -30,10 +30,10 @@ #include #include #include +#include class BRepTopAdaptor_FClass2d; class HYDROData_LandCoverMap; -class Handle(Geom_Plane); typedef NCollection_UBTree HYDROData_FaceClassifier_BndBoxTree; diff --git a/src/HYDROData/HYDROData_LandCover.cxx b/src/HYDROData/HYDROData_LandCover.cxx index d17b5243..c9199eb3 100644 --- a/src/HYDROData/HYDROData_LandCover.cxx +++ b/src/HYDROData/HYDROData_LandCover.cxx @@ -42,7 +42,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity ) IMPLEMENT_STANDARD_RTTIEXT( HYDROData_LandCover, HYDROData_Entity ) HYDROData_LandCover::HYDROData_LandCover() diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index 3d166025..c766e5ca 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -55,9 +55,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -78,7 +78,6 @@ const char TELEMAC_FORMAT = 'f'; const int TELEMAC_PRECISION = 3; -IMPLEMENT_STANDARD_HANDLE(HYDROData_LandCoverMap, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_LandCoverMap, HYDROData_Entity) /** @@ -1145,7 +1144,7 @@ void HYDROData_LandCoverMap::RemoveInternal(TopoDS_Shape& ShToRebuild, NCollecti // if (!anEdgesToRemove.IsEmpty()) { - Handle_ShapeBuild_ReShape aReshape = new ShapeBuild_ReShape(); + Handle(ShapeBuild_ReShape) aReshape = new ShapeBuild_ReShape(); TopoDS_Shape OutF = aReshape->Apply(CurFace); TopTools_ListIteratorOfListOfShape aIt(anEdgesToRemove); for (; aIt.More(); aIt.Next()) @@ -1160,7 +1159,7 @@ void HYDROData_LandCoverMap::RemoveInternal(TopoDS_Shape& ShToRebuild, NCollecti } } // - Handle_ShapeBuild_ReShape anExtReshape = new ShapeBuild_ReShape(); + Handle(ShapeBuild_ReShape) anExtReshape = new ShapeBuild_ReShape(); for (int i = 1; i <= aF2FReplace->Extent(); i++) { TopoDS_Face aFK = aF2FReplace->FindKey(i); @@ -1182,7 +1181,7 @@ void HYDROData_LandCoverMap::SetTransparency( double theTransparency ) double HYDROData_LandCoverMap::GetTransparency() const { - return GetDouble( DataTag_Transparency, 0.5 ); + return GetDouble( DataTag_Transparency, 0.25 ); } bool HYDROData_LandCoverMap::ImportSHP( const QString& theSHPFileName, @@ -1248,7 +1247,7 @@ bool HYDROData_LandCoverMap::CheckLinear() { TopoDS_Edge E = TopoDS::Edge(anEdgeEx.Current()); double aFP, aLP; - Handle_Geom_Curve aCur = BRep_Tool::Curve(E, aFP, aLP); + Handle(Geom_Curve) aCur = BRep_Tool::Curve(E, aFP, aLP); Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(aCur); if (aLine.IsNull()) { diff --git a/src/HYDROData/HYDROData_LandCoverMap.h b/src/HYDROData/HYDROData_LandCoverMap.h index 1e05c6f3..1d310ef3 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.h +++ b/src/HYDROData/HYDROData_LandCoverMap.h @@ -28,19 +28,16 @@ #include #include -class Handle_HYDROData_StricklerTable; +class HYDROData_StricklerTable; #include typedef NCollection_IndexedDataMap HYDROData_MapOfFaceToStricklerType; -DEFINE_STANDARD_HANDLE( HYDROData_LandCoverMap, HYDROData_Entity ) - class TopoDS_Shape; class TopoDS_Wire; class TopoDS_Iterator; -class TopTools_ListOfShape; -class Handle( HYDROData_PolylineXY ); -class Handle( HYDROData_Object ); +class HYDROData_PolylineXY; +class HYDROData_Object; class gp_XY; class HYDROData_LandCoverMap : public HYDROData_Entity @@ -111,12 +108,13 @@ public: HYDRODATA_EXPORT bool ExportTelemac( const QString& theFileName, double theDeflection, - const Handle_HYDROData_StricklerTable& theTable, + const Handle(HYDROData_StricklerTable)& theTable, QString& statMessage) const; HYDRODATA_EXPORT bool Add( const Handle( HYDROData_Object )&, const QString& theType ); HYDRODATA_EXPORT bool Add( const Handle( HYDROData_PolylineXY )&, const QString& theType ); + using HYDROData_Entity::Remove; HYDRODATA_EXPORT bool Remove( const TopoDS_Face& ); HYDRODATA_EXPORT bool Remove( const TopTools_ListOfShape& ); @@ -175,7 +173,7 @@ protected: double theTolerance = 1E-5 ); public: - DEFINE_STANDARD_RTTI( HYDROData_LandCoverMap ); + DEFINE_STANDARD_RTTIEXT( HYDROData_LandCoverMap, HYDROData_Entity ); private: friend class Explorer; diff --git a/src/HYDROData/HYDROData_NaturalObject.cxx b/src/HYDROData/HYDROData_NaturalObject.cxx index 00110438..ff4b3302 100644 --- a/src/HYDROData/HYDROData_NaturalObject.cxx +++ b/src/HYDROData/HYDROData_NaturalObject.cxx @@ -18,7 +18,6 @@ #include "HYDROData_NaturalObject.h" -IMPLEMENT_STANDARD_HANDLE(HYDROData_NaturalObject,HYDROData_Object) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_NaturalObject,HYDROData_Object) HYDROData_NaturalObject::HYDROData_NaturalObject( Geometry theGeometry ) diff --git a/src/HYDROData/HYDROData_NaturalObject.h b/src/HYDROData/HYDROData_NaturalObject.h index e002b9a7..ecc4736a 100644 --- a/src/HYDROData/HYDROData_NaturalObject.h +++ b/src/HYDROData/HYDROData_NaturalObject.h @@ -21,9 +21,6 @@ #include -DEFINE_STANDARD_HANDLE(HYDROData_NaturalObject, HYDROData_Object) - - /**\class HYDROData_NaturalObject * \brief The natural objects are objects of environment not created by human. * @@ -40,7 +37,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_NaturalObject); + DEFINE_STANDARD_RTTIEXT(HYDROData_NaturalObject, HYDROData_Object); protected: diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 7745ee0f..0f677624 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -32,7 +32,6 @@ #define _DEVDEBUG_ #include "HYDRO_trace.hxx" -IMPLEMENT_STANDARD_HANDLE(HYDROData_Object,HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Object,HYDROData_Entity) HYDROData_Object::HYDROData_Object( Geometry theGeometry ) @@ -184,7 +183,7 @@ int HYDROData_Object::GetGroupId( const Handle(HYDROData_ShapesGroup)& theGroup { Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( aGroups.Value( i ) ); - if ( IsEqual( theGroup, aGroup ) ) + if ( theGroup->CompareLabels ( aGroup ) ) { aRes = i - 1; break; diff --git a/src/HYDROData/HYDROData_Object.h b/src/HYDROData/HYDROData_Object.h index 0c217f27..e3646b21 100644 --- a/src/HYDROData/HYDROData_Object.h +++ b/src/HYDROData/HYDROData_Object.h @@ -21,12 +21,10 @@ #include -DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity) - class TopoDS_Shape; -class Handle(HYDROData_IAltitudeObject); -class Handle(HYDROData_DummyObject3D); -class Handle(HYDROData_ShapesGroup); +class HYDROData_IAltitudeObject; +class HYDROData_DummyObject3D; +class HYDROData_ShapesGroup; /**\class HYDROData_Object * \brief The base class for all geometrical objects in the HYDRO module. @@ -53,7 +51,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Object); + DEFINE_STANDARD_RTTIEXT(HYDROData_Object, HYDROData_Entity); /** * Updates the name of this object. diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index 4bcc7aa9..29b0a64c 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -78,7 +78,6 @@ #define _DEVDEBUG_ #include "HYDRO_trace.hxx" -IMPLEMENT_STANDARD_HANDLE(HYDROData_Obstacle,HYDROData_ArtificialObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Obstacle,HYDROData_ArtificialObject) diff --git a/src/HYDROData/HYDROData_Obstacle.h b/src/HYDROData/HYDROData_Obstacle.h index bbf690a2..e2b0c392 100644 --- a/src/HYDROData/HYDROData_Obstacle.h +++ b/src/HYDROData/HYDROData_Obstacle.h @@ -21,8 +21,6 @@ #include "HYDROData_ArtificialObject.h" -DEFINE_STANDARD_HANDLE(HYDROData_Obstacle, HYDROData_ArtificialObject) - /**\class HYDROData_Obstacle * \brief * @@ -42,7 +40,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Obstacle); + DEFINE_STANDARD_RTTIEXT(HYDROData_Obstacle, HYDROData_ArtificialObject); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_ObstacleAltitude.cxx b/src/HYDROData/HYDROData_ObstacleAltitude.cxx index cba53dfa..7bc4ed00 100644 --- a/src/HYDROData/HYDROData_ObstacleAltitude.cxx +++ b/src/HYDROData/HYDROData_ObstacleAltitude.cxx @@ -31,7 +31,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject) HYDROData_ObstacleAltitude::HYDROData_ObstacleAltitude() diff --git a/src/HYDROData/HYDROData_ObstacleAltitude.h b/src/HYDROData/HYDROData_ObstacleAltitude.h index 3dc1e2ce..3fd489d1 100644 --- a/src/HYDROData/HYDROData_ObstacleAltitude.h +++ b/src/HYDROData/HYDROData_ObstacleAltitude.h @@ -23,8 +23,6 @@ #include "HYDROData_IAltitudeObject.h" -DEFINE_STANDARD_HANDLE(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject) - /**\class HYDROData_ObstacleAltitude * \brief Class that stores/retreives information about the obstacle altitude. @@ -44,7 +42,7 @@ protected: public: - DEFINE_STANDARD_RTTI(HYDROData_ObstacleAltitude); + DEFINE_STANDARD_RTTIEXT(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject); /** * Returns the kind of this object. diff --git a/src/HYDROData/HYDROData_OperationsFactory.h b/src/HYDROData/HYDROData_OperationsFactory.h index 2de9ca0b..b9df8e71 100644 --- a/src/HYDROData/HYDROData_OperationsFactory.h +++ b/src/HYDROData/HYDROData_OperationsFactory.h @@ -24,7 +24,7 @@ #include class ImageComposer_Operator; -class Handle_HYDROData_Document; +class HYDROData_Document; /**\class HYDROData_OperationsFactory * @@ -60,7 +60,7 @@ public: * \returns created object related to the data structure */ HYDRODATA_EXPORT Handle(HYDROData_Image) CreateImage( - Handle_HYDROData_Document theDoc, const ImageComposer_Operator* theOperator); + Handle(HYDROData_Document) theDoc, const ImageComposer_Operator* theOperator); /** * Returns the operator, initialized by the properties of theImage diff --git a/src/HYDROData/HYDROData_Polyline3D.cxx b/src/HYDROData/HYDROData_Polyline3D.cxx index 66cec7be..15959d97 100644 --- a/src/HYDROData/HYDROData_Polyline3D.cxx +++ b/src/HYDROData/HYDROData_Polyline3D.cxx @@ -56,7 +56,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_Polyline3D,HYDROData_Object) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Polyline3D,HYDROData_Object) diff --git a/src/HYDROData/HYDROData_Polyline3D.h b/src/HYDROData/HYDROData_Polyline3D.h index e90b1cec..9500afa5 100644 --- a/src/HYDROData/HYDROData_Polyline3D.h +++ b/src/HYDROData/HYDROData_Polyline3D.h @@ -21,10 +21,8 @@ #include "HYDROData_Object.h" -DEFINE_STANDARD_HANDLE(HYDROData_Polyline3D, HYDROData_Object) - -class Handle(HYDROData_PolylineXY); -class Handle(HYDROData_ProfileUZ); +class HYDROData_PolylineXY; +class HYDROData_ProfileUZ; class gp_XYZ; /**\class HYDROData_Polyline3D @@ -51,7 +49,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Polyline3D); + DEFINE_STANDARD_RTTIEXT(HYDROData_Polyline3D, HYDROData_Object); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_PolylineOperator.h b/src/HYDROData/HYDROData_PolylineOperator.h index a4c280b8..6fea4512 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.h +++ b/src/HYDROData/HYDROData_PolylineOperator.h @@ -24,9 +24,9 @@ #include #include -class Handle( HYDROData_Document ); +class HYDROData_Document; class HYDROData_TopoCurve; -class Handle(HYDROData_Object); +class HYDROData_Object; class HYDRODATA_EXPORT HYDROData_PolylineOperator { diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 4b82850f..8c7db492 100644 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -126,7 +126,6 @@ TCollection_AsciiString getUniqueSectionName( const Handle(TDataStd_ExtStringLis return getUniqueSectionName( aNamesSeq ); } -IMPLEMENT_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_PolylineXY, HYDROData_IPolyline) HYDROData_PolylineXY::HYDROData_PolylineXY() diff --git a/src/HYDROData/HYDROData_PolylineXY.h b/src/HYDROData/HYDROData_PolylineXY.h index d67f0ad5..8375616b 100644 --- a/src/HYDROData/HYDROData_PolylineXY.h +++ b/src/HYDROData/HYDROData_PolylineXY.h @@ -22,8 +22,6 @@ #include "HYDROData_IPolyline.h" #include -DEFINE_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline) - class QPainterPath; class QTransform; class TopoDS_Wire; @@ -47,7 +45,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_PolylineXY); + DEFINE_STANDARD_RTTIEXT(HYDROData_PolylineXY, HYDROData_IPolyline); /** diff --git a/src/HYDROData/HYDROData_PriorityQueue.h b/src/HYDROData/HYDROData_PriorityQueue.h index 7983a1f7..ef5660ab 100644 --- a/src/HYDROData/HYDROData_PriorityQueue.h +++ b/src/HYDROData/HYDROData_PriorityQueue.h @@ -48,7 +48,7 @@ public: Standard_Integer aTag ); ~HYDROData_PriorityQueue(); - Handle_HYDROData_Entity GetMostPriorityObject( const QStringList& theZoneObjects, + Handle(HYDROData_Entity) GetMostPriorityObject( const QStringList& theZoneObjects, HYDROData_Zone::MergeType& theMergeType ) const; bool IsMorePriority( const Handle(HYDROData_Entity)& theObj1, diff --git a/src/HYDROData/HYDROData_Profile.cxx b/src/HYDROData/HYDROData_Profile.cxx index eec72e7b..0057722b 100644 --- a/src/HYDROData/HYDROData_Profile.cxx +++ b/src/HYDROData/HYDROData_Profile.cxx @@ -53,7 +53,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_Profile, HYDROData_Object) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Profile, HYDROData_Object) HYDROData_Profile::HYDROData_Profile() diff --git a/src/HYDROData/HYDROData_Profile.h b/src/HYDROData/HYDROData_Profile.h index cc18e1ab..658bc847 100644 --- a/src/HYDROData/HYDROData_Profile.h +++ b/src/HYDROData/HYDROData_Profile.h @@ -22,11 +22,9 @@ #include "HYDROData_Object.h" #include "HYDROData_ProfileUZ.h" -DEFINE_STANDARD_HANDLE(HYDROData_Profile, HYDROData_Object) - class gp_XYZ; class OSD_File; -class Handle(HYDROData_Document); +class HYDROData_Document; /**\class HYDROData_Profile * \brief Class that stores/retreives information about the profile. @@ -52,7 +50,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Profile); + DEFINE_STANDARD_RTTIEXT(HYDROData_Profile, HYDROData_Object); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_ProfileUZ.cxx b/src/HYDROData/HYDROData_ProfileUZ.cxx index bfe75e3b..5dccf20c 100644 --- a/src/HYDROData/HYDROData_ProfileUZ.cxx +++ b/src/HYDROData/HYDROData_ProfileUZ.cxx @@ -36,7 +36,6 @@ #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ProfileUZ, HYDROData_IPolyline) HYDROData_ProfileUZ::HYDROData_ProfileUZ() @@ -279,7 +278,7 @@ HYDROData_ProfileUZ::PointsList HYDROData_ProfileUZ::GetPoints( const int /*theS return aResList; } -void HYDROData_ProfileUZ::CalculateAndAddPoints(const NCollection_Sequence& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY) +void HYDROData_ProfileUZ::CalculateAndAddPoints(const NCollection_Sequence& theXYZPoints, Handle(HYDROData_PolylineXY)& thePolylineXY) { // Fill 2D polyline for ( int i = 1; i <= theXYZPoints.Size(); i++ ) { diff --git a/src/HYDROData/HYDROData_ProfileUZ.h b/src/HYDROData/HYDROData_ProfileUZ.h index aa9ebbc9..2fcb3899 100644 --- a/src/HYDROData/HYDROData_ProfileUZ.h +++ b/src/HYDROData/HYDROData_ProfileUZ.h @@ -21,10 +21,8 @@ #include "HYDROData_IPolyline.h" -DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline) - class gp_XYZ; -class Handle_HYDROData_PolylineXY; +class HYDROData_PolylineXY; /**\class HYDROData_ProfileUZ * \brief Class that stores/retreives information about the @@ -42,7 +40,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ); + DEFINE_STANDARD_RTTIEXT(HYDROData_ProfileUZ, HYDROData_IPolyline); /** @@ -170,7 +168,8 @@ public: */ HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const; - HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY); + HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence& theXYZPoints, + Handle(HYDROData_PolylineXY)& thePolylineXY); protected: diff --git a/src/HYDROData/HYDROData_Projection.cxx b/src/HYDROData/HYDROData_Projection.cxx index c88501ba..855ae1e7 100644 --- a/src/HYDROData/HYDROData_Projection.cxx +++ b/src/HYDROData/HYDROData_Projection.cxx @@ -42,7 +42,6 @@ #include #include #include -#include #include HYDROData_Make3dMesh::HYDROData_Make3dMesh( const TopoDS_Shape& aShape, diff --git a/src/HYDROData/HYDROData_Projection.h b/src/HYDROData/HYDROData_Projection.h index dab681c6..917949ca 100644 --- a/src/HYDROData/HYDROData_Projection.h +++ b/src/HYDROData/HYDROData_Projection.h @@ -21,14 +21,14 @@ #include #include +#include +#include class TopoDS_Shape; class TopoDS_Edge; class TopoDS_Face; class TopoDS_Wire; class TopoDS_Vertex; -class TopTools_ListOfShape; -class TopTools_IndexedDataMapOfShapeListOfShape; class gp_Pnt; class HYDROData_Make3dMesh diff --git a/src/HYDROData/HYDROData_Region.cxx b/src/HYDROData/HYDROData_Region.cxx index 226e0e46..daf99893 100644 --- a/src/HYDROData/HYDROData_Region.cxx +++ b/src/HYDROData/HYDROData_Region.cxx @@ -47,14 +47,12 @@ #include #include -#include "Handle_Geom_Plane.hxx" #include "Geom_Plane.hxx" #include "gp_Pln.hxx" #include "BRepTools_ReShape.hxx" //#define DEB_GET_REGION_SHAPE -IMPLEMENT_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity) @@ -374,7 +372,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* //USD algo will skip such edges and will not perform unifying through them //(more than 2 faces are connected to one edge + non same domain surfaces) TopoDS_Wire DW; - Handle_Geom_Plane DPl = new Geom_Plane(gp_Pln (gp_Pnt(0,0,0), gp_Dir(0,1,0))); //non same domain with the main surf + Handle(Geom_Plane) DPl = new Geom_Plane(gp_Pln (gp_Pnt(0,0,0), gp_Dir(0,1,0))); //non same domain with the main surf BB.MakeFace(DF, DPl, Precision::Confusion()); BB.MakeWire(DW); for (int i = 1; i <= IE.Extent(); i++) diff --git a/src/HYDROData/HYDROData_Region.h b/src/HYDROData/HYDROData_Region.h index bc9a7c6a..205e546e 100644 --- a/src/HYDROData/HYDROData_Region.h +++ b/src/HYDROData/HYDROData_Region.h @@ -22,10 +22,8 @@ #include "HYDROData_ShapesGroup.h" -DEFINE_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity) - -class Handle(HYDROData_Zone); -class Handle(HYDROData_Document); +class HYDROData_Zone; +class HYDROData_Document; class TopoDS_Shape; class TopoDS_Face; class QStringList; @@ -35,9 +33,7 @@ class QStringList; */ class HYDROData_Region : public HYDROData_Entity { - protected: - /** * Enumeration of tags corresponding to the persistent object parameters. */ @@ -49,7 +45,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Region); + DEFINE_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_River.cxx b/src/HYDROData/HYDROData_River.cxx index 1f197c03..b43f8a33 100644 --- a/src/HYDROData/HYDROData_River.cxx +++ b/src/HYDROData/HYDROData_River.cxx @@ -24,7 +24,6 @@ #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_River,HYDROData_NaturalObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_River,HYDROData_NaturalObject) diff --git a/src/HYDROData/HYDROData_River.h b/src/HYDROData/HYDROData_River.h index 0873ce15..27376559 100644 --- a/src/HYDROData/HYDROData_River.h +++ b/src/HYDROData/HYDROData_River.h @@ -21,8 +21,6 @@ #include "HYDROData_NaturalObject.h" -DEFINE_STANDARD_HANDLE(HYDROData_River, HYDROData_NaturalObject) - /**\class HYDROData_River * \brief * @@ -39,7 +37,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_River); + DEFINE_STANDARD_RTTIEXT(HYDROData_River, HYDROData_NaturalObject); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_ShapeFile.cxx b/src/HYDROData/HYDROData_ShapeFile.cxx index a66bc81b..2a38a86d 100644 --- a/src/HYDROData/HYDROData_ShapeFile.cxx +++ b/src/HYDROData/HYDROData_ShapeFile.cxx @@ -35,9 +35,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -80,21 +80,21 @@ HYDROData_ShapeFile::~HYDROData_ShapeFile() void HYDROData_ShapeFile::Export(Handle(HYDROData_Document) theDocument, const QString& aFileName, - NCollection_Sequence aPolyXYSeq, - NCollection_Sequence aPoly3DSeq, + NCollection_Sequence aPolyXYSeq, + NCollection_Sequence aPoly3DSeq, QStringList& aNonExpList) { SHPHandle hSHPHandle; if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty()) { - hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC ); + hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_ARC ); for (int i = 1; i <= aPolyXYSeq.Size(); i++) if (WriteObjectPolyXY(theDocument, hSHPHandle, aPolyXYSeq(i)) != 1) aNonExpList.append(aPolyXYSeq(i)->GetName()); } else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty()) { - hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ ); + hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_ARCZ ); for (int i = 1; i <= aPoly3DSeq.Size(); i++) if (WriteObjectPoly3D(theDocument, hSHPHandle, aPoly3DSeq(i)) != 1) aNonExpList.append(aPoly3DSeq(i)->GetName()); @@ -112,7 +112,7 @@ void HYDROData_ShapeFile::Export(Handle(HYDROData_Document) theDocument, void HYDROData_ShapeFile::Export(Handle(HYDROData_Document) theDocument, const QString& aFileName, - const Handle_HYDROData_LandCoverMap& aLCM, + const Handle(HYDROData_LandCoverMap)& aLCM, QStringList& aNonExpList, bool bCheckLinear, bool bUseDiscr, double theDefl) { @@ -122,7 +122,7 @@ void HYDROData_ShapeFile::Export(Handle(HYDROData_Document) theDocument, SHPHandle hSHPHandle = NULL; if ( !aLCM.IsNull() && !aLCM->IsEmpty()) { - hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_POLYGON ); + hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_POLYGON ); HYDROData_LandCoverMap::Explorer It( aLCM ); for( ; It.More(); It.Next()) { @@ -145,7 +145,7 @@ void HYDROData_ShapeFile::Export(Handle(HYDROData_Document) theDocument, int HYDROData_ShapeFile::WriteObjectPolyXY(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle, - Handle_HYDROData_PolylineXY thePoly ) + Handle(HYDROData_PolylineXY) thePoly ) { SHPObject *aSHPObj; std::vector x, y; @@ -183,7 +183,7 @@ int HYDROData_ShapeFile::WriteObjectPolyXY(Handle(HYDROData_Document) theDocumen int HYDROData_ShapeFile::WriteObjectPoly3D(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle, - Handle_HYDROData_Polyline3D thePoly ) + Handle(HYDROData_Polyline3D) thePoly ) { SHPObject *aSHPObj; std::vector x, y, z; @@ -398,7 +398,7 @@ void HYDROData_ShapeFile::ReadSHPPolygon(Handle(HYDROData_Document) theDocument, return; TopoDS_Edge E; int nParts = anObj->nParts; - Handle_Geom_Plane aPlaneSur = new Geom_Plane(gp_Pnt(0,0,0), gp_Dir(0,0,1)); + Handle(Geom_Plane) aPlaneSur = new Geom_Plane(gp_Pnt(0,0,0), gp_Dir(0,0,1)); BRep_Builder BB; BB.MakeFace(F); @@ -437,7 +437,7 @@ void HYDROData_ShapeFile::ReadSHPPolygon(Handle(HYDROData_Document) theDocument, gp_Pnt P2 = BRep_Tool::Pnt(VPoints(k + 1)); if (P1.Distance(P2) < Precision::Confusion()) continue; - Handle_Geom_TrimmedCurve aTC = GC_MakeSegment(P1, P2).Value(); + Handle(Geom_TrimmedCurve) aTC = GC_MakeSegment(P1, P2).Value(); TopoDS_Edge E; if ( k != VPoints.Size() - 2) E = BRepLib_MakeEdge(aTC, VPoints(k), VPoints(k + 1)).Edge(); @@ -520,7 +520,7 @@ int HYDROData_ShapeFile::ImportPolygons(Handle(HYDROData_Document) theDocument, int Stat = TryOpenShapeFile(theFileName); if (Stat != 0) return Stat; - myHSHP = SHPOpen( theFileName.toAscii().data(), "rb" ); + myHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" ); if (!Parse(myHSHP, HYDROData_ShapeFile::ShapeType_Polygon, theShapeTypeOfFile)) return 0; for (size_t i = 0; i < mySHPObjects.size(); i++) @@ -563,7 +563,7 @@ void HYDROData_ShapeFile::Free() void HYDROData_ShapeFile::ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, - int theInd, NCollection_Sequence& theEntities, bool bReadAsPolyline) + int theInd, NCollection_Sequence& theEntities, bool bReadAsPolyline) { Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) ); @@ -586,10 +586,10 @@ void HYDROData_ShapeFile::ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, anObj->padfY[StartIndex] == anObj->padfY[EndIndex - 1] ) { IsClosed = true; - aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true); + aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, true); } else - aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, false); + aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, false); if (IsClosed) EndIndex--; @@ -597,7 +597,7 @@ void HYDROData_ShapeFile::ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, else { //polygon; contours always closed - aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true); + aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, true); EndIndex--; } for ( int k = StartIndex; k < EndIndex ; k++ ) @@ -618,7 +618,7 @@ void HYDROData_ShapeFile::ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, } void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, - int theInd, NCollection_Sequence& theEntities) + int theInd, NCollection_Sequence& theEntities) { Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) ); @@ -645,10 +645,10 @@ void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, anObj->padfZ[StartIndex] == anObj->padfZ[EndIndex - 1]) { IsClosed = true; - aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true ); + aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, true ); } else - aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, false ); + aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, false ); if (IsClosed) EndIndex--; @@ -706,7 +706,7 @@ void HYDROData_ShapeFile::GetFreeIndices(std::vector& theAllowedIndexes, QS } int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName, - NCollection_Sequence& theEntities, int& theShapeTypeOfFile) + NCollection_Sequence& theEntities, int& theShapeTypeOfFile) { //Free(); int aStat = TryOpenShapeFile(theFileName); @@ -721,7 +721,7 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, anExistingNames.push_back(anIter.Current()->GetName()); SHPHandle aHSHP; - aHSHP = SHPOpen( theFileName.toAscii().data(), "rb" ); + aHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" ); QFileInfo aFileInfo(theFileName); QString aBaseFileName = aFileInfo.baseName(); @@ -832,9 +832,9 @@ int HYDROData_ShapeFile::TryOpenShapeFile(QString theFileName) return -3; FILE* pFileSHP = NULL; - pFileSHP = fopen (aSHPfile.toAscii().data(), "r"); + pFileSHP = fopen (aSHPfile.toLatin1().data(), "r"); FILE* pFileSHX = NULL; - pFileSHX = fopen (aSHXfile.toAscii().data(), "r"); + pFileSHX = fopen (aSHXfile.toLatin1().data(), "r"); if (pFileSHP == NULL || pFileSHX == NULL) { @@ -855,7 +855,7 @@ bool HYDROData_ShapeFile::CheckDBFFileExisting(const QString& theSHPFilePath, QS QString aSHPfile = theSHPFilePath.simplified(); QString aDBFfile = theSHPFilePath.simplified().replace( theSHPFilePath.simplified().size() - 4, 4, ".dbf"); FILE* pFileDBF = NULL; - pFileDBF = fopen (aDBFfile.toAscii().data(), "r"); + pFileDBF = fopen (aDBFfile.toLatin1().data(), "r"); if (pFileDBF == NULL) { @@ -870,7 +870,7 @@ bool HYDROData_ShapeFile::CheckDBFFileExisting(const QString& theSHPFilePath, QS bool HYDROData_ShapeFile::DBF_OpenDBF(const QString& thePathToDBFFile) { - myHDBF = DBFOpen( thePathToDBFFile.toAscii().data(), "r" ); + myHDBF = DBFOpen( thePathToDBFFile.toLatin1().data(), "r" ); if(myHDBF != NULL) return true; else diff --git a/src/HYDROData/HYDROData_ShapeFile.h b/src/HYDROData/HYDROData_ShapeFile.h index d74e63d5..41f2200f 100644 --- a/src/HYDROData/HYDROData_ShapeFile.h +++ b/src/HYDROData/HYDROData_ShapeFile.h @@ -19,24 +19,29 @@ #ifndef HYDRODATA_SHAPEFILE_H #define HYDRODATA_SHAPEFILE_H -#include +#include "HYDROData.h" + #include + +#include + #include -#include "HYDROData.h" + +#include + //extern "C" { #include //}; class gp_XYZ; -class Handle_HYDROData_PolylineXY; -class Handle_HYDROData_Polyline3D; -class Handle(HYDROData_Document); -class TopTools_SequenceOfShape; +class HYDROData_PolylineXY; +class HYDROData_Polyline3D; +class HYDROData_Document; class TopoDS_Face; class TopoDS_Shape; -class Handle_HYDROData_Entity; -class Handle_HYDROData_LandCoverMap; +class HYDROData_Entity; +class HYDROData_LandCoverMap; class HYDROData_ShapeFile { @@ -83,23 +88,23 @@ public: //Export operation HYDRODATA_EXPORT void Export(Handle(HYDROData_Document) theDocument, const QString& aFileName, - NCollection_Sequence aPolyXYSeq, - NCollection_Sequence aPoly3DSeq, + NCollection_Sequence aPolyXYSeq, + NCollection_Sequence aPoly3DSeq, QStringList& aNonExpList); HYDRODATA_EXPORT void Export(Handle(HYDROData_Document) theDocument, const QString& aFileName, - const Handle_HYDROData_LandCoverMap& aLCM, + const Handle(HYDROData_LandCoverMap)& aLCM, QStringList& aNonExpList, bool bCheckLinear = true, bool bUseDiscr = false, double theDefl = 0.1); int WriteObjectPolyXY(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle, - Handle_HYDROData_PolylineXY thePoly ); + Handle(HYDROData_PolylineXY) thePoly ); int WriteObjectPoly3D(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle, - Handle_HYDROData_Polyline3D thePoly ); + Handle(HYDROData_Polyline3D) thePoly ); int WriteObjectPolygon(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle, const TopoDS_Shape& theInputShape, bool bUseDiscr, double theDefl ); @@ -118,13 +123,14 @@ public: //Import Polyline void ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, - int theInd, NCollection_Sequence& theEntities, bool bReadAsPolyline = false); + int theInd, NCollection_Sequence& theEntities, + bool bReadAsPolylin = false); void ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, - int theInd, NCollection_Sequence& theEntities); + int theInd, NCollection_Sequence& theEntities); HYDRODATA_EXPORT int ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName, - NCollection_Sequence& theEntities, int& theShapeTypeOfFile); + NCollection_Sequence& theEntities, int& theShapeTypeOfFile); HYDRODATA_EXPORT QString GetShapeTypeName(int theType); diff --git a/src/HYDROData/HYDROData_ShapesGroup.cxx b/src/HYDROData/HYDROData_ShapesGroup.cxx index 92fd7e17..9db2e01c 100644 --- a/src/HYDROData/HYDROData_ShapesGroup.cxx +++ b/src/HYDROData/HYDROData_ShapesGroup.cxx @@ -32,7 +32,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_ShapesGroup,HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ShapesGroup,HYDROData_Entity) void HYDROData_ShapesGroup::GroupDefinition::Update( SeqOfGroupsDefs* theGroupsDefs, diff --git a/src/HYDROData/HYDROData_ShapesGroup.h b/src/HYDROData/HYDROData_ShapesGroup.h index 394bf16e..71c4c4be 100644 --- a/src/HYDROData/HYDROData_ShapesGroup.h +++ b/src/HYDROData/HYDROData_ShapesGroup.h @@ -20,19 +20,15 @@ #define HYDROData_ShapesGroup_HeaderFile #include - #include - +#include #include class TopoDS_Shape; -class TopTools_ListOfShape; class BRepBuilderAPI_MakeShape; class ShapeUpgrade_UnifySameDomain; class BRepTools_ReShape; -DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity) - /**\class HYDROData_ShapesGroup * \brief Class that stores/retreives the sequence of shapes. */ @@ -75,7 +71,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup); + DEFINE_STANDARD_RTTIEXT(HYDROData_ShapesGroup, HYDROData_Entity); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_ShapesTool.h b/src/HYDROData/HYDROData_ShapesTool.h index 65b9b277..53d391db 100644 --- a/src/HYDROData/HYDROData_ShapesTool.h +++ b/src/HYDROData/HYDROData_ShapesTool.h @@ -22,12 +22,12 @@ #include "HYDROData.h" #include +#include +#include class TopoDS_Shape; class TopoDS_Vertex; class TopoDS_Edge; -class TopTools_SequenceOfShape; -class TopTools_ListOfShape; class HYDRODATA_EXPORT HYDROData_ShapesTool { diff --git a/src/HYDROData/HYDROData_SinusX.cxx b/src/HYDROData/HYDROData_SinusX.cxx index 9fcbef11..a18d59eb 100644 --- a/src/HYDROData/HYDROData_SinusX.cxx +++ b/src/HYDROData/HYDROData_SinusX.cxx @@ -43,7 +43,7 @@ HYDROData_SinusX::~HYDROData_SinusX() { } -void HYDROData_SinusX::CollectExistingNames(Handle_HYDROData_Document theDocument) +void HYDROData_SinusX::CollectExistingNames(Handle(HYDROData_Document) theDocument) { HYDROData_Iterator anIter( theDocument ); int anInd = 0; @@ -86,7 +86,8 @@ QString HYDROData_SinusX::GetName(const QString& theName) } -bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence& theEntities) +bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Document) theDocument, + NCollection_Sequence& theEntities) { if ( theFilePath.isEmpty() ) { @@ -115,7 +116,7 @@ bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Docum } -void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence& theEntities) +void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence& theEntities) { for ( size_t i = 0; i < myCurveBlocks.size(); i++ ) { @@ -328,7 +329,7 @@ bool HYDROData_SinusX::Parse(QFile& theFile) } -bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence& theEntities) +bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence& theEntities) { if ( theFilePath.isEmpty() ) { @@ -354,7 +355,7 @@ bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequ } -void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence& theEntities) +void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence& theEntities) { QTextStream aTextStream(&theFile); aTextStream << "C Generated by HYDRO Module\n"; @@ -362,7 +363,7 @@ void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_SequenceIsKind( STANDARD_TYPE(HYDROData_Bathymetry) )) { Handle(HYDROData_Bathymetry) aBathy = Handle(HYDROData_Bathymetry)::DownCast( anEnt ); diff --git a/src/HYDROData/HYDROData_SinusX.h b/src/HYDROData/HYDROData_SinusX.h index b2f6a8e6..03899572 100644 --- a/src/HYDROData/HYDROData_SinusX.h +++ b/src/HYDROData/HYDROData_SinusX.h @@ -27,8 +27,8 @@ class QFile; class gp_XYZ; -class Handle_HYDROData_Entity; -class Handle_HYDROData_Document; +class HYDROData_Entity; +class HYDROData_Document; struct HYDROGUI_CurveBlock { @@ -51,15 +51,15 @@ class HYDRODATA_EXPORT HYDROData_SinusX public: HYDROData_SinusX( ); virtual ~HYDROData_SinusX(); - bool Import (const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence& theEntities); - bool Export(const QString& theFilePath, const NCollection_Sequence& theEntities); + bool Import (const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence& theEntities); + bool Export(const QString& theFilePath, const NCollection_Sequence& theEntities); private: - void SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence& theEntities); + void SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence& theEntities); bool Parse( QFile& theFile ); - void CollectExistingNames(Handle_HYDROData_Document theDocument); + void CollectExistingNames(Handle(HYDROData_Document) theDocument); QString GetName(const QString& theName); - void HydroToSX( QFile& theFile, const NCollection_Sequence& theEntities); + void HydroToSX( QFile& theFile, const NCollection_Sequence& theEntities); private: diff --git a/src/HYDROData/HYDROData_SplitShapesGroup.cxx b/src/HYDROData/HYDROData_SplitShapesGroup.cxx index a73b11cb..674f9f0f 100644 --- a/src/HYDROData/HYDROData_SplitShapesGroup.cxx +++ b/src/HYDROData/HYDROData_SplitShapesGroup.cxx @@ -18,7 +18,6 @@ #include "HYDROData_SplitShapesGroup.h" -IMPLEMENT_STANDARD_HANDLE(HYDROData_SplitShapesGroup,HYDROData_ShapesGroup) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_SplitShapesGroup,HYDROData_ShapesGroup) HYDROData_SplitShapesGroup::HYDROData_SplitShapesGroup() diff --git a/src/HYDROData/HYDROData_SplitShapesGroup.h b/src/HYDROData/HYDROData_SplitShapesGroup.h index b6812301..25043388 100644 --- a/src/HYDROData/HYDROData_SplitShapesGroup.h +++ b/src/HYDROData/HYDROData_SplitShapesGroup.h @@ -21,9 +21,6 @@ #include -DEFINE_STANDARD_HANDLE(HYDROData_SplitShapesGroup, HYDROData_ShapesGroup) - - /**\class HYDROData_SplitShapesGroup * \brief Class that stores/retreives the sequence of split shapes. */ @@ -40,7 +37,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_SplitShapesGroup); + DEFINE_STANDARD_RTTIEXT(HYDROData_SplitShapesGroup, HYDROData_ShapesGroup); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_SplitToZonesTool.h b/src/HYDROData/HYDROData_SplitToZonesTool.h index 367b22cd..2e3b8711 100644 --- a/src/HYDROData/HYDROData_SplitToZonesTool.h +++ b/src/HYDROData/HYDROData_SplitToZonesTool.h @@ -36,7 +36,7 @@ #include #include -class Handle(HYDROData_PolylineXY); +class HYDROData_PolylineXY; /** * \class HYDROData_SplitToZonesTool diff --git a/src/HYDROData/HYDROData_Stream.cxx b/src/HYDROData/HYDROData_Stream.cxx index 5ba187ec..91718cb2 100644 --- a/src/HYDROData/HYDROData_Stream.cxx +++ b/src/HYDROData/HYDROData_Stream.cxx @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -81,10 +80,9 @@ #include #include -#include - #include #include +#include //#define DEB_STREAM 1 #ifdef DEB_STREAM @@ -98,7 +96,6 @@ typedef NCollection_DataMap HYDROData_DataMapOfRealOfHDProfile; -IMPLEMENT_STANDARD_HANDLE(HYDROData_Stream,HYDROData_NaturalObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Stream,HYDROData_NaturalObject) @@ -187,7 +184,7 @@ void HYDROData_Stream::Update() } } - Handle_HYDROData_DTM dtm = DTM(); + Handle(HYDROData_DTM) dtm = DTM(); dtm->Update(); UpdatePrs( dtm ); @@ -199,7 +196,7 @@ bool HYDROData_Stream::IsHas2dPrs() const return true; } -bool HYDROData_Stream::CreatePresentations( const Handle_HYDROData_DTM& theDTM, +bool HYDROData_Stream::CreatePresentations( const Handle(HYDROData_DTM)& theDTM, PrsDefinition& thePrs ) { if ( theDTM.IsNull() ) @@ -245,7 +242,7 @@ bool HYDROData_Stream::CreatePresentations( const Handle_HYDROData_DTM& theDTM, return true; } -void HYDROData_Stream::UpdatePrs( const Handle_HYDROData_DTM& theDTM ) +void HYDROData_Stream::UpdatePrs( const Handle(HYDROData_DTM)& theDTM ) { HYDROData_NaturalObject::Update(); @@ -330,7 +327,7 @@ TopoDS_Shape HYDROData_Stream::GetOutletShape() const return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 4); } -Handle_HYDROData_DTM HYDROData_Stream::DTM() const +Handle(HYDROData_DTM) HYDROData_Stream::DTM() const { const_cast( this )->checkAndSetAltitudeObject(); return Handle(HYDROData_DTM)::DownCast( GetAltitudeObject() ); @@ -716,20 +713,21 @@ void HYDROData_Stream::updateProfilesOrder() if ( aList.IsEmpty() ) return; - TColStd_Array1OfReal anArr( 1, aList.Extent() ); + QVector anArr( aList.Extent() ); TColStd_ListIteratorOfListOfReal it( aList ); for ( int j = 1; it.More(); it.Next(), j++ ) - anArr( j ) = it.Value(); + anArr[j-1] = it.Value(); // sorting if ( aList.Extent() > 1 ) { - TCollection_CompareOfReal Compar; - SortTools_QuickSortOfReal::Sort( anArr, Compar ); + //TCollection_CompareOfReal Compar; + //SortTools_QuickSortOfReal::Sort( anArr, Compar ); + std::sort( anArr.begin(), anArr.end() ); - for (int j = 1; j <= anArr.Length(); j++) { - const Standard_Real aKey = anArr(j); + for (int j = 1; j <= anArr.size(); j++) { + const Standard_Real aKey = anArr[j-1]; const Handle(HYDROData_Profile)& aProfile = aDM.Find(aKey); insertProfileInToOrder( aProfile ); } @@ -753,9 +751,9 @@ ObjectKind HYDROData_Stream::getAltitudeObjectType() const return KIND_DTM; } -void HYDROData_Stream::setParametersArray( const TColStd_Array1OfReal& theArray ) +void HYDROData_Stream::setParametersArray( const QVector& theArray ) { - if ( theArray.Length() == 0 ) + if ( theArray.size() == 0 ) { removeParametersArray(); return; @@ -763,13 +761,13 @@ void HYDROData_Stream::setParametersArray( const TColStd_Array1OfReal& theArray TDF_Label aLabel = myLab.FindChild( DataTag_ParamsArray ); + int n = theArray.size(); Handle(TDataStd_RealArray) aParamsArray = - TDataStd_RealArray::Set( aLabel, theArray.Lower(), theArray.Upper() ); - - for ( int i = theArray.Lower(), n = theArray.Upper(); i <= n; ++i ) + TDataStd_RealArray::Set( aLabel, 1, n ); + for ( int i = 0; i < n; ++i ) { - const Standard_Real& aParam = theArray( i ); - aParamsArray->SetValue( i, aParam ); + const Standard_Real& aParam = theArray[i]; + aParamsArray->SetValue( i+1, aParam ); } } @@ -811,7 +809,7 @@ int HYDROData_Stream::insertParameter( const Standard_Real& theParam ) { aResIndex = 0; - TColStd_Array1OfReal aNewArr( anArr->Lower(), anArr->Upper() + 1 ); + QVector aNewArr( anArr->Upper() ); bool isInserted = false; for ( int i = anArr->Lower(), j = i, n = anArr->Upper(); i <= n; ++i, ++j ) @@ -825,19 +823,19 @@ int HYDROData_Stream::insertParameter( const Standard_Real& theParam ) } else { - aNewArr( j ) = theParam; + aNewArr[j-1] = theParam; isInserted = true; ++j; } } - aNewArr( j ) = aStoredParam; + aNewArr[j-1] = aStoredParam; } if ( !isInserted ) { aResIndex = -1; - aNewArr( aNewArr.Upper() ) = theParam; + aNewArr[aNewArr.size()-1] = theParam; } setParametersArray( aNewArr ); @@ -845,8 +843,8 @@ int HYDROData_Stream::insertParameter( const Standard_Real& theParam ) } else { - TColStd_Array1OfReal aNewArr( 1, 1 ); - aNewArr.SetValue( 1, theParam ); + QVector aNewArr( 1 ); + aNewArr[0] = theParam; setParametersArray( aNewArr ); } @@ -869,7 +867,7 @@ void HYDROData_Stream::removeParameter( const int& theIndex ) return; } - TColStd_Array1OfReal aNewArr( aParamsArray->Lower(), aParamsArray->Upper() - 1 ); + QVector aNewArr( aParamsArray->Upper() - 2 ); for ( int i = aParamsArray->Lower(), j = i, k = 0, n = aParamsArray->Upper(); i <= n; ++i, ++k ) { @@ -877,7 +875,7 @@ void HYDROData_Stream::removeParameter( const int& theIndex ) if ( k == theIndex ) continue; - aNewArr.SetValue( j, aStoredParam ); + aNewArr[j-1] = aStoredParam; ++j; } @@ -1131,4 +1129,4 @@ void HYDROData_Stream::CreatePresentations( const Handle(TColgp_HArray1OfPnt) thePrs.myOutlet = LS(3); thePrs.myRightBank = LS(4); -} \ No newline at end of file +} diff --git a/src/HYDROData/HYDROData_Stream.h b/src/HYDROData/HYDROData_Stream.h index 77d9bb5f..902ad5a0 100644 --- a/src/HYDROData/HYDROData_Stream.h +++ b/src/HYDROData/HYDROData_Stream.h @@ -28,16 +28,12 @@ #include #include -DEFINE_STANDARD_HANDLE(HYDROData_Stream, HYDROData_NaturalObject) - -class Handle(HYDROData_PolylineXY); -class Handle(HYDROData_Polyline3D); -class Handle(HYDROData_Profile); +class HYDROData_DTM; +class HYDROData_PolylineXY; +class HYDROData_Polyline3D; +class HYDROData_Profile; class HYDROData_IProfilesInterpolator; -class TColStd_Array1OfReal; -class Handle(TopTools_HArray1OfShape); -class Handle_HYDROData_DTM; -class TopTools_ListOfShape; +class TopTools_HArray1OfShape; /**\class HYDROData_Stream @@ -72,16 +68,15 @@ protected: }; public: - - DEFINE_STANDARD_RTTI(HYDROData_Stream); + DEFINE_STANDARD_RTTIEXT(HYDROData_Stream, HYDROData_NaturalObject); public: /** * Creates the presentations(2D and 3D) by given hydraulic axis and profiles. */ - HYDRODATA_EXPORT static bool CreatePresentations( const Handle_HYDROData_DTM& theDTM, - PrsDefinition& thePrs ); + HYDRODATA_EXPORT static bool CreatePresentations( const Handle(HYDROData_DTM)& theDTM, + PrsDefinition& thePrs ); HYDRODATA_EXPORT static void CreatePresentations( const Handle(TColgp_HArray1OfPnt) theArrayOfFPnt, const Handle(TColgp_HArray1OfPnt) theArrayOfLPnt, @@ -120,7 +115,7 @@ public: /** * Update the shape presentations of stream. */ - HYDRODATA_EXPORT void UpdatePrs( const Handle_HYDROData_DTM& ); + HYDRODATA_EXPORT void UpdatePrs( const Handle(HYDROData_DTM)& ); /** * @@ -296,7 +291,7 @@ protected: private: - void setParametersArray( const TColStd_Array1OfReal& theArray ); + void setParametersArray( const QVector& theArray ); TColStd_Array1OfReal* getParametersArray() const; @@ -306,7 +301,7 @@ private: void removeParameter( const int& theIndex ); - Handle_HYDROData_DTM DTM() const; + Handle(HYDROData_DTM) DTM() const; protected: diff --git a/src/HYDROData/HYDROData_StreamAltitude.cxx b/src/HYDROData/HYDROData_StreamAltitude.cxx index 7ab98d3f..2360eddd 100644 --- a/src/HYDROData/HYDROData_StreamAltitude.cxx +++ b/src/HYDROData/HYDROData_StreamAltitude.cxx @@ -61,7 +61,7 @@ #include #include #endif -IMPLEMENT_STANDARD_HANDLE(HYDROData_StreamAltitude, HYDROData_IAltitudeObject) + IMPLEMENT_STANDARD_RTTIEXT(HYDROData_StreamAltitude, HYDROData_IAltitudeObject) HYDROData_StreamAltitude::HYDROData_StreamAltitude() diff --git a/src/HYDROData/HYDROData_StreamAltitude.h b/src/HYDROData/HYDROData_StreamAltitude.h index 77bf0b2a..25bd528e 100644 --- a/src/HYDROData/HYDROData_StreamAltitude.h +++ b/src/HYDROData/HYDROData_StreamAltitude.h @@ -23,8 +23,6 @@ #include "HYDROData_IAltitudeObject.h" -DEFINE_STANDARD_HANDLE(HYDROData_StreamAltitude, HYDROData_IAltitudeObject) - class TopoDS_Wire; /**\class HYDROData_StreamAltitude @@ -45,7 +43,7 @@ protected: public: - DEFINE_STANDARD_RTTI(HYDROData_StreamAltitude); + DEFINE_STANDARD_RTTIEXT(HYDROData_StreamAltitude, HYDROData_IAltitudeObject); /** * Returns the kind of this object. diff --git a/src/HYDROData/HYDROData_StricklerTable.cxx b/src/HYDROData/HYDROData_StricklerTable.cxx index 6cf7c2cc..1c51cf1e 100644 --- a/src/HYDROData/HYDROData_StricklerTable.cxx +++ b/src/HYDROData/HYDROData_StricklerTable.cxx @@ -38,7 +38,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity ) IMPLEMENT_STANDARD_RTTIEXT( HYDROData_StricklerTable, HYDROData_Entity ) HYDROData_StricklerTable::HYDROData_StricklerTable() diff --git a/src/HYDROData/HYDROData_StricklerTable.h b/src/HYDROData/HYDROData_StricklerTable.h index f50f4546..de409785 100644 --- a/src/HYDROData/HYDROData_StricklerTable.h +++ b/src/HYDROData/HYDROData_StricklerTable.h @@ -23,9 +23,7 @@ #include -class Handle( TDataStd_NamedData ); - -DEFINE_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity ) +class TDataStd_NamedData; class HYDROData_StricklerTable : public HYDROData_Entity { @@ -42,7 +40,7 @@ protected: HYDRODATA_EXPORT ~HYDROData_StricklerTable(); public: - DEFINE_STANDARD_RTTI( HYDROData_StricklerTable ); + DEFINE_STANDARD_RTTIEXT( HYDROData_StricklerTable, HYDROData_Entity ); HYDRODATA_EXPORT virtual const ObjectKind GetKind() const; diff --git a/src/HYDROData/HYDROData_Tool.h b/src/HYDROData/HYDROData_Tool.h index e8fd7967..69afafa6 100644 --- a/src/HYDROData/HYDROData_Tool.h +++ b/src/HYDROData/HYDROData_Tool.h @@ -23,8 +23,8 @@ #include #include -class Handle_HYDROData_Document; -class Handle_HYDROData_Entity; +class HYDROData_Document; +class HYDROData_Entity; class HYDROData_SequenceOfObjects; class MapOfTreatedObjects; class gp_XY; @@ -40,7 +40,6 @@ class TopoDS_Edge; class TopoDS_Face; class TopoDS_Shape; class TopoDS_Wire; -class TopTools_SequenceOfShape; class Quantity_Color; class HYDRODATA_EXPORT HYDROData_Tool { @@ -59,7 +58,7 @@ public: * \param theIsTryToUsePurePrefix if true - the prefix will be returned if the name equal to the prefix is not busy * \return generated name */ - static QString GenerateObjectName( const Handle_HYDROData_Document& theDoc, + static QString GenerateObjectName( const Handle(HYDROData_Document)& theDoc, const QString& thePrefix, const QStringList& theUsedNames = QStringList(), const bool theIsTryToUsePurePrefix = false ); @@ -69,7 +68,7 @@ public: * \param theObject object to check * \return true if object is geometry object */ - static bool IsGeometryObject( const Handle_HYDROData_Entity& theObject ); + static bool IsGeometryObject( const Handle(HYDROData_Entity)& theObject ); /** * \brief Updates the child object name. @@ -79,7 +78,7 @@ public: */ static void UpdateChildObjectName( const QString& theOldStr, const QString& theNewStr, - const Handle_HYDROData_Entity& theObject ); + const Handle(HYDROData_Entity)& theObject ); /** diff --git a/src/HYDROData/HYDROData_TopoCurve.h b/src/HYDROData/HYDROData_TopoCurve.h index e85b7550..5bba3b28 100644 --- a/src/HYDROData/HYDROData_TopoCurve.h +++ b/src/HYDROData/HYDROData_TopoCurve.h @@ -20,7 +20,7 @@ #define HYDRODATA_TOPOCURVE_H #include -#include +#include #include #include #include diff --git a/src/HYDROData/HYDROData_VisualState.cxx b/src/HYDROData/HYDROData_VisualState.cxx index e7d8ff79..48d8ba1e 100644 --- a/src/HYDROData/HYDROData_VisualState.cxx +++ b/src/HYDROData/HYDROData_VisualState.cxx @@ -20,7 +20,6 @@ #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_VisualState, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_VisualState, HYDROData_Entity) HYDROData_VisualState::HYDROData_VisualState() diff --git a/src/HYDROData/HYDROData_VisualState.h b/src/HYDROData/HYDROData_VisualState.h index 49890c1f..ea694a9b 100644 --- a/src/HYDROData/HYDROData_VisualState.h +++ b/src/HYDROData/HYDROData_VisualState.h @@ -21,8 +21,6 @@ #include -DEFINE_STANDARD_HANDLE(HYDROData_VisualState, HYDROData_Entity) - /**\class HYDROData_VisualState * \brief Class that stores/retreives information about the visual state. * @@ -41,7 +39,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_VisualState); + DEFINE_STANDARD_RTTIEXT(HYDROData_VisualState, HYDROData_Entity); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index 6f247edd..3e45fb89 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -29,7 +29,6 @@ #define _DEVDEBUG_ #include "HYDRO_trace.hxx" -IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity) @@ -147,8 +146,7 @@ void HYDROData_Zone::SetMergeObject( const Handle(HYDROData_Entity)& theObject ) Handle(HYDROData_Entity) HYDROData_Zone::GetMergeObject() const { - return Handle(HYDROData_Entity)::DownCast( - GetReferenceObject( DataTag_MergeObject ) ); + return GetReferenceObject( DataTag_MergeObject ); } void HYDROData_Zone::RemoveMergeObject() diff --git a/src/HYDROData/HYDROData_Zone.h b/src/HYDROData/HYDROData_Zone.h index cde3b789..2ed80acc 100644 --- a/src/HYDROData/HYDROData_Zone.h +++ b/src/HYDROData/HYDROData_Zone.h @@ -22,11 +22,9 @@ #include "HYDROData_Entity.h" #include "HYDROData_IInterpolator.h" -class Handle(HYDROData_LandCover); +class HYDROData_LandCover; class TopoDS_Shape; -DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity) - /**\class HYDROData_Zone * \brief Class that stores/retreives information about the 2d face. @@ -35,7 +33,6 @@ class HYDROData_Zone : public HYDROData_Entity { public: - // Enumeration of mergin types for conflict altitudes/types enum MergeType { @@ -59,7 +56,7 @@ protected: }; public: - DEFINE_STANDARD_RTTI(HYDROData_Zone); + DEFINE_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity); /** * Returns the kind of this object. Must be redefined in all objects of known type. diff --git a/src/HYDROGUI/CMakeLists.txt b/src/HYDROGUI/CMakeLists.txt index bcb457a4..96cbffbc 100644 --- a/src/HYDROGUI/CMakeLists.txt +++ b/src/HYDROGUI/CMakeLists.txt @@ -1,6 +1,7 @@ include(../../CMake/Common.cmake) include(../../CMake/UseQT4EXT.cmake) - +INCLUDE(UseQtExt) + set(PROJECT_HEADERS HYDROGUI.h HYDROGUI_AbstractDisplayer.h @@ -145,7 +146,7 @@ set(PROJECT_HEADERS HYDROGUI_TransparencyDlg.h ) -QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS}) +QT_WRAP_MOC(PROJECT_HEADERS_MOC ${PROJECT_HEADERS}) set(PROJECT_SOURCES HYDROGUI_AbstractDisplayer.cxx @@ -208,6 +209,7 @@ set(PROJECT_SOURCES HYDROGUI_Operations.cxx HYDROGUI_Poly3DDlg.cxx HYDROGUI_Poly3DOp.cxx + HYDROGUI_Polyline.cxx HYDROGUI_PolylineDlg.cxx HYDROGUI_PolylineOp.cxx HYDROGUI_ProfileDlg.cxx @@ -226,7 +228,6 @@ set(PROJECT_SOURCES HYDROGUI_Region.cxx HYDROGUI_RemoveImageRefsOp.cxx HYDROGUI_Shape.cxx - HYDROGUI_Polyline.cxx HYDROGUI_ShapeBathymetry.cxx HYDROGUI_ShapeImage.cxx HYDROGUI_ShapeLandCoverMap.cxx diff --git a/src/HYDROGUI/HYDROGUI_AISShape.cxx b/src/HYDROGUI/HYDROGUI_AISShape.cxx index 162e44cd..e714a2e6 100644 --- a/src/HYDROGUI/HYDROGUI_AISShape.cxx +++ b/src/HYDROGUI/HYDROGUI_AISShape.cxx @@ -20,9 +20,8 @@ #include #include #include -#include +#include -IMPLEMENT_STANDARD_HANDLE(HYDROGUI_AISShape, AIS_Shape) IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_AISShape, AIS_Shape) HYDROGUI_AISShape::HYDROGUI_AISShape( const TopoDS_Shape& theShape ) @@ -70,5 +69,5 @@ void HYDROGUI_AISShape::Compute( const Handle(PrsMgr_PresentationManager3d)& the } if( theMode==AIS_Shaded ) - StdPrs_WFDeflectionShape::Add( thePresentation, Shape(), myDrawer ); + StdPrs_WFShape::Add( thePresentation, Shape(), myDrawer ); } diff --git a/src/HYDROGUI/HYDROGUI_AISShape.h b/src/HYDROGUI/HYDROGUI_AISShape.h index 7353dcb5..91fa4fa2 100644 --- a/src/HYDROGUI/HYDROGUI_AISShape.h +++ b/src/HYDROGUI/HYDROGUI_AISShape.h @@ -22,12 +22,10 @@ #include -DEFINE_STANDARD_HANDLE(HYDROGUI_AISShape, AIS_Shape) - class HYDROGUI_AISShape : public AIS_Shape { public: - DEFINE_STANDARD_RTTI(HYDROGUI_AISShape); + DEFINE_STANDARD_RTTIEXT(HYDROGUI_AISShape, AIS_Shape); HYDROGUI_AISShape( const TopoDS_Shape& ); virtual ~HYDROGUI_AISShape(); diff --git a/src/HYDROGUI/HYDROGUI_AISTrihedron.cxx b/src/HYDROGUI/HYDROGUI_AISTrihedron.cxx index 3642aaa8..79959971 100644 --- a/src/HYDROGUI/HYDROGUI_AISTrihedron.cxx +++ b/src/HYDROGUI/HYDROGUI_AISTrihedron.cxx @@ -79,9 +79,9 @@ void HYDROGUI_AISTrihedron::ComputeAxis( const Handle(Prs3d_Presentation)& thePr theParams.myPfirst, theParams.myPlast ); } -void HYDROGUI_AISTrihedron::Compute(const Handle_Prs3d_Projector& aProjector, - const Handle_Geom_Transformation& aTransformation, - const Handle_Prs3d_Presentation& aPresentation) +void HYDROGUI_AISTrihedron::Compute(const Handle(Prs3d_Projector)& aProjector, + const Handle(Geom_Transformation)& aTransformation, + const Handle(Prs3d_Presentation)& aPresentation) { } diff --git a/src/HYDROGUI/HYDROGUI_AISTrihedron.h b/src/HYDROGUI/HYDROGUI_AISTrihedron.h index b8c13235..8722c508 100644 --- a/src/HYDROGUI/HYDROGUI_AISTrihedron.h +++ b/src/HYDROGUI/HYDROGUI_AISTrihedron.h @@ -31,7 +31,6 @@ * \brief AIS trihedron is redefined in order to show U text on the OX axis * and Z text on the OY axis. */ -DEFINE_STANDARD_HANDLE(HYDROGUI_AISTrihedron, AIS_Trihedron) class HYDROGUI_AISTrihedron : public AIS_Trihedron { @@ -86,9 +85,9 @@ public: * \param theTransformation the transformation * \param thePresentationManager the presentation */ - void Compute( const Handle_Prs3d_Projector& theProjector, - const Handle_Geom_Transformation& theTransformation, - const Handle_Prs3d_Presentation& thePresentation ); + void Compute( const Handle(Prs3d_Projector)& theProjector, + const Handle(Geom_Transformation)& theTransformation, + const Handle(Prs3d_Presentation)& thePresentation ); /** * AIS trihedron compute selection method. It is empty. We do not select the trihedron diff --git a/src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx index 2d2f03b7..36b111ec 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx @@ -52,7 +52,7 @@ void HYDROGUI_BathymetryBoundsOp::startOperation() bool HYDROGUI_BathymetryBoundsOp::processApply( int& theUpdateFlags, QString& theErrorMsg, QStringList& theBrowseObjectsEntries ) { - Handle_HYDROData_PolylineXY aPolyline = myBath->CreateBoundaryPolyline(); + Handle(HYDROData_PolylineXY) aPolyline = myBath->CreateBoundaryPolyline(); bool isOK = !aPolyline.IsNull(); theUpdateFlags = 0; if( isOK ) { diff --git a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx index 778ac431..1133fcb1 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx @@ -671,7 +671,7 @@ QStringList HYDROGUI_CalculationDlg::getSelectedAvailableGeomObjects() const void HYDROGUI_CalculationDlg::setEditedObject( const Handle(HYDROData_CalculationCase) theCase ) { myEditedObject = theCase; - myValidator->setEditedObject( theCase ); + myValidator->setEditedObject( myEditedObject ); // Build the calculation case subtree module()->getDataModel()->buildCaseTree( myBrowser->root(), myEditedObject); diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index 6200d72c..134c3bd0 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -1276,7 +1276,7 @@ void HYDROGUI_CalculationOp::createPreview( const bool theLandCoverMap ) HYDROData_SequenceOfObjects::Iterator anIter( aSeq ); for ( ; anIter.More(); anIter.Next() ) { - const Handle_HYDROData_Entity& ent = anIter.Value(); + const Handle(HYDROData_Entity)& ent = anIter.Value(); if (!ent.IsNull()) setObjectVisibility( ent, true ); } @@ -1371,11 +1371,11 @@ void HYDROGUI_CalculationOp::setAvailableGroups() HYDROData_SequenceOfObjects anObjs = myEditedObject->GetGeometryObjects(); for( int anIndex = 1, aLength = anObjs.Length(); anIndex <= aLength; anIndex++ ) { - Handle_HYDROData_Object anObj = Handle_HYDROData_Object::DownCast( anObjs.Value( anIndex ) ); + Handle(HYDROData_Object) anObj = Handle(HYDROData_Object)::DownCast( anObjs.Value( anIndex ) ); HYDROData_SequenceOfObjects aGroups = anObj->GetGroups(); for( int aGIndex = 1, aGLength = aGroups.Length(); aGIndex <= aGLength; aGIndex++ ) { - Handle_HYDROData_ShapesGroup aGroup = Handle_HYDROData_ShapesGroup::DownCast( aGroups.Value( aGIndex ) ); + Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( aGroups.Value( aGIndex ) ); aGroupsNames.append( aGroup->GetName() ); } } diff --git a/src/HYDROGUI/HYDROGUI_DataBrowser.cxx b/src/HYDROGUI/HYDROGUI_DataBrowser.cxx index eb5f2539..66eec4f6 100644 --- a/src/HYDROGUI/HYDROGUI_DataBrowser.cxx +++ b/src/HYDROGUI/HYDROGUI_DataBrowser.cxx @@ -277,7 +277,7 @@ HYDROGUI_DataBrowser::HYDROGUI_DataBrowser( HYDROGUI_Module* theModule, // Create OBSelector new HYDROGUI_OBSelector( this, theModule->getApp()->selectionMgr() ); - treeView()->header()->setResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed); + treeView()->header()->setSectionResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed); treeView()->header()->moveSection(SUIT_DataObject::NameId,SUIT_DataObject::VisibilityId); treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH); treeView()->hideColumn( SUIT_DataObject::VisibilityId ); diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index 8968fad7..232475f9 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -270,40 +270,40 @@ void HYDROGUI_DataModel::update( const int theStudyId ) // Create root objects: // IMAGES - LightApp_DataObject* anImageRootObj = createObject( aNewRootObj, tr( partitionName( KIND_IMAGE ).toAscii() ) ); + LightApp_DataObject* anImageRootObj = createObject( aNewRootObj, tr( partitionName( KIND_IMAGE ).toLatin1() ) ); // BATHYMETRY - LightApp_DataObject* aBathymetryRootObj = createObject( aNewRootObj, tr( partitionName( KIND_BATHYMETRY ).toAscii() ) ); + LightApp_DataObject* aBathymetryRootObj = createObject( aNewRootObj, tr( partitionName( KIND_BATHYMETRY ).toLatin1() ) ); // POLYLINES - LightApp_DataObject* aPolylineRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINEXY ).toAscii() ) ); + LightApp_DataObject* aPolylineRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINEXY ).toLatin1() ) ); // PROFILES - LightApp_DataObject* aProfileRootObj = createObject( aNewRootObj, tr( partitionName( KIND_PROFILE ).toAscii() ) ); + LightApp_DataObject* aProfileRootObj = createObject( aNewRootObj, tr( partitionName( KIND_PROFILE ).toLatin1() ) ); // POLYLINES 3D - LightApp_DataObject* aPolyline3DRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINE ).toAscii() ) ); + LightApp_DataObject* aPolyline3DRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINE ).toLatin1() ) ); // NATURAL OBJECTS - LightApp_DataObject* aNaturalObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_NATURAL_OBJECT ).toAscii() ) ); + LightApp_DataObject* aNaturalObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_NATURAL_OBJECT ).toLatin1() ) ); // ARTIFICIAL OBJECTS - LightApp_DataObject* anArtificialObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toAscii() ) ); + LightApp_DataObject* anArtificialObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toLatin1() ) ); // OBSTACLES - LightApp_DataObject* anObstaclesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_OBSTACLE ).toAscii() ) ); + LightApp_DataObject* anObstaclesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_OBSTACLE ).toLatin1() ) ); // STRICKLER TABLES - LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toAscii() ) ); + LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toLatin1() ) ); // LAND COVER MAPS - LightApp_DataObject* aLandCoversRootObj = createObject( aNewRootObj, tr( partitionName( KIND_LAND_COVER_MAP ).toAscii() ) ); + LightApp_DataObject* aLandCoversRootObj = createObject( aNewRootObj, tr( partitionName( KIND_LAND_COVER_MAP ).toLatin1() ) ); // CALCULATION CASES - LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toAscii() ) ); + LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toLatin1() ) ); // VISUAL STATES - LightApp_DataObject* aVisualStateRootObj = createObject( aNewRootObj, tr( partitionName( KIND_VISUAL_STATE ).toAscii() ) ); + LightApp_DataObject* aVisualStateRootObj = createObject( aNewRootObj, tr( partitionName( KIND_VISUAL_STATE ).toLatin1() ) ); int aNoStricklerTableObj = 0; HYDROData_Iterator anIterator( aDocument, KIND_UNKNOWN ); @@ -964,10 +964,10 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent, createObject( aPolylineSect, aPolyline, aGuiObj->entry(), false ); LightApp_DataObject* aCaseAOSect = - createObject( aGuiObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toAscii() ), + createObject( aGuiObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toLatin1() ), aGuiObj->entry() ); LightApp_DataObject* aCaseNOSect = - createObject( aGuiObj, tr( partitionName( KIND_NATURAL_OBJECT ).toAscii() ), + createObject( aGuiObj, tr( partitionName( KIND_NATURAL_OBJECT ).toLatin1() ), aGuiObj->entry() ); HYDROData_SequenceOfObjects aSeq = aCaseObj->GetGeometryObjects(); diff --git a/src/HYDROGUI/HYDROGUI_DataObject.cxx b/src/HYDROGUI/HYDROGUI_DataObject.cxx index 8ec9658d..890e29a9 100644 --- a/src/HYDROGUI/HYDROGUI_DataObject.cxx +++ b/src/HYDROGUI/HYDROGUI_DataObject.cxx @@ -161,7 +161,7 @@ QPixmap HYDROGUI_DataObject::icon( const int theId ) const anObjectKind = aFatherObj->GetKind(); } - anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toAscii() ); + anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toLatin1() ); } return aResMgr->loadPixmap( "HYDRO", anIcon ); diff --git a/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx b/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx index 76cbf0dc..cf1565cf 100644 --- a/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx @@ -48,9 +48,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -78,8 +78,8 @@ void HYDROGUI_ExportFileOp::startOperation() Handle(HYDROData_PolylineXY) aPolyXY; Handle(HYDROData_Polyline3D) aPoly3D; - NCollection_Sequence aPolyXYSeq; - NCollection_Sequence aPoly3DSeq; + NCollection_Sequence aPolyXYSeq; + NCollection_Sequence aPoly3DSeq; // HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() ); for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ ) @@ -107,7 +107,7 @@ void HYDROGUI_ExportFileOp::startOperation() { QStringList aNonExpList; HYDROData_ShapeFile anExporter; - Handle_HYDROData_Document aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); if (!aPolyXYSeq.IsEmpty() || !aPolyXYSeq.IsEmpty()) //Export polylines anExporter.Export(aDoc, aFileName, aPolyXYSeq, aPoly3DSeq, aNonExpList); @@ -134,7 +134,7 @@ void HYDROGUI_ExportFileOp::startOperation() QStringList SortedListOfAttr = anAttrNames.toList(); SortedListOfAttr.sort(); // - Handle_HYDROData_LandCoverMap aLCM = Handle(HYDROData_LandCoverMap)::DownCast( aSeq(1) ); + Handle(HYDROData_LandCoverMap) aLCM = Handle(HYDROData_LandCoverMap)::DownCast( aSeq(1) ); bool IsLinear = aLCM->CheckLinear(); HYDROGUI_ExportLandCoverMapDlg aDlg( module()->getApp()->desktop(), IsLinear, SortedListOfAttr); if ( aDlg.exec() == HYDROGUI_ExportLandCoverMapDlg::Accepted ) diff --git a/src/HYDROGUI/HYDROGUI_ExportFileOp.h b/src/HYDROGUI/HYDROGUI_ExportFileOp.h index e841688e..2f20d768 100644 --- a/src/HYDROGUI/HYDROGUI_ExportFileOp.h +++ b/src/HYDROGUI/HYDROGUI_ExportFileOp.h @@ -23,10 +23,6 @@ #include class SUIT_FileDlg; -class gp_XYZ; -class Handle_HYDROData_PolylineXY; -class Handle_HYDROData_Polyline3D; -class TopoDS_Face; class HYDROGUI_ExportFileOp : public HYDROGUI_Operation { diff --git a/src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx b/src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx index 5180be14..1179745d 100644 --- a/src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx @@ -179,14 +179,14 @@ void HYDROGUI_GeomObjectDlg::onBrowse() { SUIT_FileDlg* aFileDlg = new SUIT_FileDlg( this, true ); aFileDlg->setWindowTitle( tr("IMPORT_OBSTACLE_FROM_FILE") ); - aFileDlg->setFilter( tr("OBSTACLE_FILTER") ); + aFileDlg->setNameFilter( tr("OBSTACLE_FILTER") ); if ( !lastUsedFilter.isEmpty() ) { - aFileDlg->selectFilter( lastUsedFilter ); + aFileDlg->selectNameFilter( lastUsedFilter ); } if ( aFileDlg->exec() == QDialog::Accepted ) { QString aFileName = aFileDlg->selectedFile(); - lastUsedFilter = aFileDlg->selectedFilter(); + lastUsedFilter = aFileDlg->selectedNameFilter(); if ( !aFileName.isEmpty() ) { myFileName->setText( aFileName ); @@ -261,4 +261,4 @@ void HYDROGUI_GeomObjectDlg::setDefaultName( const QString& theName ) QString HYDROGUI_GeomObjectDlg::getDefaultName() { return myDefaultName; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_ImagePrs.cxx b/src/HYDROGUI/HYDROGUI_ImagePrs.cxx index b85450eb..9ebb95a1 100644 --- a/src/HYDROGUI/HYDROGUI_ImagePrs.cxx +++ b/src/HYDROGUI/HYDROGUI_ImagePrs.cxx @@ -33,21 +33,10 @@ #include -IMPLEMENT_STANDARD_TYPE(HYDROGUI_ImagePrs) - IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() - STANDARD_TYPE(AIS_InteractiveObject), - STANDARD_TYPE(SelectMgr_SelectableObject), - STANDARD_TYPE(PrsMgr_PresentableObject), - STANDARD_TYPE(MMgt_TShared), - STANDARD_TYPE(Standard_Transient), - IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() - IMPLEMENT_STANDARD_TYPE_END(HYDROGUI_ImagePrs) - - IMPLEMENT_DOWNCAST(HYDROGUI_ImagePrs,Standard_Transient) - IMPLEMENT_STANDARD_RTTI(HYDROGUI_ImagePrs) - - HYDROGUI_ImagePrs::HYDROGUI_ImagePrs() - : AIS_InteractiveObject() +IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_ImagePrs, AIS_InteractiveObject) + +HYDROGUI_ImagePrs::HYDROGUI_ImagePrs() + : AIS_InteractiveObject() { } diff --git a/src/HYDROGUI/HYDROGUI_ImagePrs.h b/src/HYDROGUI/HYDROGUI_ImagePrs.h index d74a9a79..63968caf 100644 --- a/src/HYDROGUI/HYDROGUI_ImagePrs.h +++ b/src/HYDROGUI/HYDROGUI_ImagePrs.h @@ -28,8 +28,6 @@ class Font_FTFont; class HYDROGUI_ImagePrs; -DEFINE_STANDARD_HANDLE(HYDROGUI_ImagePrs, AIS_InteractiveObject) - class HYDROGUI_ImagePrs : public AIS_InteractiveObject { public: @@ -47,7 +45,7 @@ public: const Handle(Prs3d_Presentation)&, const Standard_Integer = 0 ); virtual void ComputeSelection( const Handle(SelectMgr_Selection)&, const Standard_Integer ); - DEFINE_STANDARD_RTTI(HYDROGUI_ImagePrs) + DEFINE_STANDARD_RTTIEXT(HYDROGUI_ImagePrs, AIS_InteractiveObject) private: gp_Pnt convert( const QPointF& ) const; diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx index f72601fb..3ad5e1dc 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx @@ -269,7 +269,7 @@ void HYDROGUI_ImportLandCoverMapDlg::FillCorrespondenceTable(const QStringList& myCorrTableWidget->setHorizontalHeaderItem(0, aHeader_1); myCorrTableWidget->setHorizontalHeaderItem(1, aHeader_2); myCorrTableWidget->setHorizontalHeaderItem(2, aHeader_3); - myCorrTableWidget->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents ); + myCorrTableWidget->horizontalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents ); // for (int i = 0; i < aFCSize; i++) { @@ -468,4 +468,4 @@ bool HYDROGUI_ImportLandCoverMapDlg::CheckFirstPageFilling() const return false; } return true; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx index 5820dcfa..ecae1836 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx @@ -263,7 +263,7 @@ bool HYDROGUI_ImportLandCoverMapOp::processApply( int& theUpdateFlags, if ( !aPanel->getFileName().isEmpty() ) anObjName = aPanel->getObjectName(); - Handle_HYDROData_Document aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); //check if name of LCM is already exists QSet aNameList; @@ -409,7 +409,7 @@ void HYDROGUI_ImportLandCoverMapOp::onNext( const int theIndex ) //Collect all strickler_types QSet aSTSet; - Handle_HYDROData_Document aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() ); Handle(HYDROData_StricklerTable) DefStricklerTableObj; if ( aDoc ) { @@ -496,8 +496,7 @@ void HYDROGUI_ImportLandCoverMapOp::onApply() } else { - Handle(HYDROData_Entity) LCM = Handle(HYDROData_Entity)::DownCast( myLCM ); - LCM->Remove(); + myLCM->Remove(); module()->setObjectRemoved( myLCM ); abort(); } diff --git a/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx b/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx index 5a639978..9c0743c0 100644 --- a/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx @@ -72,9 +72,9 @@ void HYDROGUI_ImportObstacleFromFileOp::startOperation() } else { myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true ); myFileDlg->setWindowTitle( getName() ); - myFileDlg->setFilter( tr("OBSTACLE_FILTER") ); + myFileDlg->setNameFilter( tr("OBSTACLE_FILTER") ); if ( !lastUsedFilter.isEmpty() ) { - myFileDlg->selectFilter( lastUsedFilter ); + myFileDlg->selectNameFilter( lastUsedFilter ); } connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) ); @@ -118,7 +118,7 @@ bool HYDROGUI_ImportObstacleFromFileOp::processApply( int& theUpdateFlags, } else if ( myFileDlg ) { // Get file name and file filter defined by the user aFileName = myFileDlg->selectedFile(); - lastUsedFilter = myFileDlg->selectedFilter(); + lastUsedFilter = myFileDlg->selectedNameFilter(); } // Check the file name @@ -195,4 +195,4 @@ HYDROGUI_InputPanel* HYDROGUI_ImportObstacleFromFileOp::createInputPanel() const } return aPanel; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx b/src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx index 238acf07..e7faee11 100644 --- a/src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx @@ -58,7 +58,7 @@ void HYDROGUI_ImportPolylineOp::startOperation() myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true ); myFileDlg->setWindowTitle( getName() ); myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles ); - myFileDlg->setFilter( tr("POLYLINE_FILTER") ); + myFileDlg->setNameFilter( tr("POLYLINE_FILTER") ); connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) ); connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) ); @@ -89,7 +89,7 @@ void HYDROGUI_ImportPolylineOp::onApply() if (anExt == "shp") { HYDROData_ShapeFile anImporter; - NCollection_Sequence theEntities; + NCollection_Sequence theEntities; int aShapeTypeOfFile = -1; int aStat = anImporter.ImportPolylines(doc(), aFileName, theEntities, aShapeTypeOfFile ); if (aStat == 1) @@ -125,7 +125,7 @@ void HYDROGUI_ImportPolylineOp::onApply() QApplication::restoreOverrideCursor(); } -void HYDROGUI_ImportPolylineOp::UpdateView( NCollection_Sequence& anEntities) +void HYDROGUI_ImportPolylineOp::UpdateView( NCollection_Sequence& anEntities) { size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() ); if ( anActiveViewId == 0 ) diff --git a/src/HYDROGUI/HYDROGUI_ImportPolylineOp.h b/src/HYDROGUI/HYDROGUI_ImportPolylineOp.h index 9bd684a9..23cb0b87 100644 --- a/src/HYDROGUI/HYDROGUI_ImportPolylineOp.h +++ b/src/HYDROGUI/HYDROGUI_ImportPolylineOp.h @@ -25,7 +25,7 @@ #include class SUIT_FileDlg; -class Handle_HYDROData_Entity; +class HYDROData_Entity; class HYDROGUI_ImportPolylineOp : public HYDROGUI_Operation { @@ -38,7 +38,7 @@ public: protected: virtual void startOperation(); virtual void onApply(); - void UpdateView( NCollection_Sequence& anEntities); + void UpdateView( NCollection_Sequence& anEntities); private: SUIT_FileDlg* myFileDlg; diff --git a/src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx b/src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx index deaab0c3..9e12b9ee 100644 --- a/src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx @@ -52,7 +52,7 @@ void HYDROGUI_ImportProfilesOp::startOperation() myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true ); myFileDlg->setWindowTitle( getName() ); myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles ); - myFileDlg->setFilter( tr("PROFILE_FILTER") ); + myFileDlg->setNameFilter( tr("PROFILE_FILTER") ); connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) ); connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) ); diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx index 4f30e802..38b5cf4c 100644 --- a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx @@ -59,7 +59,7 @@ void HYDROGUI_ImportSinusXOp::startOperation() myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true ); myFileDlg->setWindowTitle( getName() ); myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles ); - myFileDlg->setFilter( tr("SINUSX_FILTER") ); + myFileDlg->setNameFilter( tr("SINUSX_FILTER") ); connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) ); connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) ); @@ -91,7 +91,7 @@ void HYDROGUI_ImportSinusXOp::onApply() if (anExt == "sx") { HYDROData_SinusX aSinusXImporter; - NCollection_Sequence anEntities; + NCollection_Sequence anEntities; if (aSinusXImporter.Import(aFileName, doc(), anEntities)) { UpdateView(anEntities); @@ -112,7 +112,7 @@ void HYDROGUI_ImportSinusXOp::onApply() QApplication::restoreOverrideCursor(); } -void HYDROGUI_ImportSinusXOp::UpdateView( NCollection_Sequence& anEntities) +void HYDROGUI_ImportSinusXOp::UpdateView( NCollection_Sequence& anEntities) { size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() ); if ( anActiveViewId == 0 ) diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.h b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.h index 738d25e4..36665cae 100644 --- a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.h +++ b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.h @@ -23,7 +23,7 @@ #include class SUIT_FileDlg; -class Handle_HYDROData_Entity; +class HYDROData_Entity; class HYDROGUI_ImportSinusXOp : public HYDROGUI_Operation { @@ -36,7 +36,7 @@ public: protected: virtual void startOperation(); virtual void onApply(); - void UpdateView( NCollection_Sequence& anEntities); + void UpdateView( NCollection_Sequence& anEntities); private: SUIT_FileDlg* myFileDlg; }; diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx index 196bd70d..aa29e8a4 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -31,7 +31,6 @@ const Quantity_Color EDGES_COLOR = Quantity_NOC_SLATEGRAY; const int HILIGHT_ISO_NB = 10; -IMPLEMENT_STANDARD_HANDLE( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape ) IMPLEMENT_STANDARD_RTTIEXT( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape ) HYDROGUI_LandCoverMapPrs::HYDROGUI_LandCoverMapPrs( const Handle(HYDROData_LandCoverMap)& theMap ) @@ -79,12 +78,12 @@ void HYDROGUI_LandCoverMapPrs::UpdateColors() SetTransparency( myLCMap->GetTransparency() ); } -Handle(Aspect_ColorScale) HYDROGUI_LandCoverMapPrs::GetColorScale() const +Handle(AIS_ColorScale) HYDROGUI_LandCoverMapPrs::GetColorScale() const { return myColorScale; } -void HYDROGUI_LandCoverMapPrs::SetColorScale( const Handle(Aspect_ColorScale)& theColorScale ) +void HYDROGUI_LandCoverMapPrs::SetColorScale( const Handle(AIS_ColorScale)& theColorScale ) { myColorScale = theColorScale; double aMin = 0, aMax = 0; @@ -152,7 +151,7 @@ void HYDROGUI_LandCoverMapPrs::Compute( const Handle(PrsMgr_PresentationManager3 } if( theMode==AIS_Shaded ) - StdPrs_WFDeflectionShape::Add( thePresentation, Shape(), myDrawer ); + StdPrs_WFShape::Add( thePresentation, Shape(), myDrawer ); } void HYDROGUI_LandCoverMapPrs::HilightSelected( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, @@ -166,7 +165,7 @@ void HYDROGUI_LandCoverMapPrs::HilightSelected( const Handle(PrsMgr_Presentation { Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast( theOwners.Value( i ) ); if( !anOwner.IsNull() ) - StdPrs_WFDeflectionShape::Add( aSelectPrs, anOwner->Shape(), HilightAttributes() ); + StdPrs_WFShape::Add( aSelectPrs, anOwner->Shape(), HilightAttributes() ); } HilightAttributes()->UIsoAspect()->SetNumber( 0 ); diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h index dabe4526..f9fe4a15 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h @@ -22,14 +22,13 @@ #include #include #include -#include +#include -DEFINE_STANDARD_HANDLE( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape ) class HYDROGUI_LandCoverMapPrs : public AIS_ColoredShape { public: - DEFINE_STANDARD_RTTI( HYDROGUI_LandCoverMapPrs ); + DEFINE_STANDARD_RTTIEXT( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape ); HYDROGUI_LandCoverMapPrs( const Handle(HYDROData_LandCoverMap)& ); virtual ~HYDROGUI_LandCoverMapPrs(); @@ -37,8 +36,8 @@ public: Handle(HYDROData_LandCoverMap) GetLandCoverMap() const; void SetLandCoverMap( const Handle(HYDROData_LandCoverMap)& ); - Handle(Aspect_ColorScale) GetColorScale() const; - void SetColorScale( const Handle(Aspect_ColorScale)& ); + Handle(AIS_ColorScale) GetColorScale() const; + void SetColorScale( const Handle(AIS_ColorScale)& ); Handle(HYDROData_StricklerTable) GetTable() const; void SetTable( const Handle(HYDROData_StricklerTable)& ); @@ -59,7 +58,7 @@ protected: private: Handle(HYDROData_LandCoverMap) myLCMap; - Handle(Aspect_ColorScale) myColorScale; + Handle(AIS_ColorScale) myColorScale; Handle(HYDROData_StricklerTable) myTable; }; diff --git a/src/HYDROGUI/HYDROGUI_ListModel.cxx b/src/HYDROGUI/HYDROGUI_ListModel.cxx index 254cb7c3..a452d2b3 100644 --- a/src/HYDROGUI/HYDROGUI_ListModel.cxx +++ b/src/HYDROGUI/HYDROGUI_ListModel.cxx @@ -51,9 +51,6 @@ HYDROGUI_ListModel::HYDROGUI_ListModel( QObject* theParent ) myEye = QPixmap( 16, 16 ); myEye.fill( Qt::black ); } - - // Set the supported drag actions for the items in the model - setSupportedDragActions( Qt::MoveAction | Qt::CopyAction ); } /** @@ -156,9 +153,9 @@ int HYDROGUI_ListModel::rowCount( const QModelIndex &theParent ) const */ void HYDROGUI_ListModel::setObjects( const Object2VisibleList& theObjects ) { + beginResetModel(); myObjects = theObjects; - - reset(); + endResetModel(); } /** @@ -182,9 +179,9 @@ HYDROGUI_ListModel::ObjectList HYDROGUI_ListModel::getObjects() const */ void HYDROGUI_ListModel::addObject( const Object2Visible& theObject ) { + beginResetModel(); myObjects << theObject; - - reset(); + endResetModel(); } /** @@ -200,9 +197,9 @@ void HYDROGUI_ListModel::removeObjectByName( const QString& theObjectName ) } } + beginResetModel(); myObjects.removeAll(anItem); - - reset(); + endResetModel(); } @@ -315,6 +312,14 @@ Qt::DropActions HYDROGUI_ListModel::supportedDropActions() const return Qt::MoveAction | Qt::CopyAction; } +/** +*/ +Qt::DropActions HYDROGUI_ListModel::supportedDragActions() const +{ + // Set the supported drag actions for the items in the model + return Qt::MoveAction | Qt::CopyAction; +} + /** Get list of ids by the list model indexes. @param theIsToSort defines if the list of ids should be sorted in ascending order @@ -520,6 +525,7 @@ void HYDROGUI_ListModel::setDecorationEnabled( const bool theIsToEnable ) void HYDROGUI_ListModel::undoLastMove() { + beginResetModel(); myObjects = myPrevObjects; - reset(); + endResetModel(); } diff --git a/src/HYDROGUI/HYDROGUI_ListModel.h b/src/HYDROGUI/HYDROGUI_ListModel.h index 8216175a..f8246036 100644 --- a/src/HYDROGUI/HYDROGUI_ListModel.h +++ b/src/HYDROGUI/HYDROGUI_ListModel.h @@ -59,6 +59,7 @@ public: virtual bool dropMimeData( const QMimeData* theData, Qt::DropAction theAction, int theRow, int theColumn, const QModelIndex& theParent ); virtual Qt::DropActions supportedDropActions() const; + virtual Qt::DropActions supportedDragActions() const; QList getIds( const QModelIndexList& theIndexes, bool theIsToSort = true ) const; @@ -95,4 +96,4 @@ private: bool myIsDecorationEnabled; }; -#endif \ No newline at end of file +#endif diff --git a/src/HYDROGUI/HYDROGUI_Module.h b/src/HYDROGUI/HYDROGUI_Module.h index 8780c389..2e62e508 100644 --- a/src/HYDROGUI/HYDROGUI_Module.h +++ b/src/HYDROGUI/HYDROGUI_Module.h @@ -41,7 +41,7 @@ class SVTK_Viewer; class SUIT_ViewWindow; class SUIT_ViewManager; -class Handle(HYDROData_StricklerTable); +class HYDROData_StricklerTable; class HYDROGUI_DataModel; class HYDROGUI_Displayer; diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx index b7505b0c..f0386a46 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx @@ -36,8 +36,7 @@ #include #include #include - -#include +#include #include @@ -163,12 +162,12 @@ HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int return aResShape; if( theObject->IsKind( STANDARD_TYPE( HYDROData_Image ) ) ) - aResShape = new HYDROGUI_ShapeImage( theContext, Handle_HYDROData_Image::DownCast( theObject ) ); + aResShape = new HYDROGUI_ShapeImage( theContext, Handle(HYDROData_Image)::DownCast( theObject ) ); else if( theObject->IsKind( STANDARD_TYPE( HYDROData_Bathymetry ) ) ) - aResShape = new HYDROGUI_ShapeBathymetry( this, theContext, Handle_HYDROData_Bathymetry::DownCast( theObject ) ); + aResShape = new HYDROGUI_ShapeBathymetry( this, theContext, Handle(HYDROData_Bathymetry)::DownCast( theObject ) ); else if( theObject->IsKind( STANDARD_TYPE( HYDROData_LandCoverMap ) ) ) { bool isScalarMode = module()->isLandCoversScalarMapModeOn( theViewerId ); - aResShape = new HYDROGUI_ShapeLandCoverMap( this, theContext, Handle_HYDROData_LandCoverMap::DownCast( theObject ), -1, isScalarMode ); + aResShape = new HYDROGUI_ShapeLandCoverMap( this, theContext, Handle(HYDROData_LandCoverMap)::DownCast( theObject ), -1, isScalarMode ); } else aResShape = new HYDROGUI_Shape( theContext, theObject ); @@ -424,13 +423,6 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer QList aBathShapes = module()->getObjectShapes( aViewerId, KIND_BATHYMETRY ); bool isDisplayColorScale = !aBathShapes.empty() || isLandCoverColoringOn; - Standard_Real anXPos = 0.05; //TODO - Standard_Real anYPos = 0.1; //TODO - Standard_Real aWidth = 0.2; //TODO - Standard_Real aHeight = 0.5; //TODO - Standard_Integer aTextHeight = 14; //TODO - Standard_Integer aNbIntervals = 20; //TODO - TCollection_ExtendedString aColorScaleTitle = "";//TODO Standard_Real aColorScaleMin = 0, aColorScaleMax = 1; @@ -465,22 +457,20 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer } } - Handle(Aspect_ColorScale) aColorScale; + Handle(AIS_ColorScale) aColorScale = GetColorScale( aViewerId ); + Handle(AIS_InteractiveContext) aCtx = theViewer->getAISContext(); if( isDisplayColorScale ) { - aColorScale = aView->ColorScale(); if( !aColorScale.IsNull() ) { - aColorScale->SetXPosition( anXPos ); - aColorScale->SetYPosition( anYPos ); - aColorScale->SetWidth( aWidth ); - aColorScale->SetHeight( aHeight ); - - aColorScale->SetTextHeight( aTextHeight ); - aColorScale->SetNumberOfIntervals( aNbIntervals ); - + // Set color scale title + TCollection_ExtendedString aColorScaleTitle = ""; //TODO aColorScale->SetTitle( aColorScaleTitle ); + + // Set color scale range aColorScale->SetRange( aColorScaleMin, aColorScaleMax ); + + aColorScale->SetToUpdate(); if ( !isLandCoverColoringOn ) { foreach( HYDROGUI_Shape* aShape, aBathShapes ) { @@ -491,14 +481,21 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer aBathShape->UpdateWithColorScale( aColorScale ); } } + + if ( !aCtx.IsNull()/* && !aCtx->IsDisplayed( aColorScale ) */) { + if ( !aCtx->IsDisplayed( aColorScale ) ) { + aCtx->Display( aColorScale, Standard_False ); + } + + aCtx->Update( aColorScale ); + } } - if( !aView->ColorScaleIsDisplayed() ) - aView->ColorScaleDisplay(); } else { - if( aView->ColorScaleIsDisplayed() ) - aView->ColorScaleErase(); + if ( !aCtx.IsNull() && aCtx->IsDisplayed( aColorScale ) ) { + aCtx->Erase( aColorScale ); + } } foreach( HYDROGUI_Shape* aShape, aLandCoverMapShapes ) { @@ -526,3 +523,37 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer myToUpdateColorScale = false; } + +Handle(AIS_ColorScale) HYDROGUI_OCCDisplayer::GetColorScale( const int theViewerId ) +{ + Handle(AIS_ColorScale) aColorScale; + + aColorScale = myColorScales.value( theViewerId, aColorScale ); + if ( aColorScale.IsNull() ) { + // Create color scale + aColorScale = new AIS_ColorScale(); + + // Set properties + Standard_Integer anXPos = 50; //TODO + Standard_Integer anYPos = 100; //TODO + Standard_Integer aWidth = 100; //TODO + Standard_Integer aHeight = 350; //TODO + + Standard_Integer aTextHeight = 14; //TODO + Standard_Integer aNbIntervals = 20; //TODO + + aColorScale->SetTransformPersistence( Graphic3d_TMF_2d, gp_Pnt( -1, -1, 0 ) ); + + aColorScale->SetXPosition( anXPos ); + aColorScale->SetYPosition( anYPos ); + aColorScale->SetSize( aWidth, aHeight ); + + aColorScale->SetTextHeight( aTextHeight ); + aColorScale->SetNumberOfIntervals( aNbIntervals ); + + // Put into the map + myColorScales.insert( theViewerId, aColorScale ); + } + + return aColorScale; +} diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.h b/src/HYDROGUI/HYDROGUI_OCCDisplayer.h index b454518d..92e20c81 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.h +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.h @@ -22,7 +22,8 @@ #include "HYDROGUI_AbstractDisplayer.h" class HYDROGUI_Shape; -class Handle(AIS_InteractiveContext); +class AIS_InteractiveContext; +class AIS_ColorScale; class OCCViewer_ViewManager; class OCCViewer_Viewer; @@ -74,6 +75,13 @@ public: void SetToUpdateColorScale(); + /** + * \brief Get color scale for the viewer. + * \param theViewerId viewer identifier + * \return the color scale + */ + Handle(AIS_ColorScale) GetColorScale( const int theViewerId ); + protected: /** * \brief Erase all viewer objects. @@ -145,6 +153,8 @@ private: private: bool myToUpdateColorScale; + + QMap myColorScales; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_OCCSelector.h b/src/HYDROGUI/HYDROGUI_OCCSelector.h index 093f0b3b..4f717c92 100644 --- a/src/HYDROGUI/HYDROGUI_OCCSelector.h +++ b/src/HYDROGUI/HYDROGUI_OCCSelector.h @@ -23,7 +23,7 @@ class HYDROGUI_Module; class OCCViewer_Viewer; -class Handle_AIS_InteractiveObject; +class AIS_InteractiveObject; class HYDROGUI_OCCSelector : public LightApp_OCCSelector { @@ -39,7 +39,7 @@ protected: virtual void getSelection( SUIT_DataOwnerPtrList& ) const; virtual void setSelection( const SUIT_DataOwnerPtrList& ); - virtual QString entry( const Handle_AIS_InteractiveObject& ) const; + virtual QString entry( const Handle(AIS_InteractiveObject)& ) const; private: HYDROGUI_Module* myModule; diff --git a/src/HYDROGUI/HYDROGUI_Operation.cxx b/src/HYDROGUI/HYDROGUI_Operation.cxx index 916a5a68..30caab31 100644 --- a/src/HYDROGUI/HYDROGUI_Operation.cxx +++ b/src/HYDROGUI/HYDROGUI_Operation.cxx @@ -390,7 +390,7 @@ void HYDROGUI_Operation::commitDocOperation() } } -Handle_HYDROData_Document HYDROGUI_Operation::doc() const +Handle(HYDROData_Document) HYDROGUI_Operation::doc() const { return HYDROData_Document::Document( myModule->getStudyId() ); } diff --git a/src/HYDROGUI/HYDROGUI_Operation.h b/src/HYDROGUI/HYDROGUI_Operation.h index b3b3d7bc..11e38511 100644 --- a/src/HYDROGUI/HYDROGUI_Operation.h +++ b/src/HYDROGUI/HYDROGUI_Operation.h @@ -20,7 +20,7 @@ #define HYDROGUI_OPERATION_H #include - +#include #include class HYDROGUI_Module; @@ -30,8 +30,8 @@ class HYDROGUI_Shape; class SUIT_SelectionMgr; class OCCViewer_ViewManager; -class Handle_HYDROData_Document; -class Handle_HYDROData_Object; +class HYDROData_Document; +class HYDROData_Object; class HYDROGUI_Operation : public LightApp_Operation { @@ -77,7 +77,7 @@ protected: void abortDocOperation(); void commitDocOperation(); - Handle_HYDROData_Document doc() const; + Handle(HYDROData_Document) doc() const; virtual bool isToAbortOnApply() const { return true; } diff --git a/src/HYDROGUI/HYDROGUI_Polyline.cxx b/src/HYDROGUI/HYDROGUI_Polyline.cxx index 90e3e42e..b9a7a2aa 100644 --- a/src/HYDROGUI/HYDROGUI_Polyline.cxx +++ b/src/HYDROGUI/HYDROGUI_Polyline.cxx @@ -41,7 +41,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE (HYDROGUI_Polyline, AIS_Shape) IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_Polyline, AIS_Shape) diff --git a/src/HYDROGUI/HYDROGUI_Polyline.h b/src/HYDROGUI/HYDROGUI_Polyline.h index 45e79dba..7b70a15f 100644 --- a/src/HYDROGUI/HYDROGUI_Polyline.h +++ b/src/HYDROGUI/HYDROGUI_Polyline.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -43,9 +43,7 @@ public: const Standard_Integer aMode = 0); public: - DEFINE_STANDARD_RTTI(HYDROGUI_Polyline); + DEFINE_STANDARD_RTTIEXT(HYDROGUI_Polyline, AIS_Shape); }; -DEFINE_STANDARD_HANDLE(HYDROGUI_Polyline, AIS_Shape) - #endif diff --git a/src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx b/src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx index 0d7061cb..0b008616 100644 --- a/src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx +++ b/src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx @@ -530,7 +530,6 @@ void HYDROGUI_PriorityTableModel::undoLastChange() beginResetModel(); myRules = myPrevRules; endResetModel(); - reset(); } /** diff --git a/src/HYDROGUI/HYDROGUI_PriorityWidget.cxx b/src/HYDROGUI/HYDROGUI_PriorityWidget.cxx index e6e15e01..2f84a822 100644 --- a/src/HYDROGUI/HYDROGUI_PriorityWidget.cxx +++ b/src/HYDROGUI/HYDROGUI_PriorityWidget.cxx @@ -154,12 +154,12 @@ HYDROGUI_PriorityWidget::HYDROGUI_PriorityWidget( QWidget* theParent ) // Set resize mode myTable->horizontalHeader()->setStretchLastSection( false); - myTable->horizontalHeader()->setResizeMode( 0, QHeaderView::Stretch ); - myTable->horizontalHeader()->setResizeMode( 1, QHeaderView::ResizeToContents ); - myTable->horizontalHeader()->setResizeMode( 2, QHeaderView::Stretch ); - myTable->horizontalHeader()->setResizeMode( 3, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 0, QHeaderView::Stretch ); + myTable->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 2, QHeaderView::Stretch ); + myTable->horizontalHeader()->setSectionResizeMode( 3, QHeaderView::ResizeToContents ); - myTable->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents ); + myTable->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents ); // Layout // buttons diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index ac85dfbf..c34f2cc9 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -480,10 +480,10 @@ void HYDROGUI_Shape::setZLayer( const int theZLayer ) myContext->SetZLayer( myShape, myZLayer ); } -Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const +Handle(AIS_InteractiveObject) HYDROGUI_Shape::createShape() const { if( myTopoShape.IsNull() ) { - return Handle_AIS_InteractiveObject(); + return Handle(AIS_InteractiveObject)(); } TopAbs_ShapeEnum aShapeType = myTopoShape.ShapeType(); @@ -513,7 +513,7 @@ void HYDROGUI_Shape::buildShape() if( myShape.IsNull() ) return; - Handle_AIS_Shape anAISShape = Handle_AIS_Shape::DownCast( myShape ); + Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast( myShape ); if( !anAISShape.IsNull() ) anAISShape ->SetHLRAngleAndDeviation( 0.001 ); @@ -523,9 +523,8 @@ void HYDROGUI_Shape::buildShape() if ( !myObject.IsNull() && !myObject->IsKind( STANDARD_TYPE(HYDROData_LandCoverMap) ) ) myShape->SetTransparency( 0 ); myShape->SetDisplayMode( (AIS_DisplayMode)myDisplayMode ); - myShape->SetSelectionMode( (Standard_Integer)mySelectionMode ); - // Init default params for shape + // Init default params for shape const Handle(Prs3d_Drawer)& anAttributes = myShape->Attributes(); if ( !anAttributes.IsNull() ) { @@ -677,4 +676,4 @@ void HYDROGUI_Shape::setDisplayMode( int theDisplayMode ) void HYDROGUI_Shape::setSelectionMode( int theSelectionMode ) { mySelectionMode = theSelectionMode; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_Shape.h b/src/HYDROGUI/HYDROGUI_Shape.h index 5447abb0..76113ba1 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.h +++ b/src/HYDROGUI/HYDROGUI_Shape.h @@ -109,7 +109,7 @@ protected: virtual void eraseShape( const bool theIsUpdateViewer ); virtual QColor getActiveColor() const; - virtual Handle_AIS_InteractiveObject createShape() const; + virtual Handle(AIS_InteractiveObject) createShape() const; void setDisplayMode( int theDisplayMode ); diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx index e8e7941b..a88b5069 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx @@ -22,12 +22,12 @@ #include #include -#include +#include #include HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer, const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_Bathymetry& theBathymetry, + const Handle(HYDROData_Bathymetry)& theBathymetry, const int theZLayer ) : HYDROGUI_Shape( theContext, theBathymetry, theZLayer ), myDisplayer( theDisplayer ) @@ -58,12 +58,14 @@ void HYDROGUI_ShapeBathymetry::update( bool theIsUpdateViewer, bool isDeactivate } -Handle_AIS_InteractiveObject HYDROGUI_ShapeBathymetry::createShape() const +Handle(AIS_InteractiveObject) HYDROGUI_ShapeBathymetry::createShape() const { - Handle_HYDROData_Bathymetry aBath = Handle_HYDROData_Bathymetry::DownCast( getObject() ); + Handle(AIS_InteractiveObject) aPntCloud; + + Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( getObject() ); if( !aBath.IsNull() ) { - Handle_AIS_PointCloud aPntCloud = new HYDROGUI_BathymetryPrs(); + aPntCloud = new HYDROGUI_BathymetryPrs(); aPntCloud->SetHilightMode( AIS_PointCloud::DM_BndBox ); aPntCloud->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 2.0)); @@ -76,11 +78,9 @@ Handle_AIS_InteractiveObject HYDROGUI_ShapeBathymetry::createShape() const aThat->myColors = new Quantity_HArray1OfColor( aLower, anUpper ); for( int i=aLower; i<=anUpper; i++ ) aThat->myCoords->SetValue( i, gp_Pnt( aBathPoints[i].X, aBathPoints[i].Y, aBathPoints[i].Z ) ); - - return aPntCloud; } - else - return Handle_AIS_InteractiveObject(); + + return aPntCloud; } void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const @@ -102,7 +102,7 @@ void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const } } -void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(Aspect_ColorScale)& theColorScale ) +void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale)& theColorScale ) { if (!myCoords) return; @@ -113,7 +113,7 @@ void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(Aspect_ColorSc theColorScale->FindColor( z, aColor ); myColors->SetValue( i, aColor ); } - Handle_AIS_PointCloud aPntCloud = Handle_AIS_PointCloud::DownCast( getAISObject() ); + Handle(AIS_PointCloud) aPntCloud = Handle(AIS_PointCloud)::DownCast( getAISObject() ); aPntCloud->SetPoints( myCoords, myColors ); getContext()->Redisplay( aPntCloud, Standard_False ); } diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h index 8a644721..c736c60f 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h @@ -23,8 +23,8 @@ #include #include -class Handle_HYDROData_Bathymetry; -class Handle_Aspect_ColorScale; +class HYDROData_Bathymetry; +class AIS_ColorScale; class HYDROGUI_OCCDisplayer; class HYDROGUI_ShapeBathymetry : public HYDROGUI_Shape @@ -32,12 +32,12 @@ class HYDROGUI_ShapeBathymetry : public HYDROGUI_Shape public: HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer, const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_Bathymetry& theBathymetry, + const Handle(HYDROData_Bathymetry)& theBathymetry, const int theZLayer = -1 ); virtual ~HYDROGUI_ShapeBathymetry(); void GetRange( double& theMin, double& theMax ) const; - void UpdateWithColorScale( const Handle_Aspect_ColorScale& ); + void UpdateWithColorScale( const Handle(AIS_ColorScale)& ); virtual void display( const bool theIsUpdateViewer = true ); virtual void erase( const bool theIsUpdateViewer = true ); @@ -48,15 +48,15 @@ public: virtual void setVisible( const bool theState, const bool theIsUpdateViewer = true ); protected: - virtual Handle_AIS_InteractiveObject createShape() const; + virtual Handle(AIS_InteractiveObject) createShape() const; virtual void displayShape( const bool theIsUpdateViewer ); void setToUpdateColorScale( bool isChanged ); private: HYDROGUI_OCCDisplayer* myDisplayer; - Handle_TColgp_HArray1OfPnt myCoords; - Handle_Quantity_HArray1OfColor myColors; + Handle(TColgp_HArray1OfPnt) myCoords; + Handle(Quantity_HArray1OfColor) myColors; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_ShapeImage.cxx b/src/HYDROGUI/HYDROGUI_ShapeImage.cxx index 3d519965..4f832399 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeImage.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeImage.cxx @@ -27,7 +27,7 @@ #include HYDROGUI_ShapeImage::HYDROGUI_ShapeImage( const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_Image& theImage, + const Handle(HYDROData_Image)& theImage, const int theZLayer ) : HYDROGUI_Shape( theContext, theImage, theZLayer ) { @@ -48,12 +48,15 @@ void HYDROGUI_ShapeImage::update( bool theIsUpdateViewer, bool isDeactivateSelec Handle(AIS_InteractiveObject) HYDROGUI_ShapeImage::createShape() const { - Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( getObject() ); - if ( anImageObj.IsNull() ) - return Handle_AIS_InteractiveObject(); + Handle(HYDROGUI_ImagePrs) aPrs; - Handle(HYDROGUI_ImagePrs) aPrs = new HYDROGUI_ImagePrs( imagePixMap( anImageObj ), imageContour( anImageObj ) ); - return aPrs; + Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( getObject() ); + if ( !anImageObj.IsNull() ) + { + aPrs = new HYDROGUI_ImagePrs( imagePixMap( anImageObj ), imageContour( anImageObj ) ); + } + + return aPrs; } Handle(Image_PixMap) HYDROGUI_ShapeImage::imagePixMap( const Handle(HYDROData_Image)& theImageObj ) const @@ -81,7 +84,7 @@ Handle(Image_PixMap) HYDROGUI_ShapeImage::imagePixMap( const Handle(HYDROData_Im return aPix; } -QPolygonF HYDROGUI_ShapeImage::imageContour( const Handle_HYDROData_Image& theImageObj ) const +QPolygonF HYDROGUI_ShapeImage::imageContour( const Handle(HYDROData_Image)& theImageObj ) const { QPolygonF aContour; if ( !theImageObj.IsNull() ) diff --git a/src/HYDROGUI/HYDROGUI_ShapeImage.h b/src/HYDROGUI/HYDROGUI_ShapeImage.h index e9cf07a4..aba5b82b 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeImage.h +++ b/src/HYDROGUI/HYDROGUI_ShapeImage.h @@ -23,22 +23,22 @@ #include -class Handle_HYDROData_Image; +class HYDROData_Image; class HYDROGUI_ShapeImage : public HYDROGUI_Shape { public: HYDROGUI_ShapeImage( const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_Image& theImage, + const Handle(HYDROData_Image)& theImage, const int theZLayer = -1 ); virtual ~HYDROGUI_ShapeImage(); virtual void update( bool isUpdateViewer, bool isDeactivateSelection ); protected: - virtual Handle_AIS_InteractiveObject createShape() const; - Handle(Image_PixMap) imagePixMap( const Handle_HYDROData_Image& ) const; - QPolygonF imageContour( const Handle_HYDROData_Image& ) const; + virtual Handle(AIS_InteractiveObject) createShape() const; + Handle(Image_PixMap) imagePixMap( const Handle(HYDROData_Image)& ) const; + QPolygonF imageContour( const Handle(HYDROData_Image)& ) const; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx index 0a6b59ab..3446545e 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx @@ -34,7 +34,7 @@ HYDROGUI_ShapeLandCoverMap::HYDROGUI_ShapeLandCoverMap( HYDROGUI_OCCDisplayer* theDisplayer, const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_LandCoverMap& theLandCoverMap, + const Handle(HYDROData_LandCoverMap)& theLandCoverMap, const int theZLayer, const bool theIsScalarMode ) : HYDROGUI_Shape( theContext, theLandCoverMap, theZLayer ), @@ -91,7 +91,7 @@ void HYDROGUI_ShapeLandCoverMap::displayShape( const bool theIsUpdateViewer ) myDisplayer->SetToUpdateColorScale(); } -Handle_AIS_InteractiveObject HYDROGUI_ShapeLandCoverMap::createShape() const +Handle(AIS_InteractiveObject) HYDROGUI_ShapeLandCoverMap::createShape() const { Handle(HYDROData_LandCoverMap) aLandCoverMap = Handle(HYDROData_LandCoverMap)::DownCast( getObject() ); if ( !aLandCoverMap.IsNull() ) @@ -115,13 +115,7 @@ Handle_AIS_InteractiveObject HYDROGUI_ShapeLandCoverMap::createShape() const aLandCoverMapPrs->SetTable( aTable ); // Set color scale - OCCViewer_ViewWindow* aWnd = dynamic_cast( aViewer->getViewManager()->getActiveView() ); - Handle(V3d_View) aView = aWnd->getViewPort()->getView(); - if( !aView.IsNull() ) - { - Handle(Aspect_ColorScale) aColorScale = aView->ColorScale(); - aLandCoverMapPrs->SetColorScale( aColorScale ); - } + aLandCoverMapPrs->SetColorScale( myDisplayer->GetColorScale( aViewerId) ); } } } diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h index 263c2329..526c52e5 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h +++ b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h @@ -24,14 +24,14 @@ #include class HYDROGUI_OCCDisplayer; -class Handle_HYDROData_LandCoverMap; +class HYDROData_LandCoverMap; class HYDROGUI_ShapeLandCoverMap : public HYDROGUI_Shape { public: HYDROGUI_ShapeLandCoverMap( HYDROGUI_OCCDisplayer* theDisplayer, const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_LandCoverMap& theLandCoverMap, + const Handle(HYDROData_LandCoverMap)& theLandCoverMap, const int theZLayer = -1, const bool theIsScalarMode = false ); virtual ~HYDROGUI_ShapeLandCoverMap(); @@ -54,7 +54,7 @@ public: protected: virtual void displayShape( const bool theIsUpdateViewer ); - virtual Handle_AIS_InteractiveObject createShape() const; + virtual Handle(AIS_InteractiveObject) createShape() const; private: HYDROGUI_OCCDisplayer* myDisplayer; diff --git a/src/HYDROGUI/HYDROGUI_StreamOp.cxx b/src/HYDROGUI/HYDROGUI_StreamOp.cxx index ecac0f9f..89f44d99 100755 --- a/src/HYDROGUI/HYDROGUI_StreamOp.cxx +++ b/src/HYDROGUI/HYDROGUI_StreamOp.cxx @@ -385,7 +385,7 @@ void HYDROGUI_StreamOp::createPreview() HYDROGUI_Tool::FindObjectByName( module(), myHydAxis, KIND_POLYLINEXY ) ); HYDROData_SequenceOfObjects aRefProfiles; - //std::vector aRefProfiles; + //std::vector aRefProfiles; int plen = myProfiles.length(); for ( int i = 0; i < plen; ++i ) { diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx index 6c14e957..07bb17ad 100644 --- a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx @@ -46,7 +46,7 @@ HYDROGUI_ColorDelegate::~HYDROGUI_ColorDelegate() void HYDROGUI_ColorDelegate::paint( QPainter* thePainter, const QStyleOptionViewItem& theOption, const QModelIndex& theIndex ) const { - QColor aColor = qVariantValue( theIndex.data( Qt::BackgroundColorRole ) ); + QColor aColor = theIndex.data( Qt::BackgroundColorRole ).value(); thePainter->fillRect( theOption.rect, aColor ); } @@ -54,7 +54,7 @@ QWidget* HYDROGUI_ColorDelegate::createEditor( QWidget* theParent, const QStyleOptionViewItem& theOption, const QModelIndex& theIndex ) const { - QColor aColor = qVariantValue( theIndex.data( Qt::BackgroundColorRole ) ); + QColor aColor = theIndex.data( Qt::BackgroundColorRole ).value(); QColor aNewColor = QColorDialog::getColor( aColor ); if( aNewColor.isValid() ) { @@ -166,13 +166,13 @@ HYDROGUI_StricklerTableDlg::HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModu myTable->setHorizontalHeaderLabels( aColumnNames ); myTable->horizontalHeader()->setStretchLastSection( false ); - myTable->horizontalHeader()->setResizeMode( 0, QHeaderView::ResizeToContents ); - myTable->horizontalHeader()->setResizeMode( 1, QHeaderView::ResizeToContents ); - myTable->horizontalHeader()->setResizeMode( 2, QHeaderView::ResizeToContents ); - myTable->horizontalHeader()->setResizeMode( 3, QHeaderView::Stretch ); + myTable->horizontalHeader()->setSectionResizeMode( 0, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 2, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 3, QHeaderView::Stretch ); myTable->horizontalHeader()->setMinimumSectionSize( 50 ); - myTable->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents ); + myTable->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents ); // Layout // buttons @@ -250,7 +250,7 @@ void HYDROGUI_StricklerTableDlg::setTableNameReadOnly( bool on ) myName->setReadOnly( on ); } -void HYDROGUI_StricklerTableDlg::getGuiData( Handle_HYDROData_StricklerTable& theTable ) const +void HYDROGUI_StricklerTableDlg::getGuiData( Handle(HYDROData_StricklerTable)& theTable ) const { if( theTable.IsNull() ) return; @@ -278,7 +278,7 @@ void HYDROGUI_StricklerTableDlg::getGuiData( Handle_HYDROData_StricklerTable& th } } -void HYDROGUI_StricklerTableDlg::setGuiData( const Handle_HYDROData_StricklerTable& theTable ) +void HYDROGUI_StricklerTableDlg::setGuiData( const Handle(HYDROData_StricklerTable)& theTable ) { myAttrName->setText( theTable->GetAttrName() ); diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h index 6801b55d..11704db4 100644 --- a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h +++ b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h @@ -21,8 +21,9 @@ #include "HYDROGUI_InputPanel.h" #include +#include -class Handle_HYDROData_StricklerTable; +class HYDROData_StricklerTable; class QGroupBox; class QLineEdit; @@ -52,8 +53,8 @@ public: bool isTableNameReadOnly() const; void setTableNameReadOnly( bool ); - void getGuiData( Handle_HYDROData_StricklerTable& theTable ) const; - void setGuiData( const Handle_HYDROData_StricklerTable& theTable ); + void getGuiData( Handle(HYDROData_StricklerTable)& theTable ) const; + void setGuiData( const Handle(HYDROData_StricklerTable)& theTable ); protected: void updateControls(); diff --git a/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx b/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx index 8f592db3..321a72cd 100644 --- a/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx +++ b/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx @@ -46,7 +46,7 @@ HYDROGUI_StricklerTypeComboBox::HYDROGUI_StricklerTypeComboBox( HYDROGUI_Module* if ( myModule ) { // Construct a list of unique names of all Strickler types defined within the data model - Handle_HYDROData_Document aDoc = HYDROData_Document::Document( myModule->getStudyId() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myModule->getStudyId() ); if ( aDoc ) { QStringList aStricklerTypes; diff --git a/src/HYDROGUI/HYDROGUI_Tool.cxx b/src/HYDROGUI/HYDROGUI_Tool.cxx index f86499f2..af925117 100644 --- a/src/HYDROGUI/HYDROGUI_Tool.cxx +++ b/src/HYDROGUI/HYDROGUI_Tool.cxx @@ -200,7 +200,7 @@ HYDROData_SequenceOfObjects HYDROGUI_Tool::GetObjectBackReferences( const Handle } QMap HYDROGUI_Tool::GetObjectsBackReferences( - const Handle_HYDROData_Document& theDocument, const QStringList& theObjectNames ) + const Handle(HYDROData_Document)& theDocument, const QStringList& theObjectNames ) { QMap aResMap; @@ -268,7 +268,7 @@ QStringList HYDROGUI_Tool::FindExistingObjectsNames( const Handle(HYDROData_Docu if( isOK && isCheckValidProfile ) { - Handle_HYDROData_Profile aProfile = Handle_HYDROData_Profile::DownCast( anObject ); + Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( anObject ); if( !aProfile.IsNull() && !aProfile->IsValid() ) isOK = false; } diff --git a/src/HYDROGUI/HYDROGUI_Tool.h b/src/HYDROGUI/HYDROGUI_Tool.h index 99aa175c..90756880 100644 --- a/src/HYDROGUI/HYDROGUI_Tool.h +++ b/src/HYDROGUI/HYDROGUI_Tool.h @@ -23,10 +23,10 @@ #include class TCollection_AsciiString; -class Handle_HYDROData_Document; -class Handle_Image_PixMap; -class Handle_TCollection_HAsciiString; -class Handle_TCollection_HExtendedString; +class HYDROData_Document; +class Image_PixMap; +class TCollection_HAsciiString; +class TCollection_HExtendedString; class QDockWidget; class QImage; class QWidget; @@ -35,8 +35,8 @@ namespace HYDROGUI_Tool { QString ToQString( const TCollection_AsciiString& ); QString ToQString( const TCollection_ExtendedString& ); - QString ToQString( const Handle_TCollection_HAsciiString& ); - QString ToQString( const Handle_TCollection_HExtendedString& ); + QString ToQString( const Handle(TCollection_HAsciiString)& ); + QString ToQString( const Handle(TCollection_HExtendedString)& ); TCollection_AsciiString ToAsciiString( const QString& ); TCollection_ExtendedString ToExtString( const QString& ); Handle(TCollection_HAsciiString) ToHAsciiString( const QString& ); @@ -46,19 +46,19 @@ namespace HYDROGUI_Tool QDockWidget* WindowDock( QWidget* wid ); - QStringList FindExistingObjectsNames( const Handle_HYDROData_Document& theDoc, + QStringList FindExistingObjectsNames( const Handle(HYDROData_Document)& theDoc, const ObjectKind theObjectKind, bool isCheckValidProfile = false ); QString GetCoordinateString( const double theNumber, bool isInLocale ); - Handle_Image_PixMap Pixmap( const QImage& theImage ); + Handle(Image_PixMap) Pixmap( const QImage& theImage ); void GetObjectReferences( const Handle(HYDROData_Entity)& theObj, HYDROData_SequenceOfObjects& theRefObjects, QStringList& theRefNames ); HYDROData_SequenceOfObjects GetObjectBackReferences( const Handle(HYDROData_Entity)& theObj ); QMap GetObjectsBackReferences - ( const Handle_HYDROData_Document& theDocument, const QStringList& theObjectNames ); + ( const Handle(HYDROData_Document)& theDocument, const QStringList& theObjectNames ); }; #endif diff --git a/src/HYDROGUI/HYDROGUI_Tool2.cxx b/src/HYDROGUI/HYDROGUI_Tool2.cxx index c87743e0..ef1962e8 100644 --- a/src/HYDROGUI/HYDROGUI_Tool2.cxx +++ b/src/HYDROGUI/HYDROGUI_Tool2.cxx @@ -244,7 +244,7 @@ ObjectKind HYDROGUI_Tool::GetSelectedPartition( HYDROGUI_Module* theModule ) { anEntry.remove( aPrefix ); for( ObjectKind anObjectKind = KIND_UNKNOWN + 1; anObjectKind <= KIND_LAST; anObjectKind++ ) - if( HYDROGUI_DataModel::tr( HYDROGUI_DataModel::partitionName( anObjectKind ).toAscii() ) == anEntry ) + if( HYDROGUI_DataModel::tr( HYDROGUI_DataModel::partitionName( anObjectKind ).toLatin1() ) == anEntry ) return anObjectKind; } } diff --git a/src/HYDROGUI/HYDROGUI_Tool2.h b/src/HYDROGUI/HYDROGUI_Tool2.h index e39bc3f6..980372ac 100644 --- a/src/HYDROGUI/HYDROGUI_Tool2.h +++ b/src/HYDROGUI/HYDROGUI_Tool2.h @@ -33,7 +33,7 @@ class HYDROGUI_Prs; class SUIT_ViewManager; class GraphicsView_ViewPort; class OCCViewer_ViewFrame; -class Handle_HYDROData_Document; +class HYDROData_Document; namespace HYDROGUI_Tool { @@ -52,7 +52,7 @@ namespace HYDROGUI_Tool HYDROData_SequenceOfObjects GetSelectedObjects( HYDROGUI_Module* theModule ); - bool IsObjectHasPresentation( const Handle_HYDROData_Entity& theObject, + bool IsObjectHasPresentation( const Handle(HYDROData_Entity)& theObject, const QString& theViewerType = "" ); Handle(HYDROData_Entity) GetSelectedObject( HYDROGUI_Module* theModule ); @@ -95,7 +95,7 @@ namespace HYDROGUI_Tool QColor GenerateFillingColor( HYDROGUI_Module* theModule, const QStringList& theZoneNames ); - QColor GenerateFillingColor( const Handle_HYDROData_Document& theDoc, + QColor GenerateFillingColor( const Handle(HYDROData_Document)& theDoc, const QStringList& theZoneNames ); QStringList GetSelectedGeomObjects( HYDROGUI_Module* theModule, diff --git a/src/HYDROGUI/HYDROGUI_UpdateObjectOp.h b/src/HYDROGUI/HYDROGUI_UpdateObjectOp.h index 4e8b5ba0..70f1157f 100644 --- a/src/HYDROGUI/HYDROGUI_UpdateObjectOp.h +++ b/src/HYDROGUI/HYDROGUI_UpdateObjectOp.h @@ -23,7 +23,7 @@ #include -class Handle_HYDROData_Entity; +class HYDROData_Entity; class HYDROGUI_UpdateObjectOp : public HYDROGUI_Operation { @@ -38,7 +38,7 @@ protected: virtual void startOperation(); - virtual void updateObject( const Handle_HYDROData_Entity& theObject, + virtual void updateObject( const Handle(HYDROData_Entity)& theObject, NCollection_Map& theMapOfTreated ) const; private: diff --git a/src/HYDROGUI/HYDROGUI_VTKPrs.cxx b/src/HYDROGUI/HYDROGUI_VTKPrs.cxx index c16dbb01..925f013c 100644 --- a/src/HYDROGUI/HYDROGUI_VTKPrs.cxx +++ b/src/HYDROGUI/HYDROGUI_VTKPrs.cxx @@ -34,7 +34,7 @@ HYDROGUI_VTKPrs::HYDROGUI_VTKPrs( const Handle(HYDROData_Entity)& theObject ) // Define IO for actors to be added: QString anEntry = HYDROGUI_DataObject::dataObjectEntry( theObject ); myIO = new SALOME_InteractiveObject( - anEntry.toAscii(), QString::number( theObject->GetKind() ).toAscii(), theObject->GetName().toAscii() ); + anEntry.toLatin1(), QString::number( theObject->GetKind() ).toLatin1(), theObject->GetName().toLatin1() ); myZRange[0] = HYDROData_IAltitudeObject::GetInvalidAltitude(); myZRange[1] = HYDROData_IAltitudeObject::GetInvalidAltitude(); } diff --git a/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx b/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx index 52969e5e..af8b9bf8 100644 --- a/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx +++ b/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx @@ -192,8 +192,7 @@ void HYDROGUI_VTKPrsShape::buildShape() HYDROData_SequenceOfObjects::Iterator anIter( aRefObjects ); for ( ; anIter.More(); anIter.Next() ) { - Handle(HYDROData_Entity) aRefbject = - Handle(HYDROData_Entity)::DownCast( anIter.Value() ); + Handle(HYDROData_Entity) aRefbject = anIter.Value(); if ( aRefbject.IsNull() ) continue; diff --git a/src/HYDROGUI/HYDROGUI_ZLayers.cxx b/src/HYDROGUI/HYDROGUI_ZLayers.cxx index 0fe911d4..4cd49e8b 100644 --- a/src/HYDROGUI/HYDROGUI_ZLayers.cxx +++ b/src/HYDROGUI/HYDROGUI_ZLayers.cxx @@ -23,7 +23,7 @@ void SetZLayerForPrs( const Handle(PrsMgr_Presentation)& thePrs, int theLayerId ); -void SetPrsZLayer( const Handle_PrsMgr_PresentableObject& thePresentableObject, +void SetPrsZLayer( const Handle(PrsMgr_PresentableObject)& thePresentableObject, const int theMode, const int theLayerId ) { PrsMgr_Presentations& aPresentations = thePresentableObject->Presentations(); @@ -37,7 +37,7 @@ void SetPrsZLayer( const Handle_PrsMgr_PresentableObject& thePresentableObject, } } -void SetZLayerSettings( const Handle_V3d_Viewer& theViewer3d, int theLayerId, bool theIsOrdered ) +void SetZLayerSettings( const Handle(V3d_Viewer)& theViewer3d, int theLayerId, bool theIsOrdered ) { if ( theViewer3d.IsNull() /*|| theLayerId < 0*/ ) { @@ -65,7 +65,7 @@ void SetZLayerSettings( const Handle_V3d_Viewer& theViewer3d, int theLayerId, bo theViewer3d->SetZLayerSettings( theLayerId, aSettings ); } -int CreateTopZLayer( const Handle_V3d_Viewer& theViewer3d ) +int CreateTopZLayer( const Handle(V3d_Viewer)& theViewer3d ) { int aTopZLayer = -1; @@ -77,7 +77,7 @@ int CreateTopZLayer( const Handle_V3d_Viewer& theViewer3d ) } -HYDROGUI_ZLayersIterator::HYDROGUI_ZLayersIterator( const Handle_V3d_Viewer& theViewer ) +HYDROGUI_ZLayersIterator::HYDROGUI_ZLayersIterator( const Handle(V3d_Viewer)& theViewer ) : myIndex( 0 ), myNewZLayer( -1 ), myViewer( theViewer ) { Init( theViewer ); @@ -87,7 +87,7 @@ HYDROGUI_ZLayersIterator::~HYDROGUI_ZLayersIterator() { } -void HYDROGUI_ZLayersIterator::Init( const Handle_V3d_Viewer& theViewer ) +void HYDROGUI_ZLayersIterator::Init( const Handle(V3d_Viewer)& theViewer ) { TColStd_SequenceOfInteger anExistingZLayers; theViewer->GetAllZLayers( anExistingZLayers ); diff --git a/src/HYDROGUI/HYDROGUI_ZLayers.h b/src/HYDROGUI/HYDROGUI_ZLayers.h index 3fd3fd47..1b3069d9 100644 --- a/src/HYDROGUI/HYDROGUI_ZLayers.h +++ b/src/HYDROGUI/HYDROGUI_ZLayers.h @@ -22,16 +22,16 @@ #include #include -class Handle_PrsMgr_PresentableObject; -class Handle_AIS_InteractiveContext; +class PrsMgr_PresentableObject; +class AIS_InteractiveContext; class HYDROGUI_ZLayersIterator { public: - HYDROGUI_ZLayersIterator( const Handle_V3d_Viewer& ); + HYDROGUI_ZLayersIterator( const Handle(V3d_Viewer)& ); ~HYDROGUI_ZLayersIterator(); - void Init( const Handle_V3d_Viewer& ); + void Init( const Handle(V3d_Viewer)& ); bool More() const; void Next(); int LayerId() const; @@ -41,13 +41,13 @@ private: std::vector myZLayers; int myIndex; int myNewZLayer; - Handle_V3d_Viewer myViewer; + Handle(V3d_Viewer) myViewer; }; -void SetPrsZLayer( const Handle_PrsMgr_PresentableObject& thePresentableObject, +void SetPrsZLayer( const Handle(PrsMgr_PresentableObject)& thePresentableObject, const int theMode, const int theLayerId ); -void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle_AIS_InteractiveContext&, int theLayer ); -void SetZLayerSettings( const Handle_V3d_Viewer&, int theLayerId, bool theIsOrdered ); -int CreateTopZLayer( const Handle_V3d_Viewer& ); +void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle(AIS_InteractiveContext)&, int theLayer ); +void SetZLayerSettings( const Handle(V3d_Viewer)&, int theLayerId, bool theIsOrdered ); +int CreateTopZLayer( const Handle(V3d_Viewer)& ); #endif diff --git a/src/HYDROGUI/HYDROGUI_ZLayers2.cxx b/src/HYDROGUI/HYDROGUI_ZLayers2.cxx index 76bd41b0..c3f54766 100644 --- a/src/HYDROGUI/HYDROGUI_ZLayers2.cxx +++ b/src/HYDROGUI/HYDROGUI_ZLayers2.cxx @@ -23,8 +23,9 @@ #include #include #include +#include -void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle_AIS_InteractiveContext& theContext, +void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle(AIS_InteractiveContext)& theContext, int theLayer ) { AIS_ListOfInteractive aDisplayedObjects; @@ -37,7 +38,12 @@ void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle_AIS_Int if( !aPrsObj.IsNull() && !aPrsObj->IsKind( STANDARD_TYPE(AIS_Trihedron) ) ) { int aMode = aPrsObj->HasHilightMode() ? aPrsObj->HilightMode() : 0; - theContext->MainPrsMgr()->Color( aPrsObj, Quantity_NOC_YELLOW, aMode ); +#if OCC_VERSION_LARGE < 0x07010000 + Quantity_NameOfColor aStyle = Quantity_NOC_YELLOW; +#else + Handle(Graphic3d_HighlightStyle) aStyle = new Graphic3d_HighlightStyle( Aspect_TOHM_COLOR, Quantity_NOC_YELLOW ); +#endif + theContext->MainPrsMgr()->Color( aPrsObj, aStyle, aMode ); SetPrsZLayer( aPrsObj, aMode, theLayer ); theContext->MainPrsMgr()->Unhighlight( aPrsObj, aMode ); } diff --git a/src/HYDROGUI/HYDROGUI_Zone.cxx b/src/HYDROGUI/HYDROGUI_Zone.cxx index 0d0ab6bc..6da859d9 100644 --- a/src/HYDROGUI/HYDROGUI_Zone.cxx +++ b/src/HYDROGUI/HYDROGUI_Zone.cxx @@ -65,8 +65,7 @@ QString HYDROGUI_Zone::getRefObjectNames() const HYDROData_SequenceOfObjects::Iterator anIter( aSeq ); for ( ; anIter.More(); anIter.Next() ) { - Handle(HYDROData_Entity) aRefGeomObj = - Handle(HYDROData_Entity)::DownCast( anIter.Value() ); + Handle(HYDROData_Entity) aRefGeomObj = anIter.Value(); if ( !aRefGeomObj.IsNull() ) { // Get Ref.Object name diff --git a/src/HYDROPy/CMakeLists.txt b/src/HYDROPy/CMakeLists.txt index 6eedb591..9ed9e053 100644 --- a/src/HYDROPy/CMakeLists.txt +++ b/src/HYDROPy/CMakeLists.txt @@ -1,5 +1,5 @@ include(../../CMake/Common.cmake) -include(UsePyQt4) +INCLUDE(UsePyQt) # additional include directories INCLUDE_DIRECTORIES( @@ -25,15 +25,9 @@ SET(_link_LIBRARIES HYDROData ) -# --- resources --- - -# sip files / to be processed by sip -SET(_sip_input_file - HYDROData.sip -) - SET(_add_SOURCES sipHYDROPycmodule.cc + sipHYDROPyNCollection_Sequence0600opencascadehandle0100HYDROData_Entity.cc sipHYDROPygp_XY.cc sipHYDROPygp_XYZ.cc sipHYDROPyHYDROData_AltitudeObject.cc @@ -72,7 +66,6 @@ SET(_add_SOURCES 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 @@ -85,13 +78,13 @@ SET(_add_SOURCES sipHYDROPyTCollection_AsciiString.cc ) +set_source_files_properties( ${_add_SOURCES} PROPERTIES GENERATED TRUE ) + # sources / sip wrappings -PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_input_file} SOURCES ${_add_SOURCES}) +PYQT_WRAP_SIP( _sip_SOURCES HYDROData.sip ) # sources / to compile -SET(HYDROPy_SOURCES ${_sip_SOURCES}) - -ADD_LIBRARY(HYDROPy ${HYDROPy_SOURCES}) +ADD_LIBRARY( HYDROPy ${_sip_SOURCES} ${_add_SOURCES} ) TARGET_LINK_LIBRARIES(HYDROPy ${_link_LIBRARIES}) INSTALL(TARGETS HYDROPy EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) diff --git a/src/HYDROPy/HYDROData_CalculationCase.sip b/src/HYDROPy/HYDROData_CalculationCase.sip index 5f7d254d..52c09e4f 100644 --- a/src/HYDROPy/HYDROData_CalculationCase.sip +++ b/src/HYDROPy/HYDROData_CalculationCase.sip @@ -87,7 +87,7 @@ public: /** * Add new one reference geometry object for calculation case. */ - bool AddGeometryObject( HYDROData_Object theObject ) [bool ( const Handle_HYDROData_Object& )]; + bool AddGeometryObject( HYDROData_Object theObject ) [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Object) aRef = Handle(HYDROData_Object)::DownCast( createHandle( a0 ) ); @@ -109,7 +109,7 @@ public: * Removes reference geometry object from calculation case. */ void RemoveGeometryObject( HYDROData_Object theObject ) - [void ( const Handle_HYDROData_Object& )]; + [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Object) aRef = Handle(HYDROData_Object)::DownCast( createHandle( a0 ) ); @@ -134,7 +134,7 @@ public: /** * Add new one reference geometry group for calculation case. */ - bool AddGeometryGroup( HYDROData_ShapesGroup theGroup ) [bool ( const Handle_HYDROData_ShapesGroup& )]; + bool AddGeometryGroup( HYDROData_ShapesGroup theGroup ) [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_ShapesGroup) aRef = Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) ); @@ -155,7 +155,7 @@ public: /** * Removes reference geometry group from calculation case. */ - void RemoveGeometryGroup( HYDROData_ShapesGroup theGroup ) [void ( const Handle_HYDROData_ShapesGroup& )]; + void RemoveGeometryGroup( HYDROData_ShapesGroup theGroup ) [void ( opencascade::handle& )]; %MethodCode Handle(HYDROData_ShapesGroup) aRef = Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) ); @@ -180,7 +180,7 @@ public: /** * Sets reference boundary polyline object for calculation case. */ - void SetBoundaryPolyline( HYDROData_PolylineXY thePolyline ) [void ( const Handle_HYDROData_PolylineXY& )]; + void SetBoundaryPolyline( HYDROData_PolylineXY thePolyline ) [void ( opencascade::handle& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); @@ -199,7 +199,7 @@ public: /** * Returns reference boundary polyline object of calculation case. */ - HYDROData_PolylineXY GetBoundaryPolyline() const [Handle_HYDROData_PolylineXY ()]; + HYDROData_PolylineXY GetBoundaryPolyline() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_PolylineXY) aRef; @@ -216,7 +216,7 @@ public: */ void RemoveBoundaryPolyline(); - void SetLandCoverMap( HYDROData_LandCoverMap theLandCoverMap ) [void ( const Handle_HYDROData_LandCoverMap& )]; + void SetLandCoverMap( HYDROData_LandCoverMap theLandCoverMap ) [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_LandCoverMap) aRef = Handle(HYDROData_LandCoverMap)::DownCast( createHandle( a0 ) ); @@ -232,7 +232,7 @@ public: } %End - void SetStricklerTable( HYDROData_StricklerTable theStricklerTable ) [void ( const Handle_HYDROData_StricklerTable& )]; + void SetStricklerTable( HYDROData_StricklerTable theStricklerTable ) [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_StricklerTable) aRef = Handle(HYDROData_StricklerTable)::DownCast( createHandle( a0 ) ); @@ -254,7 +254,7 @@ public: * The label of theZone is changed during this operation * because of new region becomes the new parent for this zone. */ - HYDROData_Region AddNewRegion( HYDROData_Zone theZone ) [Handle_HYDROData_Region ( const Handle_HYDROData_Zone& )]; + HYDROData_Region AddNewRegion( HYDROData_Zone theZone ) [opencascade::handle ( opencascade::handle& )]; %MethodCode Handle(HYDROData_Zone) aRef = Handle(HYDROData_Zone)::DownCast( createHandle( a0 ) ); @@ -275,7 +275,7 @@ public: * Add new one reference region for calculation case. * The label of theRegion is changed in case if old parent is not this calculation. */ - bool AddRegion( HYDROData_Region theRegion ) [bool ( const Handle_HYDROData_Region& )]; + bool AddRegion( HYDROData_Region theRegion ) [bool ( opencascade::handle& )]; %MethodCode Handle(HYDROData_Region) aRef = Handle(HYDROData_Region)::DownCast( createHandle( a0 ) ); @@ -301,7 +301,7 @@ public: /** * Removes reference region from calculation case. */ - void RemoveRegion( HYDROData_Region theRegion ) [void ( const Handle_HYDROData_Region& )]; + void RemoveRegion( HYDROData_Region theRegion ) [void ( opencascade::handle& )]; %MethodCode Handle(HYDROData_Region) aRef = Handle(HYDROData_Region)::DownCast( createHandle( a0 ) ); @@ -389,7 +389,7 @@ public: double GetAltitudeForPoint( const double theCoordX, const double theCoordY, HYDROData_Region theRegion ) const - [double ( const gp_XY&, const Handle_HYDROData_Region& )]; + [double ( const gp_XY&, opencascade::handle& )]; %MethodCode gp_XY aPnt( a0, a1 ); Handle(HYDROData_Region) aRefRegion = @@ -410,7 +410,7 @@ public: double GetAltitudeForPoint( const double theCoordX, const double theCoordY, HYDROData_Zone theZone ) const - [double ( const gp_XY&, const Handle_HYDROData_Zone& )]; + [double ( const gp_XY&, opencascade::handle& )]; %MethodCode gp_XY aPnt( a0, a1 ); Handle(HYDROData_Zone) aRefZone = @@ -432,7 +432,7 @@ public: const NCollection_Sequence& theCoordsY, HYDROData_Region theRegion, int theMethod = 0) const - [NCollection_Sequence ( const NCollection_Sequence&, const Handle_HYDROData_Region&, int)]; + [NCollection_Sequence ( const NCollection_Sequence&, opencascade::handle&, int)]; %MethodCode NCollection_Sequence aPnts; @@ -509,7 +509,7 @@ public: const NCollection_Sequence& theCoordsY, HYDROData_Zone theZone, int theMethod = 0) const - [NCollection_Sequence ( const NCollection_Sequence&, const Handle_HYDROData_Zone&, int )]; + [NCollection_Sequence ( const NCollection_Sequence&, opencascade::handle&, int )]; %MethodCode NCollection_Sequence aPnts; @@ -541,7 +541,7 @@ public: */ HYDROData_Region GetRegionFromPoint( const double theCoordX, const double theCoordY ) const - [Handle_HYDROData_Region ( const gp_XY& )]; + [opencascade::handle ( const gp_XY& )]; %MethodCode Handle(HYDROData_Region) aRes; @@ -562,7 +562,7 @@ public: */ HYDROData_Zone GetZoneFromPoint( const double theCoordX, const double theCoordY ) const - [Handle_HYDROData_Zone ( const gp_XY& )]; + [opencascade::handle ( const gp_XY& )]; %MethodCode Handle(HYDROData_Zone) aRes; @@ -585,7 +585,7 @@ public: PointClassification GetPointClassification( const double theCoordX, const double theCoordY, HYDROData_Zone theZone ) const - [PointClassification ( const gp_XY&, const Handle_HYDROData_Zone& )]; + [PointClassification ( const gp_XY&, opencascade::handle& )]; %MethodCode gp_XY aPnt( a0, a1 ); @@ -606,12 +606,10 @@ public: HYDROData_Entity theObject2, HYDROData_Zone::MergeType theMergeType, HYDROData_CalculationCase::DataTag theDataTag ) - [void ( const Handle_HYDROData_Entity&, HYDROData_PriorityType, const Handle_HYDROData_Entity&, HYDROData_Zone::MergeType, HYDROData_CalculationCase::DataTag )]; + [void ( const opencascade::handle&, HYDROData_PriorityType, opencascade::handle&, HYDROData_Zone::MergeType, HYDROData_CalculationCase::DataTag )]; %MethodCode - Handle(HYDROData_Entity) anObject1 = - Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) ); - Handle(HYDROData_Entity) anObject2 = - Handle(HYDROData_Entity)::DownCast( createHandle( a2 ) ); + Handle(HYDROData_Entity) anObject1 = createHandle( a0 ); + Handle(HYDROData_Entity) anObject2 = createHandle( a2 ); Py_BEGIN_ALLOW_THREADS sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::AddRule( anObject1, a1, anObject2, a3, a4 ) : diff --git a/src/HYDROPy/HYDROData_Channel.sip b/src/HYDROPy/HYDROData_Channel.sip index 1ff170ac..f1ef457a 100644 --- a/src/HYDROPy/HYDROData_Channel.sip +++ b/src/HYDROPy/HYDROData_Channel.sip @@ -63,7 +63,7 @@ public: * Sets reference guide line object for channel. */ bool SetGuideLine( HYDROData_Polyline3D theGuideLine ) - [bool ( const Handle_HYDROData_Polyline3D& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Polyline3D) aRef = Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) ); @@ -80,7 +80,7 @@ public: * Returns reference guide line object of channel. */ HYDROData_Polyline3D GetGuideLine() const - [Handle_HYDROData_Polyline3D ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_Polyline3D) aRef; @@ -102,7 +102,7 @@ public: * Sets reference profile object for channel. */ bool SetProfile( HYDROData_Profile theProfile ) - [bool ( const Handle_HYDROData_Profile& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Profile) aRef = Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) ); @@ -119,7 +119,7 @@ public: * Returns reference profile object of channel. */ HYDROData_Profile GetProfile() const - [Handle_HYDROData_Profile ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_Profile) aRef; diff --git a/src/HYDROPy/HYDROData_Document.sip b/src/HYDROPy/HYDROData_Document.sip index 4ebd3353..882fe167 100644 --- a/src/HYDROPy/HYDROData_Document.sip +++ b/src/HYDROPy/HYDROData_Document.sip @@ -42,7 +42,8 @@ class HYDROData_Document %End %ConvertToSubClassCode - if ( !Handle(HYDROData_Document)::DownCast( sipCpp ).IsNull() ) + HYDROData_Document* aDoc = dynamic_cast< HYDROData_Document*>( sipCpp ); + if ( aDoc ) sipClass = sipClass_HYDROData_Document; else sipClass = NULL; @@ -199,7 +200,7 @@ class HYDROData_Document public: //! Returns the existing document or creates new if it is not exist - static HYDROData_Document Document( const int theStudyID ) [Handle_HYDROData_Document (const int)] ; + static HYDROData_Document Document( const int theStudyID ) [opencascade::handle (const int)] ; %MethodCode Handle(HYDROData_Document) aDocument; @@ -273,7 +274,7 @@ public: //! Creates and locates in the document a new object //! \param theKind kind of the created object, can not be UNKNOWN //! \returns the created object - HYDROData_Entity CreateObject( const ObjectKind theKind ) [Handle_HYDROData_Entity (const ObjectKind)] ; + HYDROData_Entity CreateObject( const ObjectKind theKind ) [opencascade::handle (const ObjectKind)] ; %MethodCode Handle(HYDROData_Entity) anObject; @@ -288,7 +289,7 @@ public: HYDROData_Entity FindObjectByName( const QString& theName, const ObjectKind theKind = KIND_UNKNOWN ) - [Handle_HYDROData_Entity (const QString&, const ObjectKind)] ; + [opencascade::handle (const QString&, const ObjectKind)] ; %MethodCode Handle(HYDROData_Entity) anObject; diff --git a/src/HYDROPy/HYDROData_Entity.sip b/src/HYDROPy/HYDROData_Entity.sip index 4eae394f..c9b67667 100644 --- a/src/HYDROPy/HYDROData_Entity.sip +++ b/src/HYDROPy/HYDROData_Entity.sip @@ -222,7 +222,7 @@ public: * Returns father object. For object created under root document label * this method always return NULL object. */ - HYDROData_Entity GetFatherObject() const [Handle_HYDROData_Entity ()]; + HYDROData_Entity GetFatherObject() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_Entity) aFather; @@ -244,7 +244,7 @@ public: /** * Returns the z-level for object presentation, -1 if no z-level. */ - virtual bool GetZLevel( int& theLevel ) const [Standard_Boolean ( Standard_Integer& )]; + virtual bool GetZLevel( int& theLevel ) const [bool ( Standard_Integer& )]; /** * Set the z-level for object presentation. diff --git a/src/HYDROPy/HYDROData_IInterpolator.sip b/src/HYDROPy/HYDROData_IInterpolator.sip index 1b5dfe44..23ed1ad9 100644 --- a/src/HYDROPy/HYDROData_IInterpolator.sip +++ b/src/HYDROPy/HYDROData_IInterpolator.sip @@ -56,7 +56,7 @@ public: * Sets the altitude object for interpolation. */ void SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) - [void ( const Handle_HYDROData_IAltitudeObject& )]; + [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_IAltitudeObject) anAltitude = Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) ); @@ -74,7 +74,7 @@ public: /** * Returns the altitude object for interpolation. */ - HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()]; + HYDROData_IAltitudeObject GetAltitudeObject() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_IAltitudeObject) aRes; diff --git a/src/HYDROPy/HYDROData_Image.sip b/src/HYDROPy/HYDROData_Image.sip index 00e70250..64935d93 100644 --- a/src/HYDROPy/HYDROData_Image.sip +++ b/src/HYDROPy/HYDROData_Image.sip @@ -196,7 +196,7 @@ public: const QPointF& thePointB, const QPointF& thePointC = QPoint( INT_MIN, INT_MIN ), const bool theIsUpdate = true ) - [void ( const Handle_HYDROData_Image&, const QPointF&, const QPointF&, const QPointF&, const bool )]; + [void ( const opencascade::handle&, const QPointF&, const QPointF&, const QPointF&, const bool )]; %MethodCode Handle(HYDROData_Image) aRefImage = Handle(HYDROData_Image)::DownCast( createHandle( a0 ) ); @@ -221,7 +221,7 @@ public: QPointF& thePointA /Out/, QPointF& thePointB /Out/, QPointF& thePointC /Out/ ) const - [bool ( const Handle_HYDROData_Image&, QPointF&, QPointF&, QPointF& )]; + [bool ( const opencascade::handle&, QPointF&, QPointF&, QPointF& )]; %MethodCode Handle(HYDROData_Image) aRefImage = Handle(HYDROData_Image)::DownCast( createHandle( a0 ) ); @@ -239,12 +239,11 @@ public: */ bool HasReferencePoints() const; - /** * Stores the reference image for transformation * \param theRefImage reference image */ - void SetTrsfReferenceImage( HYDROData_Image theRefImage ) [void ( const Handle_HYDROData_Image& )]; + void SetTrsfReferenceImage( HYDROData_Image theRefImage ) [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Image) aRefImage = Handle(HYDROData_Image)::DownCast( createHandle( a0 ) ); @@ -260,7 +259,7 @@ public: /** * Returns the reference image for transformation */ - HYDROData_Image GetTrsfReferenceImage() const [Handle_HYDROData_Image ()]; + HYDROData_Image GetTrsfReferenceImage() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_Image) aRefImage; @@ -299,7 +298,7 @@ public: * Appends reference to other object (image or polyline). * \param theReferenced the object referenced by this */ - void AppendReference( HYDROData_Entity theReferenced ) [void ( const Handle_HYDROData_Entity& )]; + void AppendReference( HYDROData_Entity theReferenced ) [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Entity) aRef = createHandle( a0 ); if ( !aRef.IsNull() ) @@ -316,7 +315,7 @@ public: * \param theIndex number of reference [0; NbReference) * \returns the referenced object, or Null if index is invalid */ - HYDROData_Entity Reference( const int theIndex ) const [Handle_HYDROData_Entity ()]; + HYDROData_Entity Reference( const int theIndex ) const [opencascade::handle ()]; %MethodCode Handle(HYDROData_Entity) aRef; @@ -335,7 +334,7 @@ public: * \param theReferenced the object referenced by this */ void ChangeReference( const int theIndex, HYDROData_Entity theReferenced ) - [void ( const int, const Handle_HYDROData_Entity& )]; + [void ( const int, const opencascade::handle& )]; %MethodCode Handle(HYDROData_Entity) aRef = createHandle( a1 ); if ( !aRef.IsNull() ) diff --git a/src/HYDROPy/HYDROData_ImmersibleZone.sip b/src/HYDROPy/HYDROData_ImmersibleZone.sip index bd9ecd7a..3f5f6116 100644 --- a/src/HYDROPy/HYDROData_ImmersibleZone.sip +++ b/src/HYDROPy/HYDROData_ImmersibleZone.sip @@ -45,7 +45,7 @@ public: /** * Sets reference polyline object for zone. */ - void SetPolyline( HYDROData_PolylineXY thePolyline ) [void (const Handle_HYDROData_PolylineXY&)]; + void SetPolyline( HYDROData_PolylineXY thePolyline ) [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_PolylineXY) aRefPolyline = @@ -63,7 +63,7 @@ public: /** * Returns reference polyline object of zone. */ - HYDROData_PolylineXY GetPolyline() const [Handle_HYDROData_PolylineXY ()]; + HYDROData_PolylineXY GetPolyline() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_PolylineXY) aRefPolyline; diff --git a/src/HYDROPy/HYDROData_LandCoverMap.sip b/src/HYDROPy/HYDROData_LandCoverMap.sip index b20417de..7f9d1542 100644 --- a/src/HYDROPy/HYDROData_LandCoverMap.sip +++ b/src/HYDROPy/HYDROData_LandCoverMap.sip @@ -68,7 +68,7 @@ public: bool ExportTelemac( const QString& theFileName, double theDeflection, HYDROData_StricklerTable theTable ) const - [bool( const QString&, double, const Handle_HYDROData_StricklerTable& )]; + [bool( const QString&, double, const opencascade::handle& )]; %MethodCode Handle(HYDROData_StricklerTable) aRef = Handle(HYDROData_StricklerTable)::DownCast( createHandle( a2 ) ); @@ -83,7 +83,7 @@ public: %End bool Add( HYDROData_Object theObject, const QString& theType ) - [bool ( const Handle_HYDROData_Object&, const QString& )]; + [bool ( const opencascade::handle&, const QString& )]; %MethodCode Handle(HYDROData_Object) aRef = Handle(HYDROData_Object)::DownCast( createHandle( a0 ) ); @@ -97,7 +97,7 @@ public: %End bool Add( HYDROData_PolylineXY thePolyline, const QString& theType ) - [bool ( const Handle_HYDROData_PolylineXY&, const QString& )]; + [bool ( const opencascade::handle&, const QString& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); @@ -111,7 +111,7 @@ public: %End bool Split( HYDROData_PolylineXY thePolyline ) - [bool ( const Handle_HYDROData_PolylineXY& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); diff --git a/src/HYDROPy/HYDROData_Object.sip b/src/HYDROPy/HYDROData_Object.sip index 5e18bd21..9b0fd58e 100644 --- a/src/HYDROPy/HYDROData_Object.sip +++ b/src/HYDROPy/HYDROData_Object.sip @@ -77,7 +77,7 @@ public: /** * Set reference altitude object for geometry object. */ - bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)]; + bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_IAltitudeObject) aRefAltitude = @@ -95,7 +95,7 @@ public: /** * Returns reference altitude object of geometry object. */ - HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()]; + HYDROData_IAltitudeObject GetAltitudeObject() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_IAltitudeObject) aRefAltitude; @@ -143,7 +143,7 @@ public: /** * Returns group data model object by it id. */ - HYDROData_ShapesGroup GetGroup( const int theGroupId ) const [Handle_HYDROData_ShapesGroup ()]; + HYDROData_ShapesGroup GetGroup( const int theGroupId ) const [opencascade::handle ()]; %MethodCode Handle(HYDROData_ShapesGroup) aRefGroup; @@ -160,7 +160,7 @@ public: /** * Returns group id by data model object. */ - int GetGroupId( HYDROData_ShapesGroup theGroup ) const [int (const Handle_HYDROData_ShapesGroup&)]; + int GetGroupId( HYDROData_ShapesGroup theGroup ) const [int (const opencascade::handle&)]; %MethodCode Handle(HYDROData_ShapesGroup) aRefGroup = diff --git a/src/HYDROPy/HYDROData_Polyline3D.sip b/src/HYDROPy/HYDROData_Polyline3D.sip index 58de3fd6..9e293a03 100644 --- a/src/HYDROPy/HYDROData_Polyline3D.sip +++ b/src/HYDROPy/HYDROData_Polyline3D.sip @@ -46,7 +46,7 @@ public: */ bool SetPolylineXY( HYDROData_PolylineXY thePolyline, const bool theIsUpdateProfile = true ) - [bool ( const Handle_HYDROData_PolylineXY&, + [bool ( const opencascade::handle&, const bool = true )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = @@ -64,7 +64,7 @@ public: * Returns reference x,y polyline object of 3D polyline. */ HYDROData_PolylineXY GetPolylineXY() const - [Handle_HYDROData_PolylineXY ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_PolylineXY) aRef; @@ -86,7 +86,7 @@ public: * Sets reference u,z profile object for 3D polyline. */ bool SetProfileUZ( HYDROData_ProfileUZ theProfile ) - [bool ( const Handle_HYDROData_ProfileUZ& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_ProfileUZ) aRef = Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) ); @@ -103,7 +103,7 @@ public: * Returns reference u,z profile object of 3D polyline. */ HYDROData_ProfileUZ GetProfileUZ() const - [Handle_HYDROData_ProfileUZ ()]; + [Hopencascade::handle ()]; %MethodCode Handle(HYDROData_ProfileUZ) aRef; @@ -126,7 +126,7 @@ public: * Reimplemented to remove reference u,z profile. */ bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) - [bool ( const Handle_HYDROData_IAltitudeObject& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_IAltitudeObject) aRef = Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) ); @@ -150,7 +150,7 @@ public: * Returns the child u,z profile which has been generated from bathymetry. */ HYDROData_ProfileUZ GetChildProfileUZ( const bool theIsCreate = true ) const - [Handle_HYDROData_ProfileUZ ( const bool = true )]; + [opencascade::handle ( const bool = true )]; %MethodCode Handle(HYDROData_ProfileUZ) aRef; @@ -166,7 +166,7 @@ public: /** * Sets the child u,z profile for polyline. */ - void SetChildProfileUZ( HYDROData_ProfileUZ theProfile ) [void ( const Handle_HYDROData_ProfileUZ& )]; + void SetChildProfileUZ( HYDROData_ProfileUZ theProfile ) [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_ProfileUZ) aRef = Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) ); diff --git a/src/HYDROPy/HYDROData_Profile.sip b/src/HYDROPy/HYDROData_Profile.sip index 601be203..e67faaea 100644 --- a/src/HYDROPy/HYDROData_Profile.sip +++ b/src/HYDROPy/HYDROData_Profile.sip @@ -93,7 +93,7 @@ public: * \return profile U,Z */ HYDROData_ProfileUZ GetProfileUZ( const bool theIsCreate = true ) const - [Handle_HYDROData_ProfileUZ ( const bool theIsCreate = true )]; + [opencascade::handle ( const bool theIsCreate = true )]; %MethodCode Handle(HYDROData_ProfileUZ) aRefProfileUZ; @@ -173,8 +173,8 @@ public: static int ImportFromFile( HYDROData_Document theDoc, const TCollection_AsciiString& theFileName, NCollection_Sequence& theBadProfilesIds, - bool isToProject = true ) - [int ( const Handle_HYDROData_Document&, + bool isToProject = true ) + [int ( const opencascade::handle&, const TCollection_AsciiString&, NCollection_Sequence& )]; %MethodCode diff --git a/src/HYDROPy/HYDROData_Region.sip b/src/HYDROPy/HYDROData_Region.sip index f3af2f81..5917f614 100644 --- a/src/HYDROPy/HYDROData_Region.sip +++ b/src/HYDROPy/HYDROData_Region.sip @@ -45,7 +45,7 @@ public: /** * Add new one reference zone for region. */ - void AddZone( HYDROData_Zone theZone ) [void (const Handle_HYDROData_Zone&)]; + void AddZone( HYDROData_Zone theZone ) [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_Zone) aZone = @@ -68,7 +68,7 @@ public: /** * Removes reference zone from region. */ - void RemoveZone( HYDROData_Zone theZone ) [void (const Handle_HYDROData_Zone&)]; + void RemoveZone( HYDROData_Zone theZone ) [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_Zone) aZone = diff --git a/src/HYDROPy/HYDROData_SequenceOfObjects.sip b/src/HYDROPy/HYDROData_SequenceOfObjects.sip index 141a5279..e1832150 100644 --- a/src/HYDROPy/HYDROData_SequenceOfObjects.sip +++ b/src/HYDROPy/HYDROData_SequenceOfObjects.sip @@ -20,7 +20,7 @@ #include %End -%MappedType NCollection_Sequence +%MappedType NCollection_Sequence> { %TypeHeaderCode #include @@ -44,7 +44,7 @@ { Py_DECREF(l); { - Handle_HYDROData_Entity anEnt( aPntr ); + Handle(HYDROData_Entity) anEnt( aPntr ); } return NULL; @@ -79,8 +79,8 @@ return 1; } - NCollection_Sequence *aSeq = - new NCollection_Sequence; + NCollection_Sequence *aSeq = + new NCollection_Sequence; len = PySequence_Size(sipPy); for (SIP_SSIZE_T i = 0; i < len; ++i) @@ -100,7 +100,7 @@ return 0; } - Handle_HYDROData_Entity anEnt( t ); + Handle(HYDROData_Entity) anEnt( t ); aSeq->Append( anEnt ); //sipReleaseType(t, sipType_HYDROData_Entity, state); @@ -112,4 +112,4 @@ %End }; -typedef NCollection_Sequence HYDROData_SequenceOfObjects; +typedef NCollection_Sequence> HYDROData_SequenceOfObjects; diff --git a/src/HYDROPy/HYDROData_Stream.sip b/src/HYDROPy/HYDROData_Stream.sip index f6890ad3..cb233c5c 100644 --- a/src/HYDROPy/HYDROData_Stream.sip +++ b/src/HYDROPy/HYDROData_Stream.sip @@ -60,7 +60,7 @@ public: * Sets reference hydraulic axis object for stream. */ bool SetHydraulicAxis( HYDROData_PolylineXY theAxis ) - [bool ( const Handle_HYDROData_PolylineXY& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); @@ -77,7 +77,7 @@ public: * Returns reference hydraulic axis object of stream. */ HYDROData_PolylineXY GetHydraulicAxis() const - [Handle_HYDROData_PolylineXY ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_PolylineXY) aRef; @@ -98,7 +98,7 @@ public: * Add new one reference profile object for stream. */ bool AddProfile( HYDROData_Profile theProfile ) - [bool ( const Handle_HYDROData_Profile& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Profile) aRef = Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) ); @@ -120,7 +120,7 @@ public: * Removes reference profile object from stream. */ bool RemoveProfile( HYDROData_Profile theProfile ) - [bool ( const Handle_HYDROData_Profile& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Profile) aRef = Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) ); @@ -147,7 +147,7 @@ public: * Returns reference bottom polyline object of stream. */ HYDROData_Polyline3D GetBottomPolyline() const - [Handle_HYDROData_Polyline3D ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_Polyline3D) aRef; @@ -163,7 +163,7 @@ public: * Sets reference bottom polyline object for stream. */ bool SetBottomPolyline( HYDROData_Polyline3D theBottom ) - [bool ( const Handle_HYDROData_Polyline3D& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Polyline3D) aRef = Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) ); diff --git a/src/HYDROPy/HYDROData_Zone.sip b/src/HYDROPy/HYDROData_Zone.sip index 070354cd..ff034d86 100644 --- a/src/HYDROPy/HYDROData_Zone.sip +++ b/src/HYDROPy/HYDROData_Zone.sip @@ -56,7 +56,7 @@ public: MergeType GetMergeType() const; void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude ) - [void (const Handle_HYDROData_IAltitudeObject&)]; + [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_IAltitudeObject) aRefAltitude = Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) ); @@ -69,7 +69,7 @@ public: } %End - HYDROData_IAltitudeObject GetMergeAltitude() const [Handle_HYDROData_IAltitudeObject ()]; + HYDROData_IAltitudeObject GetMergeAltitude() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_IAltitudeObject) aRefAltitude; Py_BEGIN_ALLOW_THREADS @@ -88,10 +88,9 @@ public: Py_END_ALLOW_THREADS %End - void SetMergeObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)]; + void SetMergeObject( HYDROData_Entity theObject ) [void (const opencascade::handle&)]; %MethodCode - Handle(HYDROData_Entity) aRefObject = - Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) ); + Handle(HYDROData_Entity) aRefObject = createHandle( a0 ); if ( !aRefObject.IsNull() ) { Py_BEGIN_ALLOW_THREADS @@ -101,7 +100,7 @@ public: } %End - HYDROData_Entity GetMergeObject() const [Handle_HYDROData_Entity ()]; + HYDROData_Entity GetMergeObject() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_Entity) aRefObject; Py_BEGIN_ALLOW_THREADS @@ -113,11 +112,10 @@ public: void RemoveMergeObject(); - void AddObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)]; + void AddObject( HYDROData_Entity theObject ) [void (const opencascade::handle&)]; %MethodCode - Handle(HYDROData_Entity) anObj = - Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) ); + Handle(HYDROData_Entity) anObj = createHandle( a0 ); if ( !anObj.IsNull() ) { Py_BEGIN_ALLOW_THREADS diff --git a/src/HYDROTools/controls.py b/src/HYDROTools/controls.py index a75fdc99..13197b5f 100644 --- a/src/HYDROTools/controls.py +++ b/src/HYDROTools/controls.py @@ -79,7 +79,8 @@ def controlStatZ(statz,refstatz): print "value: ", vals, " reference: ", valsref raise ValueError("z interpolation error") -from MEDLoader import MEDLoader, MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh +import MEDLoader +from MEDLoader import MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh import os, time def controlTelemacResult(aMedFile, refs): diff --git a/src/HYDROTools/interpolZ.py b/src/HYDROTools/interpolZ.py index 93daf47b..0321ca9d 100644 --- a/src/HYDROTools/interpolZ.py +++ b/src/HYDROTools/interpolZ.py @@ -109,7 +109,8 @@ def createZfield1(fichierMaillage): # ----------------------------------------------------------------------------- -from MEDLoader import MEDLoader, MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh +import MEDLoader +from MEDLoader import MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh def createZfield2(fichierMaillage): """ diff --git a/src/HYDRO_tests/Basics_OCCTVersion.hxx b/src/HYDRO_tests/Basics_OCCTVersion.hxx deleted file mode 100644 index 2f9b4942..00000000 --- a/src/HYDRO_tests/Basics_OCCTVersion.hxx +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// - -// File : Basics_OCCTVersion.hxx -// Author : Julia DOROVSKIKH, Open CASCADE S.A.S (julia.dorovskikh@opencascade.com) - -#ifndef BASICS_OCCTVERSION_HXX -#define BASICS_OCCTVERSION_HXX - -#include - -// -// NOTE: Since version 6.7.0 OCC_VERSION_DEVELOPMENT macro in the Standard_Version.hxx -// points to the development status of the OCCT version: for example "dev", "alpha", -// "beta", "rc1", etc. -// OCC_VERSION_MAJOR, OCC_VERSION_MINOR and OCC_VERSION_MAINTENANCE macros -// specify actual (final) version number; for development version it is a future -// target version number (i.e. version number is incremented immediately after -// releasing of the stable version). -// - -#ifdef OCC_VERSION_SERVICEPACK -# define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) -#else -# ifdef OCC_VERSION_DEVELOPMENT -# define OCC_VERSION_LARGE ((OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)-1) -# else -# define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) -# endif -#endif - -#endif // BASICS_OCCTVERSION_HXX diff --git a/src/HYDRO_tests/CMakeLists.txt b/src/HYDRO_tests/CMakeLists.txt index 7ee64231..75c0c61f 100644 --- a/src/HYDRO_tests/CMakeLists.txt +++ b/src/HYDRO_tests/CMakeLists.txt @@ -67,7 +67,7 @@ ENDIF() SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT}/include ) SET( CAS_INCLUDES $ENV{CASROOT}/inc ) -SET( QT_INCLUDES $ENV{QTDIR}/include $ENV{QTDIR}/include/QtCore $ENV{QTDIR}/include/QtGui $ENV{QTDIR}/include/QtTest ) +SET( QT_INCLUDES $ENV{QT5_ROOT_DIR}/include $ENV{QT5_ROOT_DIR}/include/QtCore $ENV{QT5_ROOT_DIR}/include/QtGui $ENV{QT5_ROOT_DIR}/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 ) @@ -75,11 +75,11 @@ SET( GEOM_INCLUDES $ENV{GEOM_ROOT_DIR}/include/salome ) IF( ${WIN32} ) link_directories( $ENV{CASROOT}/win32/libd ) ELSE() - link_directories( $ENV{CASROOT}/lib ) + link_directories( $ENV{CASROOT}/lib $ENV{TBB_ROOT_DIR}/lib/intel64/gcc4.4 ) 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{QTDIR}/lib ) +link_directories( $ENV{QT5_ROOT_DIR}/lib ) IF( ${WIN32} ) SET( QT_LIBRARIES QtCored4 QtGuid4 QtTestd4 ) ELSE() diff --git a/src/HYDRO_tests/ExternalFiles.cmake b/src/HYDRO_tests/ExternalFiles.cmake index 004295c1..b093912a 100644 --- a/src/HYDRO_tests/ExternalFiles.cmake +++ b/src/HYDRO_tests/ExternalFiles.cmake @@ -1,5 +1,6 @@ -find_package(Qt4 4.8.4 REQUIRED QtCore QtGui ) +find_package( Qt5Core ) +find_package( Qt5Widgets ) set( EXTERNAL_FILES ../HYDROData/HYDROData_AltitudeObject.cxx @@ -86,4 +87,4 @@ set( MOC_HEADERS ../HYDROGUI/HYDROGUI_OrderedListWidget.h ) -QT4_WRAP_CPP( PROJECT_MOC_HEADERS ${MOC_HEADERS} ) +QT_WRAP_MOC( PROJECT_MOC_HEADERS ${MOC_HEADERS} ) diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index ab5e7744..5ef6d2d9 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -34,9 +34,8 @@ #ifdef WIN32 #pragma warning ( disable: 4251 ) #endif -#include #include -#include +#include #include #include #include @@ -308,22 +307,16 @@ bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, cons return false; } -Handle_Aspect_ColorScale TestViewer::colorScale() +Handle(AIS_ColorScale) TestViewer::colorScale() { - Handle(V3d_View) aView = myViewWindow->getViewPort()->getView(); - if( aView.IsNull() ) - return Handle(Aspect_ColorScale)(); - else - return aView->ColorScale(); + static Handle(AIS_ColorScale) aColorScale = new AIS_ColorScale(); + + return aColorScale; } void TestViewer::showColorScale( bool isShow ) { - Handle(V3d_View) aView = myViewWindow->getViewPort()->getView(); - if( aView.IsNull() ) - return; - - Handle(Aspect_ColorScale) aColorScale = colorScale(); + Handle(AIS_ColorScale) aColorScale = colorScale(); if( aColorScale.IsNull() ) return; @@ -344,24 +337,23 @@ void TestViewer::showColorScale( bool isShow ) aColorScale->SetTitle( "test" ); aColorScale->SetRange( 0, 1 ); + aColorScale->SetToUpdate(); + if( isShow ) { - if( !aView->ColorScaleIsDisplayed() ) - aView->ColorScaleDisplay(); + if( !context()->IsDisplayed( aColorScale ) ) + context()->Display( aColorScale ); } else { - if( aView->ColorScaleIsDisplayed() ) - aView->ColorScaleErase(); + if( context()->IsDisplayed( aColorScale ) ) + context()->Erase( aColorScale ); } } bool TestViewer::ColorScaleIsDisplayed() { - Handle(V3d_View) aView = myViewWindow->getViewPort()->getView(); - if( aView.IsNull() ) - return false; - return aView->ColorScaleIsDisplayed(); + return context()->IsDisplayed( colorScale() ); } void TestViewer::select( int theViewX, int theViewY ) diff --git a/src/HYDRO_tests/TestViewer.h b/src/HYDRO_tests/TestViewer.h index fd470bbd..90aac840 100644 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@ -18,6 +18,8 @@ #pragma once +#include + class OCCViewer_ViewManager; class OCCViewer_Viewer; class OCCViewer_ViewWindow; @@ -25,9 +27,8 @@ class TopoDS_Shape; class QString; class QColor; class QImage; -class Handle_AIS_InteractiveContext; -class Handle_AIS_InteractiveObject; -class Handle_Aspect_ColorScale; +class AIS_InteractiveObject; +class AIS_ColorScale; class TestViewer { @@ -35,10 +36,10 @@ public: static OCCViewer_ViewManager* viewManager(); static OCCViewer_Viewer* viewer(); static OCCViewer_ViewWindow* viewWindow(); - static Handle_AIS_InteractiveContext context(); + static Handle(AIS_InteractiveContext) context(); static void eraseAll( bool isUpdate ); - static void show( const Handle_AIS_InteractiveObject& theObject, + static void show( const Handle(AIS_InteractiveObject)& theObject, int theMode, int theSelectionMode, bool isFitAll, const char* theKey ); static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor, int theUIANb = 10, int theVIANb = 10); @@ -47,7 +48,7 @@ public: static bool AssertImages( QString& theMessage, const QImage* = 0, const char* theCase = 0 ); static QColor GetColor(int i); - static Handle_Aspect_ColorScale colorScale(); + static Handle(AIS_ColorScale) colorScale(); static void showColorScale( bool ); static bool ColorScaleIsDisplayed(); diff --git a/src/HYDRO_tests/test_HYDROData_Bathymetry.h b/src/HYDRO_tests/test_HYDROData_Bathymetry.h index 421933c0..27bed5c6 100644 --- a/src/HYDRO_tests/test_HYDROData_Bathymetry.h +++ b/src/HYDRO_tests/test_HYDROData_Bathymetry.h @@ -18,7 +18,6 @@ #include -class Handle_HYDROData_Bathymetry; class QString; class test_HYDROData_Bathymetry : public CppUnit::TestFixture { diff --git a/src/HYDRO_tests/test_HYDROData_CalcCase.cxx b/src/HYDRO_tests/test_HYDROData_CalcCase.cxx index 1350b9aa..1d4b877c 100644 --- a/src/HYDRO_tests/test_HYDROData_CalcCase.cxx +++ b/src/HYDRO_tests/test_HYDROData_CalcCase.cxx @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/src/HYDRO_tests/test_HYDROData_DTM.cxx b/src/HYDRO_tests/test_HYDROData_DTM.cxx index 136b8e5a..74bf64ba 100644 --- a/src/HYDRO_tests/test_HYDROData_DTM.cxx +++ b/src/HYDRO_tests/test_HYDROData_DTM.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -201,7 +201,7 @@ void test_HYDROData_DTM::test_hydraulic_axis() profiles.push_back( aProfile2 ); profiles.push_back( aProfile3 ); - Handle_Geom2d_BSplineCurve HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances ); + Handle(Geom2d_BSplineCurve) HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances ); CPPUNIT_ASSERT_EQUAL( false, (bool)HA.IsNull() ); CPPUNIT_ASSERT_EQUAL( 3, (int)distances.size() ); @@ -245,8 +245,8 @@ void test_HYDROData_DTM::test_profile_conversion_to_2d() aUMin2 = aUMin1, aUMax2 = aUMax1; gp_Vec2d aProfileDir; - std::vector curves1 = HYDROData_DTM::ProfileToParametric( aProfile1, aUMin1, aUMax1, aProfileDir ); - std::vector curves2 = HYDROData_DTM::ProfileToParametric( aProfile2, aUMin2, aUMax2, aProfileDir ); + std::vector curves1 = HYDROData_DTM::ProfileToParametric( aProfile1, aUMin1, aUMax1, aProfileDir ); + std::vector curves2 = HYDROData_DTM::ProfileToParametric( aProfile2, aUMin2, aUMax2, aProfileDir ); gp_Pnt2d aFirst, aLast; CPPUNIT_ASSERT_EQUAL( 3, (int)curves1.size() ); @@ -497,7 +497,7 @@ void test_HYDROData_DTM::test_curve_to_3d() profiles.push_back( aProfile1 ); profiles.push_back( aProfile2 ); - Handle_Geom2d_BSplineCurve HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances ); + Handle(Geom2d_BSplineCurve) HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances ); HYDROData_DTM::AltitudePoints points; HYDROData_DTM::CurveUZ mid( 5.0, gp_Vec2d(-10,10), 0 ); mid.push_back( HYDROData_DTM::PointUZ( 0, 5 ) ); @@ -550,13 +550,13 @@ void test_HYDROData_DTM::test_presentation() CPPUNIT_ASSERT_EQUAL( 9177, (int)DTM->GetAltitudePoints().size() ); - Handle_AIS_InteractiveContext aContext = TestViewer::context(); + Handle(AIS_InteractiveContext) aContext = TestViewer::context(); HYDROGUI_ShapeBathymetry* aBathPrs = new HYDROGUI_ShapeBathymetry( 0, aContext, DTM ); aBathPrs->update( true, false ); bool ColorScaleIsDisp = TestViewer::ColorScaleIsDisplayed(); TestViewer::showColorScale( true ); - Handle_Aspect_ColorScale aCS = TestViewer::colorScale(); + Handle(AIS_ColorScale) aCS = TestViewer::colorScale(); aCS->SetMin( 0.0 ); aCS->SetMax( 5.0 ); aCS->SetNumberOfIntervals( 10 ); @@ -603,14 +603,14 @@ void test_HYDROData_DTM::test_garonne() CPPUNIT_ASSERT_EQUAL( 282338, (int)DTM->GetAltitudePoints().size() ); - Handle_AIS_InteractiveContext aContext = TestViewer::context(); + Handle(AIS_InteractiveContext) aContext = TestViewer::context(); HYDROGUI_ShapeBathymetry* aBathPrs = new HYDROGUI_ShapeBathymetry( 0, aContext, DTM ); aBathPrs->update( true, false ); bool ColorScaleIsDisp = TestViewer::ColorScaleIsDisplayed(); TestViewer::showColorScale( true ); - Handle_Aspect_ColorScale aCS = TestViewer::colorScale(); + Handle(AIS_ColorScale) aCS = TestViewer::colorScale(); aCS->SetMin( 0.0 ); aCS->SetMax( 25.0 ); aCS->SetNumberOfIntervals( 30 ); @@ -627,13 +627,13 @@ void test_HYDROData_DTM::test_classifier_1() { TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); fname += "/pb_1066.cbf"; - CPPUNIT_ASSERT_EQUAL( DocError_OK, HYDROData_Document::Load( fname.ToCString(), 1 ) ); + CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString(), 1 ) ); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); Handle(HYDROData_CalculationCase) aCase = Handle(HYDROData_CalculationCase)::DownCast( aDoc->FindObjectByName( "Case_1" ) ); - CPPUNIT_ASSERT_EQUAL( Standard_False, aCase.IsNull() ); + CPPUNIT_ASSERT_EQUAL( false, aCase.IsNull() ); std::vector points; points.push_back( gp_XY( 43.4842, 3.33176 ) ); points.push_back( gp_XY( -125.777, 2.24728 ) ); diff --git a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index 96d67057..488c2127 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/src/HYDRO_tests/test_HYDROData_Main.cxx b/src/HYDRO_tests/test_HYDROData_Main.cxx index d50bdcf7..05f6b9b8 100644 --- a/src/HYDRO_tests/test_HYDROData_Main.cxx +++ b/src/HYDRO_tests/test_HYDROData_Main.cxx @@ -44,7 +44,7 @@ int main( int argc, char* argv[] ) int W = 800, H = 600; aWindow->setGeometry( 200, 200, W, H ); aWindow->show(); - QTest::qWaitForWindowShown( aWindow ); + QTest::qWaitForWindowExposed( aWindow ); int dy = 34; //std::cout << dx << "," << dy << std::endl; diff --git a/src/HYDRO_tests/test_HYDROData_Profile.h b/src/HYDRO_tests/test_HYDROData_Profile.h index 9707ce22..9a22db00 100644 --- a/src/HYDRO_tests/test_HYDROData_Profile.h +++ b/src/HYDRO_tests/test_HYDROData_Profile.h @@ -18,7 +18,6 @@ #include -class Handle_HYDROData_Profile; class QString; class test_HYDROData_Profile : public CppUnit::TestFixture { diff --git a/src/HYDRO_tests/test_HYDROData_Stream.cxx b/src/HYDRO_tests/test_HYDROData_Stream.cxx index dff2c9bb..86c3d676 100644 --- a/src/HYDRO_tests/test_HYDROData_Stream.cxx +++ b/src/HYDRO_tests/test_HYDROData_Stream.cxx @@ -91,8 +91,7 @@ void test_HYDROData_Stream::test_params_sync() Handle(HYDROData_Stream) aStream = Handle(HYDROData_Stream)::DownCast( aDoc->CreateObject( KIND_STREAM ) ); - Handle(HYDROData_DTM) aDTM = - Handle(HYDROData_DTM)::DownCast( aStream->DTM() ); + Handle(HYDROData_DTM) aDTM = aStream->DTM(); CPPUNIT_ASSERT_EQUAL( false, (bool)aDTM.IsNull() ); Handle(HYDROData_Profile) aProfile1 = diff --git a/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx b/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx index f5b0ea49..2290ed7e 100644 --- a/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx @@ -22,7 +22,7 @@ #include #include -Handle_HYDROData_Document GetDocument() +Handle(HYDROData_Document) GetDocument() { return HYDROData_Document::Document( 0 ); } @@ -33,7 +33,7 @@ HYDROGUI_ListModel::Object2VisibleList CreateTestObjects( int theObjCount ) for( int i=0; iCreateObject( KIND_IMMERSIBLE_ZONE ); + Handle(HYDROData_Entity) anObj = GetDocument()->CreateObject( KIND_IMMERSIBLE_ZONE ); std::string aName = " "; aName[0] = 'A' + i; @@ -424,4 +424,4 @@ void test_HYDROGUI_ListModel::testDragAndDrop() aRes = aModel->move( QList() << 0 << 2 << 4 << 5 << 7, aDnD, false, 3 ); CPPUNIT_ASSERT_EQUAL( true, aRes ); CPPUNIT_ASSERT_EQUAL( std::string( "F, *A, *G, *C, H, *E, D, B" ), GetObjects( aModel ) ); -} \ No newline at end of file +} diff --git a/src/HYDRO_tests/test_HYDROGUI_Shape.cxx b/src/HYDRO_tests/test_HYDROGUI_Shape.cxx index 2d696144..ee5ca41f 100644 --- a/src/HYDRO_tests/test_HYDROGUI_Shape.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_Shape.cxx @@ -31,8 +31,8 @@ void test_HYDROGUI_Shape::test_face_in_preview() 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << 31 << 114 ); - Handle_AIS_InteractiveContext aContext = TestViewer::context(); - Handle_HYDROData_Entity anEntity; //it should be null as in preview + Handle(AIS_InteractiveContext) aContext = TestViewer::context(); + Handle(HYDROData_Entity) anEntity; //it should be null as in preview HYDROGUI_Shape* aPreview = new HYDROGUI_Shape( aContext, anEntity ); aPreview->setFace( aFace, true, true, "" ); -- 2.39.2