[core] Add Filter accessors
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/layer.hpp>
|
||||
#include <mbgl/style/filter.hpp>
|
||||
#include <mbgl/style/property_value.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/layer.hpp>
|
||||
#include <mbgl/style/filter.hpp>
|
||||
#include <mbgl/style/property_value.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
@@ -18,6 +19,9 @@ public:
|
||||
const std::string& getSourceID() const;
|
||||
const std::string& getSourceLayer() const;
|
||||
|
||||
void setFilter(const Filter&);
|
||||
const Filter& getFilter() const;
|
||||
|
||||
// Paint properties
|
||||
|
||||
PropertyValue<float> getCircleRadius() const;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/layer.hpp>
|
||||
#include <mbgl/style/filter.hpp>
|
||||
#include <mbgl/style/property_value.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
@@ -18,6 +19,9 @@ public:
|
||||
const std::string& getSourceID() const;
|
||||
const std::string& getSourceLayer() const;
|
||||
|
||||
void setFilter(const Filter&);
|
||||
const Filter& getFilter() const;
|
||||
|
||||
// Paint properties
|
||||
|
||||
PropertyValue<bool> getFillAntialias() const;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/layer.hpp>
|
||||
#include <mbgl/style/filter.hpp>
|
||||
#include <mbgl/style/property_value.hpp>
|
||||
|
||||
#include <vector>
|
||||
@@ -20,6 +21,9 @@ public:
|
||||
const std::string& getSourceID() const;
|
||||
const std::string& getSourceLayer() const;
|
||||
|
||||
void setFilter(const Filter&);
|
||||
const Filter& getFilter() const;
|
||||
|
||||
// Layout properties
|
||||
|
||||
PropertyValue<LineCapType> getLineCap() const;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/layer.hpp>
|
||||
#include <mbgl/style/filter.hpp>
|
||||
#include <mbgl/style/property_value.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/style/layer.hpp>
|
||||
#include <mbgl/style/filter.hpp>
|
||||
#include <mbgl/style/property_value.hpp>
|
||||
|
||||
#include <vector>
|
||||
@@ -20,6 +21,9 @@ public:
|
||||
const std::string& getSourceID() const;
|
||||
const std::string& getSourceLayer() const;
|
||||
|
||||
void setFilter(const Filter&);
|
||||
const Filter& getFilter() const;
|
||||
|
||||
// Layout properties
|
||||
|
||||
PropertyValue<SymbolPlacementType> getSymbolPlacement() const;
|
||||
|
||||
103
include/mbgl/style/filter.hpp
Normal file
103
include/mbgl/style/filter.hpp
Normal file
@@ -0,0 +1,103 @@
|
||||
#pragma once
|
||||
|
||||
#include <mbgl/util/variant.hpp>
|
||||
#include <mbgl/util/feature.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
typedef variant<
|
||||
class NullFilter,
|
||||
class EqualsFilter,
|
||||
class NotEqualsFilter,
|
||||
class LessThanFilter,
|
||||
class LessThanEqualsFilter,
|
||||
class GreaterThanFilter,
|
||||
class GreaterThanEqualsFilter,
|
||||
class InFilter,
|
||||
class NotInFilter,
|
||||
class AnyFilter,
|
||||
class AllFilter,
|
||||
class NoneFilter,
|
||||
class HasFilter,
|
||||
class NotHasFilter
|
||||
> Filter;
|
||||
|
||||
class NullFilter {};
|
||||
|
||||
class EqualsFilter {
|
||||
public:
|
||||
std::string key;
|
||||
Value value;
|
||||
};
|
||||
|
||||
class NotEqualsFilter {
|
||||
public:
|
||||
std::string key;
|
||||
Value value;
|
||||
};
|
||||
|
||||
class LessThanFilter {
|
||||
public:
|
||||
std::string key;
|
||||
Value value;
|
||||
};
|
||||
|
||||
class LessThanEqualsFilter {
|
||||
public:
|
||||
std::string key;
|
||||
Value value;
|
||||
};
|
||||
|
||||
class GreaterThanFilter {
|
||||
public:
|
||||
std::string key;
|
||||
Value value;
|
||||
};
|
||||
|
||||
class GreaterThanEqualsFilter {
|
||||
public:
|
||||
std::string key;
|
||||
Value value;
|
||||
};
|
||||
|
||||
class InFilter {
|
||||
public:
|
||||
std::string key;
|
||||
std::vector<Value> values;
|
||||
};
|
||||
|
||||
class NotInFilter {
|
||||
public:
|
||||
std::string key;
|
||||
std::vector<Value> values;
|
||||
};
|
||||
|
||||
class AnyFilter {
|
||||
public:
|
||||
std::vector<Filter> filters;
|
||||
};
|
||||
|
||||
class AllFilter {
|
||||
public:
|
||||
std::vector<Filter> filters;
|
||||
};
|
||||
|
||||
class NoneFilter {
|
||||
public:
|
||||
std::vector<Filter> filters;
|
||||
};
|
||||
|
||||
class HasFilter {
|
||||
public:
|
||||
std::string key;
|
||||
};
|
||||
|
||||
class NotHasFilter {
|
||||
public:
|
||||
std::string key;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
10
include/mbgl/util/variant.hpp
Normal file
10
include/mbgl/util/variant.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <mapbox/variant.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
template <typename... T>
|
||||
using variant = mapbox::util::variant<T...>;
|
||||
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user