blob: 065fa30db1ca2b6fc4ac1aee50952938aada95a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#pragma once
#include <mbgl/style/expression/expression.hpp>
#include <mbgl/style/expression/compound_expression.hpp>
namespace mbgl {
namespace style {
namespace expression {
template <typename T>
bool isGlobalPropertyConstant(const Expression& expression, const T& properties) {
if (expression.getKind() == Kind::CompoundExpression) {
auto e = static_cast<const CompoundExpressionBase*>(&expression);
for (const std::string& property : properties) {
if (e->getName() == property) {
return false;
}
}
}
bool isConstant = true;
expression.eachChild([&](const Expression& e) {
if (isConstant && !isGlobalPropertyConstant(e, properties)) {
isConstant = false;
}
});
return isConstant;
};
bool isFeatureConstant(const Expression& expression);
bool isZoomConstant(const Expression& e);
} // namespace expression
} // namespace style
} // namespace mbgl
|