Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make compatible with QGIS 3.38 #234

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/windows_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
with:
repository: vcloarec/QGIS
path: QGIS
ref: forLekanMaster
ref: master

- name: check QGIS hash
id: getQgisHash
Expand Down
57 changes: 42 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ ADD_DEFINITIONS(-DREOS_PROVIDERS="${REOS_PROVIDERS_DIR}")
ADD_DEFINITIONS(-DREOS_SIMULATION_ENGINES="${REOS_ENGINES_DIR}")
ADD_DEFINITIONS(-DREOS_BUILDING_OUTPUT="${REOS_OUTPUT_DIRECTORY}")

SET(WITH_GUI TRUE CACHE BOOL "With Graphic User Interface (LEKAN)")
SET(WITH_3D TRUE CACHE BOOL "With Graphic User Interface (LEKAN)")

SET(WITH_QTWEBKIT FALSE CACHE BOOL "With QtWebKit")
SET(QGIS_PROVIDERS_PATH CACHE PATH "Path to the folder containing the data providers of QGIS. Only necessary for dev and tests.")
SET(QGIS_INCLUDE_DIR CACHE PATH "Path to the include dir of QGIS")
Expand All @@ -62,14 +65,19 @@ SET(QGIS_APP_LIB CACHE FILEPATH "Path to QGIS app lib")
SET(QGIS_APP_INCLUDE CACHE PATH "Path to QGIS app header files (in source)")
SET(QGIS_LIBS ${QGIS_CORE_LIB} ${QGIS_GUI_LIB} ${QGIS_ANALYSIS_LIB} ${QGIS_3D_LIB})
SET(QSCISCINTILLA_INCLUDE_DIR CACHE PATH "Path to Qsciscintilla include dir")
SET(GMSH_INCLUDE_DIR CACHE PATH "Path to the include dir of gmsh")
SET(GMSH_LIB CACHE FILEPATH "Path to the lib file of gmsh")
SET(TELEMAC_PATH CACHE PATH "Path to TELEMAC.")
SET(TELEMAC_CONFIG_NAME CACHE STRING "Configuration name of TELEMAC.")
SET(TELEMAC_CONFIG_FILE CACHE FILEPATH "Configuration file of TELEMAC.")
SET(TELEMAC_PYTHON_PATH CACHE FILEPATH "Python interpreter path to use for TELEMAC.")


SET(ENABLE_HEC_DSS TRUE CACHE BOOL "Enable hec-dss")

IF(WITH_3D)
add_definitions(-DENABLE_3D)
ENDIF(WITH_3D)

IF(WITH_GUI)
add_definitions(-DENABLE_GUI)
ENDIF(WITH_GUI)


IF(ENABLE_HEC_DSS)
SET (HEC_DSS_LIBS_PATH CACHE PATH "Path to the hec-dss libraries")
SET (HEC_DSS_INCLUDE CACHE PATH "Path to the hec-dss include dir")
Expand All @@ -96,9 +104,24 @@ IF(ENABLE_HEC_DSS)
ENDIF(MSVC)
ENDIF(ENABLE_HEC_DSS)

SET(MDAL_INCLUDE_DIR CACHE PATH "Path to the include dir of MDAL")
SET(MDAL_LIB CACHE FILEPATH "Path to the lib file of MDAL")
SET(WITH_HYDRAULIC_MODEL_SUPPORT TRUE CACHE BOOL "Enable Hydraulic Model support")
IF(WITH_HYDRAULIC_MODEL_SUPPORT)
add_definitions(-DWITH_GMSH)
SET(GMSH_INCLUDE_DIR CACHE PATH "Path to the include dir of gmsh")
SET(GMSH_LIB CACHE FILEPATH "Path to the lib file of gmsh")

