Files
MapLibreParticleLab/include/mbgl/style/layer_properties.hpp
Mikhail Pozdnyakov 858097102d [core] Render layers use synchronized buckets and paint properties
Actual for layers rendering the geometry tile data: line, fill, fill-extrusion, heatmap, circle, symbol (was updated in previous commits).
2019-04-17 17:21:41 +03:00

35 lines
872 B
C++

#pragma once
#include <mbgl/style/layer_impl.hpp>
namespace mbgl {
namespace style {
/**
* @brief An interface, wrapping evaluated layer properties.
*
* It is an abstract base class; concrete derived classes that hold the actual data are provided for each layer type.
*/
class LayerProperties {
public:
virtual ~LayerProperties() = default;
Immutable<Layer::Impl> baseImpl;
protected:
LayerProperties(Immutable<Layer::Impl> impl) : baseImpl(std::move(impl)) {}
};
template <class Derived>
inline const auto& getEvaluated(const Immutable<LayerProperties>& properties) {
return static_cast<const Derived&>(*properties).evaluated;
}
template <class Derived>
inline const auto& getCrossfade(const Immutable<LayerProperties>& properties) {
return static_cast<const Derived&>(*properties).crossfade;
}
} // namespace style
} // namespace mbgl