397 lines
12 KiB
C++
397 lines
12 KiB
C++
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
|
|
|
|
#include <mbgl/style/layers/circle_layer.hpp>
|
|
#include <mbgl/style/layers/circle_layer_impl.hpp>
|
|
#include <mbgl/style/layer_observer.hpp>
|
|
|
|
namespace mbgl {
|
|
namespace style {
|
|
|
|
CircleLayer::CircleLayer(const std::string& layerID, const std::string& sourceID)
|
|
: Layer(makeMutable<Impl>(LayerType::Circle, layerID, sourceID)) {
|
|
}
|
|
|
|
CircleLayer::CircleLayer(Immutable<Impl> impl_)
|
|
: Layer(std::move(impl_)) {
|
|
}
|
|
|
|
CircleLayer::~CircleLayer() = default;
|
|
|
|
const CircleLayer::Impl& CircleLayer::impl() const {
|
|
return static_cast<const Impl&>(*baseImpl);
|
|
}
|
|
|
|
Mutable<CircleLayer::Impl> CircleLayer::mutableImpl() const {
|
|
return makeMutable<Impl>(impl());
|
|
}
|
|
|
|
std::unique_ptr<Layer> CircleLayer::cloneRef(const std::string& id_) const {
|
|
auto impl_ = mutableImpl();
|
|
impl_->id = id_;
|
|
impl_->paint = CirclePaintProperties::Transitionable();
|
|
return std::make_unique<CircleLayer>(std::move(impl_));
|
|
}
|
|
|
|
void CircleLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const {
|
|
}
|
|
|
|
// Source
|
|
|
|
const std::string& CircleLayer::getSourceID() const {
|
|
return impl().source;
|
|
}
|
|
|
|
void CircleLayer::setSourceLayer(const std::string& sourceLayer) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->sourceLayer = sourceLayer;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
const std::string& CircleLayer::getSourceLayer() const {
|
|
return impl().sourceLayer;
|
|
}
|
|
|
|
// Filter
|
|
|
|
void CircleLayer::setFilter(const Filter& filter) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->filter = filter;
|
|
baseImpl = std::move(impl_);
|
|
observer->onLayerFilterChanged(*this);
|
|
}
|
|
|
|
const Filter& CircleLayer::getFilter() const {
|
|
return impl().filter;
|
|
}
|
|
|
|
// Visibility
|
|
|
|
void CircleLayer::setVisibility(VisibilityType value) {
|
|
if (value == getVisibility())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->visibility = value;
|
|
baseImpl = std::move(impl_);
|
|
observer->onLayerVisibilityChanged(*this);
|
|
}
|
|
|
|
// Zoom range
|
|
|
|
void CircleLayer::setMinZoom(float minZoom) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->minZoom = minZoom;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
void CircleLayer::setMaxZoom(float maxZoom) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->maxZoom = maxZoom;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
// Layout properties
|
|
|
|
|
|
// Paint properties
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleRadius() {
|
|
return { 5 };
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getCircleRadius() const {
|
|
return impl().paint.template get<CircleRadius>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleRadius(DataDrivenPropertyValue<float> value) {
|
|
if (value == getCircleRadius())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleRadius>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
if (value.isDataDriven()) {
|
|
observer->onLayerDataDrivenPaintPropertyChanged(*this);
|
|
} else {
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
}
|
|
|
|
void CircleLayer::setCircleRadiusTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleRadius>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleRadiusTransition() const {
|
|
return impl().paint.template get<CircleRadius>().options;
|
|
}
|
|
|
|
DataDrivenPropertyValue<Color> CircleLayer::getDefaultCircleColor() {
|
|
return { Color::black() };
|
|
}
|
|
|
|
DataDrivenPropertyValue<Color> CircleLayer::getCircleColor() const {
|
|
return impl().paint.template get<CircleColor>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleColor(DataDrivenPropertyValue<Color> value) {
|
|
if (value == getCircleColor())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleColor>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
if (value.isDataDriven()) {
|
|
observer->onLayerDataDrivenPaintPropertyChanged(*this);
|
|
} else {
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
}
|
|
|
|
void CircleLayer::setCircleColorTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleColor>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleColorTransition() const {
|
|
return impl().paint.template get<CircleColor>().options;
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleBlur() {
|
|
return { 0 };
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getCircleBlur() const {
|
|
return impl().paint.template get<CircleBlur>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleBlur(DataDrivenPropertyValue<float> value) {
|
|
if (value == getCircleBlur())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleBlur>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
if (value.isDataDriven()) {
|
|
observer->onLayerDataDrivenPaintPropertyChanged(*this);
|
|
} else {
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
}
|
|
|
|
void CircleLayer::setCircleBlurTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleBlur>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleBlurTransition() const {
|
|
return impl().paint.template get<CircleBlur>().options;
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleOpacity() {
|
|
return { 1 };
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getCircleOpacity() const {
|
|
return impl().paint.template get<CircleOpacity>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleOpacity(DataDrivenPropertyValue<float> value) {
|
|
if (value == getCircleOpacity())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleOpacity>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
if (value.isDataDriven()) {
|
|
observer->onLayerDataDrivenPaintPropertyChanged(*this);
|
|
} else {
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
}
|
|
|
|
void CircleLayer::setCircleOpacityTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleOpacity>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleOpacityTransition() const {
|
|
return impl().paint.template get<CircleOpacity>().options;
|
|
}
|
|
|
|
PropertyValue<std::array<float, 2>> CircleLayer::getDefaultCircleTranslate() {
|
|
return { {{ 0, 0 }} };
|
|
}
|
|
|
|
PropertyValue<std::array<float, 2>> CircleLayer::getCircleTranslate() const {
|
|
return impl().paint.template get<CircleTranslate>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleTranslate(PropertyValue<std::array<float, 2>> value) {
|
|
if (value == getCircleTranslate())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleTranslate>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
|
|
void CircleLayer::setCircleTranslateTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleTranslate>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleTranslateTransition() const {
|
|
return impl().paint.template get<CircleTranslate>().options;
|
|
}
|
|
|
|
PropertyValue<TranslateAnchorType> CircleLayer::getDefaultCircleTranslateAnchor() {
|
|
return { TranslateAnchorType::Map };
|
|
}
|
|
|
|
PropertyValue<TranslateAnchorType> CircleLayer::getCircleTranslateAnchor() const {
|
|
return impl().paint.template get<CircleTranslateAnchor>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleTranslateAnchor(PropertyValue<TranslateAnchorType> value) {
|
|
if (value == getCircleTranslateAnchor())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleTranslateAnchor>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
|
|
void CircleLayer::setCircleTranslateAnchorTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleTranslateAnchor>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleTranslateAnchorTransition() const {
|
|
return impl().paint.template get<CircleTranslateAnchor>().options;
|
|
}
|
|
|
|
PropertyValue<CirclePitchScaleType> CircleLayer::getDefaultCirclePitchScale() {
|
|
return { CirclePitchScaleType::Map };
|
|
}
|
|
|
|
PropertyValue<CirclePitchScaleType> CircleLayer::getCirclePitchScale() const {
|
|
return impl().paint.template get<CirclePitchScale>().value;
|
|
}
|
|
|
|
void CircleLayer::setCirclePitchScale(PropertyValue<CirclePitchScaleType> value) {
|
|
if (value == getCirclePitchScale())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CirclePitchScale>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
|
|
void CircleLayer::setCirclePitchScaleTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CirclePitchScale>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCirclePitchScaleTransition() const {
|
|
return impl().paint.template get<CirclePitchScale>().options;
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleStrokeWidth() {
|
|
return { 0 };
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getCircleStrokeWidth() const {
|
|
return impl().paint.template get<CircleStrokeWidth>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleStrokeWidth(DataDrivenPropertyValue<float> value) {
|
|
if (value == getCircleStrokeWidth())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleStrokeWidth>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
if (value.isDataDriven()) {
|
|
observer->onLayerDataDrivenPaintPropertyChanged(*this);
|
|
} else {
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
}
|
|
|
|
void CircleLayer::setCircleStrokeWidthTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleStrokeWidth>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleStrokeWidthTransition() const {
|
|
return impl().paint.template get<CircleStrokeWidth>().options;
|
|
}
|
|
|
|
DataDrivenPropertyValue<Color> CircleLayer::getDefaultCircleStrokeColor() {
|
|
return { Color::black() };
|
|
}
|
|
|
|
DataDrivenPropertyValue<Color> CircleLayer::getCircleStrokeColor() const {
|
|
return impl().paint.template get<CircleStrokeColor>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleStrokeColor(DataDrivenPropertyValue<Color> value) {
|
|
if (value == getCircleStrokeColor())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleStrokeColor>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
if (value.isDataDriven()) {
|
|
observer->onLayerDataDrivenPaintPropertyChanged(*this);
|
|
} else {
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
}
|
|
|
|
void CircleLayer::setCircleStrokeColorTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleStrokeColor>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleStrokeColorTransition() const {
|
|
return impl().paint.template get<CircleStrokeColor>().options;
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getDefaultCircleStrokeOpacity() {
|
|
return { 1 };
|
|
}
|
|
|
|
DataDrivenPropertyValue<float> CircleLayer::getCircleStrokeOpacity() const {
|
|
return impl().paint.template get<CircleStrokeOpacity>().value;
|
|
}
|
|
|
|
void CircleLayer::setCircleStrokeOpacity(DataDrivenPropertyValue<float> value) {
|
|
if (value == getCircleStrokeOpacity())
|
|
return;
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleStrokeOpacity>().value = value;
|
|
baseImpl = std::move(impl_);
|
|
if (value.isDataDriven()) {
|
|
observer->onLayerDataDrivenPaintPropertyChanged(*this);
|
|
} else {
|
|
observer->onLayerPaintPropertyChanged(*this);
|
|
}
|
|
}
|
|
|
|
void CircleLayer::setCircleStrokeOpacityTransition(const TransitionOptions& options) {
|
|
auto impl_ = mutableImpl();
|
|
impl_->paint.template get<CircleStrokeOpacity>().options = options;
|
|
baseImpl = std::move(impl_);
|
|
}
|
|
|
|
TransitionOptions CircleLayer::getCircleStrokeOpacityTransition() const {
|
|
return impl().paint.template get<CircleStrokeOpacity>().options;
|
|
}
|
|
|
|
} // namespace style
|
|
} // namespace mbgl
|