Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
88 lines
2.7 KiB
Plaintext
88 lines
2.7 KiB
Plaintext
<%
|
|
const type = locals.type;
|
|
const layoutProperties = locals.layoutProperties;
|
|
const paintProperties = locals.paintProperties;
|
|
-%>
|
|
// clang-format off
|
|
|
|
// This file is generated. Do not edit.
|
|
|
|
#pragma once
|
|
|
|
<% if (type === 'heatmap' || type === 'line' || type === 'color-relief') { -%>
|
|
#include <mln/style/color_ramp_property_value.hpp>
|
|
<% } -%>
|
|
#include <mln/style/layer.hpp>
|
|
#include <mln/style/filter.hpp>
|
|
#include <mln/style/property_value.hpp>
|
|
<% if (type === 'location-indicator') { -%>
|
|
#include <mln/style/rotation.hpp>
|
|
<% } -%>
|
|
<% if (type === 'symbol') { -%>
|
|
#include <mln/style/expression/formatted.hpp>
|
|
#include <mln/style/variable_anchor_offset_collection.hpp>
|
|
<% } -%>
|
|
#include <mln/util/color.hpp>
|
|
|
|
<% if (type === 'line' || type === 'symbol') { -%>
|
|
#include <vector>
|
|
|
|
<% } -%>
|
|
namespace mln {
|
|
namespace style {
|
|
|
|
class TransitionOptions;
|
|
|
|
class <%- camelize(type) %>Layer final : public Layer {
|
|
public:
|
|
<% if ((type === 'background') || (type === 'location-indicator')) { -%>
|
|
<%- camelize(type) %>Layer(const std::string& layerID);
|
|
<% } else { -%>
|
|
<%- camelize(type) %>Layer(const std::string& layerID, const std::string& sourceID);
|
|
<% } -%>
|
|
~<%- camelize(type) %>Layer() override;
|
|
|
|
<% if (layoutProperties.length) { -%>
|
|
// Layout properties
|
|
|
|
<% for (const property of layoutProperties) { -%>
|
|
static <%- propertyValueType(property) %> getDefault<%- camelize(property.name) %>();
|
|
const <%- propertyValueType(property) %>& get<%- camelize(property.name) %>() const;
|
|
void set<%- camelize(property.name) %>(const <%- propertyValueType(property) %>&);
|
|
|
|
<% } -%>
|
|
<% } -%>
|
|
// Paint properties
|
|
|
|
<% for (const property of paintProperties) { -%>
|
|
static <%- propertyValueType(property) %> getDefault<%- camelize(property.name) %>();
|
|
const <%- propertyValueType(property) %>& get<%- camelize(property.name) %>() const;
|
|
void set<%- camelize(property.name) %>(const <%- propertyValueType(property) %>&);
|
|
void set<%- camelize(property.name) %>Transition(const TransitionOptions&);
|
|
TransitionOptions get<%- camelize(property.name) %>Transition() const;
|
|
|
|
<% } -%>
|
|
// Private implementation
|
|
|
|
class Impl;
|
|
const Impl& impl() const;
|
|
|
|
Mutable<Impl> mutableImpl() const;
|
|
<%- camelize(type) %>Layer(Immutable<Impl>);
|
|
std::unique_ptr<Layer> cloneRef(const std::string& id) const final;
|
|
|
|
protected:
|
|
// Dynamic properties
|
|
std::optional<conversion::Error> setPropertyInternal(const std::string& name, const conversion::Convertible& value) final;
|
|
|
|
StyleProperty getProperty(const std::string& name) const final;
|
|
Value serialize() const final;
|
|
|
|
Mutable<Layer::Impl> mutableBaseImpl() const final;
|
|
};
|
|
|
|
} // namespace style
|
|
} // namespace mln
|
|
|
|
// clang-format on
|