From 628583d17fc56446dd9bb169652425ce298bd6d3 Mon Sep 17 00:00:00 2001 From: Samuli Vuorinen Date: Mon, 30 Aug 2021 15:13:25 +0300 Subject: [PATCH 1/6] Fix typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 56810eb..0a8a576 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ HaloRay.exe -platform windows:dpiawareness=2 HaloRay writes a log file to help in troubleshooting. On Windows you can find it in `%LOCALAPPDATA%\Temp\haloray\haloray.log` where -`%LOCALAPPDATA` is usually equal to `C:\Users\\AppData\Local` +`%LOCALAPPDATA%` is usually equal to `C:\Users\\AppData\Local` On Linux the log file is in `/tmp/haloray/haloray.log` From c0f46b9b4f103adff4f933a21b030448cc449373 Mon Sep 17 00:00:00 2001 From: Samuli Vuorinen Date: Wed, 4 May 2022 16:32:13 +0300 Subject: [PATCH 2/6] Rotate auth token Github recommended rotation the auth token used by AppVeyor to add new releases to Github. The token is encrypted by AppVeyor. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 76cf0fc..de75422 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,6 +24,6 @@ deploy: description: "" skip_tags: true auth_token: - secure: qxadIRLRDKo8Tji0y+kZ03BIbNPJzdmp2HkzE6+G5lp1xtRCoeSpp6c4m4KU99D4 + secure: eMwk/VxPE6NFjxlZpAAFZuf66bhTSGr53RDKw4DYPFhKomd2jybUE1y2dHQDAjgG on: branch: master From 20215fbbc56ec3803d536efbf1359686462afbbb Mon Sep 17 00:00:00 2001 From: Samuli Vuorinen Date: Sat, 23 Jul 2022 17:40:02 +0300 Subject: [PATCH 3/6] Change index-of-refraction calculation Changed equation used to calculate index of refraction for use switched from one provided in Stanley Gedzelman's paper Simulatin Rainbows and Halos in Color to a polynomial fitted to data provided by Warren and Brandt in their paper Optical Constants of Ice from The Ultraviolet to The Microwave, which is what HaloPoint 2.0 uses. --- CHANGELOG.md | 10 ++++++++++ src/haloray-core/resources/shaders/raytrace.glsl | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9548c89..49bf85d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Changed equation used to calculate index of refraction for use switched from + one provided in Stanley Gedzelman's paper Simulatin Rainbows and Halos in + Color to a polynomial fitted to data provided by Warren and Brandt in their + paper Optical Constants of Ice from The Ultraviolet to The Microwave, which + is what HaloPoint 2.0 used to use + ## 4.0.1 - 2021-08-26 ### Fixed diff --git a/src/haloray-core/resources/shaders/raytrace.glsl b/src/haloray-core/resources/shaders/raytrace.glsl index 341800d..d0cab77 100644 --- a/src/haloray-core/resources/shaders/raytrace.glsl +++ b/src/haloray-core/resources/shaders/raytrace.glsl @@ -208,8 +208,10 @@ float zFit_1931(float wave) float getIceIOR(float wavelength) { - // Eq. from Simulating rainbows and halos in color by Stanley Gedzelman - return 1.3203 - 0.0000333 * wavelength; + // The index of refraction is based on a second degree polynomial fitted to data from + // "Optical constants of ice from the ultraviolet to the microwave" by Warren and Brandt + // The raw data is available here: https://atmos.uw.edu/ice_optical_constants/ + return 9.35698756194051e-8 * wavelength * wavelength - 1.42326056729702e-4 * wavelength + 1.36093233643442; } uint selectFirstTriangle(vec3 rayDirection) From e360228022b0d566f45a6485cd0278f6d4e7085d Mon Sep 17 00:00:00 2001 From: Samuli Vuorinen Date: Sat, 23 Jul 2022 18:32:26 +0300 Subject: [PATCH 4/6] Set application and organization name to enable using QSettings QSettings can be used to store the latest folder used to open or save files. Instead of repeatedly passing the application and organization names to the QSettings member functions, they are set globally. --- src/main/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/main.cpp b/src/main/main.cpp index e0a0ea4..cfc4686 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -101,6 +101,9 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(haloray); initializeLogging(); + QCoreApplication::setOrganizationName("Other Computer Software"); + QCoreApplication::setApplicationName("HaloRay"); + QGuiApplication::setAttribute(Qt::AA_UseDesktopOpenGL); QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); From 127478fc44e7415e70a2a1d55014c16076cb559c Mon Sep 17 00:00:00 2001 From: Samuli Vuorinen Date: Sat, 23 Jul 2022 18:59:34 +0300 Subject: [PATCH 5/6] Remember folder used for savings or opening files most recently When you open or save files like simulation INI files or image files with HaloRay, the folder is remembered. The next time you open the file dialog, it opens the same folder, unless it has stopped existing. --- CHANGELOG.md | 3 +++ src/haloray-core/gui/mainWindow.cpp | 38 +++++++++++++++++++++++------ src/haloray-core/gui/mainWindow.h | 5 +++- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49bf85d..739b043 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ and this project adheres to Color to a polynomial fitted to data provided by Warren and Brandt in their paper Optical Constants of Ice from The Ultraviolet to The Microwave, which is what HaloPoint 2.0 used to use +- HaloRay now remembers which folder you opened last when loading or saving + files like simulation parameter files or images, and opens the file dialog + picker in that same folder the next time ## 4.0.1 - 2021-08-26 diff --git a/src/haloray-core/gui/mainWindow.cpp b/src/haloray-core/gui/mainWindow.cpp index 44e1790..68610bb 100644 --- a/src/haloray-core/gui/mainWindow.cpp +++ b/src/haloray-core/gui/mainWindow.cpp @@ -98,39 +98,43 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_previousTimedIt auto defaultFilename = QString("haloray_%1.png") .arg(currentTime) .replace(":", "-"); + auto defaultFilePath = getLatestAccessedFolder().absoluteFilePath(defaultFilename); QString filename = QFileDialog::getSaveFileName(this, tr("Save File"), - defaultFilename, + defaultFilePath, tr("Images (*.png)")); - if (!filename.isNull()) - { - image.save(filename, "PNG", 50); - } + if (filename.isNull()) return; + + image.save(filename, "PNG", 50); + updateLatestAccessedFolder(filename); }); connect(m_saveSimulationAction, &QAction::triggered, [this]() { auto currentTime = QDateTime::currentDateTimeUtc().toString(Qt::DateFormat::ISODate); auto defaultFilename = QString("haloray_sim_%1.ini") .arg(currentTime) .replace(":", "-"); + auto defaultFilePath = getLatestAccessedFolder().absoluteFilePath(defaultFilename); QString filename = QFileDialog::getSaveFileName(this, tr("Save File"), - defaultFilename, + defaultFilePath, tr("Simulation files (*.ini)")); if (filename.isNull()) return; StateSaver::SaveState(filename, m_engine, m_crystalRepository.get()); + updateLatestAccessedFolder(filename); }); connect(m_loadSimulationAction, &QAction::triggered, [this]() { QString filename = QFileDialog::getOpenFileName(this, tr("Open file"), - QString(), + getLatestAccessedFolder().absolutePath(), tr("Simulation files (*.ini)")); if (filename.isNull()) return; StateSaver::LoadState(filename, m_simulationStateModel, m_crystalModel); + updateLatestAccessedFolder(filename); }); connect(m_openCrystalPreviewWindow, &QAction::triggered, [this]() { auto previewWindow = new CrystalPreviewWindow(m_crystalModel, m_crystalSettingsWidget->getCurrentPopulationIndex(), this); @@ -273,4 +277,24 @@ void HaloRay::MainWindow::restartSimulation() m_openGLWidget->update(); } +QDir MainWindow::getLatestAccessedFolder() const +{ + QSettings settings; + QString pathString = settings.value("filedialog/latestFolder", QString()).toString(); + QDir dir(pathString); + if (dir.exists()) { + return dir; + } + + return QDir(); +} + +void MainWindow::updateLatestAccessedFolder(QString fileOrDirPath) +{ + QFileInfo fileInfo(fileOrDirPath); + QString path = fileInfo.absoluteDir().path(); + QSettings settings; + settings.setValue("filedialog/latestFolder", path); +} + } diff --git a/src/haloray-core/gui/mainWindow.h b/src/haloray-core/gui/mainWindow.h index 66aebc2..63c8292 100644 --- a/src/haloray-core/gui/mainWindow.h +++ b/src/haloray-core/gui/mainWindow.h @@ -4,11 +4,11 @@ #include #include "gui/models/simulationStateModel.h" - class QDoubleSpinBox; class QProgressBar; class QScrollArea; class QAction; +class QDir; namespace HaloRay { @@ -39,6 +39,9 @@ class MainWindow : public QMainWindow void setupRenderTimer(); void restartSimulation(); + QDir getLatestAccessedFolder() const; + void updateLatestAccessedFolder(QString fileOrDirPath); + GeneralSettingsWidget *m_generalSettingsWidget; CrystalSettingsWidget *m_crystalSettingsWidget; ViewSettingsWidget *m_viewSettingsWidget; From 617087c5551fd25352ebac925a947a94a4013af6 Mon Sep 17 00:00:00 2001 From: Samuli Vuorinen Date: Sat, 23 Jul 2022 19:07:43 +0300 Subject: [PATCH 6/6] Bump version number --- CHANGELOG.md | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 739b043..668289a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 4.1.0 - 2022-07-23 ### Changed diff --git a/appveyor.yml b/appveyor.yml index de75422..ddb97ee 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: "4.0.1-{build}" +version: "4.1.0-{build}" branches: only: - master