SET(WITH_TELEMAC_SUPPORT TRUE CACHE BOOL "Enable TELEMAC Model support")
IF(WITH_TELEMAC_SUPPORT)
SET(TELEMAC_PATH CACHE PATH "Path to TELEMAC.")
SET(TELEMAC_CONFIG_NAME CACHE STRING "Configuration name of TELEMAC.")
SET(TELEMAC_CONFIG_FILE CACHE FILEPATH "Configuration file of TELEMAC.")
SET(TELEMAC_PYTHON_PATH CACHE FILEPATH "Python interpreter path to use for TELEMAC.")
ENDIF(WITH_TELEMAC_SUPPORT)

SET(MDAL_INCLUDE_DIR CACHE PATH "Path to the include dir of MDAL")
SET(MDAL_LIB CACHE FILEPATH "Path to the lib file of MDAL")

ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT)

set(QT_MIN_VERSION 5.14.0)
set(QT_VERSION_BASE "Qt5")
Expand All @@ -123,13 +146,14 @@ if(NOT MSVC)
FIND_QCAOSSL_PLUGIN_CPP(ENABLE_TESTS)
endif()

IF (WITH_QTWEBKIT)
FIND_PACKAGE(Qt5 COMPONENTS WebKit WebKitWidgets REQUIRED)
ENDIF(WITH_QTWEBKIT)

SET(QWT_LIB CACHE FILEPATH "Path to qwt LIB")
SET(QWT_INCLUDE CACHE PATH "Path to qwt headers")
IF(WITH_GUI)
IF (WITH_QTWEBKIT)
FIND_PACKAGE(Qt5 COMPONENTS WebKit WebKitWidgets REQUIRED)
ENDIF(WITH_QTWEBKIT)

SET(QWT_LIB CACHE FILEPATH "Path to qwt LIB")
SET(QWT_INCLUDE CACHE PATH "Path to qwt headers")
ENDIF(WITH_GUI)


#############################################################
Expand Down Expand Up @@ -196,7 +220,9 @@ endif()

ADD_SUBDIRECTORY(images)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(i18n)
IF(WITH_GUI)
ADD_SUBDIRECTORY(i18n)
ENDIF(WITH_GUI)

if (WITH_BINDINGS)
ADD_SUBDIRECTORY(python)
Expand All @@ -206,6 +232,7 @@ endif()
IF (ENABLE_TESTS)

set(COMEPHORE_TESTS_ENABLE FALSE CACHE BOOL "Enable tests for Comephore gridded rainfall, some specific files are necessary.")
set(ERA5_TESTS_ENABLE FALSE CACHE BOOL "Enable tests for ERA5 gridded data, some specific files are necessary.")
set(METEOFRANCEAPI_TESTS_ENABLE FALSE CACHE BOOL "Enable tests for Meteo France, a file containing a API key is necessary")
set(INTERN_PYTHON_TESTS_ENABLE FALSE CACHE BOOL "Enable tests related calling python from Reos")

Expand Down
18 changes: 16 additions & 2 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,25 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/gui/GIS
)

IF(WITH_GUI)
include_directories(
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/GIS
)
ENDIF(WITH_GUI)


add_subdirectory(core)
add_subdirectory(gui)
IF(WITH_GUI)
add_subdirectory(gui)
ENDIF(WITH_GUI)

add_subdirectory(dataProviders)
add_subdirectory(simulationEngines)

if(WITH_HYDRAULIC_MODEL_SUPPORT)
add_subdirectory(simulationEngines)
endif(WITH_HYDRAULIC_MODEL_SUPPORT)


if(INTERN_PYTHON_TESTS_ENABLE)
add_subdirectory(python)
Expand Down
8 changes: 7 additions & 1 deletion Tests/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,15 @@ SET(TESTS
reos_hydrograph_transfer_test.cpp
reos_hydraulic_structure_2D_test.cpp
reos_hydraulic_network_test.cpp
reos_mesh_test.cpp
)


IF(WITH_HYDRAULIC_MODEL_SUPPORT)
SET(TESTS
reos_mesh_test.cpp
)
ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT)

