summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/layer_properties.cpp.ejs
blob: b781a4a9d95a87c21127ce157080e4d0e3209c31 (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
37
38
<%
  const type = locals.type;
  const layoutProperties = locals.layoutProperties;
  const paintProperties = locals.paintProperties;
-%>
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.

#include <mbgl/style/layers/<%- type %>_layer_properties.hpp>

namespace mbgl {
namespace style {

<% if (layoutProperties.length) { -%>
void <%- camelize(type) %>LayoutProperties::recalculate(const CalculationParameters& parameters) {
<% for (const property of layoutProperties) { -%>
    <%- camelizeWithLeadingLowercase(property.name) %>.calculate(parameters);
<% } -%>
}

<% } -%>
void <%- camelize(type) %>PaintProperties::cascade(const CascadeParameters& parameters) {
<% for (const property of paintProperties) { -%>
    <%- camelizeWithLeadingLowercase(property.name) %>.cascade(parameters);
<% } -%>
}

bool <%- camelize(type) %>PaintProperties::recalculate(const CalculationParameters& parameters) {
    bool hasTransitions = false;

<% for (const property of paintProperties) { -%>
    hasTransitions |= <%- camelizeWithLeadingLowercase(property.name) %>.calculate(parameters);
<% } -%>

    return hasTransitions;
}

} // namespace style
} // namespace mbgl