From 3afc8b4a2939da70c76dc5b2eb5d007fc917d348 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 19 Oct 2015 15:24:22 -0700 Subject: [core] Introduce StyleLayer subclasses --- include/mbgl/annotation/shape_annotation.hpp | 8 ++++++-- include/mbgl/style/style_properties.hpp | 18 ++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) (limited to 'include/mbgl') diff --git a/include/mbgl/annotation/shape_annotation.hpp b/include/mbgl/annotation/shape_annotation.hpp index dd8bf5e4d5..5e6a13149a 100644 --- a/include/mbgl/annotation/shape_annotation.hpp +++ b/include/mbgl/annotation/shape_annotation.hpp @@ -6,6 +6,8 @@ #include +#include + namespace mbgl { using AnnotationSegment = std::vector; @@ -13,12 +15,14 @@ using AnnotationSegments = std::vector; class ShapeAnnotation { public: - inline ShapeAnnotation(const AnnotationSegments& segments_, const StyleProperties& styleProperties_) + using Properties = mapbox::util::variant; + + inline ShapeAnnotation(const AnnotationSegments& segments_, const Properties& styleProperties_) : segments(segments_), styleProperties(styleProperties_) { } const AnnotationSegments segments; - const StyleProperties styleProperties; + const Properties styleProperties; }; } diff --git a/include/mbgl/style/style_properties.hpp b/include/mbgl/style/style_properties.hpp index aacac3387b..2216491135 100644 --- a/include/mbgl/style/style_properties.hpp +++ b/include/mbgl/style/style_properties.hpp @@ -1,14 +1,10 @@ #ifndef MBGL_STYLE_STYLE_PROPERTIES #define MBGL_STYLE_STYLE_PROPERTIES -#include - #include #include #include -#include -#include #include namespace mbgl { @@ -169,22 +165,16 @@ public: float opacity = 1.0f; Color color = {{ 0, 0, 0, 1 }}; Faded image; + + inline bool isVisible() const { + return opacity > 0; + } }; class BackgroundLayoutProperties { public: }; -typedef mapbox::util::variant< - FillPaintProperties, - LinePaintProperties, - CirclePaintProperties, - SymbolPaintProperties, - RasterPaintProperties, - BackgroundPaintProperties, - std::false_type -> StyleProperties; - } #endif -- cgit v1.2.1