From 23f9f3714d3d35fec3853327099a4eebb1e5f28f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 5 Oct 2017 16:21:22 -0700 Subject: [PATCH 01/20] Update Slack signup link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 765271bcfa..48ef4988f4 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,4 @@ The project stems from the same academic collaboration between Sweden’s [Link This repository contains the source code and example scenes for OpenSpace, but does not contain any data. To build and install the client, we refer to the [Wiki](https://github.com/OpenSpace/OpenSpace/wiki) pages here on GitHub, specifically [building](https://github.com/OpenSpace/OpenSpace/wiki/General-Getting-Started-Guide%3A-Compiling-OpenSpace) for [Windows](https://github.com/OpenSpace/OpenSpace/wiki/Guides-Compile-OpenSpace-on-Windows), [Linux](https://github.com/OpenSpace/OpenSpace/wiki/Guides-Compile-OpenSpace-on-Linux), and [MacOS](https://github.com/OpenSpace/OpenSpace/wiki/Guides-Compile-OpenSpace-on-OSX). Required preexisting dependencies are: [Boost](http://www.boost.org/) and [Qt](http://www.qt.io/download). Feel free to create issues for missing features, bug reports, or compile problems or contact us via [email](mailto:alexander.bock@me.com?subject=OpenSpace:). -Regarding any issues, you are very welcome on our [Slack support channel](https://openspacesupport.slack.com) to which you can freely [sign-up](https://join.slack.com/openspacesupport/shared_invite/MjA4ODY1MDQzNTUzLTE0OTk0MzUyODEtOGZkYTMwNmI5ZA). +Regarding any issues, you are very welcome on our [Slack support channel](https://openspacesupport.slack.com) to which you can freely [sign-up](https://join.slack.com/t/openspacesupport/shared_invite/enQtMjUxNzUyMTQ1ODQxLTI4YjNmMTY3ZDI1N2Q1NWM1ZjQ1NTQyNzAxM2YyMGQ5Y2NmYWJiNjI1NjU4YTkyNTc5ZDE5NzdhNGM2YmUzYTk). From 45d567617757900b9760a9cfd24fdf90adae1fee Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 10 Oct 2017 11:27:29 -0400 Subject: [PATCH 02/20] Minor compile fixes --- modules/galaxy/rendering/renderablegalaxy.cpp | 2 +- modules/galaxy/rendering/renderablegalaxy.h | 2 +- modules/galaxy/tasks/milkywayconversiontask.cpp | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index f01aff865c..8802f3bf86 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -158,7 +158,7 @@ void RenderableGalaxy::initialize() { _aspect = static_cast(_volumeDimensions); _aspect = _aspect / std::max(std::max(_aspect.x, _aspect.y), _aspect.z); - RawVolumeReader> reader(_volumeFilename, _volumeDimensions); + volume::RawVolumeReader> reader(_volumeFilename, _volumeDimensions); _volume = reader.read(); _texture = std::make_unique( diff --git a/modules/galaxy/rendering/renderablegalaxy.h b/modules/galaxy/rendering/renderablegalaxy.h index cb398be19c..638ba8690b 100644 --- a/modules/galaxy/rendering/renderablegalaxy.h +++ b/modules/galaxy/rendering/renderablegalaxy.h @@ -63,7 +63,7 @@ private: std::string _pointsFilename; std::unique_ptr _raycaster; - std::unique_ptr>> _volume; + std::unique_ptr>> _volume; std::unique_ptr _texture; glm::mat4 _pointTransform; glm::vec3 _aspect; diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index 9a32d4cce8..f850cf42b1 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -83,6 +83,8 @@ std::string MilkywayConversionTask::description() } void MilkywayConversionTask::perform(const Task::ProgressCallback& progressCallback) { + using namespace openspace::volume; + std::vector filenames; for (int i = 0; i < _inNSlices; i++) { filenames.push_back(_inFilenamePrefix + std::to_string(i + _inFirstIndex) + _inFilenameSuffix); From fe8e893b81bd9a5002dad06c06603b2e48a13ea8 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 10 Oct 2017 11:45:40 -0400 Subject: [PATCH 03/20] Restore the current working directory if there is an error in the scene loading (closes #342) --- src/scene/sceneloader.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/scene/sceneloader.cpp b/src/scene/sceneloader.cpp index 54a6f5db44..8f44613c5d 100644 --- a/src/scene/sceneloader.cpp +++ b/src/scene/sceneloader.cpp @@ -95,20 +95,27 @@ std::unique_ptr SceneLoader::loadScene(const std::string& path) { // inside the modules to toggle settings. ghoul::lua::runScriptFile(state, absScenePath); std::vector keys = moduleDictionary.keys(); - ghoul::filesystem::Directory oldDirectory = FileSys.currentDirectory(); std::vector allNodes; - for (const std::string& key : keys) { - std::string fullModuleName = moduleDictionary.value(key); - std::replace(fullModuleName.begin(), fullModuleName.end(), '/', FileSys.PathSeparator); - std::string modulePath = FileSys.pathByAppendingComponent(modulesPath, fullModuleName); + { + // Inside loadDirectory the working directory is changed (for now), so we need + // to save the old state + ghoul::filesystem::Directory oldDirectory = FileSys.currentDirectory(); + + // Placing this head to guard against exceptions in the directory loading that + // would otherwise mess up the working directory for everyone else + OnExit([&]() { FileSys.setCurrentDirectory(oldDirectory); }); - std::vector nodes = loadDirectory(modulePath, state); - std::move(nodes.begin(), nodes.end(), std::back_inserter(allNodes)); + for (const std::string& key : keys) { + std::string fullName = moduleDictionary.value(key); + std::replace(fullName.begin(), fullName.end(), '/', FileSys.PathSeparator); + std::string path = FileSys.pathByAppendingComponent(modulesPath, fullName); + + std::vector nodes = loadDirectory(path, state); + std::move(nodes.begin(), nodes.end(), std::back_inserter(allNodes)); + } } - - FileSys.setCurrentDirectory(oldDirectory); std::unique_ptr scene = std::make_unique(); @@ -206,6 +213,8 @@ std::vector SceneLoader::loadDirectory( if (FileSys.fileExists(moduleFile)) { // TODO: Get rid of changing the working directory (global state is bad) -- emiax // This requires refactoring all renderables to not use relative paths in constructors. + // For now, no need to reset the directory here as it is done from the outside + // function calling this method FileSys.setCurrentDirectory(ghoul::filesystem::Directory(path)); // We have a module file, so it is a direct include. From 93534d13bcf44409f43f766925950dbf12d3b674 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 10 Oct 2017 12:34:11 -0400 Subject: [PATCH 04/20] Fix error with preInitialization timestep being overwritten --- include/openspace/util/timemanager.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/openspace/util/timemanager.h b/include/openspace/util/timemanager.h index 2a7ef4d21b..d2f207ea2e 100644 --- a/include/openspace/util/timemanager.h +++ b/include/openspace/util/timemanager.h @@ -44,8 +44,9 @@ public: void clearKeyframes(); void setTimeNextFrame(Time t); size_t nKeyframes() const; + private: - bool _shouldSetTime; + bool _shouldSetTime = false; Time _timeNextFrame; Timeline