diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset index 2059d900f5..4464eff324 100644 --- a/data/assets/util/webgui.asset +++ b/data/assets/util/webgui.asset @@ -4,7 +4,7 @@ local guiCustomization = asset.require("customization/gui") -- Select which commit hashes to use for the frontend and backend -local frontendHash = "26e709be4e4b17d7fcdbd8f53cf681f4f4126b29" +local frontendHash = "ab3222e9b281ba9964205426a134d6ce5b404d43" local frontend = asset.resource({ Identifier = "WebGuiFrontend", diff --git a/modules/exoplanets/exoplanetsmodule.cpp b/modules/exoplanets/exoplanetsmodule.cpp index a724c68c5f..b3923b27b4 100644 --- a/modules/exoplanets/exoplanetsmodule.cpp +++ b/modules/exoplanets/exoplanetsmodule.cpp @@ -110,6 +110,15 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + constexpr openspace::properties::Property::PropertyInfo ComparisonCircleColorInfo = { + "ComparisonCircleColor", + "Comparison Circle Color", + "Decides the color of the 1 AU size comparison circles that are generated as part " + "of an exoplanet system. Changing the color will not modify already existing " + "circles", + openspace::properties::Property::Visibility::NoviceUser + }; + constexpr openspace::properties::Property::PropertyInfo ShowComparisonCircleInfo = { "ShowComparisonCircle", "Show Comparison Circle", @@ -119,6 +128,14 @@ namespace { openspace::properties::Property::Visibility::NoviceUser }; + constexpr openspace::properties::Property::PropertyInfo ShowOrbitUncertaintyInfo = { + "ShowOrbitUncertainty", + "Show Orbit Uncertainty", + "If true, a disc showing the uncertainty for each planetary orbit is enabled per " + "default when an exoplanet system is created", + openspace::properties::Property::Visibility::User + }; + constexpr openspace::properties::Property::PropertyInfo ShowHabitableZoneInfo = { "ShowHabitableZone", "Show Habitable Zone", @@ -174,9 +191,15 @@ namespace { // [[codegen::verbatim(HabitableZoneTextureInfo.description)]] std::optional habitableZoneTexture; + // [[codegen::verbatim(ComparisonCircleColorInfo.description)]] + std::optional comparisonCircleColor [[codegen::color()]]; + // [[codegen::verbatim(ShowComparisonCircleInfo.description)]] std::optional showComparisonCircle; + // [[codegen::verbatim(ShowOrbitUncertaintyInfo.description)]] + std::optional showOrbitUncertainty; + // [[codegen::verbatim(ShowHabitableZoneInfo.description)]] std::optional showHabitableZone; @@ -203,7 +226,14 @@ ExoplanetsModule::ExoplanetsModule() , _noDataTexturePath(NoDataTextureInfo) , _orbitDiscTexturePath(OrbitDiscTextureInfo) , _habitableZoneTexturePath(HabitableZoneTextureInfo) + , _comparisonCircleColor( + ComparisonCircleColorInfo, + glm::vec3(0.f, 0.8f, 0.8f), + glm::vec3(0.f), + glm::vec3(1.f) + ) , _showComparisonCircle(ShowComparisonCircleInfo, false) + , _showOrbitUncertainty(ShowOrbitUncertaintyInfo, true) , _showHabitableZone(ShowHabitableZoneInfo, true) , _useOptimisticZone(UseOptimisticZoneInfo, true) , _habitableZoneOpacity(HabitableZoneOpacityInfo, 0.1f, 0.f, 1.f) @@ -220,7 +250,10 @@ ExoplanetsModule::ExoplanetsModule() addProperty(_orbitDiscTexturePath); addProperty(_habitableZoneTexturePath); + _comparisonCircleColor.setViewOption(properties::Property::ViewOptions::Color); + addProperty(_comparisonCircleColor); addProperty(_showComparisonCircle); + addProperty(_showOrbitUncertainty); addProperty(_showHabitableZone); addProperty(_useOptimisticZone); @@ -279,10 +312,18 @@ std::string ExoplanetsModule::habitableZoneTexturePath() const { return _habitableZoneTexturePath; } +glm::vec3 ExoplanetsModule::comparisonCircleColor() const { + return _comparisonCircleColor; +} + bool ExoplanetsModule::showComparisonCircle() const { return _showComparisonCircle; } +bool ExoplanetsModule::showOrbitUncertainty() const { + return _showOrbitUncertainty; +} + bool ExoplanetsModule::showHabitableZone() const { return _showHabitableZone; } @@ -328,7 +369,9 @@ void ExoplanetsModule::internalInitialize(const ghoul::Dictionary& dict) { _habitableZoneTexturePath = p.habitableZoneTexture.value().string(); } + _comparisonCircleColor = p.comparisonCircleColor.value_or(_comparisonCircleColor); _showComparisonCircle = p.showComparisonCircle.value_or(_showComparisonCircle); + _showOrbitUncertainty = p.showOrbitUncertainty.value_or(_showOrbitUncertainty); _showHabitableZone = p.showHabitableZone.value_or(_showHabitableZone); _useOptimisticZone = p.useOptimisticZone.value_or(_useOptimisticZone); diff --git a/modules/exoplanets/exoplanetsmodule.h b/modules/exoplanets/exoplanetsmodule.h index a77b6a43b5..61c748740e 100644 --- a/modules/exoplanets/exoplanetsmodule.h +++ b/modules/exoplanets/exoplanetsmodule.h @@ -31,6 +31,7 @@ #include #include #include +#include namespace openspace { @@ -51,7 +52,9 @@ public: std::string noDataTexturePath() const; std::string orbitDiscTexturePath() const; std::string habitableZoneTexturePath() const; + glm::vec3 comparisonCircleColor() const; bool showComparisonCircle() const; + bool showOrbitUncertainty() const; bool showHabitableZone() const; bool useOptimisticZone() const; float habitableZoneOpacity() const; @@ -71,7 +74,9 @@ protected: properties::StringProperty _orbitDiscTexturePath; properties::StringProperty _habitableZoneTexturePath; + properties::Vec3Property _comparisonCircleColor; properties::BoolProperty _showComparisonCircle; + properties::BoolProperty _showOrbitUncertainty; properties::BoolProperty _showHabitableZone; properties::BoolProperty _useOptimisticZone; diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl index a7aa2d4f15..9b4677e3f6 100644 --- a/modules/exoplanets/exoplanetsmodule_lua.inl +++ b/modules/exoplanets/exoplanetsmodule_lua.inl @@ -355,11 +355,14 @@ void createExoplanetSystem(const std::string& starName, const std::string discTexture = module->orbitDiscTexturePath(); + bool isDiscEnabled = module->showOrbitUncertainty(); + const std::string discNode = "{" "Identifier = '" + planetIdentifier + "_Disc'," "Parent = '" + starIdentifier + "'," "Renderable = {" "Type = 'RenderableOrbitDisc'," + "Enabled = " + (isDiscEnabled ? "true" : "false") + "," "Texture = openspace.absPath('" + formatPathToLua(discTexture) + "')," @@ -377,6 +380,7 @@ void createExoplanetSystem(const std::string& starName, "Rotation = " + ghoul::to_string(rotationMat3) + "" "}" "}," + "Tag = {'exoplanet_uncertainty_disc'}," "GUI = {" "Name = '" + planetName + " Disc'," "Path = '" + guiPath + "'" @@ -402,7 +406,7 @@ void createExoplanetSystem(const std::string& starName, const glm::dmat3 meanOrbitPlaneRotationMatrix = static_cast(rotation); bool isCircleEnabled = module->showComparisonCircle(); - const std::string isCircleEnabledString = isCircleEnabled ? "true" : "false"; + glm::vec3 circleColor = module->comparisonCircleColor(); // 1 AU Size Comparison Circle const std::string circle = "{" @@ -410,8 +414,9 @@ void createExoplanetSystem(const std::string& starName, "Parent = '" + starIdentifier + "'," "Renderable = {" "Type = 'RenderableRadialGrid'," - "Enabled = " + isCircleEnabledString + "," + "Enabled = " + (isCircleEnabled ? "true" : "false") + "," "Radii = { 0.0, 1.0 }," + "Color = " + ghoul::to_string(circleColor) + "," "CircleSegments = 64," "LineWidth = 2.0," "}," @@ -425,6 +430,7 @@ void createExoplanetSystem(const std::string& starName, "Scale = " + std::to_string(distanceconstants::AstronomicalUnit) + "" "}" "}," + "Tag = {'exoplanet_1au_ring'}," "GUI = {" "Name = '1 AU Size Comparison Circle'," "Path = '" + guiPath + "'" @@ -455,13 +461,8 @@ void createExoplanetSystem(const std::string& starName, "above freezing anywhere on the planet"; const std::string hzTexture = module->habitableZoneTexturePath(); - bool isHzEnabled = module->showHabitableZone(); - const std::string isHzEnabledString = isHzEnabled ? "true" : "false"; - bool useOptimistic = module->useOptimisticZone(); - const std::string useOptimisticString = useOptimistic ? "true" : "false"; - float opacity = module->habitableZoneOpacity(); const std::string zoneDiscNode = "{" @@ -469,11 +470,11 @@ void createExoplanetSystem(const std::string& starName, "Parent = '" + starIdentifier + "'," "Renderable = {" "Type = 'RenderableHabitableZone'," - "Enabled = " + isHzEnabledString + "," + "Enabled = " + (isHzEnabled ? "true" : "false") + "," "Texture = openspace.absPath('" + formatPathToLua(hzTexture) + "')," "Luminosity = " + std::to_string(system.starData.luminosity) + "," "EffectiveTemperature = " + std::to_string(system.starData.teff) + "," - "Optimistic = " + useOptimisticString + "," + "Optimistic = " + (useOptimistic ? "true" : "false") + "," "Opacity = " + std::to_string(opacity) + "" "}," "Transform = {" @@ -482,6 +483,7 @@ void createExoplanetSystem(const std::string& starName, "Rotation = " + ghoul::to_string(meanOrbitPlaneRotationMatrix) + "" "}" "}," + "Tag = {'exoplanet_habitable_zone'}," "GUI = {" "Name = '" + starName + " Habitable Zone'," "Path = '" + guiPath + "',"