diff options
Diffstat (limited to 'src/mbgl/style/layers')
20 files changed, 358 insertions, 0 deletions
diff --git a/src/mbgl/style/layers/background_layer_properties.cpp b/src/mbgl/style/layers/background_layer_properties.cpp index ba3e638977..f0da811379 100644 --- a/src/mbgl/style/layers/background_layer_properties.cpp +++ b/src/mbgl/style/layers/background_layer_properties.cpp @@ -2,8 +2,28 @@ #include <mbgl/style/layers/background_layer_properties.hpp> +#include <mbgl/style/layers/background_layer_impl.hpp> + namespace mbgl { namespace style { +BackgroundLayerProperties::BackgroundLayerProperties( + Immutable<BackgroundLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +BackgroundLayerProperties::BackgroundLayerProperties( + Immutable<BackgroundLayer::Impl> impl_, + CrossfadeParameters crossfade_, + BackgroundPaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + crossfade(std::move(crossfade_)), + evaluated(std::move(evaluated_)) {} + +BackgroundLayerProperties::~BackgroundLayerProperties() = default; + +const BackgroundLayer::Impl& BackgroundLayerProperties::layerImpl() const { + return static_cast<const BackgroundLayer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/background_layer_properties.hpp b/src/mbgl/style/layers/background_layer_properties.hpp index 3a61392fb4..3765e2e569 100644 --- a/src/mbgl/style/layers/background_layer_properties.hpp +++ b/src/mbgl/style/layers/background_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/background_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -30,5 +32,20 @@ class BackgroundPaintProperties : public Properties< BackgroundOpacity > {}; +class BackgroundLayerProperties final : public LayerProperties { +public: + explicit BackgroundLayerProperties(Immutable<BackgroundLayer::Impl>); + BackgroundLayerProperties( + Immutable<BackgroundLayer::Impl>, + CrossfadeParameters, + BackgroundPaintProperties::PossiblyEvaluated); + ~BackgroundLayerProperties() override; + + const BackgroundLayer::Impl& layerImpl() const; + // Data members. + CrossfadeParameters crossfade; + BackgroundPaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/circle_layer_properties.cpp b/src/mbgl/style/layers/circle_layer_properties.cpp index af727fa36f..fbb4aeabd4 100644 --- a/src/mbgl/style/layers/circle_layer_properties.cpp +++ b/src/mbgl/style/layers/circle_layer_properties.cpp @@ -2,8 +2,26 @@ #include <mbgl/style/layers/circle_layer_properties.hpp> +#include <mbgl/style/layers/circle_layer_impl.hpp> + namespace mbgl { namespace style { +CircleLayerProperties::CircleLayerProperties( + Immutable<CircleLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +CircleLayerProperties::CircleLayerProperties( + Immutable<CircleLayer::Impl> impl_, + CirclePaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + evaluated(std::move(evaluated_)) {} + +CircleLayerProperties::~CircleLayerProperties() = default; + +const CircleLayer::Impl& CircleLayerProperties::layerImpl() const { + return static_cast<const CircleLayer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/circle_layer_properties.hpp b/src/mbgl/style/layers/circle_layer_properties.hpp index 57caba9e3a..ef08e65455 100644 --- a/src/mbgl/style/layers/circle_layer_properties.hpp +++ b/src/mbgl/style/layers/circle_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/circle_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -70,5 +72,18 @@ class CirclePaintProperties : public Properties< CircleStrokeOpacity > {}; +class CircleLayerProperties final : public LayerProperties { +public: + explicit CircleLayerProperties(Immutable<CircleLayer::Impl>); + CircleLayerProperties( + Immutable<CircleLayer::Impl>, + CirclePaintProperties::PossiblyEvaluated); + ~CircleLayerProperties() override; + + const CircleLayer::Impl& layerImpl() const; + // Data members. + CirclePaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/fill_extrusion_layer_properties.cpp b/src/mbgl/style/layers/fill_extrusion_layer_properties.cpp index 59572bd3ab..7986c40923 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer_properties.cpp +++ b/src/mbgl/style/layers/fill_extrusion_layer_properties.cpp @@ -2,8 +2,28 @@ #include <mbgl/style/layers/fill_extrusion_layer_properties.hpp> +#include <mbgl/style/layers/fill_extrusion_layer_impl.hpp> + namespace mbgl { namespace style { +FillExtrusionLayerProperties::FillExtrusionLayerProperties( + Immutable<FillExtrusionLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +FillExtrusionLayerProperties::FillExtrusionLayerProperties( + Immutable<FillExtrusionLayer::Impl> impl_, + CrossfadeParameters crossfade_, + FillExtrusionPaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + crossfade(std::move(crossfade_)), + evaluated(std::move(evaluated_)) {} + +FillExtrusionLayerProperties::~FillExtrusionLayerProperties() = default; + +const FillExtrusionLayer::Impl& FillExtrusionLayerProperties::layerImpl() const { + return static_cast<const FillExtrusionLayer::Impl&>(*baseImpl); +} + } // namespace style } // 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 a7799eee22..c90594036b 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp +++ b/src/mbgl/style/layers/fill_extrusion_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/fill_extrusion_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -55,5 +57,20 @@ class FillExtrusionPaintProperties : public Properties< FillExtrusionVerticalGradient > {}; +class FillExtrusionLayerProperties final : public LayerProperties { +public: + explicit FillExtrusionLayerProperties(Immutable<FillExtrusionLayer::Impl>); + FillExtrusionLayerProperties( + Immutable<FillExtrusionLayer::Impl>, + CrossfadeParameters, + FillExtrusionPaintProperties::PossiblyEvaluated); + ~FillExtrusionLayerProperties() override; + + const FillExtrusionLayer::Impl& layerImpl() const; + // Data members. + CrossfadeParameters crossfade; + FillExtrusionPaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/fill_layer_properties.cpp b/src/mbgl/style/layers/fill_layer_properties.cpp index b07a083950..55e5a58cce 100644 --- a/src/mbgl/style/layers/fill_layer_properties.cpp +++ b/src/mbgl/style/layers/fill_layer_properties.cpp @@ -2,8 +2,28 @@ #include <mbgl/style/layers/fill_layer_properties.hpp> +#include <mbgl/style/layers/fill_layer_impl.hpp> + namespace mbgl { namespace style { +FillLayerProperties::FillLayerProperties( + Immutable<FillLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +FillLayerProperties::FillLayerProperties( + Immutable<FillLayer::Impl> impl_, + CrossfadeParameters crossfade_, + FillPaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + crossfade(std::move(crossfade_)), + evaluated(std::move(evaluated_)) {} + +FillLayerProperties::~FillLayerProperties() = default; + +const FillLayer::Impl& FillLayerProperties::layerImpl() const { + return static_cast<const FillLayer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/fill_layer_properties.hpp b/src/mbgl/style/layers/fill_layer_properties.hpp index 942733f2e1..f76aee448b 100644 --- a/src/mbgl/style/layers/fill_layer_properties.hpp +++ b/src/mbgl/style/layers/fill_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/fill_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -50,5 +52,20 @@ class FillPaintProperties : public Properties< FillPattern > {}; +class FillLayerProperties final : public LayerProperties { +public: + explicit FillLayerProperties(Immutable<FillLayer::Impl>); + FillLayerProperties( + Immutable<FillLayer::Impl>, + CrossfadeParameters, + FillPaintProperties::PossiblyEvaluated); + ~FillLayerProperties() override; + + const FillLayer::Impl& layerImpl() const; + // Data members. + CrossfadeParameters crossfade; + FillPaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/heatmap_layer_properties.cpp b/src/mbgl/style/layers/heatmap_layer_properties.cpp index 2edb839589..03a73be103 100644 --- a/src/mbgl/style/layers/heatmap_layer_properties.cpp +++ b/src/mbgl/style/layers/heatmap_layer_properties.cpp @@ -2,8 +2,26 @@ #include <mbgl/style/layers/heatmap_layer_properties.hpp> +#include <mbgl/style/layers/heatmap_layer_impl.hpp> + namespace mbgl { namespace style { +HeatmapLayerProperties::HeatmapLayerProperties( + Immutable<HeatmapLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +HeatmapLayerProperties::HeatmapLayerProperties( + Immutable<HeatmapLayer::Impl> impl_, + HeatmapPaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + evaluated(std::move(evaluated_)) {} + +HeatmapLayerProperties::~HeatmapLayerProperties() = default; + +const HeatmapLayer::Impl& HeatmapLayerProperties::layerImpl() const { + return static_cast<const HeatmapLayer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/heatmap_layer_properties.hpp b/src/mbgl/style/layers/heatmap_layer_properties.hpp index ce00217b2e..cccff61449 100644 --- a/src/mbgl/style/layers/heatmap_layer_properties.hpp +++ b/src/mbgl/style/layers/heatmap_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/heatmap_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -39,5 +41,18 @@ class HeatmapPaintProperties : public Properties< HeatmapOpacity > {}; +class HeatmapLayerProperties final : public LayerProperties { +public: + explicit HeatmapLayerProperties(Immutable<HeatmapLayer::Impl>); + HeatmapLayerProperties( + Immutable<HeatmapLayer::Impl>, + HeatmapPaintProperties::PossiblyEvaluated); + ~HeatmapLayerProperties() override; + + const HeatmapLayer::Impl& layerImpl() const; + // Data members. + HeatmapPaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/hillshade_layer_properties.cpp b/src/mbgl/style/layers/hillshade_layer_properties.cpp index f296ab4520..407acb6fc0 100644 --- a/src/mbgl/style/layers/hillshade_layer_properties.cpp +++ b/src/mbgl/style/layers/hillshade_layer_properties.cpp @@ -2,8 +2,26 @@ #include <mbgl/style/layers/hillshade_layer_properties.hpp> +#include <mbgl/style/layers/hillshade_layer_impl.hpp> + namespace mbgl { namespace style { +HillshadeLayerProperties::HillshadeLayerProperties( + Immutable<HillshadeLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +HillshadeLayerProperties::HillshadeLayerProperties( + Immutable<HillshadeLayer::Impl> impl_, + HillshadePaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + evaluated(std::move(evaluated_)) {} + +HillshadeLayerProperties::~HillshadeLayerProperties() = default; + +const HillshadeLayer::Impl& HillshadeLayerProperties::layerImpl() const { + return static_cast<const HillshadeLayer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/hillshade_layer_properties.hpp b/src/mbgl/style/layers/hillshade_layer_properties.hpp index 260d7ea808..6433151148 100644 --- a/src/mbgl/style/layers/hillshade_layer_properties.hpp +++ b/src/mbgl/style/layers/hillshade_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/hillshade_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -45,5 +47,18 @@ class HillshadePaintProperties : public Properties< HillshadeAccentColor > {}; +class HillshadeLayerProperties final : public LayerProperties { +public: + explicit HillshadeLayerProperties(Immutable<HillshadeLayer::Impl>); + HillshadeLayerProperties( + Immutable<HillshadeLayer::Impl>, + HillshadePaintProperties::PossiblyEvaluated); + ~HillshadeLayerProperties() override; + + const HillshadeLayer::Impl& layerImpl() const; + // Data members. + HillshadePaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/layer_properties.cpp.ejs b/src/mbgl/style/layers/layer_properties.cpp.ejs index e5523e5439..2c8e1ce9a0 100644 --- a/src/mbgl/style/layers/layer_properties.cpp.ejs +++ b/src/mbgl/style/layers/layer_properties.cpp.ejs @@ -7,8 +7,32 @@ #include <mbgl/style/layers/<%- type.replace('-', '_') %>_layer_properties.hpp> +#include <mbgl/style/layers/<%- type.replace('-', '_') %>_layer_impl.hpp> + namespace mbgl { namespace style { +<%- camelize(type) %>LayerProperties::<%- camelize(type) %>LayerProperties( + Immutable<<%- camelize(type) %>Layer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +<%- camelize(type) %>LayerProperties::<%- camelize(type) %>LayerProperties( + Immutable<<%- camelize(type) %>Layer::Impl> impl_, +<% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%> + CrossfadeParameters crossfade_, +<% } -%> + <%- camelize(type) %>PaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), +<% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%> + crossfade(std::move(crossfade_)), +<% } -%> + evaluated(std::move(evaluated_)) {} + +<%- camelize(type) %>LayerProperties::~<%- camelize(type) %>LayerProperties() = default; + +const <%- camelize(type) %>Layer::Impl& <%- camelize(type) %>LayerProperties::layerImpl() const { + return static_cast<const <%- camelize(type) %>Layer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/layer_properties.hpp.ejs b/src/mbgl/style/layers/layer_properties.hpp.ejs index de647fbc07..11a1db33c7 100644 --- a/src/mbgl/style/layers/layer_properties.hpp.ejs +++ b/src/mbgl/style/layers/layer_properties.hpp.ejs @@ -8,6 +8,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/<%- type.replace('-', '_') %>_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -66,5 +68,24 @@ class <%- camelize(type) %>PaintProperties : public Properties< <%- camelize(paintProperties.slice(-1)[0].name) %> > {}; +class <%- camelize(type) %>LayerProperties final : public LayerProperties { +public: + explicit <%- camelize(type) %>LayerProperties(Immutable<<%- camelize(type) %>Layer::Impl>); + <%- camelize(type) %>LayerProperties( + Immutable<<%- camelize(type) %>Layer::Impl>, +<% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%> + CrossfadeParameters, +<% } -%> + <%- camelize(type) %>PaintProperties::PossiblyEvaluated); + ~<%- camelize(type) %>LayerProperties() override; + + const <%- camelize(type) %>Layer::Impl& layerImpl() const; + // Data members. +<% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%> + CrossfadeParameters crossfade; +<% } -%> + <%- camelize(type) %>PaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/line_layer_properties.cpp b/src/mbgl/style/layers/line_layer_properties.cpp index 174239bcc8..09fb6ff80c 100644 --- a/src/mbgl/style/layers/line_layer_properties.cpp +++ b/src/mbgl/style/layers/line_layer_properties.cpp @@ -2,8 +2,28 @@ #include <mbgl/style/layers/line_layer_properties.hpp> +#include <mbgl/style/layers/line_layer_impl.hpp> + namespace mbgl { namespace style { +LineLayerProperties::LineLayerProperties( + Immutable<LineLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +LineLayerProperties::LineLayerProperties( + Immutable<LineLayer::Impl> impl_, + CrossfadeParameters crossfade_, + LinePaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + crossfade(std::move(crossfade_)), + evaluated(std::move(evaluated_)) {} + +LineLayerProperties::~LineLayerProperties() = default; + +const LineLayer::Impl& LineLayerProperties::layerImpl() const { + return static_cast<const LineLayer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/line_layer_properties.hpp b/src/mbgl/style/layers/line_layer_properties.hpp index 33d7eddbe8..5fcbecf3be 100644 --- a/src/mbgl/style/layers/line_layer_properties.hpp +++ b/src/mbgl/style/layers/line_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/line_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -102,5 +104,20 @@ class LinePaintProperties : public Properties< LineGradient > {}; +class LineLayerProperties final : public LayerProperties { +public: + explicit LineLayerProperties(Immutable<LineLayer::Impl>); + LineLayerProperties( + Immutable<LineLayer::Impl>, + CrossfadeParameters, + LinePaintProperties::PossiblyEvaluated); + ~LineLayerProperties() override; + + const LineLayer::Impl& layerImpl() const; + // Data members. + CrossfadeParameters crossfade; + LinePaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/raster_layer_properties.cpp b/src/mbgl/style/layers/raster_layer_properties.cpp index 303719af40..4d9245a218 100644 --- a/src/mbgl/style/layers/raster_layer_properties.cpp +++ b/src/mbgl/style/layers/raster_layer_properties.cpp @@ -2,8 +2,26 @@ #include <mbgl/style/layers/raster_layer_properties.hpp> +#include <mbgl/style/layers/raster_layer_impl.hpp> + namespace mbgl { namespace style { +RasterLayerProperties::RasterLayerProperties( + Immutable<RasterLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +RasterLayerProperties::RasterLayerProperties( + Immutable<RasterLayer::Impl> impl_, + RasterPaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + evaluated(std::move(evaluated_)) {} + +RasterLayerProperties::~RasterLayerProperties() = default; + +const RasterLayer::Impl& RasterLayerProperties::layerImpl() const { + return static_cast<const RasterLayer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/raster_layer_properties.hpp b/src/mbgl/style/layers/raster_layer_properties.hpp index 08818c9fb3..c380ea471d 100644 --- a/src/mbgl/style/layers/raster_layer_properties.hpp +++ b/src/mbgl/style/layers/raster_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/raster_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -55,5 +57,18 @@ class RasterPaintProperties : public Properties< RasterFadeDuration > {}; +class RasterLayerProperties final : public LayerProperties { +public: + explicit RasterLayerProperties(Immutable<RasterLayer::Impl>); + RasterLayerProperties( + Immutable<RasterLayer::Impl>, + RasterPaintProperties::PossiblyEvaluated); + ~RasterLayerProperties() override; + + const RasterLayer::Impl& layerImpl() const; + // Data members. + RasterPaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/symbol_layer_properties.cpp b/src/mbgl/style/layers/symbol_layer_properties.cpp index 5a1ce713ba..aeca39b419 100644 --- a/src/mbgl/style/layers/symbol_layer_properties.cpp +++ b/src/mbgl/style/layers/symbol_layer_properties.cpp @@ -2,8 +2,26 @@ #include <mbgl/style/layers/symbol_layer_properties.hpp> +#include <mbgl/style/layers/symbol_layer_impl.hpp> + namespace mbgl { namespace style { +SymbolLayerProperties::SymbolLayerProperties( + Immutable<SymbolLayer::Impl> impl_) + : LayerProperties(std::move(impl_)) {} + +SymbolLayerProperties::SymbolLayerProperties( + Immutable<SymbolLayer::Impl> impl_, + SymbolPaintProperties::PossiblyEvaluated evaluated_) + : LayerProperties(std::move(impl_)), + evaluated(std::move(evaluated_)) {} + +SymbolLayerProperties::~SymbolLayerProperties() = default; + +const SymbolLayer::Impl& SymbolLayerProperties::layerImpl() const { + return static_cast<const SymbolLayer::Impl&>(*baseImpl); +} + } // namespace style } // namespace mbgl diff --git a/src/mbgl/style/layers/symbol_layer_properties.hpp b/src/mbgl/style/layers/symbol_layer_properties.hpp index caefbad137..6e3fa54241 100644 --- a/src/mbgl/style/layers/symbol_layer_properties.hpp +++ b/src/mbgl/style/layers/symbol_layer_properties.hpp @@ -3,6 +3,8 @@ #pragma once #include <mbgl/style/types.hpp> +#include <mbgl/style/layer_properties.hpp> +#include <mbgl/style/layers/symbol_layer.hpp> #include <mbgl/style/layout_property.hpp> #include <mbgl/style/paint_property.hpp> #include <mbgl/style/properties.hpp> @@ -331,5 +333,18 @@ class SymbolPaintProperties : public Properties< TextTranslateAnchor > {}; +class SymbolLayerProperties final : public LayerProperties { +public: + explicit SymbolLayerProperties(Immutable<SymbolLayer::Impl>); + SymbolLayerProperties( + Immutable<SymbolLayer::Impl>, + SymbolPaintProperties::PossiblyEvaluated); + ~SymbolLayerProperties() override; + + const SymbolLayer::Impl& layerImpl() const; + // Data members. + SymbolPaintProperties::PossiblyEvaluated evaluated; +}; + } // namespace style } // namespace mbgl |