From 938ce5780231618c1fd42f786ece27a244ac9078 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Mon, 3 Mar 2025 17:24:15 +0100 Subject: [PATCH 1/5] Update nautical mile abbreviation to an accepted one "nm" is non-standard. It should apparently be either M, NM or nmi --- include/openspace/util/distanceconversion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openspace/util/distanceconversion.h b/include/openspace/util/distanceconversion.h index 1f09acb207..7f061896db 100644 --- a/include/openspace/util/distanceconversion.h +++ b/include/openspace/util/distanceconversion.h @@ -115,7 +115,7 @@ DistanceUnitNames { { { "Furlong", "Furlongs", "fur" }, { "Mile", "Miles", "mi" }, { "League", "Leagues", "league" }, - { "Nautical Mile", "Nautical Miles", "nm" } + { "Nautical Mile", "Nautical Miles", "NM" } }}; constexpr bool isValidDistanceUnitName(std::string_view name) { From b9910befcf26a13a42139f343601c876e6b9b46c Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 3 Mar 2025 17:34:47 +0100 Subject: [PATCH 2/5] Fix spelling error in the HEEQ rotation asset --- .../heliosphere/bastille_day/carrington_to_heeq_rotation.asset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/assets/scene/solarsystem/heliosphere/bastille_day/carrington_to_heeq_rotation.asset b/data/assets/scene/solarsystem/heliosphere/bastille_day/carrington_to_heeq_rotation.asset index d7e7bedefe..c4607f4f9f 100644 --- a/data/assets/scene/solarsystem/heliosphere/bastille_day/carrington_to_heeq_rotation.asset +++ b/data/assets/scene/solarsystem/heliosphere/bastille_day/carrington_to_heeq_rotation.asset @@ -1,5 +1,5 @@ local CarringtonLongitudeToHEEQ180Rotation = { - -- This isa rotation matrix to go from the Carrington longitude reference frame to the + -- This is a rotation matrix to go from the Carrington longitude reference frame to the -- HEEQ180 reference frame. At the reference time, MAS_seq = 0, 2000-07-14T08:33:37.105 -- the Carrington longitude was 309.3 degrees. -- Difference from HEEQ => 360-309.3=50.7 (or 0-309.3 = -309.3). However this leads to From 80dcc0db3a7d755dbec14a0428066da509569ad3 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 3 Mar 2025 22:48:50 +0100 Subject: [PATCH 3/5] Revert C++ version back to 20 due to a bug in Clang17 https://github.com/llvm/llvm-project/issues/61415 --- apps/OpenSpace/ext/sgct | 2 +- ext/ghoul | 2 +- support/cmake/set_openspace_compile_settings.cmake | 4 +++- support/coding/codegen | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 35fa986062..3fca4ba79f 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 35fa9860620f6deea4c0fc6220d815ed4524bf37 +Subproject commit 3fca4ba79fc25ca2887a7cbfb8974dddb086804e diff --git a/ext/ghoul b/ext/ghoul index 5e61410f45..e7ff4891f4 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 5e61410f45f850498b4b5c39f6f135d96f6a1f89 +Subproject commit e7ff4891f43e1358e03f344faba81e137334b6dc diff --git a/support/cmake/set_openspace_compile_settings.cmake b/support/cmake/set_openspace_compile_settings.cmake index 98c613b186..2a124d3e32 100644 --- a/support/cmake/set_openspace_compile_settings.cmake +++ b/support/cmake/set_openspace_compile_settings.cmake @@ -23,7 +23,9 @@ ########################################################################################## function (set_openspace_compile_settings target) - target_compile_features(${target} PUBLIC cxx_std_23) + # Switching to cxx_std_23 triggers a bug in Clang17 + # https://github.com/llvm/llvm-project/issues/61415 + target_compile_features(${target} PUBLIC cxx_std_20) set(MSVC_WARNINGS "/MP" # Multi-threading support diff --git a/support/coding/codegen b/support/coding/codegen index 83239bacae..3d3cb4e0c0 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit 83239bacae73119928ee68daf144775eae3024f8 +Subproject commit 3d3cb4e0c00d82f886531ffe9698961d0104a88d From 501fab40e82cf554b269f35ae2697149d2681292 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 4 Mar 2025 09:42:55 +0100 Subject: [PATCH 4/5] Make the "Clear Projections" in the ProjectionComponent actually a button --- modules/spacecraftinstruments/util/projectioncomponent.cpp | 7 ++++--- modules/spacecraftinstruments/util/projectioncomponent.h | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index a429957f1c..c854520475 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -175,12 +175,13 @@ documentation::Documentation ProjectionComponent::Documentation() { ProjectionComponent::ProjectionComponent() : properties::PropertyOwner({ "ProjectionComponent", "Projection Component" }) , _performProjection(ProjectionInfo, true) - , _clearAllProjections(ClearProjectionInfo, false) + , _clearAllProjections(ClearProjectionInfo) , _projectionFading(FadingInfo, 1.f, 0.f, 1.f) , _textureSize(TextureSizeInfo, glm::ivec2(16), glm::ivec2(16), glm::ivec2(32768)) , _applyTextureSize(ApplyTextureSizeInfo) { addProperty(_performProjection); + _clearAllProjections.onChange([this]() { _needsClearProjection = true; }); addProperty(_clearAllProjections); addProperty(_projectionFading); @@ -790,7 +791,7 @@ bool ProjectionComponent::doesPerformProjection() const { } bool ProjectionComponent::needsClearProjection() const { - return _clearAllProjections; + return _needsClearProjection; } bool ProjectionComponent::needsMipMapGeneration() const { @@ -857,7 +858,7 @@ void ProjectionComponent::clearAllProjections() { glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); - _clearAllProjections = false; + _needsClearProjection = false; _mipMapDirty = true; } diff --git a/modules/spacecraftinstruments/util/projectioncomponent.h b/modules/spacecraftinstruments/util/projectioncomponent.h index 0de6753ef9..d83f80577f 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.h +++ b/modules/spacecraftinstruments/util/projectioncomponent.h @@ -27,9 +27,9 @@ #include -#include #include #include +#include #include #include #include @@ -100,7 +100,7 @@ private: protected: properties::BoolProperty _performProjection; - properties::BoolProperty _clearAllProjections; + properties::TriggerProperty _clearAllProjections; properties::FloatProperty _projectionFading; properties::IVec2Property _textureSize; @@ -125,7 +125,8 @@ protected: GLuint _depthFboID = 0; GLint _defaultFBO = 0; - GLint _viewport[4] = { 0, 0, 0, 0}; + GLint _viewport[4] = { 0, 0, 0, 0 }; + bool _needsClearProjection = false; struct { bool isEnabled = false; From 25f7a2f1e40e861bba4f26105308df2838ee5bb9 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 4 Mar 2025 11:43:44 +0100 Subject: [PATCH 5/5] Fix assertion failures in the ImGUI UI code --- modules/imgui/src/renderproperties.cpp | 133 +++++++++++++++++++------ 1 file changed, 100 insertions(+), 33 deletions(-) diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp index 6b24c90acc..246bdba40c 100644 --- a/modules/imgui/src/renderproperties.cpp +++ b/modules/imgui/src/renderproperties.cpp @@ -240,11 +240,6 @@ void renderStringProperty(Property* prop, const std::string& ownerName, void renderListProperty(const std::string& name, const std::string& fullIdentifier, const std::string& stringValue) { - ghoul_assert( - stringValue.size() > 2, - "an empty list should have the string value '[]'" - ); - // Remove brackets from the string value const std::string value = stringValue.substr(1, stringValue.size() - 2); @@ -371,8 +366,8 @@ void renderIntProperty(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); IntProperty::ValueType value = *p; - const int min = p->minValue(); - const int max = p->maxValue(); + const int min = std::max(p->minValue(), std::numeric_limits::lowest() + 1); + const int max = std::min(p->maxValue(), std::numeric_limits::max() - 1); const bool changed = ImGui::SliderInt(name.c_str(), &value, min, max); if (showTooltip) { @@ -395,8 +390,14 @@ void renderIVec2Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); IVec2Property::ValueType value = *p; - const int min = glm::compMin(p->minValue()); - const int max = glm::compMax(p->maxValue()); + const int min = std::max( + glm::compMin(p->minValue()), + std::numeric_limits::lowest() / 2 + ); + const int max = std::min( + glm::compMax(p->maxValue()), + std::numeric_limits::max() / 2 + ); const bool changed = ImGui::SliderInt2(name.c_str(), &value.x, min, max); if (showTooltip) { renderTooltip(prop, tooltipDelay); @@ -418,8 +419,14 @@ void renderIVec3Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); IVec3Property::ValueType value = *p; - const int min = glm::compMin(p->minValue()); - const int max = glm::compMax(p->maxValue()); + const int min = std::max( + glm::compMin(p->minValue()), + std::numeric_limits::lowest() / 2 + ); + const int max = std::min( + glm::compMax(p->maxValue()), + std::numeric_limits::max() / 2 + ); const bool changed = ImGui::SliderInt3(name.c_str(), &value.x, min, max); if (showTooltip) { renderTooltip(prop, tooltipDelay); @@ -440,8 +447,14 @@ void renderIVec4Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); IVec4Property::ValueType value = *p; - const int min = glm::compMin(p->minValue()); - const int max = glm::compMax(p->maxValue()); + const int min = std::max( + glm::compMin(p->minValue()), + std::numeric_limits::lowest() / 2 + ); + const int max = std::min( + glm::compMax(p->maxValue()), + std::numeric_limits::max() / 2 + ); const bool changed = ImGui::SliderInt4(name.c_str(), &value.x, min, max); if (showTooltip) { renderTooltip(prop, tooltipDelay); @@ -462,8 +475,8 @@ void renderFloatProperty(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); FloatProperty::ValueType value = *p; - const float min = p->minValue(); - const float max = p->maxValue(); + const float min = std::max(p->minValue(), std::numeric_limits::lowest() / 2.f); + const float max = std::min(p->maxValue(), std::numeric_limits::max() / 2.f); const bool changed = ImGui::SliderFloat( name.c_str(), &value, @@ -492,8 +505,14 @@ void renderVec2Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); Vec2Property::ValueType value = *p; - const float min = glm::compMin(p->minValue()); - const float max = glm::compMax(p->maxValue()); + const float min = std::max( + glm::compMin(p->minValue()), + std::numeric_limits::lowest() / 2.f + ); + const float max = std::min( + glm::compMax(p->maxValue()), + std::numeric_limits::max() / 2.f + ); const bool changed = ImGui::SliderFloat2( name.c_str(), &value.x, @@ -522,8 +541,14 @@ void renderVec3Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); Vec3Property::ValueType value = *p; - const float min = glm::compMin(p->minValue()); - const float max = glm::compMax(p->maxValue()); + const float min = std::max( + glm::compMin(p->minValue()), + std::numeric_limits::lowest() / 2.f + ); + const float max = std::min( + glm::compMax(p->maxValue()), + std::numeric_limits::max() / 2.f + ); bool changed = false; if (prop->viewOption(Property::ViewOptions::Color)) { changed = ImGui::ColorEdit3(name.c_str(), glm::value_ptr(value)); @@ -558,8 +583,14 @@ void renderVec4Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); Vec4Property::ValueType value = *p; - const float min = glm::compMin(p->minValue()); - const float max = glm::compMax(p->maxValue()); + const float min = std::max( + glm::compMin(p->minValue()), + std::numeric_limits::lowest() / 2.f + ); + const float max = std::min( + glm::compMax(p->maxValue()), + std::numeric_limits::max() / 2.f + ); bool changed = false; if (prop->viewOption(Property::ViewOptions::Color)) { changed = ImGui::ColorEdit4(name.c_str(), glm::value_ptr(value)); @@ -594,8 +625,14 @@ void renderDVec2Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); glm::vec2 value = glm::dvec2(*p); - const float min = static_cast(glm::compMin(p->minValue())); - const float max = static_cast(glm::compMax(p->maxValue())); + const float min = std::max( + static_cast(glm::compMin(p->minValue())), + std::numeric_limits::lowest() / 2.f + ); + const float max = std::min( + static_cast(glm::compMax(p->maxValue())), + std::numeric_limits::max() / 2.f + ); const bool changed = ImGui::SliderFloat2( name.c_str(), &value.x, @@ -624,8 +661,14 @@ void renderDVec3Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); glm::vec3 value = glm::dvec3(*p); - const float min = static_cast(glm::compMin(p->minValue())); - const float max = static_cast(glm::compMax(p->maxValue())); + const float min = std::max( + static_cast(glm::compMin(p->minValue())), + std::numeric_limits::lowest() / 2.f + ); + const float max = std::min( + static_cast(glm::compMax(p->maxValue())), + std::numeric_limits::max() / 2.f + ); const bool changed = ImGui::SliderFloat3( name.c_str(), glm::value_ptr(value), @@ -654,8 +697,14 @@ void renderDVec4Property(Property* prop, const std::string& ownerName, ImGui::PushID((ownerName + '.' + name).c_str()); glm::vec4 value = glm::dvec4(*p); - const float min = static_cast(glm::compMin(p->minValue())); - const float max = static_cast(glm::compMax(p->maxValue())); + const float min = std::max( + static_cast(glm::compMin(p->minValue())), + std::numeric_limits::lowest() / 2.f + ); + const float max = std::min( + static_cast(glm::compMax(p->maxValue())), + std::numeric_limits::max() / 2.f + ); const bool changed = ImGui::SliderFloat4( name.c_str(), &value.x, @@ -690,13 +739,19 @@ void renderDMat2Property(Property* prop, const std::string& ownerName, glm::compMin(p->minValue()[0]), glm::compMin(p->minValue()[1]) ); - const float min = static_cast(glm::compMin(minValues)); + const float min = std::max( + static_cast(glm::compMin(minValues)), + std::numeric_limits::lowest() / 2.f + ); const glm::dvec2 maxValues = glm::dvec2( glm::compMax(p->maxValue()[0]), glm::compMax(p->maxValue()[1]) ); - const float max = static_cast(glm::compMax(maxValues)); + const float max = std::min( + static_cast(glm::compMax(maxValues)), + std::numeric_limits::max() / 2.f + ); bool changed = false; changed |= ImGui::SliderFloat2( @@ -743,14 +798,20 @@ void renderDMat3Property(Property* prop, const std::string& ownerName, glm::compMin(p->minValue()[1]), glm::compMin(p->minValue()[2]) ); - const float min = static_cast(glm::compMin(minValues)); + const float min = std::max( + static_cast(glm::compMin(minValues)), + std::numeric_limits::lowest() / 2.f + ); const glm::dvec3 maxValues = glm::dvec3( glm::compMax(p->maxValue()[0]), glm::compMax(p->maxValue()[1]), glm::compMax(p->maxValue()[2]) ); - const float max = static_cast(glm::compMax(maxValues)); + const float max = std::min( + static_cast(glm::compMax(maxValues)), + std::numeric_limits::max() / 2.f + ); bool changed = false; changed |= ImGui::SliderFloat3( @@ -806,7 +867,10 @@ void renderDMat4Property(Property* prop, const std::string& ownerName, glm::compMin(p->minValue()[2]), glm::compMin(p->minValue()[3]) ); - const float min = static_cast(glm::compMin(minValues)); + const float min = std::max( + static_cast(glm::compMin(minValues)), + std::numeric_limits::lowest() / 2.f + ); const glm::dvec4 maxValues = glm::dvec4( glm::compMax(p->maxValue()[0]), @@ -814,7 +878,10 @@ void renderDMat4Property(Property* prop, const std::string& ownerName, glm::compMax(p->maxValue()[2]), glm::compMax(p->maxValue()[3]) ); - const float max = static_cast(glm::compMax(maxValues)); + const float max = std::min( + static_cast(glm::compMax(maxValues)), + std::numeric_limits::max() / 2.f + ); bool changed = false; changed |= ImGui::SliderFloat4(