// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. #include #include #include #include #include #include #include #include #include #include namespace mbgl { namespace style { // static const LayerTypeInfo* FillLayer::Impl::staticTypeInfo() noexcept { const static LayerTypeInfo typeInfo {"fill", LayerTypeInfo::Source::Required, LayerTypeInfo::Pass3D::NotRequired, LayerTypeInfo::Layout::Required, LayerTypeInfo::Clipping::Required, LayerTypeInfo::FadingTiles::NotRequired }; return &typeInfo; } FillLayer::FillLayer(const std::string& layerID, const std::string& sourceID) : Layer(makeMutable(layerID, sourceID)) { } FillLayer::FillLayer(Immutable impl_) : Layer(std::move(impl_)) { } FillLayer::~FillLayer() = default; const FillLayer::Impl& FillLayer::impl() const { return static_cast(*baseImpl); } Mutable FillLayer::mutableImpl() const { return makeMutable(impl()); } std::unique_ptr FillLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; impl_->paint = FillPaintProperties::Transitionable(); return std::make_unique(std::move(impl_)); } void FillLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } // Layout properties // Paint properties PropertyValue FillLayer::getDefaultFillAntialias() { return { true }; } const PropertyValue& FillLayer::getFillAntialias() const { return impl().paint.template get().value; } void FillLayer::setFillAntialias(const PropertyValue& value) { if (value == getFillAntialias()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void FillLayer::setFillAntialiasTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions FillLayer::getFillAntialiasTransition() const { return impl().paint.template get().options; } PropertyValue FillLayer::getDefaultFillColor() { return { Color::black() }; } const PropertyValue& FillLayer::getFillColor() const { return impl().paint.template get().value; } void FillLayer::setFillColor(const PropertyValue& value) { if (value == getFillColor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void FillLayer::setFillColorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions FillLayer::getFillColorTransition() const { return impl().paint.template get().options; } PropertyValue FillLayer::getDefaultFillOpacity() { return { 1 }; } const PropertyValue& FillLayer::getFillOpacity() const { return impl().paint.template get().value; } void FillLayer::setFillOpacity(const PropertyValue& value) { if (value == getFillOpacity()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void FillLayer::setFillOpacityTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions FillLayer::getFillOpacityTransition() const { return impl().paint.template get().options; } PropertyValue FillLayer::getDefaultFillOutlineColor() { return { {} }; } const PropertyValue& FillLayer::getFillOutlineColor() const { return impl().paint.template get().value; } void FillLayer::setFillOutlineColor(const PropertyValue& value) { if (value == getFillOutlineColor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void FillLayer::setFillOutlineColorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions FillLayer::getFillOutlineColorTransition() const { return impl().paint.template get().options; } PropertyValue FillLayer::getDefaultFillPattern() { return { "" }; } const PropertyValue& FillLayer::getFillPattern() const { return impl().paint.template get().value; } void FillLayer::setFillPattern(const PropertyValue& value) { if (value == getFillPattern()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void FillLayer::setFillPatternTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions FillLayer::getFillPatternTransition() const { return impl().paint.template get().options; } PropertyValue> FillLayer::getDefaultFillTranslate() { return { {{ 0, 0 }} }; } const PropertyValue>& FillLayer::getFillTranslate() const { return impl().paint.template get().value; } void FillLayer::setFillTranslate(const PropertyValue>& value) { if (value == getFillTranslate()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void FillLayer::setFillTranslateTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions FillLayer::getFillTranslateTransition() const { return impl().paint.template get().options; } PropertyValue FillLayer::getDefaultFillTranslateAnchor() { return { TranslateAnchorType::Map }; } const PropertyValue& FillLayer::getFillTranslateAnchor() const { return impl().paint.template get().value; } void FillLayer::setFillTranslateAnchor(const PropertyValue& value) { if (value == getFillTranslateAnchor()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void FillLayer::setFillTranslateAnchorTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions FillLayer::getFillTranslateAnchorTransition() const { return impl().paint.template get().options; } using namespace conversion; optional FillLayer::setPaintProperty(const std::string& name, const Convertible& value) { enum class Property : uint8_t { FillAntialias, FillColor, FillOpacity, FillOutlineColor, FillPattern, FillTranslate, FillTranslateAnchor, FillAntialiasTransition, FillColorTransition, FillOpacityTransition, FillOutlineColorTransition, FillPatternTransition, FillTranslateTransition, FillTranslateAnchorTransition, }; MAPBOX_ETERNAL_CONSTEXPR const auto properties = mapbox::eternal::hash_map({ { "fill-antialias", static_cast(Property::FillAntialias) }, { "fill-color", static_cast(Property::FillColor) }, { "fill-opacity", static_cast(Property::FillOpacity) }, { "fill-outline-color", static_cast(Property::FillOutlineColor) }, { "fill-pattern", static_cast(Property::FillPattern) }, { "fill-translate", static_cast(Property::FillTranslate) }, { "fill-translate-anchor", static_cast(Property::FillTranslateAnchor) }, { "fill-antialias-transition", static_cast(Property::FillAntialiasTransition) }, { "fill-color-transition", static_cast(Property::FillColorTransition) }, { "fill-opacity-transition", static_cast(Property::FillOpacityTransition) }, { "fill-outline-color-transition", static_cast(Property::FillOutlineColorTransition) }, { "fill-pattern-transition", static_cast(Property::FillPatternTransition) }, { "fill-translate-transition", static_cast(Property::FillTranslateTransition) }, { "fill-translate-anchor-transition", static_cast(Property::FillTranslateAnchorTransition) } }); const auto it = properties.find(name.c_str()); if (it == properties.end()) { return Error { "layer doesn't support this property" }; } auto property = static_cast(it->second); if (property == Property::FillAntialias) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setFillAntialias(*typedValue); return nullopt; } if (property == Property::FillColor || property == Property::FillOutlineColor) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } if (property == Property::FillColor) { setFillColor(*typedValue); return nullopt; } if (property == Property::FillOutlineColor) { setFillOutlineColor(*typedValue); return nullopt; } } if (property == Property::FillOpacity) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } setFillOpacity(*typedValue); return nullopt; } if (property == Property::FillPattern) { Error error; optional> typedValue = convert>(value, error, true, false); if (!typedValue) { return error; } setFillPattern(*typedValue); return nullopt; } if (property == Property::FillTranslate) { Error error; optional>> typedValue = convert>>(value, error, false, false); if (!typedValue) { return error; } setFillTranslate(*typedValue); return nullopt; } if (property == Property::FillTranslateAnchor) { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setFillTranslateAnchor(*typedValue); return nullopt; } Error error; optional transition = convert(value, error); if (!transition) { return error; } if (property == Property::FillAntialiasTransition) { setFillAntialiasTransition(*transition); return nullopt; } if (property == Property::FillColorTransition) { setFillColorTransition(*transition); return nullopt; } if (property == Property::FillOpacityTransition) { setFillOpacityTransition(*transition); return nullopt; } if (property == Property::FillOutlineColorTransition) { setFillOutlineColorTransition(*transition); return nullopt; } if (property == Property::FillPatternTransition) { setFillPatternTransition(*transition); return nullopt; } if (property == Property::FillTranslateTransition) { setFillTranslateTransition(*transition); return nullopt; } if (property == Property::FillTranslateAnchorTransition) { setFillTranslateAnchorTransition(*transition); return nullopt; } return Error { "layer doesn't support this property" }; } optional FillLayer::setLayoutProperty(const std::string& name, const Convertible& value) { if (name == "visibility") { return Layer::setVisibility(value); } return Error { "layer doesn't support this property" }; } Mutable FillLayer::mutableBaseImpl() const { return staticMutableCast(mutableImpl()); } } // namespace style } // namespace mbgl