From da4d735e2c465195e0fb9531ce9d4d7c5c9e6503 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 10 May 2017 11:34:00 -0700 Subject: [core] Unify {Paint,Layout,Light}Properties --- src/mbgl/style/layers/background_layer.cpp | 1 - .../style/layers/background_layer_properties.hpp | 3 +- src/mbgl/style/layers/circle_layer.cpp | 1 - src/mbgl/style/layers/circle_layer_properties.hpp | 3 +- src/mbgl/style/layers/fill_extrusion_layer.cpp | 1 - .../layers/fill_extrusion_layer_properties.hpp | 3 +- src/mbgl/style/layers/fill_layer.cpp | 1 - src/mbgl/style/layers/fill_layer_properties.hpp | 3 +- src/mbgl/style/layers/layer.cpp.ejs | 7 +- src/mbgl/style/layers/layer_properties.hpp.ejs | 5 +- src/mbgl/style/layers/line_layer.cpp | 19 ++- src/mbgl/style/layers/line_layer_impl.hpp | 2 +- src/mbgl/style/layers/line_layer_properties.hpp | 5 +- src/mbgl/style/layers/raster_layer.cpp | 1 - src/mbgl/style/layers/raster_layer_properties.hpp | 3 +- src/mbgl/style/layers/symbol_layer.cpp | 139 ++++++++++----------- src/mbgl/style/layers/symbol_layer_impl.hpp | 2 +- src/mbgl/style/layers/symbol_layer_properties.hpp | 5 +- 18 files changed, 102 insertions(+), 102 deletions(-) (limited to 'src/mbgl/style/layers') diff --git a/src/mbgl/style/layers/background_layer.cpp b/src/mbgl/style/layers/background_layer.cpp index 2aa15a779c..1c5b6c3a66 100644 --- a/src/mbgl/style/layers/background_layer.cpp +++ b/src/mbgl/style/layers/background_layer.cpp @@ -2,7 +2,6 @@ #include #include -#include #include namespace mbgl { diff --git a/src/mbgl/style/layers/background_layer_properties.hpp b/src/mbgl/style/layers/background_layer_properties.hpp index fae6c26a4b..f9a67b214d 100644 --- a/src/mbgl/style/layers/background_layer_properties.hpp +++ b/src/mbgl/style/layers/background_layer_properties.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include namespace mbgl { @@ -22,7 +23,7 @@ struct BackgroundOpacity : PaintProperty { static float defaultValue() { return 1; } }; -class BackgroundPaintProperties : public PaintProperties< +class BackgroundPaintProperties : public Properties< BackgroundColor, BackgroundPattern, BackgroundOpacity diff --git a/src/mbgl/style/layers/circle_layer.cpp b/src/mbgl/style/layers/circle_layer.cpp index ea812748d0..e874f00ff7 100644 --- a/src/mbgl/style/layers/circle_layer.cpp +++ b/src/mbgl/style/layers/circle_layer.cpp @@ -2,7 +2,6 @@ #include #include -#include #include namespace mbgl { diff --git a/src/mbgl/style/layers/circle_layer_properties.hpp b/src/mbgl/style/layers/circle_layer_properties.hpp index 1cb4f5a635..734dab109c 100644 --- a/src/mbgl/style/layers/circle_layer_properties.hpp +++ b/src/mbgl/style/layers/circle_layer_properties.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include namespace mbgl { @@ -50,7 +51,7 @@ struct CircleStrokeOpacity : DataDrivenPaintProperty #include -#include #include namespace mbgl { diff --git a/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp b/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp index c1dd3b079d..1819f98ae6 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp +++ b/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include namespace mbgl { @@ -38,7 +39,7 @@ struct FillExtrusionBase : DataDrivenPaintProperty { static float defaultValue() { return 0; } }; -class FillExtrusionPaintProperties : public PaintProperties< +class FillExtrusionPaintProperties : public Properties< FillExtrusionOpacity, FillExtrusionColor, FillExtrusionTranslate, diff --git a/src/mbgl/style/layers/fill_layer.cpp b/src/mbgl/style/layers/fill_layer.cpp index 0031972842..d38b027740 100644 --- a/src/mbgl/style/layers/fill_layer.cpp +++ b/src/mbgl/style/layers/fill_layer.cpp @@ -2,7 +2,6 @@ #include #include -#include #include namespace mbgl { diff --git a/src/mbgl/style/layers/fill_layer_properties.hpp b/src/mbgl/style/layers/fill_layer_properties.hpp index f44a18d0e0..67c2ae1fa4 100644 --- a/src/mbgl/style/layers/fill_layer_properties.hpp +++ b/src/mbgl/style/layers/fill_layer_properties.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include namespace mbgl { @@ -38,7 +39,7 @@ struct FillPattern : CrossFadedPaintProperty { static std::string defaultValue() { return ""; } }; -class FillPaintProperties : public PaintProperties< +class FillPaintProperties : public Properties< FillAntialias, FillOpacity, FillColor, diff --git a/src/mbgl/style/layers/layer.cpp.ejs b/src/mbgl/style/layers/layer.cpp.ejs index b07f7db307..738165e668 100644 --- a/src/mbgl/style/layers/layer.cpp.ejs +++ b/src/mbgl/style/layers/layer.cpp.ejs @@ -7,7 +7,6 @@ #include _layer.hpp> #include _layer_impl.hpp> -#include #include namespace mbgl { @@ -46,7 +45,7 @@ std::unique_ptr <%- camelize(type) %>Layer::cloneRef(const std::string& i <% if (layoutProperties.length) { -%> void <%- camelize(type) %>Layer::Impl::stringifyLayout(rapidjson::Writer& writer) const { - conversion::stringify(writer, layout); + layout.stringify(writer); } <% } else { -%> void <%- camelize(type) %>Layer::Impl::stringifyLayout(rapidjson::Writer&) const { @@ -119,14 +118,14 @@ void <%- camelize(type) %>Layer::setMaxZoom(float maxZoom) { } <%- propertyValueType(property) %> <%- camelize(type) %>Layer::get<%- camelize(property.name) %>() const { - return impl().layout.unevaluated.get<<%- camelize(property.name) %>>(); + return impl().layout.get<<%- camelize(property.name) %>>(); } void <%- camelize(type) %>Layer::set<%- camelize(property.name) %>(<%- propertyValueType(property) %> value) { if (value == get<%- camelize(property.name) %>()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get<<%- camelize(property.name) %>>() = value; + impl_->layout.get<<%- camelize(property.name) %>>() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "<%- property.name %>"); } diff --git a/src/mbgl/style/layers/layer_properties.hpp.ejs b/src/mbgl/style/layers/layer_properties.hpp.ejs index 2a736ca388..a271a27e8d 100644 --- a/src/mbgl/style/layers/layer_properties.hpp.ejs +++ b/src/mbgl/style/layers/layer_properties.hpp.ejs @@ -10,6 +10,7 @@ #include #include #include +#include #include namespace mbgl { @@ -29,7 +30,7 @@ struct <%- camelize(property.name) %> : <%- paintPropertyType(property, type) %> <% } -%> <% if (layoutProperties.length) { -%> -class <%- camelize(type) %>LayoutProperties : public LayoutProperties< +class <%- camelize(type) %>LayoutProperties : public Properties< <% for (const property of layoutProperties.slice(0, -1)) { -%> <%- camelize(property.name) %>, <% } -%> @@ -37,7 +38,7 @@ class <%- camelize(type) %>LayoutProperties : public LayoutProperties< > {}; <% } -%> -class <%- camelize(type) %>PaintProperties : public PaintProperties< +class <%- camelize(type) %>PaintProperties : public Properties< <% for (const property of paintProperties.slice(0, -1)) { -%> <%- camelize(property.name) %>, <% } -%> diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp index 359078f913..c8684ec6f5 100644 --- a/src/mbgl/style/layers/line_layer.cpp +++ b/src/mbgl/style/layers/line_layer.cpp @@ -2,7 +2,6 @@ #include #include -#include #include namespace mbgl { @@ -34,7 +33,7 @@ std::unique_ptr LineLayer::cloneRef(const std::string& id_) const { } void LineLayer::Impl::stringifyLayout(rapidjson::Writer& writer) const { - conversion::stringify(writer, layout); + layout.stringify(writer); } // Source @@ -98,14 +97,14 @@ PropertyValue LineLayer::getDefaultLineCap() { } PropertyValue LineLayer::getLineCap() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void LineLayer::setLineCap(PropertyValue value) { if (value == getLineCap()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "line-cap"); } @@ -114,14 +113,14 @@ PropertyValue LineLayer::getDefaultLineJoin() { } PropertyValue LineLayer::getLineJoin() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void LineLayer::setLineJoin(PropertyValue value) { if (value == getLineJoin()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "line-join"); } @@ -130,14 +129,14 @@ PropertyValue LineLayer::getDefaultLineMiterLimit() { } PropertyValue LineLayer::getLineMiterLimit() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void LineLayer::setLineMiterLimit(PropertyValue value) { if (value == getLineMiterLimit()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "line-miter-limit"); } @@ -146,14 +145,14 @@ PropertyValue LineLayer::getDefaultLineRoundLimit() { } PropertyValue LineLayer::getLineRoundLimit() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void LineLayer::setLineRoundLimit(PropertyValue value) { if (value == getLineRoundLimit()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "line-round-limit"); } diff --git a/src/mbgl/style/layers/line_layer_impl.hpp b/src/mbgl/style/layers/line_layer_impl.hpp index 8328378a1f..2eab19a612 100644 --- a/src/mbgl/style/layers/line_layer_impl.hpp +++ b/src/mbgl/style/layers/line_layer_impl.hpp @@ -13,7 +13,7 @@ public: void stringifyLayout(rapidjson::Writer&) const override; - LineLayoutProperties layout; + LineLayoutProperties::Unevaluated layout; LinePaintProperties::Cascading paint; }; diff --git a/src/mbgl/style/layers/line_layer_properties.hpp b/src/mbgl/style/layers/line_layer_properties.hpp index 724026e3a6..62acad295b 100644 --- a/src/mbgl/style/layers/line_layer_properties.hpp +++ b/src/mbgl/style/layers/line_layer_properties.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include namespace mbgl { @@ -70,14 +71,14 @@ struct LinePattern : CrossFadedPaintProperty { static std::string defaultValue() { return ""; } }; -class LineLayoutProperties : public LayoutProperties< +class LineLayoutProperties : public Properties< LineCap, LineJoin, LineMiterLimit, LineRoundLimit > {}; -class LinePaintProperties : public PaintProperties< +class LinePaintProperties : public Properties< LineOpacity, LineColor, LineTranslate, diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp index fb31d97657..a17e34dd8a 100644 --- a/src/mbgl/style/layers/raster_layer.cpp +++ b/src/mbgl/style/layers/raster_layer.cpp @@ -2,7 +2,6 @@ #include #include -#include #include namespace mbgl { diff --git a/src/mbgl/style/layers/raster_layer_properties.hpp b/src/mbgl/style/layers/raster_layer_properties.hpp index 219fe34d8c..732f5b2aff 100644 --- a/src/mbgl/style/layers/raster_layer_properties.hpp +++ b/src/mbgl/style/layers/raster_layer_properties.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include namespace mbgl { @@ -38,7 +39,7 @@ struct RasterFadeDuration : PaintProperty { static float defaultValue() { return 300; } }; -class RasterPaintProperties : public PaintProperties< +class RasterPaintProperties : public Properties< RasterOpacity, RasterHueRotate, RasterBrightnessMin, diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp index 75de1bb36b..4a3ad2ffcc 100644 --- a/src/mbgl/style/layers/symbol_layer.cpp +++ b/src/mbgl/style/layers/symbol_layer.cpp @@ -2,7 +2,6 @@ #include #include -#include #include namespace mbgl { @@ -34,7 +33,7 @@ std::unique_ptr SymbolLayer::cloneRef(const std::string& id_) const { } void SymbolLayer::Impl::stringifyLayout(rapidjson::Writer& writer) const { - conversion::stringify(writer, layout); + layout.stringify(writer); } // Source @@ -98,14 +97,14 @@ PropertyValue SymbolLayer::getDefaultSymbolPlacement() { } PropertyValue SymbolLayer::getSymbolPlacement() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setSymbolPlacement(PropertyValue value) { if (value == getSymbolPlacement()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "symbol-placement"); } @@ -114,14 +113,14 @@ PropertyValue SymbolLayer::getDefaultSymbolSpacing() { } PropertyValue SymbolLayer::getSymbolSpacing() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setSymbolSpacing(PropertyValue value) { if (value == getSymbolSpacing()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "symbol-spacing"); } @@ -130,14 +129,14 @@ PropertyValue SymbolLayer::getDefaultSymbolAvoidEdges() { } PropertyValue SymbolLayer::getSymbolAvoidEdges() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setSymbolAvoidEdges(PropertyValue value) { if (value == getSymbolAvoidEdges()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "symbol-avoid-edges"); } @@ -146,14 +145,14 @@ PropertyValue SymbolLayer::getDefaultIconAllowOverlap() { } PropertyValue SymbolLayer::getIconAllowOverlap() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconAllowOverlap(PropertyValue value) { if (value == getIconAllowOverlap()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-allow-overlap"); } @@ -162,14 +161,14 @@ PropertyValue SymbolLayer::getDefaultIconIgnorePlacement() { } PropertyValue SymbolLayer::getIconIgnorePlacement() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconIgnorePlacement(PropertyValue value) { if (value == getIconIgnorePlacement()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-ignore-placement"); } @@ -178,14 +177,14 @@ PropertyValue SymbolLayer::getDefaultIconOptional() { } PropertyValue SymbolLayer::getIconOptional() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconOptional(PropertyValue value) { if (value == getIconOptional()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-optional"); } @@ -194,14 +193,14 @@ PropertyValue SymbolLayer::getDefaultIconRotationAlignment() { } PropertyValue SymbolLayer::getIconRotationAlignment() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconRotationAlignment(PropertyValue value) { if (value == getIconRotationAlignment()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-rotation-alignment"); } @@ -210,14 +209,14 @@ DataDrivenPropertyValue SymbolLayer::getDefaultIconSize() { } DataDrivenPropertyValue SymbolLayer::getIconSize() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconSize(DataDrivenPropertyValue value) { if (value == getIconSize()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-size"); } @@ -226,14 +225,14 @@ PropertyValue SymbolLayer::getDefaultIconTextFit() { } PropertyValue SymbolLayer::getIconTextFit() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconTextFit(PropertyValue value) { if (value == getIconTextFit()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-text-fit"); } @@ -242,14 +241,14 @@ PropertyValue> SymbolLayer::getDefaultIconTextFitPadding() } PropertyValue> SymbolLayer::getIconTextFitPadding() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconTextFitPadding(PropertyValue> value) { if (value == getIconTextFitPadding()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-text-fit-padding"); } @@ -258,14 +257,14 @@ DataDrivenPropertyValue SymbolLayer::getDefaultIconImage() { } DataDrivenPropertyValue SymbolLayer::getIconImage() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconImage(DataDrivenPropertyValue value) { if (value == getIconImage()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-image"); } @@ -274,14 +273,14 @@ DataDrivenPropertyValue SymbolLayer::getDefaultIconRotate() { } DataDrivenPropertyValue SymbolLayer::getIconRotate() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconRotate(DataDrivenPropertyValue value) { if (value == getIconRotate()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-rotate"); } @@ -290,14 +289,14 @@ PropertyValue SymbolLayer::getDefaultIconPadding() { } PropertyValue SymbolLayer::getIconPadding() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconPadding(PropertyValue value) { if (value == getIconPadding()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-padding"); } @@ -306,14 +305,14 @@ PropertyValue SymbolLayer::getDefaultIconKeepUpright() { } PropertyValue SymbolLayer::getIconKeepUpright() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconKeepUpright(PropertyValue value) { if (value == getIconKeepUpright()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-keep-upright"); } @@ -322,14 +321,14 @@ DataDrivenPropertyValue> SymbolLayer::getDefaultIconOffset( } DataDrivenPropertyValue> SymbolLayer::getIconOffset() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setIconOffset(DataDrivenPropertyValue> value) { if (value == getIconOffset()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "icon-offset"); } @@ -338,14 +337,14 @@ PropertyValue SymbolLayer::getDefaultTextPitchAlignment() { } PropertyValue SymbolLayer::getTextPitchAlignment() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextPitchAlignment(PropertyValue value) { if (value == getTextPitchAlignment()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-pitch-alignment"); } @@ -354,14 +353,14 @@ PropertyValue SymbolLayer::getDefaultTextRotationAlignment() { } PropertyValue SymbolLayer::getTextRotationAlignment() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextRotationAlignment(PropertyValue value) { if (value == getTextRotationAlignment()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-rotation-alignment"); } @@ -370,14 +369,14 @@ DataDrivenPropertyValue SymbolLayer::getDefaultTextField() { } DataDrivenPropertyValue SymbolLayer::getTextField() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextField(DataDrivenPropertyValue value) { if (value == getTextField()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-field"); } @@ -386,14 +385,14 @@ PropertyValue> SymbolLayer::getDefaultTextFont() { } PropertyValue> SymbolLayer::getTextFont() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextFont(PropertyValue> value) { if (value == getTextFont()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-font"); } @@ -402,14 +401,14 @@ DataDrivenPropertyValue SymbolLayer::getDefaultTextSize() { } DataDrivenPropertyValue SymbolLayer::getTextSize() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextSize(DataDrivenPropertyValue value) { if (value == getTextSize()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-size"); } @@ -418,14 +417,14 @@ PropertyValue SymbolLayer::getDefaultTextMaxWidth() { } PropertyValue SymbolLayer::getTextMaxWidth() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextMaxWidth(PropertyValue value) { if (value == getTextMaxWidth()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-max-width"); } @@ -434,14 +433,14 @@ PropertyValue SymbolLayer::getDefaultTextLineHeight() { } PropertyValue SymbolLayer::getTextLineHeight() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextLineHeight(PropertyValue value) { if (value == getTextLineHeight()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-line-height"); } @@ -450,14 +449,14 @@ PropertyValue SymbolLayer::getDefaultTextLetterSpacing() { } PropertyValue SymbolLayer::getTextLetterSpacing() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextLetterSpacing(PropertyValue value) { if (value == getTextLetterSpacing()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-letter-spacing"); } @@ -466,14 +465,14 @@ PropertyValue SymbolLayer::getDefaultTextJustify() { } PropertyValue SymbolLayer::getTextJustify() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextJustify(PropertyValue value) { if (value == getTextJustify()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-justify"); } @@ -482,14 +481,14 @@ PropertyValue SymbolLayer::getDefaultTextAnchor() { } PropertyValue SymbolLayer::getTextAnchor() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextAnchor(PropertyValue value) { if (value == getTextAnchor()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-anchor"); } @@ -498,14 +497,14 @@ PropertyValue SymbolLayer::getDefaultTextMaxAngle() { } PropertyValue SymbolLayer::getTextMaxAngle() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextMaxAngle(PropertyValue value) { if (value == getTextMaxAngle()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-max-angle"); } @@ -514,14 +513,14 @@ DataDrivenPropertyValue SymbolLayer::getDefaultTextRotate() { } DataDrivenPropertyValue SymbolLayer::getTextRotate() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextRotate(DataDrivenPropertyValue value) { if (value == getTextRotate()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-rotate"); } @@ -530,14 +529,14 @@ PropertyValue SymbolLayer::getDefaultTextPadding() { } PropertyValue SymbolLayer::getTextPadding() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextPadding(PropertyValue value) { if (value == getTextPadding()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-padding"); } @@ -546,14 +545,14 @@ PropertyValue SymbolLayer::getDefaultTextKeepUpright() { } PropertyValue SymbolLayer::getTextKeepUpright() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextKeepUpright(PropertyValue value) { if (value == getTextKeepUpright()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-keep-upright"); } @@ -562,14 +561,14 @@ DataDrivenPropertyValue SymbolLayer::getDefaultTextTransform( } DataDrivenPropertyValue SymbolLayer::getTextTransform() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextTransform(DataDrivenPropertyValue value) { if (value == getTextTransform()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-transform"); } @@ -578,14 +577,14 @@ DataDrivenPropertyValue> SymbolLayer::getDefaultTextOffset( } DataDrivenPropertyValue> SymbolLayer::getTextOffset() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextOffset(DataDrivenPropertyValue> value) { if (value == getTextOffset()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-offset"); } @@ -594,14 +593,14 @@ PropertyValue SymbolLayer::getDefaultTextAllowOverlap() { } PropertyValue SymbolLayer::getTextAllowOverlap() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextAllowOverlap(PropertyValue value) { if (value == getTextAllowOverlap()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-allow-overlap"); } @@ -610,14 +609,14 @@ PropertyValue SymbolLayer::getDefaultTextIgnorePlacement() { } PropertyValue SymbolLayer::getTextIgnorePlacement() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextIgnorePlacement(PropertyValue value) { if (value == getTextIgnorePlacement()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-ignore-placement"); } @@ -626,14 +625,14 @@ PropertyValue SymbolLayer::getDefaultTextOptional() { } PropertyValue SymbolLayer::getTextOptional() const { - return impl().layout.unevaluated.get(); + return impl().layout.get(); } void SymbolLayer::setTextOptional(PropertyValue value) { if (value == getTextOptional()) return; auto impl_ = mutableImpl(); - impl_->layout.unevaluated.get() = value; + impl_->layout.get() = value; baseImpl = std::move(impl_); observer->onLayerLayoutPropertyChanged(*this, "text-optional"); } diff --git a/src/mbgl/style/layers/symbol_layer_impl.hpp b/src/mbgl/style/layers/symbol_layer_impl.hpp index d961dbb0b9..28760e1f74 100644 --- a/src/mbgl/style/layers/symbol_layer_impl.hpp +++ b/src/mbgl/style/layers/symbol_layer_impl.hpp @@ -13,7 +13,7 @@ public: void stringifyLayout(rapidjson::Writer&) const override; - SymbolLayoutProperties layout; + SymbolLayoutProperties::Unevaluated layout; SymbolPaintProperties::Cascading paint; }; diff --git a/src/mbgl/style/layers/symbol_layer_properties.hpp b/src/mbgl/style/layers/symbol_layer_properties.hpp index 42f593890b..d484d699d7 100644 --- a/src/mbgl/style/layers/symbol_layer_properties.hpp +++ b/src/mbgl/style/layers/symbol_layer_properties.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include namespace mbgl { @@ -236,7 +237,7 @@ struct TextTranslateAnchor : PaintProperty { static TranslateAnchorType defaultValue() { return TranslateAnchorType::Map; } }; -class SymbolLayoutProperties : public LayoutProperties< +class SymbolLayoutProperties : public Properties< SymbolPlacement, SymbolSpacing, SymbolAvoidEdges, @@ -273,7 +274,7 @@ class SymbolLayoutProperties : public LayoutProperties< TextOptional > {}; -class SymbolPaintProperties : public PaintProperties< +class SymbolPaintProperties : public Properties< IconOpacity, IconColor, IconHaloColor, -- cgit v1.2.1