mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 20:21:24 -06:00
Add new property hint to determine if a scene graph node should focusable (#3508)
This commit is contained in:
@@ -181,6 +181,7 @@ private:
|
||||
properties::StringProperty _guiDisplayName;
|
||||
properties::StringProperty _guiDescription;
|
||||
properties::BoolProperty _useGuiOrdering;
|
||||
properties::BoolProperty _guiFocusable;
|
||||
properties::FloatProperty _guiOrderingNumber;
|
||||
|
||||
// Transformation defined by translation, rotation and scale
|
||||
|
||||
@@ -193,6 +193,15 @@ namespace {
|
||||
openspace::properties::Property::Visibility::Hidden
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo GuiFocusableInfo = {
|
||||
"IsFocusable",
|
||||
"Focusable Hint",
|
||||
"This value serves as a hint to determine if it makes sense to focus the camera "
|
||||
"on this scene graph node. It only serves as a hint and does not actually "
|
||||
"prevent the focussing. The default value is `true`.",
|
||||
openspace::properties::Property::Visibility::Hidden
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ShowDebugSphereInfo = {
|
||||
"ShowDebugSphere",
|
||||
"Show Debug Sphere",
|
||||
@@ -330,6 +339,9 @@ namespace {
|
||||
// not display, for example, barycenters
|
||||
std::optional<bool> hidden;
|
||||
|
||||
// [[codegen::verbatim(GuiFocusableInfo.description)]]
|
||||
std::optional<bool> focusable;
|
||||
|
||||
// If this value is specified, the scene graph node will be ordered in
|
||||
// relation to its neighbors in the GUI based on this value, so that nodes
|
||||
// with a higher value appear later in the list. Scene graph nodes with the
|
||||
@@ -396,6 +408,7 @@ ghoul::mm_unique_ptr<SceneGraphNode> SceneGraphNode::createFromDictionary(
|
||||
if (p.gui->orderingNumber.has_value()) {
|
||||
result->_guiOrderingNumber = *p.gui->orderingNumber;
|
||||
}
|
||||
result->_guiFocusable = p.gui->focusable.value_or(result->_guiFocusable);
|
||||
}
|
||||
|
||||
result->_boundingSphere = p.boundingSphere.value_or(result->_boundingSphere);
|
||||
@@ -541,6 +554,7 @@ SceneGraphNode::SceneGraphNode()
|
||||
, _guiDisplayName(GuiNameInfo)
|
||||
, _guiDescription(GuiDescriptionInfo)
|
||||
, _useGuiOrdering(UseGuiOrderInfo, false)
|
||||
, _guiFocusable(GuiFocusableInfo, true)
|
||||
, _guiOrderingNumber(GuiOrderInfo, 0.f)
|
||||
, _transform {
|
||||
ghoul::mm_unique_ptr<Translation>(
|
||||
@@ -625,6 +639,7 @@ SceneGraphNode::SceneGraphNode()
|
||||
addProperty(_guiPath);
|
||||
addProperty(_guiOrderingNumber);
|
||||
addProperty(_useGuiOrdering);
|
||||
addProperty(_guiFocusable);
|
||||
}
|
||||
|
||||
SceneGraphNode::~SceneGraphNode() {}
|
||||
|
||||
Reference in New Issue
Block a user