FOREACH(TESTSRC ${TESTS})
ADD_REOS_TEST(${TESTSRC})
ENDFOREACH(TESTSRC)
Expand Down
2 changes: 1 addition & 1 deletion Tests/core/reos_mesh_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ email : vcloarec at gmail dot com
#include "reosmesh.h"
#include "reosmeshgenerator.h"
#include "reospolylinesstructure.h"
#include "reosgmshgenerator.h"
#include "gmsh/reosgmshgenerator.h"
#include "reos_testutils.h"
#include "reosparameter.h"

Expand Down
1 change: 1 addition & 0 deletions Tests/dataProviders/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

add_subdirectory(grib)
add_subdirectory(hydroportail)

if (COMEPHORE_TESTS_ENABLE)
add_subdirectory(comephore)
endif(COMEPHORE_TESTS_ENABLE)
Expand Down
7 changes: 6 additions & 1 deletion Tests/simulationEngines/hecras/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ TARGET_LINK_LIBRARIES(test_hecras
${Qt5Test_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
reosCore
reosGui
reosHecDss
${HEC_DSS_ALL_STATIC_LIB}
${MDAL_LIB}
)

IF (WITH_GUI)
TARGET_LINK_LIBRARIES(test_hecras
reosGui
)
ENDIF(WITH_GUI)

IF(GDAL_FOUND)
TARGET_INCLUDE_DIRECTORIES(${TESTNAME} PRIVATE ${GDAL_INCLUDE_DIRS})
ENDIF(GDAL_FOUND)
Expand Down
7 changes: 6 additions & 1 deletion Tests/simulationEngines/telemac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ TARGET_LINK_LIBRARIES(test_telemac
${Qt5Test_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
reosCore
reosGui
${MDAL_LIB}
)

IF (WITH_GUI)
TARGET_LINK_LIBRARIES(test_telemac
reosGui
)
ENDIF(WITH_GUI)

IF(GDAL_FOUND)
TARGET_INCLUDE_DIRECTORIES(${TESTNAME} PRIVATE ${GDAL_INCLUDE_DIRS})
ENDIF(GDAL_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile_deps
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM ubuntu:22.04
LABEL maintainer="[email protected]"

RUN export DEBIAN_FRONTEND=noninteractive \
Expand Down
17 changes: 12 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(ui)
ADD_SUBDIRECTORY(gui)

IF(WITH_GUI)
ADD_SUBDIRECTORY(ui)
ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(lekan)
ADD_SUBDIRECTORY(reosSystem)
ENDIF(WITH_GUI)

if (WITH_BINDINGS)
ADD_SUBDIRECTORY(python)
endif()

ADD_SUBDIRECTORY(lekan)
ADD_SUBDIRECTORY(reosSystem)

ADD_SUBDIRECTORY(dataProviders)
ADD_SUBDIRECTORY(simulationEngines)

IF(WITH_HYDRAULIC_MODEL_SUPPORT)
ADD_SUBDIRECTORY(simulationEngines)
ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT)


38 changes: 31 additions & 7 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,18 @@ SET(REOS_CORE_SOURCES
hydraulicNetwork/simulation/reoshydraulicstructureprofile.cpp

mesh/reosmeshgenerator.cpp
mesh/reosgmshgenerator.cpp
mesh/reosmeshdatasetsource.cpp

network/reosnetworkaccessmanager.cpp
)

IF(WITH_HYDRAULIC_MODEL_SUPPORT)
SET(REOS_CORE_SOURCES
${REOS_CORE_SOURCES}
mesh/gmsh/reosgmshgenerator.cpp
)
ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT)

SET(REOS_CORE_HEADERS
reoscore.h
reosapplication.h
Expand Down Expand Up @@ -195,12 +201,17 @@ SET(REOS_CORE_HEADERS
hydraulicNetwork/simulation/reoshydraulicstructureprofile.h

mesh/reosmeshgenerator.h
mesh/reosgmshgenerator.h
mesh/reosmeshdatasetsource.h

network/reosnetworkaccessmanager.h
)

IF(WITH_HYDRAULIC_MODEL_SUPPORT)
SET(REOS_CORE_HEADERS
${REOS_CORE_HEADERS}
mesh/gmsh/reosgmshgenerator.h
)
ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT)

SET(REOS_CORE_HDRS_PRIVATE
GIS/private/reosdigitalelevationmodel_p.h
GIS/private/reospolylinesstructure_p.h
Expand Down Expand Up @@ -276,12 +287,17 @@ TARGET_LINK_LIBRARIES(reosCore PUBLIC
${Qt5Concurrent_LIBRARIES}
${QGIS_CORE_LIB}
${QGIS_ANALYSIS_LIB}
${QGIS_3D_LIB}
${QGIS_GUI_LIB}
${GMSH_LIB}
${NETCDF_LIBRARY}
)

IF(WITH_3D)
TARGET_LINK_LIBRARIES(reosCore PUBLIC ${QGIS_3D_LIB})
ENDIF(WITH_3D)

IF(WITH_HYDRAULIC_MODEL_SUPPORT)
TARGET_LINK_LIBRARIES(reosCore PUBLIC ${GMSH_LIB})
ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT)

TARGET_INCLUDE_DIRECTORIES(reosCore SYSTEM PUBLIC
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR})
Expand Down Expand Up @@ -332,9 +348,17 @@ TARGET_INCLUDE_DIRECTORIES( reosCore PUBLIC

INCLUDE_DIRECTORIES(
${QGIS_INCLUDE_DIR}
${GMSH_INCLUDE_DIR}
)

IF(WITH_HYDRAULIC_MODEL_SUPPORT)
INCLUDE_DIRECTORIES(
${GMSH_INCLUDE_DIR}
)
TARGET_INCLUDE_DIRECTORIES( reosCore PUBLIC
${CMAKE_SOURCE_DIR}/src/core/gmsh
)
ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT)

