1 // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. 2 3 #include <mbgl/style/layers/hillshade_layer.hpp> 4 #include <mbgl/style/layers/hillshade_layer_impl.hpp> 5 #include <mbgl/style/layer_observer.hpp> 6 7 namespace mbgl { 8 namespace style { 9 HillshadeLayer(const std::string & layerID,const std::string & sourceID)10HillshadeLayer::HillshadeLayer(const std::string& layerID, const std::string& sourceID) 11 : Layer(makeMutable<Impl>(LayerType::Hillshade, layerID, sourceID)) { 12 } 13 HillshadeLayer(Immutable<Impl> impl_)14HillshadeLayer::HillshadeLayer(Immutable<Impl> impl_) 15 : Layer(std::move(impl_)) { 16 } 17 18 HillshadeLayer::~HillshadeLayer() = default; 19 impl() const20const HillshadeLayer::Impl& HillshadeLayer::impl() const { 21 return static_cast<const Impl&>(*baseImpl); 22 } 23 mutableImpl() const24Mutable<HillshadeLayer::Impl> HillshadeLayer::mutableImpl() const { 25 return makeMutable<Impl>(impl()); 26 } 27 cloneRef(const std::string & id_) const28std::unique_ptr<Layer> HillshadeLayer::cloneRef(const std::string& id_) const { 29 auto impl_ = mutableImpl(); 30 impl_->id = id_; 31 impl_->paint = HillshadePaintProperties::Transitionable(); 32 return std::make_unique<HillshadeLayer>(std::move(impl_)); 33 } 34 stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer> &) const35void HillshadeLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const { 36 } 37 38 // Source 39 getSourceID() const40const std::string& HillshadeLayer::getSourceID() const { 41 return impl().source; 42 } 43 44 45 // Visibility 46 setVisibility(VisibilityType value)47void HillshadeLayer::setVisibility(VisibilityType value) { 48 if (value == getVisibility()) 49 return; 50 auto impl_ = mutableImpl(); 51 impl_->visibility = value; 52 baseImpl = std::move(impl_); 53 observer->onLayerChanged(*this); 54 } 55 56 // Zoom range 57 setMinZoom(float minZoom)58void HillshadeLayer::setMinZoom(float minZoom) { 59 auto impl_ = mutableImpl(); 60 impl_->minZoom = minZoom; 61 baseImpl = std::move(impl_); 62 observer->onLayerChanged(*this); 63 } 64 setMaxZoom(float maxZoom)65void HillshadeLayer::setMaxZoom(float maxZoom) { 66 auto impl_ = mutableImpl(); 67 impl_->maxZoom = maxZoom; 68 baseImpl = std::move(impl_); 69 observer->onLayerChanged(*this); 70 } 71 72 // Layout properties 73 74 75 // Paint properties 76 getDefaultHillshadeIlluminationDirection()77PropertyValue<float> HillshadeLayer::getDefaultHillshadeIlluminationDirection() { 78 return { 335 }; 79 } 80 getHillshadeIlluminationDirection() const81PropertyValue<float> HillshadeLayer::getHillshadeIlluminationDirection() const { 82 return impl().paint.template get<HillshadeIlluminationDirection>().value; 83 } 84 setHillshadeIlluminationDirection(PropertyValue<float> value)85void HillshadeLayer::setHillshadeIlluminationDirection(PropertyValue<float> value) { 86 if (value == getHillshadeIlluminationDirection()) 87 return; 88 auto impl_ = mutableImpl(); 89 impl_->paint.template get<HillshadeIlluminationDirection>().value = value; 90 baseImpl = std::move(impl_); 91 observer->onLayerChanged(*this); 92 } 93 setHillshadeIlluminationDirectionTransition(const TransitionOptions & options)94void HillshadeLayer::setHillshadeIlluminationDirectionTransition(const TransitionOptions& options) { 95 auto impl_ = mutableImpl(); 96 impl_->paint.template get<HillshadeIlluminationDirection>().options = options; 97 baseImpl = std::move(impl_); 98 } 99 getHillshadeIlluminationDirectionTransition() const100TransitionOptions HillshadeLayer::getHillshadeIlluminationDirectionTransition() const { 101 return impl().paint.template get<HillshadeIlluminationDirection>().options; 102 } 103 getDefaultHillshadeIlluminationAnchor()104PropertyValue<HillshadeIlluminationAnchorType> HillshadeLayer::getDefaultHillshadeIlluminationAnchor() { 105 return { HillshadeIlluminationAnchorType::Viewport }; 106 } 107 getHillshadeIlluminationAnchor() const108PropertyValue<HillshadeIlluminationAnchorType> HillshadeLayer::getHillshadeIlluminationAnchor() const { 109 return impl().paint.template get<HillshadeIlluminationAnchor>().value; 110 } 111 setHillshadeIlluminationAnchor(PropertyValue<HillshadeIlluminationAnchorType> value)112void HillshadeLayer::setHillshadeIlluminationAnchor(PropertyValue<HillshadeIlluminationAnchorType> value) { 113 if (value == getHillshadeIlluminationAnchor()) 114 return; 115 auto impl_ = mutableImpl(); 116 impl_->paint.template get<HillshadeIlluminationAnchor>().value = value; 117 baseImpl = std::move(impl_); 118 observer->onLayerChanged(*this); 119 } 120 setHillshadeIlluminationAnchorTransition(const TransitionOptions & options)121void HillshadeLayer::setHillshadeIlluminationAnchorTransition(const TransitionOptions& options) { 122 auto impl_ = mutableImpl(); 123 impl_->paint.template get<HillshadeIlluminationAnchor>().options = options; 124 baseImpl = std::move(impl_); 125 } 126 getHillshadeIlluminationAnchorTransition() const127TransitionOptions HillshadeLayer::getHillshadeIlluminationAnchorTransition() const { 128 return impl().paint.template get<HillshadeIlluminationAnchor>().options; 129 } 130 getDefaultHillshadeExaggeration()131PropertyValue<float> HillshadeLayer::getDefaultHillshadeExaggeration() { 132 return { 0.5 }; 133 } 134 getHillshadeExaggeration() const135PropertyValue<float> HillshadeLayer::getHillshadeExaggeration() const { 136 return impl().paint.template get<HillshadeExaggeration>().value; 137 } 138 setHillshadeExaggeration(PropertyValue<float> value)139void HillshadeLayer::setHillshadeExaggeration(PropertyValue<float> value) { 140 if (value == getHillshadeExaggeration()) 141 return; 142 auto impl_ = mutableImpl(); 143 impl_->paint.template get<HillshadeExaggeration>().value = value; 144 baseImpl = std::move(impl_); 145 observer->onLayerChanged(*this); 146 } 147 setHillshadeExaggerationTransition(const TransitionOptions & options)148void HillshadeLayer::setHillshadeExaggerationTransition(const TransitionOptions& options) { 149 auto impl_ = mutableImpl(); 150 impl_->paint.template get<HillshadeExaggeration>().options = options; 151 baseImpl = std::move(impl_); 152 } 153 getHillshadeExaggerationTransition() const154TransitionOptions HillshadeLayer::getHillshadeExaggerationTransition() const { 155 return impl().paint.template get<HillshadeExaggeration>().options; 156 } 157 getDefaultHillshadeShadowColor()158PropertyValue<Color> HillshadeLayer::getDefaultHillshadeShadowColor() { 159 return { Color::black() }; 160 } 161 getHillshadeShadowColor() const162PropertyValue<Color> HillshadeLayer::getHillshadeShadowColor() const { 163 return impl().paint.template get<HillshadeShadowColor>().value; 164 } 165 setHillshadeShadowColor(PropertyValue<Color> value)166void HillshadeLayer::setHillshadeShadowColor(PropertyValue<Color> value) { 167 if (value == getHillshadeShadowColor()) 168 return; 169 auto impl_ = mutableImpl(); 170 impl_->paint.template get<HillshadeShadowColor>().value = value; 171 baseImpl = std::move(impl_); 172 observer->onLayerChanged(*this); 173 } 174 setHillshadeShadowColorTransition(const TransitionOptions & options)175void HillshadeLayer::setHillshadeShadowColorTransition(const TransitionOptions& options) { 176 auto impl_ = mutableImpl(); 177 impl_->paint.template get<HillshadeShadowColor>().options = options; 178 baseImpl = std::move(impl_); 179 } 180 getHillshadeShadowColorTransition() const181TransitionOptions HillshadeLayer::getHillshadeShadowColorTransition() const { 182 return impl().paint.template get<HillshadeShadowColor>().options; 183 } 184 getDefaultHillshadeHighlightColor()185PropertyValue<Color> HillshadeLayer::getDefaultHillshadeHighlightColor() { 186 return { Color::white() }; 187 } 188 getHillshadeHighlightColor() const189PropertyValue<Color> HillshadeLayer::getHillshadeHighlightColor() const { 190 return impl().paint.template get<HillshadeHighlightColor>().value; 191 } 192 setHillshadeHighlightColor(PropertyValue<Color> value)193void HillshadeLayer::setHillshadeHighlightColor(PropertyValue<Color> value) { 194 if (value == getHillshadeHighlightColor()) 195 return; 196 auto impl_ = mutableImpl(); 197 impl_->paint.template get<HillshadeHighlightColor>().value = value; 198 baseImpl = std::move(impl_); 199 observer->onLayerChanged(*this); 200 } 201 setHillshadeHighlightColorTransition(const TransitionOptions & options)202void HillshadeLayer::setHillshadeHighlightColorTransition(const TransitionOptions& options) { 203 auto impl_ = mutableImpl(); 204 impl_->paint.template get<HillshadeHighlightColor>().options = options; 205 baseImpl = std::move(impl_); 206 } 207 getHillshadeHighlightColorTransition() const208TransitionOptions HillshadeLayer::getHillshadeHighlightColorTransition() const { 209 return impl().paint.template get<HillshadeHighlightColor>().options; 210 } 211 getDefaultHillshadeAccentColor()212PropertyValue<Color> HillshadeLayer::getDefaultHillshadeAccentColor() { 213 return { Color::black() }; 214 } 215 getHillshadeAccentColor() const216PropertyValue<Color> HillshadeLayer::getHillshadeAccentColor() const { 217 return impl().paint.template get<HillshadeAccentColor>().value; 218 } 219 setHillshadeAccentColor(PropertyValue<Color> value)220void HillshadeLayer::setHillshadeAccentColor(PropertyValue<Color> value) { 221 if (value == getHillshadeAccentColor()) 222 return; 223 auto impl_ = mutableImpl(); 224 impl_->paint.template get<HillshadeAccentColor>().value = value; 225 baseImpl = std::move(impl_); 226 observer->onLayerChanged(*this); 227 } 228 setHillshadeAccentColorTransition(const TransitionOptions & options)229void HillshadeLayer::setHillshadeAccentColorTransition(const TransitionOptions& options) { 230 auto impl_ = mutableImpl(); 231 impl_->paint.template get<HillshadeAccentColor>().options = options; 232 baseImpl = std::move(impl_); 233 } 234 getHillshadeAccentColorTransition() const235TransitionOptions HillshadeLayer::getHillshadeAccentColorTransition() const { 236 return impl().paint.template get<HillshadeAccentColor>().options; 237 } 238 239 } // namespace style 240 } // namespace mbgl 241