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 <olssonelon@gmail.com>
This commit is contained in:
Emma Broman
2025-04-02 09:28:11 +02:00
committed by GitHub
parent 80955e3ec1
commit eb709b830c
34 changed files with 115 additions and 236 deletions

View File

@@ -637,10 +637,7 @@ RenderablePointCloud::RenderablePointCloud(const ghoul::Dictionary& dictionary)
, _useAdditiveBlending(UseAdditiveBlendingInfo, true)
, _useRotation(UseOrientationDataInfo, false)
, _drawElements(DrawElementsInfo, true)
, _renderOption(
OrientationRenderOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, _renderOption(OrientationRenderOptionInfo)
, _nDataPoints(NumShownDataPointsInfo, 0)
, _hasOrientationData(HasOrientationDataInfo, false)
{

View File

@@ -121,10 +121,7 @@ documentation::Documentation SizeMappingComponent::Documentation() {
SizeMappingComponent::SizeMappingComponent()
: properties::PropertyOwner({ "SizeMapping", "Size Mapping", "" })
, enabled(EnabledInfo, true)
, parameterOption(
OptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, parameterOption(OptionInfo)
, scaleFactor(ScaleFactorInfo, 1.f, 0.f, 1000.f)
, isRadius(IsRadiusInfo, false)
{

View File

@@ -106,7 +106,7 @@ documentation::Documentation RenderableDistanceLabel::Documentation() {
RenderableDistanceLabel::RenderableDistanceLabel(const ghoul::Dictionary& dictionary)
: RenderableLabel(dictionary)
, _nodelineId(NodeLineInfo)
, _distanceUnit(DistanceUnitInfo, properties::OptionProperty::DisplayType::Dropdown)
, _distanceUnit(DistanceUnitInfo)
, _customUnitDescriptor(CustomUnitDescriptorInfo)
, _precision(PrecisionInfo, 0, 0, 10)
{

View File

@@ -252,7 +252,7 @@ documentation::Documentation RenderableLabel::Documentation() {
RenderableLabel::RenderableLabel(const ghoul::Dictionary& dictionary)
: Renderable(dictionary, { .automaticallyUpdateRenderBin = false })
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _blendMode(BlendModeInfo)
, _text(TextInfo, "")
, _color(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
, _fontSize(FontSizeInfo, 50.f, 1.f, 100.f)
@@ -261,14 +261,8 @@ RenderableLabel::RenderableLabel(const ghoul::Dictionary& dictionary)
, _enableFadingEffect(EnableFadingEffectInfo, false)
, _fadeWidths(FadeWidthsInfo, glm::vec2(1.f), glm::vec2(0.f), glm::vec2(100.f))
, _fadeDistances(FadeDistancesInfo, glm::vec2(1.f), glm::vec2(0.f), glm::vec2(100.f))
, _fadeUnitOption(
FadeUnitOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, _orientationOption(
OrientationOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, _fadeUnitOption(FadeUnitOptionInfo)
, _orientationOption(OrientationOptionInfo)
{
const Parameters p = codegen::bake<Parameters>(dictionary);

View File

@@ -295,10 +295,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
, _modelScale(ModelScaleInfo, 1.0, std::numeric_limits<double>::epsilon(), 4e+27)
, _rotationVec(RotationVecInfo, glm::dvec3(0.0), glm::dvec3(0.0), glm::dvec3(360.0))
, _enableDepthTest(EnableDepthTestInfo, true)
, _blendingFuncOption(
BlendingOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, _blendingFuncOption(BlendingOptionInfo)
, _lightSourcePropertyOwner({ "LightSources", "Light Sources" })
{
const Parameters p = codegen::bake<Parameters>(dictionary);

View File

@@ -131,7 +131,7 @@ documentation::Documentation RenderablePlane::Documentation() {
RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
: Renderable(dictionary, { .automaticallyUpdateRenderBin = false })
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _blendMode(BlendModeInfo)
, _billboard(BillboardInfo, false)
, _mirrorBackside(MirrorBacksideInfo, false)
, _size(SizeInfo, glm::vec2(10.f), glm::vec2(0.f), glm::vec2(1e25f))

View File

@@ -180,15 +180,12 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _size(SizeInfo, 1.f, 0.f, 1e25f)
, _segments(SegmentsInfo, 16, 4, 1000)
, _orientation(OrientationInfo, properties::OptionProperty::DisplayType::Dropdown)
, _orientation(OrientationInfo)
, _mirrorTexture(MirrorTextureInfo, false)
, _disableFadeInDistance(DisableFadeInOutInfo, false)
, _fadeInThreshold(FadeInThresholdInfo, 0.f, 0.f, 1.f, 0.001f)
, _fadeOutThreshold(FadeOutThresholdInfo, 0.f, 0.f, 1.f, 0.001f)
, _blendingFuncOption(
BlendingOptionInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, _blendingFuncOption(BlendingOptionInfo)
, _disableDepth(DisableDepthInfo, false)
{
const Parameters p = codegen::bake<Parameters>(dictionary);

View File

@@ -188,10 +188,7 @@ RenderableTrail::Appearance::Appearance()
, useLineFade(EnableFadeInfo, true)
, lineWidth(LineWidthInfo, 10.f, 1.f, 20.f)
, pointSize(PointSizeInfo, 1, 1, 64)
, renderingModes(
RenderingModeInfo,
properties::OptionProperty::DisplayType::Dropdown
)
, renderingModes(RenderingModeInfo)
, lineLength(LineLengthInfo, 1.f, 0.f, 1.f)
, lineFadeAmount(LineFadeAmountInfo, 1.f, 0.f, 1.f)
{