include_directories(${CMAKE_SOURCE_DIR}/external/poly2tri)

ADD_DEFINITIONS(-DQGIS_PLUGINS="${QGIS_PROVIDERS_PATH}")
Expand Down
9 changes: 5 additions & 4 deletions src/core/GIS/private/reosdigitalelevationmodel_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,15 @@ double ReosDigitalElevationModelRaster::averageElevationInPolygon( const QPolygo
}
}

QMap<QgsZonalStatistics::Statistic, QVariant> result = QgsZonalStatistics::calculateStatistics( mDataProvider.get(),

QMap<Qgis::ZonalStatistic, QVariant> result = QgsZonalStatistics::calculateStatistics( mDataProvider.get(),
geometry,
fabs( mExtent.xCellSize() ),
fabs( mExtent.yCellSize() ),
1,
QgsZonalStatistics::Mean );
Qgis::ZonalStatistic::Mean );

return result.value( QgsZonalStatistics::Mean ).toDouble();
return result.value( Qgis::ZonalStatistic::Mean ).toDouble();
}


Expand Down Expand Up @@ -595,7 +596,7 @@ ReosRasterExtent ReosDigitalElevationModelRaster::rasterExtent( const QgsRectang
double xPixelSize;
double yPixelSize;

if ( mDataProvider->capabilities() & QgsRasterInterface::Size )
if ( mDataProvider->capabilities() & Qgis::RasterInterfaceCapability::Size )
{
int xCount = mDataProvider->xSize();
int yCount = mDataProvider->ySize();
Expand Down
2 changes: 1 addition & 1 deletion src/core/GIS/private/reosgriddedrainfallrenderer_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ReosGriddedRainfallRendererFactory_p::ReosGriddedRainfallRendererFactory_p( Reos
renderer->setClassificationMax( 20 );
}

renderer->createShader( colorRamp.release(), QgsColorRampShader::Interpolated, QgsColorRampShader::EqualInterval, 10, false );
renderer->createShader( colorRamp.release(), Qgis::ShaderInterpolationMethod::Linear, Qgis::ShaderClassificationMethod::EqualInterval, 10, false );
mColorRampSettings->setShader( renderer->shader()->rasterShaderFunction() );
mRasterLayer->setRenderer( renderer.release() );
}
Expand Down
Loading
Loading