diff --git a/agrolib/graphics/mapGraphicsRasterUtm.cpp b/agrolib/graphics/mapGraphicsRasterUtm.cpp index 6722cc945..73d23b474 100644 --- a/agrolib/graphics/mapGraphicsRasterUtm.cpp +++ b/agrolib/graphics/mapGraphicsRasterUtm.cpp @@ -53,11 +53,10 @@ void RasterUtmObject::clear() _rasterPointer = nullptr; _colorLegendPointer = nullptr; + isLoaded = false; _utmZone = NODATA; _refCenterPixel = QPointF(NODATA, NODATA); - - isLoaded = false; } diff --git a/agrolib/project/project.cpp b/agrolib/project/project.cpp index 74bb1f1af..142590198 100644 --- a/agrolib/project/project.cpp +++ b/agrolib/project/project.cpp @@ -1002,7 +1002,8 @@ bool Project::loadDEM(QString myFileName) setColorScale(noMeteoTerrain, DEM.colorScale); // initialize radiation maps (slope, aspect, lat/lon, transmissivity, etc.) - if (radiationMaps != nullptr) radiationMaps->clear(); + if (radiationMaps != nullptr) + radiationMaps->clear(); radiationMaps = new Crit3DRadiationMaps(DEM, gisSettings); // initialize hourly meteo maps @@ -1707,6 +1708,7 @@ QDateTime Project::findDbPointFirstTime() return firstTime; } + void Project::checkMeteoPointsDEM() { for (int i=0; i < nrMeteoPoints; i++) diff --git a/bin/CRITERIA3D/mainwindow.cpp b/bin/CRITERIA3D/mainwindow.cpp index ec22dcc1e..5c681cdd5 100644 --- a/bin/CRITERIA3D/mainwindow.cpp +++ b/bin/CRITERIA3D/mainwindow.cpp @@ -666,8 +666,8 @@ void MainWindow::drawProject() void MainWindow::clearMaps_GUI() { - rasterDEM->clear(); rasterOutput->clear(); + rasterDEM->clear(); ui->labelInputRaster->setText(""); ui->labelOutputRaster->setText(""); @@ -789,7 +789,6 @@ void MainWindow::on_timeEdit_valueChanged(int myHour) } - void MainWindow::on_actionLoad_DEM_triggered() { QString fileName = QFileDialog::getOpenFileName(this, tr("Open Digital Elevation Model"), "", @@ -797,17 +796,14 @@ void MainWindow::on_actionLoad_DEM_triggered() if (fileName == "") return; - rasterDEM->setDrawing(false); - rasterOutput->setDrawing(false); + clearMaps_GUI(); if (! myProject.loadDEM(fileName)) return; - rasterDEM->setDrawing(true); - rasterOutput->setDrawing(true); - - this->renderDEM(); + renderDEM(); } + void MainWindow::on_actionOpenProject_triggered() { QString projectPath = myProject.getDefaultPath() + PATH_PROJECT;