From ca8bb214d4c6c981758e3ab44651ca6db262dfab Mon Sep 17 00:00:00 2001 From: vcloarec Date: Sat, 8 Jun 2024 17:05:18 -0400 Subject: [PATCH 1/9] make compatible with QGIS 3.38 --- .../private/reosdigitalelevationmodel_p.cpp | 9 +++--- .../private/reosgriddedrainfallrenderer_p.cpp | 2 +- src/core/GIS/private/reosmesh_p.cpp | 4 +-- .../GIS/private/reosmeshdataprovider_p.cpp | 2 +- .../GIS/private/reospolygonstructure_p.cpp | 3 +- .../GIS/private/reospolylinesstructure_p.cpp | 4 +-- src/core/GIS/reosgisengine.cpp | 10 +++---- src/gui/GIS/3D/reos3dview.cpp | 28 +++++++++++-------- src/gui/GIS/3D/reos3dview.h | 1 + src/gui/GIS/private/reosmappolygon_p.cpp | 6 ++-- src/gui/GIS/private/reosmaptool_p.cpp | 6 ++-- src/gui/GIS/reoscoordinatesystemwidget.cpp | 2 +- src/gui/GIS/reosgislayerswidget.cpp | 2 +- src/gui/GIS/reosmap.cpp | 2 +- 14 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/core/GIS/private/reosdigitalelevationmodel_p.cpp b/src/core/GIS/private/reosdigitalelevationmodel_p.cpp index 65dc5ed49..d5def5c48 100644 --- a/src/core/GIS/private/reosdigitalelevationmodel_p.cpp +++ b/src/core/GIS/private/reosdigitalelevationmodel_p.cpp @@ -222,14 +222,15 @@ double ReosDigitalElevationModelRaster::averageElevationInPolygon( const QPolygo } } - QMap result = QgsZonalStatistics::calculateStatistics( mDataProvider.get(), + + QMap 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(); } @@ -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(); diff --git a/src/core/GIS/private/reosgriddedrainfallrenderer_p.cpp b/src/core/GIS/private/reosgriddedrainfallrenderer_p.cpp index f23dc2f86..390b7368e 100644 --- a/src/core/GIS/private/reosgriddedrainfallrenderer_p.cpp +++ b/src/core/GIS/private/reosgriddedrainfallrenderer_p.cpp @@ -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() ); } diff --git a/src/core/GIS/private/reosmesh_p.cpp b/src/core/GIS/private/reosmesh_p.cpp index c159d2538..347b934c1 100644 --- a/src/core/GIS/private/reosmesh_p.cpp +++ b/src/core/GIS/private/reosmesh_p.cpp @@ -1369,7 +1369,7 @@ void ReosMeshFrame_p::generateMesh( const ReosMeshFrameData &data ) QString ReosMeshFrame_p::crs() const { - return mMeshDataProvider->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_SIMPLIFIED ); + return mMeshDataProvider->crs().toWkt( Qgis::CrsWktVariant::Preferred ); } QObject *ReosMeshFrame_p::data() const @@ -1387,7 +1387,7 @@ ReosMapExtent ReosMeshFrame_p::extent() const if ( mMeshLayer ) { ReosMapExtent ret( mMeshLayer->extent().toRectF() ); - ret.setCrs( mMeshLayer->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ) ); + ret.setCrs( mMeshLayer->crs().toWkt( Qgis::CrsWktVariant::Preferred ) ); return ret; } diff --git a/src/core/GIS/private/reosmeshdataprovider_p.cpp b/src/core/GIS/private/reosmeshdataprovider_p.cpp index de7682ce7..2a2ef3d28 100644 --- a/src/core/GIS/private/reosmeshdataprovider_p.cpp +++ b/src/core/GIS/private/reosmeshdataprovider_p.cpp @@ -304,7 +304,7 @@ void ReosMeshDataProvider_p::generateMesh( const ReosMeshFrameData &data ) void ReosMeshDataProvider_p::applyDemOnVertices( ReosDigitalElevationModel *dem ) { double noDataValue = dem->noDataValue(); - QString wktCrs = mCrs.toWkt( QgsCoordinateReferenceSystem::WKT2_2019_SIMPLIFIED ); + QString wktCrs = mCrs.toWkt( Qgis::CrsWktVariant::Wkt2_2019 ); for ( int i = 0; i < mMesh.vertexCount(); ++i ) { diff --git a/src/core/GIS/private/reospolygonstructure_p.cpp b/src/core/GIS/private/reospolygonstructure_p.cpp index a0c701a91..a9f323d25 100644 --- a/src/core/GIS/private/reospolygonstructure_p.cpp +++ b/src/core/GIS/private/reospolygonstructure_p.cpp @@ -15,6 +15,7 @@ ***************************************************************************/ #include "reospolygonstructure_p.h" +#include #include #include #include @@ -128,7 +129,7 @@ ReosEncodedElement ReosPolygonStructure_p::encode() const QString ReosPolygonStructure_p::crs() const { - return mVectorLayer->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_SIMPLIFIED ); + return mVectorLayer->crs().toWkt( Qgis::CrsWktVariant::PreferredSimplified ); } ReosPolygonStructure_p::~ReosPolygonStructure_p() diff --git a/src/core/GIS/private/reospolylinesstructure_p.cpp b/src/core/GIS/private/reospolylinesstructure_p.cpp index 5b847c18a..4e465fcf1 100644 --- a/src/core/GIS/private/reospolylinesstructure_p.cpp +++ b/src/core/GIS/private/reospolylinesstructure_p.cpp @@ -120,7 +120,7 @@ QgsRectangle ReosGeometryStructure_p::layerZone( const ReosMapExtent &zone ) con QString ReosGeometryStructure_p::crs() const { - return mVectorLayer->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ); + return mVectorLayer->crs().toWkt( Qgis::CrsWktVariant::PreferredSimplified ); } @@ -1976,7 +1976,7 @@ double ReosPolylineStructureVectorLayer::tolerance( const QString &wktCrs ) cons QString ReosPolylineStructureVectorLayer::crs() const { - return mVectorLayer->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_SIMPLIFIED ); + return mVectorLayer->crs().toWkt( Qgis::CrsWktVariant::PreferredSimplified ); } bool ReosPolylineStructureVectorLayer::isOnBoundary( const Segment &seg ) const diff --git a/src/core/GIS/reosgisengine.cpp b/src/core/GIS/reosgisengine.cpp index 87c80c2a4..9672003b0 100644 --- a/src/core/GIS/reosgisengine.cpp +++ b/src/core/GIS/reosgisengine.cpp @@ -309,17 +309,17 @@ QString ReosGisEngine::meshLayerFilters() const QString ReosGisEngine::crs() const { - return QgsProject::instance()->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ); + return QgsProject::instance()->crs().toWkt( Qgis::CrsWktVariant::Preferred ); } QString ReosGisEngine::crsFromEPSG( int epsgCode ) { - return QgsCoordinateReferenceSystem::fromEpsgId( epsgCode ).toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ); + return QgsCoordinateReferenceSystem::fromEpsgId( epsgCode ).toWkt( Qgis::CrsWktVariant::Preferred ); } QString ReosGisEngine::crsFromProj( const QString &projtring ) { - return QgsCoordinateReferenceSystem::fromProj( projtring ).toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED );; + return QgsCoordinateReferenceSystem::fromProj( projtring ).toWkt( Qgis::CrsWktVariant::Preferred );; } QString ReosGisEngine::crsWkt1( const QString &crs ) @@ -330,7 +330,7 @@ QString ReosGisEngine::crsWkt1( const QString &crs ) QString ReosGisEngine::crsEsriWkt( const QString &crs ) { - return QgsCoordinateReferenceSystem( crs ).toWkt( QgsCoordinateReferenceSystem::WKT1_ESRI ); + return QgsCoordinateReferenceSystem( crs ).toWkt( Qgis::CrsWktVariant::Wkt1Esri ); } void ReosGisEngine::setCrs( const QString &crsString ) @@ -620,7 +620,7 @@ ReosMapExtent ReosGisEngine::transformExtent( const ReosMapExtent &extent, const ReosMapExtent ReosGisEngine::transformToProjectExtent( const ReosMapExtent &extent ) const { - return transformExtent( extent, QgsProject::instance()->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ) ); + return transformExtent( extent, QgsProject::instance()->crs().toWkt( Qgis::CrsWktVariant::Preferred ) ); } ReosMapExtent ReosGisEngine::transformFromProjectExtent( const ReosMapExtent &extent, const QString &wktCrs ) const diff --git a/src/gui/GIS/3D/reos3dview.cpp b/src/gui/GIS/3D/reos3dview.cpp index bfd491904..5a2c57302 100644 --- a/src/gui/GIS/3D/reos3dview.cpp +++ b/src/gui/GIS/3D/reos3dview.cpp @@ -22,7 +22,7 @@ #include #include -#include <3d/qgs3dmapcanvas.h> +#include #include #include #include @@ -53,8 +53,8 @@ Reos3dView::Reos3dView( ReosMesh *meshTerrain, const ReosGuiContext &context ) setWindowFlag( Qt::Dialog ); setWindowTitle( tr( "3D View" ) ); - mCanvas = new Qgs3DMapCanvas( this ); - mCanvas->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + mCanvas = new Qgs3DMapCanvas(); +//mCanvas->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); QgsMeshLayer *meshLayer = nullptr; if ( meshTerrain ) @@ -77,11 +77,15 @@ Reos3dView::Reos3dView( ReosMesh *meshTerrain, const ReosGuiContext &context ) context.map()->currentTime().addMSecs( context.map()->timeStep().valueMilliSecond() ) } ); - mCanvas->setMap( settings ); + mCanvas->setMapSettings( settings ); mCanvas->setViewFromTop( extent.center(), dist, 0 ); - mCanvas->setOnScreenNavigationVisibility( false ); + //mCanvas->setOnScreenNavigationVisibility( false ); - ui->m3dViewLayout->addWidget( mCanvas ); + mContainer = QWidget::createWindowContainer( mCanvas ); + mContainer->setMinimumSize( QSize( 200, 200 ) ); + mContainer->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + + ui->m3dViewLayout->addWidget( mContainer ); QToolBar *toolBar = new QToolBar( this ); ui->mToolBarLayout->addWidget( toolBar ); @@ -192,8 +196,8 @@ Reos3dView::~Reos3dView() // so the destruction will happen after terrain creation // before launching the defered deletation, we remove reference to the mesh layer - mCanvas->map()->setLayers( QList() ); - mCanvas->map()->setTerrainGenerator( new QgsFlatTerrainGenerator ); + mCanvas->mapSettings()->setLayers( QList() ); + mCanvas->mapSettings()->setTerrainGenerator( new QgsFlatTerrainGenerator ); mCanvas->setParent( nullptr ); QTimer::singleShot( 0, mCanvas, &QObject::deleteLater ); @@ -202,11 +206,11 @@ Reos3dView::~Reos3dView() void Reos3dView::addMesh( ReosMesh *mesh ) { mMeshes.append( mesh ); - QList layers = mCanvas->map()->layers(); + QList layers = mCanvas->mapSettings()->layers(); layers.append( qobject_cast( mesh->data() ) ); - mCanvas->map()->setLayers( layers ); + mCanvas->mapSettings()->setLayers( layers ); } void Reos3dView::onExaggerationChange( double value ) @@ -231,7 +235,7 @@ void Reos3dView::onLightChange() std::unique_ptr lightSettings = std::make_unique(); lightSettings->setDirection( mLightWidget->direction() ); lightSettings->setIntensity( mLightWidget->lightIntensity() ); - mCanvas->map()->setLightSources( {lightSettings.release()} ); + mCanvas->mapSettings()->setLightSources( {lightSettings.release()} ); emit mapSettingsChanged(); } @@ -281,7 +285,7 @@ void Reos3dView::onTerrainSettingsChanged() std::unique_ptr newTerrain = std::make_unique(); newTerrain->setSymbol( terrainSymbol.release() ); newTerrain->setLayer( meshLayer ); - mCanvas->map()->setTerrainGenerator( newTerrain.release() ); + mCanvas->mapSettings()->setTerrainGenerator( newTerrain.release() ); emit terrainSettingsChanged(); } diff --git a/src/gui/GIS/3D/reos3dview.h b/src/gui/GIS/3D/reos3dview.h index 602eb9076..a8dd91b86 100644 --- a/src/gui/GIS/3D/reos3dview.h +++ b/src/gui/GIS/3D/reos3dview.h @@ -63,6 +63,7 @@ class Reos3dView : public ReosActionWidget private: Ui::Reos3dView *ui; QPointer mMeshTerrain; + QWidget *mContainer = nullptr; Qgs3DMapCanvas *mCanvas = nullptr; QAction *mActionZoomExtent = nullptr; ReosLightWidget *mLightWidget = nullptr; diff --git a/src/gui/GIS/private/reosmappolygon_p.cpp b/src/gui/GIS/private/reosmappolygon_p.cpp index 2b7da8d09..bb54c2a9b 100644 --- a/src/gui/GIS/private/reosmappolygon_p.cpp +++ b/src/gui/GIS/private/reosmappolygon_p.cpp @@ -112,7 +112,7 @@ void ReosMapPolygonBase_p::setMarkerDistance( double d ) } mMarkerposition = ReosGisEngine::setPointOnPolyline( d, mapPoly, - mMapCanvas->mapSettings().destinationCrs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_SIMPLIFIED ), mSegmentMarker ); + mMapCanvas->mapSettings().destinationCrs().toWkt( Qgis::CrsWktVariant::Preferred ), mSegmentMarker ); updatePosition(); } @@ -125,7 +125,7 @@ void ReosMapPolygonBase_p::setMarkerAtMid() { const QPolygonF &mapPoly = geometry(); mMarkerposition = ReosGisEngine::setPointOnPolyline( ReosGeometryUtils::length( mapPoly ) / 2, mapPoly, - mMapCanvas->mapSettings().destinationCrs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_SIMPLIFIED ), mSegmentMarker ); + mMapCanvas->mapSettings().destinationCrs().toWkt( Qgis::CrsWktVariant::Preferred ), mSegmentMarker ); updatePosition(); } @@ -709,5 +709,5 @@ ReosMapItem_p::ReosMapItem_p( QgsMapCanvas *canvas ) QString ReosMapItem_p::crs() const { - return mMapCanvas->mapSettings().destinationCrs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_SIMPLIFIED ); + return mMapCanvas->mapSettings().destinationCrs().toWkt( Qgis::CrsWktVariant::Preferred ); } diff --git a/src/gui/GIS/private/reosmaptool_p.cpp b/src/gui/GIS/private/reosmaptool_p.cpp index 06a02e130..4a4a530ad 100644 --- a/src/gui/GIS/private/reosmaptool_p.cpp +++ b/src/gui/GIS/private/reosmaptool_p.cpp @@ -66,7 +66,7 @@ static QList searchFeatureOnMap( QgsMapMouse QgsFeatureIterator fit = vectorLayer->getFeatures( QgsFeatureRequest() .setFilterRect( rect ) - .setFlags( QgsFeatureRequest::ExactIntersect ) ); + .setFlags( Qgis::FeatureRequestFlag::ExactIntersect ) ); QgsFeature f; while ( fit.nextFeature( f ) ) { @@ -105,7 +105,7 @@ bool ReosMapTool_p::hasFeatureOnMap( const QPointF &mapPoint ) const QgsFeatureIterator fit = vectorLayer->getFeatures( QgsFeatureRequest() .setFilterRect( rect ) - .setFlags( QgsFeatureRequest::ExactIntersect ) ); + .setFlags( Qgis::FeatureRequestFlag::ExactIntersect ) ); QgsFeature feat; if ( fit.nextFeature( feat ) ) return true; @@ -665,7 +665,7 @@ void ReosMapTool_p::keyPressEvent( QKeyEvent *e ) QString ReosMapTool_p::mapCrs() const { - return canvas()->mapSettings().destinationCrs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ); + return canvas()->mapSettings().destinationCrs().toWkt( Qgis::CrsWktVariant::PreferredSimplified ); } diff --git a/src/gui/GIS/reoscoordinatesystemwidget.cpp b/src/gui/GIS/reoscoordinatesystemwidget.cpp index 86c244a85..42ca426a7 100644 --- a/src/gui/GIS/reoscoordinatesystemwidget.cpp +++ b/src/gui/GIS/reoscoordinatesystemwidget.cpp @@ -33,7 +33,7 @@ ReosCoordinateSystemWidget::ReosCoordinateSystemWidget( QWidget *parent ) QString ReosCoordinateSystemWidget::crs() const { - return mQgsWidget->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ); + return mQgsWidget->crs().toWkt( Qgis::CrsWktVariant::Preferred ); } void ReosCoordinateSystemWidget::setCrs( const QString &crs ) diff --git a/src/gui/GIS/reosgislayerswidget.cpp b/src/gui/GIS/reosgislayerswidget.cpp index 05a134d7b..ce641d0a5 100644 --- a/src/gui/GIS/reosgislayerswidget.cpp +++ b/src/gui/GIS/reosgislayerswidget.cpp @@ -236,7 +236,7 @@ void ReosGisLayersWidget::onSetCrs() QString crs = mGisEngine->crs(); dial.setCrs( QgsCoordinateReferenceSystem::fromWkt( crs ) ); if ( dial.exec() ) - mGisEngine->setCrs( dial.crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ) ); + mGisEngine->setCrs( dial.crs().toWkt( Qgis::CrsWktVariant::Preferred ) ); } diff --git a/src/gui/GIS/reosmap.cpp b/src/gui/GIS/reosmap.cpp index 329c81d61..39e924ce6 100644 --- a/src/gui/GIS/reosmap.cpp +++ b/src/gui/GIS/reosmap.cpp @@ -593,7 +593,7 @@ ReosGisEngine *ReosMap::engine() const QString ReosMap::mapCrs() const { QgsMapCanvas *canvas = qobject_cast( mCanvas ); - return canvas->mapSettings().destinationCrs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ); + return canvas->mapSettings().destinationCrs().toWkt( Qgis::CrsWktVariant::Preferred ); } void ReosMap::setDefaultMapTool() From 6bc5a7b94367d3b002ad5b6caf12d9aa8c4d539f Mon Sep 17 00:00:00 2001 From: vcloarec Date: Fri, 21 Jun 2024 13:49:34 -0400 Subject: [PATCH 2/9] minimalist reos --- CMakeLists.txt | 56 ++++++++++++++----- Tests/CMakeLists.txt | 12 +++- Tests/core/CMakeLists.txt | 8 ++- Tests/simulationEngines/hecras/CMakeLists.txt | 7 ++- .../simulationEngines/telemac/CMakeLists.txt | 7 ++- docker/Dockerfile_deps | 2 +- src/CMakeLists.txt | 17 ++++-- src/core/CMakeLists.txt | 36 +++++++++--- src/core/GIS/private/reosmesh_p.cpp | 3 + .../GIS/private/reospolylinesstructure_p.cpp | 2 +- .../hydraulicNetwork/reoshydraulicnetwork.cpp | 2 + .../reoshydraulicstructure2d.cpp | 9 +++ .../reoshydraulicstructure2d.h | 3 + .../mesh/{ => gmsh}/reosgmshgenerator.cpp | 0 src/core/mesh/{ => gmsh}/reosgmshgenerator.h | 0 src/core/mesh/reosmeshgenerator.cpp | 8 ++- src/core/reosmemoryraster.h | 4 +- src/dataProviders/comephore/CMakeLists.txt | 27 ++++++--- src/dataProviders/delft-FEWS/CMakeLists.txt | 43 +++++++++----- src/dataProviders/grib/CMakeLists.txt | 37 ++++++++---- src/dataProviders/hec-dss/CMakeLists.txt | 50 ++++++++++++----- src/dataProviders/hub-eau/CMakeLists.txt | 44 ++++++++++----- .../meteofrance-api/CMakeLists.txt | 39 +++++++++---- src/simulationEngines/hecras/CMakeLists.txt | 48 +++++++++++----- src/simulationEngines/telemac/CMakeLists.txt | 33 ++++++++++- .../telemac/reostelemac2dsimulation.cpp | 1 + 26 files changed, 372 insertions(+), 126 deletions(-) rename src/core/mesh/{ => gmsh}/reosgmshgenerator.cpp (100%) rename src/core/mesh/{ => gmsh}/reosgmshgenerator.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c29f2b34..c571896e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") @@ -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") @@ -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 TELEMAC 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") @@ -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) ############################################################# @@ -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) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8ad3fdb07..41b9a15a4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -22,9 +22,19 @@ 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) diff --git a/Tests/core/CMakeLists.txt b/Tests/core/CMakeLists.txt index ab9ba6164..55c6de342 100644 --- a/Tests/core/CMakeLists.txt +++ b/Tests/core/CMakeLists.txt @@ -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) diff --git a/Tests/simulationEngines/hecras/CMakeLists.txt b/Tests/simulationEngines/hecras/CMakeLists.txt index 8dc3844d1..2aac0f8c1 100644 --- a/Tests/simulationEngines/hecras/CMakeLists.txt +++ b/Tests/simulationEngines/hecras/CMakeLists.txt @@ -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) diff --git a/Tests/simulationEngines/telemac/CMakeLists.txt b/Tests/simulationEngines/telemac/CMakeLists.txt index 884faf3e0..5a72c7673 100644 --- a/Tests/simulationEngines/telemac/CMakeLists.txt +++ b/Tests/simulationEngines/telemac/CMakeLists.txt @@ -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) diff --git a/docker/Dockerfile_deps b/docker/Dockerfile_deps index 943b8980b..b7a982fbc 100644 --- a/docker/Dockerfile_deps +++ b/docker/Dockerfile_deps @@ -1,4 +1,4 @@ -FROM ubuntu:latest +FROM ubuntu:22.04 LABEL maintainer="vcloarec@gmail.com" RUN export DEBIAN_FRONTEND=noninteractive \ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e1617037..b183d75c5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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_HYRAULIC_MODEL_SUPPORT) + ADD_SUBDIRECTORY(simulationEngines) +ENDIF(WITH_HYRAULIC_MODEL_SUPPORT) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 21b40583c..c317942ec 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -100,12 +100,17 @@ 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 + mesh/gmesh/reosgmshgenerator.cpp + ) +ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT) + SET(REOS_CORE_HEADERS reoscore.h reosapplication.h @@ -195,12 +200,16 @@ 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 + mesh/gmesh/reosgmshgenerator.h + ) +ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT) + SET(REOS_CORE_HDRS_PRIVATE GIS/private/reosdigitalelevationmodel_p.h GIS/private/reospolylinesstructure_p.h @@ -276,12 +285,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}) @@ -332,9 +346,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/gmesh +) +ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT) + include_directories(${CMAKE_SOURCE_DIR}/external/poly2tri) ADD_DEFINITIONS(-DQGIS_PLUGINS="${QGIS_PROVIDERS_PATH}") diff --git a/src/core/GIS/private/reosmesh_p.cpp b/src/core/GIS/private/reosmesh_p.cpp index 347b934c1..c2bc60669 100644 --- a/src/core/GIS/private/reosmesh_p.cpp +++ b/src/core/GIS/private/reosmesh_p.cpp @@ -753,6 +753,7 @@ ReosEncodedElement ReosMeshFrame_p::datasetGroupVectorSymbologyfromLayer( const void ReosMeshFrame_p::update3DRenderer() { +#ifdef ENABLE_3D if ( !mMeshLayer ) return; @@ -801,6 +802,8 @@ void ReosMeshFrame_p::update3DRenderer() renderer->setSymbol( symbol.release() ); mMeshLayer->setRenderer3D( renderer.release() ); + +#endif //ENABLE_3D } diff --git a/src/core/GIS/private/reospolylinesstructure_p.cpp b/src/core/GIS/private/reospolylinesstructure_p.cpp index 4e465fcf1..ed1978c4b 100644 --- a/src/core/GIS/private/reospolylinesstructure_p.cpp +++ b/src/core/GIS/private/reospolylinesstructure_p.cpp @@ -157,7 +157,7 @@ void ReosPolylineStructureVectorLayer::init() mVectorLayer->undoStack()->blockSignals( true ); QgsField field; - field.setType( QVariant::String ); + field.setType( QMetaType::Type::QString ); field.setName( QStringLiteral( "classId" ) ); mVectorLayer->addAttribute( field ); mVectorLayer->commitChanges( false ); diff --git a/src/core/hydraulicNetwork/reoshydraulicnetwork.cpp b/src/core/hydraulicNetwork/reoshydraulicnetwork.cpp index aafe2c71e..75eedf94e 100644 --- a/src/core/hydraulicNetwork/reoshydraulicnetwork.cpp +++ b/src/core/hydraulicNetwork/reoshydraulicnetwork.cpp @@ -194,7 +194,9 @@ ReosHydraulicNetwork::ReosHydraulicNetwork( ReosModule *parent, ReosGisEngine *g , mHydraulicSchemeCollection( new ReosHydraulicSchemeCollection( this ) ) { ReosHydrographRoutingMethodFactories::instantiate( this ); +#ifdef WITH_GMSH ReosGmshEngine::instantiate( this ); +#endif //WITH_GMSH mElementFactories.emplace( ReosHydrographNodeWatershed::staticType(), new ReosHydrographNodeWatershedFactory ); mElementFactories.emplace( ReosHydrographJunction::staticType(), new ReosHydrographJunctionFactory ); diff --git a/src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp b/src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp index 4efd2fa2c..0e753620a 100644 --- a/src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp +++ b/src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp @@ -15,7 +15,10 @@ ***************************************************************************/ #include "reoshydraulicstructure2d.h" #include "reosmeshgenerator.h" +#include "reospolygonstructure.h" +#ifdef WITH_GMSH #include "reosgmshgenerator.h" +#endif //WITH_GMSH #include "reostopographycollection.h" #include "reoshydraulicsimulation.h" #include "reoshydraulicstructureboundarycondition.h" @@ -37,7 +40,9 @@ ReosHydraulicStructure2D::ReosHydraulicStructure2D( const QPolygonF &domain, con , mCapabilities( GeometryEditable | MultiSimulation ) , mPolylinesStructures( ReosPolylinesStructure::createPolylineStructure( domain, crs ) ) , mMesh( ReosMesh::createMeshFrame( crs ) ) +#ifdef WITH_GMSH , mMeshGenerator( new ReosGmshGenerator( this ) ) +#endif //WITH_GMSH , mMeshResolutionController( new ReosMeshResolutionController( this, crs ) ) , mTopographyCollection( ReosTopographyCollection::createTopographyCollection( context.network()->gisEngine(), this ) ) , mRoughnessStructure( new ReosRoughnessStructure( crs ) ) @@ -98,7 +103,11 @@ ReosHydraulicStructure2D::ReosHydraulicStructure2D( if ( encodedElement.hasEncodedData( QStringLiteral( "mesh-generator" ) ) ) mMeshGenerator = ReosMeshGenerator::createMeshGenerator( encodedElement.getEncodedData( QStringLiteral( "mesh-generator" ) ), this ); else if ( hasCapability( GeometryEditable ) ) +#ifdef WITH_GMSH mMeshGenerator = new ReosGmshGenerator( this ); +#else + mMeshGenerator = nullptr; +#endif // WITH_GMSH if ( encodedElement.hasEncodedData( QStringLiteral( "topography-collection" ) ) ) mTopographyCollection = ReosTopographyCollection::createTopographyCollection( encodedElement.getEncodedData( QStringLiteral( "topography-collection" ) ), diff --git a/src/core/hydraulicNetwork/reoshydraulicstructure2d.h b/src/core/hydraulicNetwork/reoshydraulicstructure2d.h index 2bc420109..cc21b8a6f 100644 --- a/src/core/hydraulicNetwork/reoshydraulicstructure2d.h +++ b/src/core/hydraulicNetwork/reoshydraulicstructure2d.h @@ -21,7 +21,10 @@ #include "reoshydraulicnetwork.h" #include "reospolylinesstructure.h" #include "reoshydraulicsimulation.h" +#ifdef WITH_GMSH #include "reosgmshgenerator.h" +#endif //WITH GMSH +#include "reosmeshgenerator.h" #include "reosmesh.h" #include "reos3dmapsettings.h" #include "reoshydraulicsimulationresults.h" diff --git a/src/core/mesh/reosgmshgenerator.cpp b/src/core/mesh/gmsh/reosgmshgenerator.cpp similarity index 100% rename from src/core/mesh/reosgmshgenerator.cpp rename to src/core/mesh/gmsh/reosgmshgenerator.cpp diff --git a/src/core/mesh/reosgmshgenerator.h b/src/core/mesh/gmsh/reosgmshgenerator.h similarity index 100% rename from src/core/mesh/reosgmshgenerator.h rename to src/core/mesh/gmsh/reosgmshgenerator.h diff --git a/src/core/mesh/reosmeshgenerator.cpp b/src/core/mesh/reosmeshgenerator.cpp index 67c4aea00..b390e29ba 100644 --- a/src/core/mesh/reosmeshgenerator.cpp +++ b/src/core/mesh/reosmeshgenerator.cpp @@ -23,7 +23,9 @@ #include "reosparameter.h" #include "reospolylinesstructure.h" #include "reospolygonstructure.h" +#ifdef WITH_GMSH #include "reosgmshgenerator.h" +#endif //WITH_GMSH ReosMeshGeneratorProcess *ReosMeshGeneratorPoly2Tri::getGenerateMeshProcess( ReosPolylinesStructure *structure, ReosMeshResolutionController *, @@ -53,6 +55,7 @@ ReosParameterBoolean *ReosMeshGenerator::autoUpdateParameter() const ReosMeshGenerator *ReosMeshGenerator::createMeshGenerator( const ReosEncodedElement &element, QObject *parent ) { +#ifdef WITH_GMSH if ( element.description() == QStringLiteral( "mesh-generator" ) ) { QString type; @@ -65,6 +68,9 @@ ReosMeshGenerator *ReosMeshGenerator::createMeshGenerator( const ReosEncodedElem } return new ReosGmshGenerator( parent ); +#else + return nullptr; +#endif // WITH_GMSH } ReosMeshGenerator::ReosMeshGenerator( const ReosEncodedElement &element, QObject *parent ) @@ -182,7 +188,7 @@ void ReosMeshGeneratorPoly2TriProcess::start() if ( triangles.size() > INT32_MAX ) throw std::exception(); - int triangleCount = static_cast(triangles.size()); + int triangleCount = static_cast( triangles.size() ); mResult.facesIndexes.fill( QVector( 3 ), triangleCount ); diff --git a/src/core/reosmemoryraster.h b/src/core/reosmemoryraster.h index ebf6da9f0..79e6f5c2a 100755 --- a/src/core/reosmemoryraster.h +++ b/src/core/reosmemoryraster.h @@ -23,8 +23,8 @@ email : vcloarec@gmail.com #include #include -#include -#include +#include +#include #include "reosmapextent.h" diff --git a/src/dataProviders/comephore/CMakeLists.txt b/src/dataProviders/comephore/CMakeLists.txt index ca7ebb1bb..5220fef87 100644 --- a/src/dataProviders/comephore/CMakeLists.txt +++ b/src/dataProviders/comephore/CMakeLists.txt @@ -26,10 +26,14 @@ TARGET_LINK_LIBRARIES(provider_comephore ${Qt5Network_LIBRARIES} ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} - reosGui reosCore ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(provider_comephore + reosGui) +ENDIF(WITH_GUI) + set_target_properties(provider_comephore PROPERTIES @@ -38,14 +42,6 @@ set_target_properties(provider_comephore ) INCLUDE_DIRECTORIES( - ${CMAKE_BINARY_DIR}/src/ui - ${CMAKE_SOURCE_DIR}/src/gui - ${CMAKE_SOURCE_DIR}/src/gui/chart - ${CMAKE_SOURCE_DIR}/src/gui/form - ${CMAKE_SOURCE_DIR}/src/gui/data - ${CMAKE_SOURCE_DIR}/src/gui/GIS - ${CMAKE_SOURCE_DIR}/src/gui/watershed - ${CMAKE_SOURCE_DIR}/src/gui/rainfall ${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core/data ${CMAKE_SOURCE_DIR}/src/core/GIS @@ -58,6 +54,19 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/core/hydrograph ) +IF(WITH_GUI) + INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/src/ui + ${CMAKE_SOURCE_DIR}/src/gui + ${CMAKE_SOURCE_DIR}/src/gui/chart + ${CMAKE_SOURCE_DIR}/src/gui/form + ${CMAKE_SOURCE_DIR}/src/gui/data + ${CMAKE_SOURCE_DIR}/src/gui/GIS + ${CMAKE_SOURCE_DIR}/src/gui/watershed + ${CMAKE_SOURCE_DIR}/src/gui/rainfall + ) +ENDIF(WITH_GUI) + INSTALL(TARGETS provider_comephore LIBRARY DESTINATION bin/${REOS_PROVIDERS_DIR}) diff --git a/src/dataProviders/delft-FEWS/CMakeLists.txt b/src/dataProviders/delft-FEWS/CMakeLists.txt index 233662836..f4c8d3dd7 100644 --- a/src/dataProviders/delft-FEWS/CMakeLists.txt +++ b/src/dataProviders/delft-FEWS/CMakeLists.txt @@ -2,17 +2,25 @@ # Copyright (C) 2020 Vincent Cloarec (vcloarec at gmail dot com) SET(REOS_DELFT_FEWS_SOURCES - reosdelftfewswidget.cpp reosdelftfewsxmlprovider.cpp - reosdelftfewssettingswidget.cpp ) SET(REOS_DELFT_FEWS_HEADERS - reosdelftfewswidget.h reosdelftfewsxmlprovider.h - reosdelftfewssettingswidget.h ) +IF(WITH_GUI) + SET(REOS_DELFT_FEWS_SOURCES + reosdelftfewswidget.cpp + reosdelftfewssettingswidget.cpp + ) + + SET(REOS_DELFT_FEWS_HEADERS + reosdelftfewswidget.h + reosdelftfewssettingswidget.h + ) +ENDIF(WITH_GUI) + SET(LOGO_RCCS ${CMAKE_SOURCE_DIR}/images/providers/delft-fews/delft-fews-images.qrc) ADD_LIBRARY(provider_delft_FEWS MODULE @@ -32,10 +40,14 @@ TARGET_LINK_LIBRARIES(provider_delft_FEWS ${Qt5Network_LIBRARIES} ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} - reosGui reosCore ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(provider_delft_FEWS + reosGui) +ENDIF(WITH_GUI) + set_target_properties(provider_delft_FEWS PROPERTIES @@ -44,14 +56,6 @@ set_target_properties(provider_delft_FEWS ) INCLUDE_DIRECTORIES( - ${CMAKE_BINARY_DIR}/src/ui - ${CMAKE_SOURCE_DIR}/src/gui - ${CMAKE_SOURCE_DIR}/src/gui/chart - ${CMAKE_SOURCE_DIR}/src/gui/form - ${CMAKE_SOURCE_DIR}/src/gui/data - ${CMAKE_SOURCE_DIR}/src/gui/GIS - ${CMAKE_SOURCE_DIR}/src/gui/watershed - ${CMAKE_SOURCE_DIR}/src/gui/rainfall ${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core/data ${CMAKE_SOURCE_DIR}/src/core/GIS @@ -64,6 +68,19 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/core/hydrograph ) +IF(WITH_GUI) + INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/src/ui + ${CMAKE_SOURCE_DIR}/src/gui + ${CMAKE_SOURCE_DIR}/src/gui/chart + ${CMAKE_SOURCE_DIR}/src/gui/form + ${CMAKE_SOURCE_DIR}/src/gui/data + ${CMAKE_SOURCE_DIR}/src/gui/GIS + ${CMAKE_SOURCE_DIR}/src/gui/watershed + ${CMAKE_SOURCE_DIR}/src/gui/rainfall + ) +ENDIF(WITH_GUI) + INSTALL(TARGETS provider_delft_FEWS diff --git a/src/dataProviders/grib/CMakeLists.txt b/src/dataProviders/grib/CMakeLists.txt index 24b198e58..eaeae9648 100644 --- a/src/dataProviders/grib/CMakeLists.txt +++ b/src/dataProviders/grib/CMakeLists.txt @@ -3,14 +3,20 @@ SET(REOS_GRIB_SOURCES reosgribprovider.cpp - reosgribprecipitationwidget.cpp ) SET(REOS_GRIB_HEADERS reosgribprovider.h - reosgribprecipitationwidget.h ) +IF(WITH_GUI) + SET(REOS_GRIB_SOURCES + reosgribprecipitationwidget.cpp + ) + SET(REOS_GRIB_SOURCES + reosgribprecipitationwidget.h + ) +ENDIF(WITH_GUI) ADD_LIBRARY(provider_grib MODULE ${REOS_GRIB_SOURCES} @@ -28,10 +34,14 @@ TARGET_LINK_LIBRARIES(provider_grib ${Qt5Network_LIBRARIES} ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} - reosGui reosCore ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(provider_grib + reosGui) +ENDIF(WITH_GUI) + set_target_properties(provider_grib PROPERTIES @@ -40,14 +50,6 @@ set_target_properties(provider_grib ) INCLUDE_DIRECTORIES( - ${CMAKE_BINARY_DIR}/src/ui - ${CMAKE_SOURCE_DIR}/src/gui - ${CMAKE_SOURCE_DIR}/src/gui/chart - ${CMAKE_SOURCE_DIR}/src/gui/form - ${CMAKE_SOURCE_DIR}/src/gui/data - ${CMAKE_SOURCE_DIR}/src/gui/GIS - ${CMAKE_SOURCE_DIR}/src/gui/watershed - ${CMAKE_SOURCE_DIR}/src/gui/rainfall ${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core/data ${CMAKE_SOURCE_DIR}/src/core/GIS @@ -60,6 +62,19 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/core/hydrograph ) +IF(WITH_GUI) + INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/src/ui + ${CMAKE_SOURCE_DIR}/src/gui + ${CMAKE_SOURCE_DIR}/src/gui/chart + ${CMAKE_SOURCE_DIR}/src/gui/form + ${CMAKE_SOURCE_DIR}/src/gui/data + ${CMAKE_SOURCE_DIR}/src/gui/GIS + ${CMAKE_SOURCE_DIR}/src/gui/watershed + ${CMAKE_SOURCE_DIR}/src/gui/rainfall + ) +ENDIF(WITH_GUI) + INSTALL(TARGETS provider_grib diff --git a/src/dataProviders/hec-dss/CMakeLists.txt b/src/dataProviders/hec-dss/CMakeLists.txt index 30f4c7c3b..5dbe8c95d 100644 --- a/src/dataProviders/hec-dss/CMakeLists.txt +++ b/src/dataProviders/hec-dss/CMakeLists.txt @@ -13,17 +13,24 @@ SET(REOS_HEC_DSS_HEADERS SET(REOS_PROVIDER_HEC_DSS_SOURCES reosdssprovider.cpp - reosdssgriddedrainfallselector.cpp - reosdssprovideruriwidget.cpp - ) SET(REOS_PROVIDER_HEC_DSS_HEADERS reosdssprovider.h - reosdssgriddedrainfallselector.h - reosdssprovideruriwidget.h ) +IF(WITH_GUI) + SET(REOS_PROVIDER_HEC_DSS_SOURCES + reosdssgriddedrainfallselector.cpp + reosdssprovideruriwidget.cpp + ) + + SET(REOS_PROVIDER_HEC_DSS_HEADERS + reosdssgriddedrainfallselector.h + reosdssprovideruriwidget.h + ) +ENDIF(WITH_GUI) + #SET(LOGO_RCCS ${CMAKE_SOURCE_DIR}/images/providers/delft-fews/delft-fews-images.qrc) ADD_LIBRARY(reosHecDss SHARED @@ -41,11 +48,15 @@ TARGET_LINK_LIBRARIES(reosHecDss ${Qt5Network_LIBRARIES} ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} - reosGui reosCore ${HEC_DSS_ALL_STATIC_LIB} ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(reosHecDss + reosGui) +ENDIF(WITH_GUI) + ADD_LIBRARY(provider_HEC_DSS MODULE ${REOS_PROVIDER_HEC_DSS_SOURCES} ${REOS_PROVIDER_HEC_DSS_HEADERS} @@ -61,11 +72,15 @@ TARGET_LINK_LIBRARIES(provider_HEC_DSS ${Qt5Network_LIBRARIES} ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} - reosGui reosCore reosHecDss ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(provider_HEC_DSS + reosGui) +ENDIF(WITH_GUI) + set_target_properties(reosHecDss PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${REOS_OUTPUT_DIRECTORY}/$<0:> @@ -80,14 +95,6 @@ set_target_properties(provider_HEC_DSS ) INCLUDE_DIRECTORIES( - ${CMAKE_BINARY_DIR}/src/ui - ${CMAKE_SOURCE_DIR}/src/gui - ${CMAKE_SOURCE_DIR}/src/gui/chart - ${CMAKE_SOURCE_DIR}/src/gui/form - ${CMAKE_SOURCE_DIR}/src/gui/data - ${CMAKE_SOURCE_DIR}/src/gui/GIS - ${CMAKE_SOURCE_DIR}/src/gui/watershed - ${CMAKE_SOURCE_DIR}/src/gui/rainfall ${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core/data ${CMAKE_SOURCE_DIR}/src/core/GIS @@ -101,6 +108,19 @@ INCLUDE_DIRECTORIES( ${HEC_DSS_INCLUDE} ) +IF(WITH_GUI) + INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/src/ui + ${CMAKE_SOURCE_DIR}/src/gui + ${CMAKE_SOURCE_DIR}/src/gui/chart + ${CMAKE_SOURCE_DIR}/src/gui/form + ${CMAKE_SOURCE_DIR}/src/gui/data + ${CMAKE_SOURCE_DIR}/src/gui/GIS + ${CMAKE_SOURCE_DIR}/src/gui/watershed + ${CMAKE_SOURCE_DIR}/src/gui/rainfall + ) +ENDIF(WITH_GUI) + IF(WIN32) INSTALL(TARGETS reosHecDss diff --git a/src/dataProviders/hub-eau/CMakeLists.txt b/src/dataProviders/hub-eau/CMakeLists.txt index cb10c249c..9aa298544 100644 --- a/src/dataProviders/hub-eau/CMakeLists.txt +++ b/src/dataProviders/hub-eau/CMakeLists.txt @@ -3,18 +3,26 @@ SET(REOS_HUB_EAU_SOURCES reoshubeauserver.cpp - reoshubeauwidget.cpp reoshubeauhydrographprovider.cpp - reoshubeausettingswidget.cpp ) SET(REOS_HUB_EAU_HEADERS reoshubeauserver.h - reoshubeauwidget.h reoshubeauhydrographprovider.h - reoshubeausettingswidget.h ) +IF(WITH_GUI) + SET(REOS_HUB_EAU_SOURCES + reoshubeauwidget.cpp + reoshubeausettingswidget.cpp + ) + + SET(REOS_HUB_EAU_HEADERS + reoshubeauwidget.h + reoshubeausettingswidget.h + ) +ENDIF(WITH_GUI) + SET(LOGO_RCCS ${CMAKE_SOURCE_DIR}/images/providers/hub-eau/hub-eau-images.qrc) @@ -33,10 +41,13 @@ TARGET_LINK_LIBRARIES(provider_hub_eau ${Qt5Network_LIBRARIES} ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} - reosGui - reosCore ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(provider_hub_eau + reosGui) +ENDIF(WITH_GUI) + set_target_properties(provider_hub_eau PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${REOS_OUTPUT_DIRECTORY}/$<0:>${REOS_PROVIDERS_DIR} @@ -44,14 +55,6 @@ set_target_properties(provider_hub_eau ) INCLUDE_DIRECTORIES( - ${CMAKE_BINARY_DIR}/src/ui - ${CMAKE_SOURCE_DIR}/src/gui - ${CMAKE_SOURCE_DIR}/src/gui/chart - ${CMAKE_SOURCE_DIR}/src/gui/form - ${CMAKE_SOURCE_DIR}/src/gui/data - ${CMAKE_SOURCE_DIR}/src/gui/GIS - ${CMAKE_SOURCE_DIR}/src/gui/watershed - ${CMAKE_SOURCE_DIR}/src/gui/rainfall ${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core/data ${CMAKE_SOURCE_DIR}/src/core/GIS @@ -64,6 +67,19 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/core/hydrograph ) +IF(WITH_GUI) + INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/src/ui + ${CMAKE_SOURCE_DIR}/src/gui + ${CMAKE_SOURCE_DIR}/src/gui/chart + ${CMAKE_SOURCE_DIR}/src/gui/form + ${CMAKE_SOURCE_DIR}/src/gui/data + ${CMAKE_SOURCE_DIR}/src/gui/GIS + ${CMAKE_SOURCE_DIR}/src/gui/watershed + ${CMAKE_SOURCE_DIR}/src/gui/rainfall + ) +ENDIF(WITH_GUI) + INSTALL(TARGETS provider_hub_eau LIBRARY DESTINATION bin/${REOS_PROVIDERS_DIR}) diff --git a/src/dataProviders/meteofrance-api/CMakeLists.txt b/src/dataProviders/meteofrance-api/CMakeLists.txt index 870966f04..ef6e0fa24 100644 --- a/src/dataProviders/meteofrance-api/CMakeLists.txt +++ b/src/dataProviders/meteofrance-api/CMakeLists.txt @@ -4,15 +4,23 @@ SET(REOS_MF_API_SOURCES reosmeteofranceapi.cpp reosmeteofrancearomeprovider.cpp - reosmeteofrancearomeapiwidget.cpp ) SET(REOS_MF_API_HEADERS reosmeteofranceapi.h reosmeteofrancearomeprovider.h - reosmeteofrancearomeapiwidget.h ) +IF(WITH_GUI) + SET(REOS_MF_API_SOURCES + reosmeteofrancearomeapiwidget.cpp + ) + + SET(REOS_MF_API_HEADERS + reosmeteofrancearomeapiwidget.h + ) +ENDIF(WITH_GUI) + #SET(LOGO_RCCS ${CMAKE_SOURCE_DIR}/images/providers/hub-eau/hub-eau-images.qrc) @@ -30,10 +38,14 @@ TARGET_LINK_LIBRARIES(provider_mf_api ${Qt5Network_LIBRARIES} ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} - reosGui reosCore ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(provider_mf_api + reosGui) +ENDIF(WITH_GUI) + set_target_properties(provider_mf_api PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${REOS_OUTPUT_DIRECTORY}/$<0:>${REOS_PROVIDERS_DIR} @@ -41,14 +53,6 @@ set_target_properties(provider_mf_api ) INCLUDE_DIRECTORIES( - ${CMAKE_BINARY_DIR}/src/ui - ${CMAKE_SOURCE_DIR}/src/gui - ${CMAKE_SOURCE_DIR}/src/gui/chart - ${CMAKE_SOURCE_DIR}/src/gui/form - ${CMAKE_SOURCE_DIR}/src/gui/data - ${CMAKE_SOURCE_DIR}/src/gui/GIS - ${CMAKE_SOURCE_DIR}/src/gui/watershed - ${CMAKE_SOURCE_DIR}/src/gui/rainfall ${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core/data ${CMAKE_SOURCE_DIR}/src/core/GIS @@ -62,6 +66,19 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/core/network ) +IF(WITH_GUI) + INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/src/ui + ${CMAKE_SOURCE_DIR}/src/gui + ${CMAKE_SOURCE_DIR}/src/gui/chart + ${CMAKE_SOURCE_DIR}/src/gui/form + ${CMAKE_SOURCE_DIR}/src/gui/data + ${CMAKE_SOURCE_DIR}/src/gui/GIS + ${CMAKE_SOURCE_DIR}/src/gui/watershed + ${CMAKE_SOURCE_DIR}/src/gui/rainfall + ) +ENDIF(WITH_GUI) + INSTALL(TARGETS provider_mf_api LIBRARY DESTINATION bin/${REOS_PROVIDERS_DIR}) diff --git a/src/simulationEngines/hecras/CMakeLists.txt b/src/simulationEngines/hecras/CMakeLists.txt index e58fdc289..08999d04c 100644 --- a/src/simulationEngines/hecras/CMakeLists.txt +++ b/src/simulationEngines/hecras/CMakeLists.txt @@ -5,19 +5,28 @@ SET(REOS_HECRAS_SOURCES reoshecrascontroller.cpp reoshecrassimulation.cpp reoshecrassimulationresults.cpp - reoshecrassimulationimportwidget.cpp reoshecrasproject.cpp - reoshecrassimulationeditwidget.cpp ) SET(REOS_HECRAS_HEADERS reoshecrascontroller.h reoshecrassimulation.h reoshecrassimulationresults.h - reoshecrassimulationimportwidget.h reoshecrasproject.h +) + +IF(WITH_GUI) +SET(REOS_HECRAS_SOURCES + reoshecrassimulationimportwidget.cpp + reoshecrassimulationeditwidget.cpp +) + +SET(REOS_HECRAS_HEADERS + reoshecrassimulationimportwidget.h reoshecrassimulationeditwidget.h ) +ENDIF(WITH_GUI) + ADD_LIBRARY(hecras_engine MODULE ${REOS_HECRAS_SOURCES} @@ -35,11 +44,14 @@ TARGET_LINK_LIBRARIES(hecras_engine ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} ${MDAL_LIB} - reosGui reosCore reosHecDss ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(hecras_engine + reosGui) +ENDIF(WITH_GUI) set_target_properties(hecras_engine PROPERTIES @@ -52,16 +64,6 @@ IF (MSVC) ENDIF (MSVC) INCLUDE_DIRECTORIES( - ${CMAKE_BINARY_DIR}/src/ui - ${CMAKE_SOURCE_DIR}/src/gui - ${CMAKE_SOURCE_DIR}/src/gui/chart - ${CMAKE_SOURCE_DIR}/src/gui/form - ${CMAKE_SOURCE_DIR}/src/gui/data - ${CMAKE_SOURCE_DIR}/src/gui/GIS - ${CMAKE_SOURCE_DIR}/src/gui/watershed - ${CMAKE_SOURCE_DIR}/src/gui/rainfall - ${CMAKE_SOURCE_DIR}/src/gui/hydraulicNetwork - ${CMAKE_SOURCE_DIR}/src/gui/hydraulicNetwork/structure2d ${CMAKE_SOURCE_DIR}/src/core ${CMAKE_SOURCE_DIR}/src/core/data ${CMAKE_SOURCE_DIR}/src/core/GIS @@ -83,6 +85,24 @@ INCLUDE_DIRECTORIES( ${MDAL_INCLUDE_DIR} ) +IF(WITH_GUI) + INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/src/ui + ${CMAKE_SOURCE_DIR}/src/gui + ${CMAKE_SOURCE_DIR}/src/gui/chart + ${CMAKE_SOURCE_DIR}/src/gui/form + ${CMAKE_SOURCE_DIR}/src/gui/data + ${CMAKE_SOURCE_DIR}/src/gui/GIS + ${CMAKE_SOURCE_DIR}/src/gui/watershed + ${CMAKE_SOURCE_DIR}/src/gui/rainfall + ${CMAKE_SOURCE_DIR}/src/gui/hydraulicNetwork + ${CMAKE_SOURCE_DIR}/src/gui/hydraulicNetwork/structure2d + + ${QGIS_INCLUDE_DIR} + ${MDAL_INCLUDE_DIR} + ) +ENDIF(WITH_GUI) + INSTALL(TARGETS hecras_engine RUNTIME DESTINATION bin/${REOS_ENGINES_DIR} LIBRARY DESTINATION bin/${REOS_ENGINES_DIR}) diff --git a/src/simulationEngines/telemac/CMakeLists.txt b/src/simulationEngines/telemac/CMakeLists.txt index 7ffabd618..7ce5696ed 100644 --- a/src/simulationEngines/telemac/CMakeLists.txt +++ b/src/simulationEngines/telemac/CMakeLists.txt @@ -8,18 +8,26 @@ ADD_DEFINITIONS(-DTELEMAC_PYTHON_PATH="${TELEMAC_PYTHON_PATH}") SET(REOS_TELEMAC_SOURCES reostelemac2dsimulation.cpp - reostelemacsimulationeditwidget.cpp reostelemac2dsimulationresults.cpp reostelemac2dinitialcondition.cpp ) SET(REOS_TELEMAC_HEADERS reostelemac2dsimulation.h - reostelemacsimulationeditwidget.h reostelemac2dsimulationresults.h reostelemac2dinitialcondition.h ) +IF(WITH_GUI) + SET(REOS_TELEMAC_SOURCES + reostelemacsimulationeditwidget.cpp + ) + + SET(REOS_TELEMAC_HEADERS + reostelemacsimulationeditwidget.h + ) +ENDIF(WITH_GUI) + SET(LOGO_RCCS ${CMAKE_SOURCE_DIR}/images/engines/TELEMAC/telemac-images.qrc) ADD_LIBRARY(telemac_engine MODULE @@ -39,10 +47,14 @@ TARGET_LINK_LIBRARIES(telemac_engine ${Qt5Sql_LIBRARIES} ${Qt5Concurrent_LIBRARIES} ${MDAL_LIB} - reosGui reosCore ) +IF(WITH_GUI) + TARGET_LINK_LIBRARIES(telemac_engine + reosGui) +ENDIF(WITH_GUI) + set_target_properties(telemac_engine PROPERTIES @@ -83,6 +95,21 @@ INCLUDE_DIRECTORIES( ${MDAL_INCLUDE_DIR} ) +IF(WITH_GUI) + INCLUDE_DIRECTORIES( + ${CMAKE_BINARY_DIR}/src/ui + ${CMAKE_SOURCE_DIR}/src/gui + ${CMAKE_SOURCE_DIR}/src/gui/chart + ${CMAKE_SOURCE_DIR}/src/gui/form + ${CMAKE_SOURCE_DIR}/src/gui/data + ${CMAKE_SOURCE_DIR}/src/gui/GIS + ${CMAKE_SOURCE_DIR}/src/gui/watershed + ${CMAKE_SOURCE_DIR}/src/gui/rainfall + ${CMAKE_SOURCE_DIR}/src/gui/hydraulicNetwork + ${CMAKE_SOURCE_DIR}/src/gui/hydraulicNetwork/structure2d + ) +ENDIF(WITH_GUI) + INSTALL(TARGETS telemac_engine RUNTIME DESTINATION bin/${REOS_ENGINES_DIR} LIBRARY DESTINATION bin/${REOS_ENGINES_DIR}) diff --git a/src/simulationEngines/telemac/reostelemac2dsimulation.cpp b/src/simulationEngines/telemac/reostelemac2dsimulation.cpp index 6e0882822..9f81e086f 100644 --- a/src/simulationEngines/telemac/reostelemac2dsimulation.cpp +++ b/src/simulationEngines/telemac/reostelemac2dsimulation.cpp @@ -14,6 +14,7 @@ * * ***************************************************************************/ +#include "reospolygonstructure.h" #ifdef _MSC_VER #include #undef max From ed774d048d775c11ab598acbeab5d02407add08f Mon Sep 17 00:00:00 2001 From: vcloarec Date: Fri, 21 Jun 2024 17:04:56 -0400 Subject: [PATCH 3/9] remove ref to qgis GUI --- src/core/GIS/private/reosmesh_p.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/GIS/private/reosmesh_p.cpp b/src/core/GIS/private/reosmesh_p.cpp index c2bc60669..3832f09cc 100644 --- a/src/core/GIS/private/reosmesh_p.cpp +++ b/src/core/GIS/private/reosmesh_p.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include From 934746f4b076e5b09f779769e9897c15a2861abb Mon Sep 17 00:00:00 2001 From: vcloarec Date: Fri, 21 Jun 2024 17:44:31 -0400 Subject: [PATCH 4/9] remove ref to 3d --- src/core/GIS/private/reosmesh_p.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/GIS/private/reosmesh_p.cpp b/src/core/GIS/private/reosmesh_p.cpp index 3832f09cc..a62b230ed 100644 --- a/src/core/GIS/private/reosmesh_p.cpp +++ b/src/core/GIS/private/reosmesh_p.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include From e5e61ac543c4af4f8451b9072eb601ad037e45b0 Mon Sep 17 00:00:00 2001 From: vcloarec Date: Fri, 21 Jun 2024 18:04:39 -0400 Subject: [PATCH 5/9] disable sim engine in test if not WITH_HYDRAULIC_MODEL_SUPPORT --- Tests/CMakeLists.txt | 6 +++++- Tests/dataProviders/CMakeLists.txt | 1 + src/CMakeLists.txt | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 41b9a15a4..f14293b1a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -36,7 +36,11 @@ IF(WITH_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) diff --git a/Tests/dataProviders/CMakeLists.txt b/Tests/dataProviders/CMakeLists.txt index a86c0487a..b97de2260 100644 --- a/Tests/dataProviders/CMakeLists.txt +++ b/Tests/dataProviders/CMakeLists.txt @@ -6,6 +6,7 @@ add_subdirectory(grib) add_subdirectory(hydroportail) + if (COMEPHORE_TESTS_ENABLE) add_subdirectory(comephore) endif(COMEPHORE_TESTS_ENABLE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b183d75c5..51d993842 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,8 +14,8 @@ endif() ADD_SUBDIRECTORY(dataProviders) -IF(WITH_HYRAULIC_MODEL_SUPPORT) +IF(WITH_HYDRAULIC_MODEL_SUPPORT) ADD_SUBDIRECTORY(simulationEngines) -ENDIF(WITH_HYRAULIC_MODEL_SUPPORT) +ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT) From ee4ac09c871b1a2ac539ef917ebf2fb9297242da Mon Sep 17 00:00:00 2001 From: vcloarec Date: Wed, 26 Jun 2024 17:06:11 -0400 Subject: [PATCH 6/9] Isolate gmsh --- CMakeLists.txt | 3 ++- Tests/core/reos_mesh_test.cpp | 2 +- src/core/CMakeLists.txt | 8 +++++--- src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp | 2 +- src/core/hydraulicNetwork/reoshydraulicstructure2d.h | 2 +- src/core/mesh/reosmeshgenerator.cpp | 2 +- .../structure2d/reosgmshresolutioncontrollerwidget.h | 4 ++-- src/gui/mesh/reosmeshgeneratorgui.cpp | 2 +- src/gui/reosmainwindow.cpp | 6 +++--- 9 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c571896e1..c016ffae8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,7 @@ IF(ENABLE_HEC_DSS) ENDIF(MSVC) ENDIF(ENABLE_HEC_DSS) -SET(WITH_HYDRAULIC_MODEL_SUPPORT TRUE CACHE BOOL "Enable TELEMAC Model support") +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") @@ -232,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") diff --git a/Tests/core/reos_mesh_test.cpp b/Tests/core/reos_mesh_test.cpp index e01a2dd37..35b68818c 100644 --- a/Tests/core/reos_mesh_test.cpp +++ b/Tests/core/reos_mesh_test.cpp @@ -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" diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c317942ec..679e99f42 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -107,7 +107,8 @@ SET(REOS_CORE_SOURCES IF(WITH_HYDRAULIC_MODEL_SUPPORT) SET(REOS_CORE_SOURCES - mesh/gmesh/reosgmshgenerator.cpp + ${REOS_CORE_SOURCES} + mesh/gmsh/reosgmshgenerator.cpp ) ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT) @@ -206,7 +207,8 @@ SET(REOS_CORE_HEADERS IF(WITH_HYDRAULIC_MODEL_SUPPORT) SET(REOS_CORE_HEADERS - mesh/gmesh/reosgmshgenerator.h + ${REOS_CORE_HEADERS} + mesh/gmsh/reosgmshgenerator.h ) ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT) @@ -353,7 +355,7 @@ IF(WITH_HYDRAULIC_MODEL_SUPPORT) ${GMSH_INCLUDE_DIR} ) TARGET_INCLUDE_DIRECTORIES( reosCore PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/gmesh + ${CMAKE_SOURCE_DIR}/src/core/gmsh ) ENDIF(WITH_HYDRAULIC_MODEL_SUPPORT) diff --git a/src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp b/src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp index 0e753620a..f42b1a4f6 100644 --- a/src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp +++ b/src/core/hydraulicNetwork/reoshydraulicstructure2d.cpp @@ -17,7 +17,7 @@ #include "reosmeshgenerator.h" #include "reospolygonstructure.h" #ifdef WITH_GMSH -#include "reosgmshgenerator.h" +#include "gmsh/reosgmshgenerator.h" #endif //WITH_GMSH #include "reostopographycollection.h" #include "reoshydraulicsimulation.h" diff --git a/src/core/hydraulicNetwork/reoshydraulicstructure2d.h b/src/core/hydraulicNetwork/reoshydraulicstructure2d.h index cc21b8a6f..a2e831e40 100644 --- a/src/core/hydraulicNetwork/reoshydraulicstructure2d.h +++ b/src/core/hydraulicNetwork/reoshydraulicstructure2d.h @@ -22,7 +22,7 @@ #include "reospolylinesstructure.h" #include "reoshydraulicsimulation.h" #ifdef WITH_GMSH -#include "reosgmshgenerator.h" +#include "gmsh/reosgmshgenerator.h" #endif //WITH GMSH #include "reosmeshgenerator.h" #include "reosmesh.h" diff --git a/src/core/mesh/reosmeshgenerator.cpp b/src/core/mesh/reosmeshgenerator.cpp index b390e29ba..55ccad576 100644 --- a/src/core/mesh/reosmeshgenerator.cpp +++ b/src/core/mesh/reosmeshgenerator.cpp @@ -24,7 +24,7 @@ #include "reospolylinesstructure.h" #include "reospolygonstructure.h" #ifdef WITH_GMSH -#include "reosgmshgenerator.h" +#include "gmsh/reosgmshgenerator.h" #endif //WITH_GMSH ReosMeshGeneratorProcess *ReosMeshGeneratorPoly2Tri::getGenerateMeshProcess( ReosPolylinesStructure *structure, diff --git a/src/gui/hydraulicNetwork/structure2d/reosgmshresolutioncontrollerwidget.h b/src/gui/hydraulicNetwork/structure2d/reosgmshresolutioncontrollerwidget.h index bf23df4a9..e3156b7ca 100644 --- a/src/gui/hydraulicNetwork/structure2d/reosgmshresolutioncontrollerwidget.h +++ b/src/gui/hydraulicNetwork/structure2d/reosgmshresolutioncontrollerwidget.h @@ -18,7 +18,7 @@ #include -#include "reosgmshgenerator.h" +#include "gmsh/reosgmshgenerator.h" #include "reosmapitem.h" class ReosMapToolEditPolygonStructure; @@ -40,7 +40,7 @@ class ReosGmshResolutionControllerWidget : public QWidget explicit ReosGmshResolutionControllerWidget( ReosHydraulicStructure2D *structure2D, const ReosGuiContext &guiContext ); ~ReosGmshResolutionControllerWidget(); - void addToolBarActions(const QList &actions ); + void addToolBarActions( const QList &actions ); public slots: void updateParameters(); diff --git a/src/gui/mesh/reosmeshgeneratorgui.cpp b/src/gui/mesh/reosmeshgeneratorgui.cpp index 79a2e7237..04144b053 100644 --- a/src/gui/mesh/reosmeshgeneratorgui.cpp +++ b/src/gui/mesh/reosmeshgeneratorgui.cpp @@ -17,7 +17,7 @@ #include #include -#include "reosgmshgenerator.h" +#include "gmsh/reosgmshgenerator.h" ReosFormWidget *ReosFormGmshGeneratorWidgetFactory::createDataWidget( ReosDataObject *dataObject, const ReosGuiContext &context ) { diff --git a/src/gui/reosmainwindow.cpp b/src/gui/reosmainwindow.cpp index 1e590d844..269757c3f 100644 --- a/src/gui/reosmainwindow.cpp +++ b/src/gui/reosmainwindow.cpp @@ -35,7 +35,7 @@ email : vcloarec at gmail dot com #include "reosgisengine.h" #include "reosplotwidget.h" #include "reosstyleregistery.h" -#include "reosgmshgenerator.h" +#include "gmsh/reosgmshgenerator.h" ReosMainWindow::ReosMainWindow( ReosModule *rootModule, QWidget *parent ) @@ -298,12 +298,12 @@ void ReosMainWindow::languageSelection() void ReosMainWindow::newVersionAvailable() { - new ReosVersionMessageBox( this, version(), false ); + new ReosVersionMessageBox( this, version(), false ); } ReosModule *ReosMainWindow::rootModule() const { - return mRootModule; + return mRootModule; } ReosModule *ReosMainWindow::guiRootModule() const From f93317a107a56b4ef4f3a4dc2d28a56228cd9e9a Mon Sep 17 00:00:00 2001 From: vcloarec Date: Wed, 26 Jun 2024 17:41:49 -0400 Subject: [PATCH 7/9] upgrade python for CI --- windows/build_QGIS.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/build_QGIS.ps1 b/windows/build_QGIS.ps1 index c727c18fe..5e85bec75 100644 --- a/windows/build_QGIS.ps1 +++ b/windows/build_QGIS.ps1 @@ -5,7 +5,7 @@ $env:QGIS_SRC=Get-Location $OSGEO_DIR=$env:OSGEO4W_ROOT $BUILDCONF="Release" -$PYTHONHOME=Join-Path $OSGEO_DIR "apps\Python39" +$PYTHONHOME=Join-Path $OSGEO_DIR "apps\Python312" Write-Host "=== Python HOME" ls $PYTHONHOME @@ -60,7 +60,7 @@ cmake -S $env:QGIS_SRC ` -D SQLITE3_LIBRARY=$OSGEO_DIR/lib/sqlite3_i.lib ` -D SPATIALITE_LIBRARY=$OSGEO_DIR/lib/spatialite_i.lib ` -D SPATIALINDEX_LIBRARY=$OSGEO_DIR/lib/spatialindex-64.lib ` - -D Python_EXECUTABLE=$OSGEO_DIR/apps/python39/python3.exe ` + -D Python_EXECUTABLE=$OSGEO_DIR/apps/python312/python3.exe ` -D SIP_MODULE_EXECUTABLE=$PYTHONHOME/Scripts/sip-module.exe ` -D PYUIC_PROGRAM=$PYTHONHOME/Scripts/pyuic5.exe ` -D PYRCC_PROGRAM=$PYTHONHOME/Scripts/pyrcc5.exe ` From de68de868dc0623abb1b46ecdd345a0d41b8c74e Mon Sep 17 00:00:00 2001 From: vcloarec Date: Wed, 26 Jun 2024 17:59:10 -0400 Subject: [PATCH 8/9] use QGIS master in CI --- .github/workflows/windows_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows_test.yml b/.github/workflows/windows_test.yml index da4a1d388..907ed22ef 100644 --- a/.github/workflows/windows_test.yml +++ b/.github/workflows/windows_test.yml @@ -60,7 +60,7 @@ jobs: with: repository: vcloarec/QGIS path: QGIS - ref: forLekanMaster + ref: master - name: check QGIS hash id: getQgisHash From 7dcf1715ee55849ec41d4824dcf63f5ccb63a721 Mon Sep 17 00:00:00 2001 From: vcloarec Date: Wed, 26 Jun 2024 18:20:49 -0400 Subject: [PATCH 9/9] fix python version --- windows/load_osgeo.ps1 | 1 - windows/qgis_env_before_powershell.bat | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/windows/load_osgeo.ps1 b/windows/load_osgeo.ps1 index 4f3262d75..e692d25b2 100644 --- a/windows/load_osgeo.ps1 +++ b/windows/load_osgeo.ps1 @@ -35,7 +35,6 @@ Write-Host "=================================================" --autoaccept ` --delete-orphans ` --local-package-dir "$env:APPDATA/OSGeo4W-Packages" ` - --menu-name "QGIS LTR" ` --no-desktop ` --packages qgis-deps ` --root $osgeo_root_install ` diff --git a/windows/qgis_env_before_powershell.bat b/windows/qgis_env_before_powershell.bat index 45abc9fbe..5dec6c3a8 100644 --- a/windows/qgis_env_before_powershell.bat +++ b/windows/qgis_env_before_powershell.bat @@ -2,7 +2,7 @@ rem batch echo off set PATH=%WINDIR%\system32;%WINDIR%\system32\WindowsPowerShell\v1.0;%WINDIR%;%WINDIR%\system32\WBem;%CMAKE_PATH% -set PATH=%PATH%;%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\Python39;%OSGEO4W_ROOT%\apps\gdal-dev;%OSGEO4W_ROOT%\apps\gdal-dev\bin +set PATH=%PATH%;%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\Python312;%OSGEO4W_ROOT%\apps\gdal-dev;%OSGEO4W_ROOT%\apps\gdal-dev\bin for %%f in ("%OSGEO4W_ROOT%\etc\ini\*.bat") do call "%%f" powershell -Command %1