From eb709b830cc91dd84f685e5464a928a50c82e14a Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Wed, 2 Apr 2025 09:28:11 +0200 Subject: [PATCH] Small option property cleanup (#3577) * Notify change listeners I can't come up with a reason for why we would not want to do this * Remove the Display Type for OptionProperty (only used in ImGui) * Replace extra boolean with internal anonymous addOption function * Tiny refactor * removed dropdown on a couple of more places * Update optionproperty.cpp --------- Co-authored-by: ElonOlsson --- .../properties/misc/optionproperty.h | 29 +------- modules/base/dashboard/dashboarditemangle.cpp | 15 +--- .../base/dashboard/dashboarditemdistance.cpp | 12 +--- .../base/dashboard/dashboarditemframerate.cpp | 2 +- .../dashboarditemsimulationincrement.cpp | 2 +- .../base/dashboard/dashboarditemvelocity.cpp | 2 +- .../pointcloud/renderablepointcloud.cpp | 5 +- .../pointcloud/sizemappingcomponent.cpp | 5 +- .../rendering/renderabledistancelabel.cpp | 2 +- modules/base/rendering/renderablelabel.cpp | 12 +--- modules/base/rendering/renderablemodel.cpp | 5 +- modules/base/rendering/renderableplane.cpp | 2 +- modules/base/rendering/renderablesphere.cpp | 7 +- modules/base/rendering/renderabletrail.cpp | 5 +- modules/base/rotation/fixedrotation.cpp | 15 +--- .../rendering/renderabledumeshes.cpp | 2 +- .../renderablefieldlinessequence.cpp | 9 +-- .../gaia/rendering/renderablegaiastars.cpp | 9 +-- modules/galaxy/rendering/renderablegalaxy.cpp | 7 +- .../src/geojson/geojsoncomponent.cpp | 5 +- .../src/geojson/geojsonproperties.cpp | 10 +-- .../src/globelabelscomponent.cpp | 5 +- modules/globebrowsing/src/layer.cpp | 4 +- modules/globebrowsing/src/layeradjustment.cpp | 2 +- modules/imgui/src/renderproperties.cpp | 65 +++++++---------- .../rendering/renderablekameleonvolume.cpp | 2 +- .../space/rendering/renderablefluxnodes.cpp | 8 +-- .../rendering/renderableorbitalkepler.cpp | 5 +- modules/space/rendering/renderablestars.cpp | 14 ++-- .../rendering/renderableshadowcylinder.cpp | 5 +- .../rendering/renderabletimevaryingvolume.cpp | 2 +- src/navigation/pathnavigator.cpp | 5 +- src/properties/misc/optionproperty.cpp | 70 +++++++++---------- src/rendering/colormappingcomponent.cpp | 2 +- 34 files changed, 115 insertions(+), 236 deletions(-) diff --git a/include/openspace/properties/misc/optionproperty.h b/include/openspace/properties/misc/optionproperty.h index 6507d43a45..a833bf4830 100644 --- a/include/openspace/properties/misc/optionproperty.h +++ b/include/openspace/properties/misc/optionproperty.h @@ -48,11 +48,6 @@ public: std::string description; }; - enum class DisplayType { - Radio, - Dropdown - }; - /** * The constructor delegating the `identifier` and the `guiName` to its super class. * @@ -64,18 +59,6 @@ public: */ OptionProperty(Property::PropertyInfo info); - /** - * The constructor delegating the `identifier` and the `guiName` to its super class. - * - * \param info The PropertyInfo structure that contains all the required static - * information for initializing this Property - * \param displayType Optional DisplayType for GUI (default RADIO) - * - * \pre \p info.identifier must not be empty - * \pre \p info.guiName must not be empty - */ - OptionProperty(PropertyInfo info, DisplayType displayType); - /** * Returns the name of the class for reflection purposes. * @@ -86,21 +69,14 @@ public: using TemplateProperty::operator=; - /** - * Returns the type for GUI display. - * - * \return OptionType for display purposes - */ - DisplayType displayType() const; - /** * Adds the passed option to the list of available options. The `value` of the * `option` must not have been registered previously, or a warning will be logged. * * \param value The option that will be added to the list of available options - * \param desc The description of the value that will be added + * \param description The description of the value that will be added */ - void addOption(int value, std::string desc); + void addOption(int value, std::string description); /** * Adds multiple options to the OptionProperty. Each value in the vector consists of @@ -171,7 +147,6 @@ private: /// The list of options which have been registered with this OptionProperty std::vector