From 19f0f707dcc0c32046b2d54634e5f8338b620c19 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Wed, 3 Apr 2024 09:23:49 +0200 Subject: [PATCH] Issue/2174 - Show items with no GUI tag in asset in the GUI (#3133) * Always add GUI properties, even if tag is not in the asset To make objects wihtout GUI tag be included in the UI * Hide the hover circle, to clean up scene menu list a little * set root node gui hidden property to true * Properly add the gui properties for all scene graph nodes (even root) * Update GUI hash --- data/assets/modules/skybrowser/hover_circle.asset | 3 ++- data/assets/util/webgui.asset | 2 +- include/openspace/scene/scenegraphnode.h | 1 + src/scene/scene.cpp | 1 + src/scene/scenegraphnode.cpp | 13 +++++++++---- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/data/assets/modules/skybrowser/hover_circle.asset b/data/assets/modules/skybrowser/hover_circle.asset index 027c2a09cb..80f19603b8 100644 --- a/data/assets/modules/skybrowser/hover_circle.asset +++ b/data/assets/modules/skybrowser/hover_circle.asset @@ -23,7 +23,8 @@ local circle = { Description = [[A circular marker that shows the position on the night sky of the object hovered in the sky browser UI. The circle will hide/show up dynamically, depending on the interaction with the items in the UI]], - Path = "/SkyBrowser" + Path = "/SkyBrowser", + Hidden = true } } diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset index e45b8665d5..11b3aad4ac 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 = "65c0238b8ba931b958cf3cada2ab226c8f1c9880" +local frontendHash = "e1ebc90f79f10bafe46aea72eb91fdf0e86876ad" local frontend = asset.resource({ Identifier = "WebGuiFrontend", diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index dc269e07e8..fbd426ab14 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -147,6 +147,7 @@ public: std::string guiPath() const; bool hasGuiHintHidden() const; + void setGuiHintHidden(bool value); static documentation::Documentation Documentation(); diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 802beb24c4..2987fa8ed2 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -116,6 +116,7 @@ Scene::Scene(std::unique_ptr initializer) { _rootNode.setIdentifier(RootNodeIdentifier); _rootNode.setScene(this); + _rootNode.setGuiHintHidden(true); _camera->setParent(&_rootNode); } diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index df5c9537e0..a6ec5deab3 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -350,18 +350,15 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( result->setGuiName(*p.gui->name); result->_guiDisplayName = result->guiName(); } - result->addProperty(result->_guiDisplayName); if (p.gui->description.has_value()) { result->setDescription(*p.gui->description); result->_guiDescription = result->description(); } - result->addProperty(result->_guiDescription); if (p.gui->hidden.has_value()) { result->_guiHidden = *p.gui->hidden; } - result->addProperty(result->_guiHidden); if (p.gui->path.has_value()) { if (!p.gui->path->starts_with('/')) { @@ -369,7 +366,6 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( } result->_guiPath = *p.gui->path; } - result->addProperty(result->_guiPath); } result->_boundingSphere = p.boundingSphere.value_or(result->_boundingSphere); @@ -596,6 +592,11 @@ SceneGraphNode::SceneGraphNode() addProperty(_showDebugSphere); addProperty(_supportsDirectInteraction); + + addProperty(_guiDisplayName); + addProperty(_guiDescription); + addProperty(_guiHidden); + addProperty(_guiPath); } SceneGraphNode::~SceneGraphNode() {} @@ -1123,6 +1124,10 @@ bool SceneGraphNode::hasGuiHintHidden() const { return _guiHidden; } +void SceneGraphNode::setGuiHintHidden(bool value) { + _guiHidden = value; +} + glm::dvec3 SceneGraphNode::calculateWorldPosition() const { // recursive up the hierarchy if there are parents available if (_parent) {