1 // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
2
3 #include <mbgl/style/layers/line_layer.hpp>
4 #include <mbgl/style/layers/line_layer_impl.hpp>
5 #include <mbgl/style/layer_observer.hpp>
6
7 namespace mbgl {
8 namespace style {
9
LineLayer(const std::string & layerID,const std::string & sourceID)10 LineLayer::LineLayer(const std::string& layerID, const std::string& sourceID)
11 : Layer(makeMutable<Impl>(LayerType::Line, layerID, sourceID)) {
12 }
13
LineLayer(Immutable<Impl> impl_)14 LineLayer::LineLayer(Immutable<Impl> impl_)
15 : Layer(std::move(impl_)) {
16 }
17
18 LineLayer::~LineLayer() = default;
19
impl() const20 const LineLayer::Impl& LineLayer::impl() const {
21 return static_cast<const Impl&>(*baseImpl);
22 }
23
mutableImpl() const24 Mutable<LineLayer::Impl> LineLayer::mutableImpl() const {
25 return makeMutable<Impl>(impl());
26 }
27
cloneRef(const std::string & id_) const28 std::unique_ptr<Layer> LineLayer::cloneRef(const std::string& id_) const {
29 auto impl_ = mutableImpl();
30 impl_->id = id_;
31 impl_->paint = LinePaintProperties::Transitionable();
32 return std::make_unique<LineLayer>(std::move(impl_));
33 }
34
stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer> & writer) const35 void LineLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>& writer) const {
36 layout.stringify(writer);
37 }
38
39 // Source
40
getSourceID() const41 const std::string& LineLayer::getSourceID() const {
42 return impl().source;
43 }
44
setSourceLayer(const std::string & sourceLayer)45 void LineLayer::setSourceLayer(const std::string& sourceLayer) {
46 auto impl_ = mutableImpl();
47 impl_->sourceLayer = sourceLayer;
48 baseImpl = std::move(impl_);
49 }
50
getSourceLayer() const51 const std::string& LineLayer::getSourceLayer() const {
52 return impl().sourceLayer;
53 }
54
55 // Filter
56
setFilter(const Filter & filter)57 void LineLayer::setFilter(const Filter& filter) {
58 auto impl_ = mutableImpl();
59 impl_->filter = filter;
60 baseImpl = std::move(impl_);
61 observer->onLayerChanged(*this);
62 }
63
getFilter() const64 const Filter& LineLayer::getFilter() const {
65 return impl().filter;
66 }
67
68 // Visibility
69
setVisibility(VisibilityType value)70 void LineLayer::setVisibility(VisibilityType value) {
71 if (value == getVisibility())
72 return;
73 auto impl_ = mutableImpl();
74 impl_->visibility = value;
75 baseImpl = std::move(impl_);
76 observer->onLayerChanged(*this);
77 }
78
79 // Zoom range
80
setMinZoom(float minZoom)81 void LineLayer::setMinZoom(float minZoom) {
82 auto impl_ = mutableImpl();
83 impl_->minZoom = minZoom;
84 baseImpl = std::move(impl_);
85 observer->onLayerChanged(*this);
86 }
87
setMaxZoom(float maxZoom)88 void LineLayer::setMaxZoom(float maxZoom) {
89 auto impl_ = mutableImpl();
90 impl_->maxZoom = maxZoom;
91 baseImpl = std::move(impl_);
92 observer->onLayerChanged(*this);
93 }
94
95 // Layout properties
96
getDefaultLineCap()97 PropertyValue<LineCapType> LineLayer::getDefaultLineCap() {
98 return LineCap::defaultValue();
99 }
100
getLineCap() const101 PropertyValue<LineCapType> LineLayer::getLineCap() const {
102 return impl().layout.get<LineCap>();
103 }
104
setLineCap(PropertyValue<LineCapType> value)105 void LineLayer::setLineCap(PropertyValue<LineCapType> value) {
106 if (value == getLineCap())
107 return;
108 auto impl_ = mutableImpl();
109 impl_->layout.get<LineCap>() = value;
110 baseImpl = std::move(impl_);
111 observer->onLayerChanged(*this);
112 }
getDefaultLineJoin()113 DataDrivenPropertyValue<LineJoinType> LineLayer::getDefaultLineJoin() {
114 return LineJoin::defaultValue();
115 }
116
getLineJoin() const117 DataDrivenPropertyValue<LineJoinType> LineLayer::getLineJoin() const {
118 return impl().layout.get<LineJoin>();
119 }
120
setLineJoin(DataDrivenPropertyValue<LineJoinType> value)121 void LineLayer::setLineJoin(DataDrivenPropertyValue<LineJoinType> value) {
122 if (value == getLineJoin())
123 return;
124 auto impl_ = mutableImpl();
125 impl_->layout.get<LineJoin>() = value;
126 baseImpl = std::move(impl_);
127 observer->onLayerChanged(*this);
128 }
getDefaultLineMiterLimit()129 PropertyValue<float> LineLayer::getDefaultLineMiterLimit() {
130 return LineMiterLimit::defaultValue();
131 }
132
getLineMiterLimit() const133 PropertyValue<float> LineLayer::getLineMiterLimit() const {
134 return impl().layout.get<LineMiterLimit>();
135 }
136
setLineMiterLimit(PropertyValue<float> value)137 void LineLayer::setLineMiterLimit(PropertyValue<float> value) {
138 if (value == getLineMiterLimit())
139 return;
140 auto impl_ = mutableImpl();
141 impl_->layout.get<LineMiterLimit>() = value;
142 baseImpl = std::move(impl_);
143 observer->onLayerChanged(*this);
144 }
getDefaultLineRoundLimit()145 PropertyValue<float> LineLayer::getDefaultLineRoundLimit() {
146 return LineRoundLimit::defaultValue();
147 }
148
getLineRoundLimit() const149 PropertyValue<float> LineLayer::getLineRoundLimit() const {
150 return impl().layout.get<LineRoundLimit>();
151 }
152
setLineRoundLimit(PropertyValue<float> value)153 void LineLayer::setLineRoundLimit(PropertyValue<float> value) {
154 if (value == getLineRoundLimit())
155 return;
156 auto impl_ = mutableImpl();
157 impl_->layout.get<LineRoundLimit>() = value;
158 baseImpl = std::move(impl_);
159 observer->onLayerChanged(*this);
160 }
161
162 // Paint properties
163
getDefaultLineOpacity()164 DataDrivenPropertyValue<float> LineLayer::getDefaultLineOpacity() {
165 return { 1 };
166 }
167
getLineOpacity() const168 DataDrivenPropertyValue<float> LineLayer::getLineOpacity() const {
169 return impl().paint.template get<LineOpacity>().value;
170 }
171
setLineOpacity(DataDrivenPropertyValue<float> value)172 void LineLayer::setLineOpacity(DataDrivenPropertyValue<float> value) {
173 if (value == getLineOpacity())
174 return;
175 auto impl_ = mutableImpl();
176 impl_->paint.template get<LineOpacity>().value = value;
177 baseImpl = std::move(impl_);
178 observer->onLayerChanged(*this);
179 }
180
setLineOpacityTransition(const TransitionOptions & options)181 void LineLayer::setLineOpacityTransition(const TransitionOptions& options) {
182 auto impl_ = mutableImpl();
183 impl_->paint.template get<LineOpacity>().options = options;
184 baseImpl = std::move(impl_);
185 }
186
getLineOpacityTransition() const187 TransitionOptions LineLayer::getLineOpacityTransition() const {
188 return impl().paint.template get<LineOpacity>().options;
189 }
190
getDefaultLineColor()191 DataDrivenPropertyValue<Color> LineLayer::getDefaultLineColor() {
192 return { Color::black() };
193 }
194
getLineColor() const195 DataDrivenPropertyValue<Color> LineLayer::getLineColor() const {
196 return impl().paint.template get<LineColor>().value;
197 }
198
setLineColor(DataDrivenPropertyValue<Color> value)199 void LineLayer::setLineColor(DataDrivenPropertyValue<Color> value) {
200 if (value == getLineColor())
201 return;
202 auto impl_ = mutableImpl();
203 impl_->paint.template get<LineColor>().value = value;
204 baseImpl = std::move(impl_);
205 observer->onLayerChanged(*this);
206 }
207
setLineColorTransition(const TransitionOptions & options)208 void LineLayer::setLineColorTransition(const TransitionOptions& options) {
209 auto impl_ = mutableImpl();
210 impl_->paint.template get<LineColor>().options = options;
211 baseImpl = std::move(impl_);
212 }
213
getLineColorTransition() const214 TransitionOptions LineLayer::getLineColorTransition() const {
215 return impl().paint.template get<LineColor>().options;
216 }
217
getDefaultLineTranslate()218 PropertyValue<std::array<float, 2>> LineLayer::getDefaultLineTranslate() {
219 return { {{ 0, 0 }} };
220 }
221
getLineTranslate() const222 PropertyValue<std::array<float, 2>> LineLayer::getLineTranslate() const {
223 return impl().paint.template get<LineTranslate>().value;
224 }
225
setLineTranslate(PropertyValue<std::array<float,2>> value)226 void LineLayer::setLineTranslate(PropertyValue<std::array<float, 2>> value) {
227 if (value == getLineTranslate())
228 return;
229 auto impl_ = mutableImpl();
230 impl_->paint.template get<LineTranslate>().value = value;
231 baseImpl = std::move(impl_);
232 observer->onLayerChanged(*this);
233 }
234
setLineTranslateTransition(const TransitionOptions & options)235 void LineLayer::setLineTranslateTransition(const TransitionOptions& options) {
236 auto impl_ = mutableImpl();
237 impl_->paint.template get<LineTranslate>().options = options;
238 baseImpl = std::move(impl_);
239 }
240
getLineTranslateTransition() const241 TransitionOptions LineLayer::getLineTranslateTransition() const {
242 return impl().paint.template get<LineTranslate>().options;
243 }
244
getDefaultLineTranslateAnchor()245 PropertyValue<TranslateAnchorType> LineLayer::getDefaultLineTranslateAnchor() {
246 return { TranslateAnchorType::Map };
247 }
248
getLineTranslateAnchor() const249 PropertyValue<TranslateAnchorType> LineLayer::getLineTranslateAnchor() const {
250 return impl().paint.template get<LineTranslateAnchor>().value;
251 }
252
setLineTranslateAnchor(PropertyValue<TranslateAnchorType> value)253 void LineLayer::setLineTranslateAnchor(PropertyValue<TranslateAnchorType> value) {
254 if (value == getLineTranslateAnchor())
255 return;
256 auto impl_ = mutableImpl();
257 impl_->paint.template get<LineTranslateAnchor>().value = value;
258 baseImpl = std::move(impl_);
259 observer->onLayerChanged(*this);
260 }
261
setLineTranslateAnchorTransition(const TransitionOptions & options)262 void LineLayer::setLineTranslateAnchorTransition(const TransitionOptions& options) {
263 auto impl_ = mutableImpl();
264 impl_->paint.template get<LineTranslateAnchor>().options = options;
265 baseImpl = std::move(impl_);
266 }
267
getLineTranslateAnchorTransition() const268 TransitionOptions LineLayer::getLineTranslateAnchorTransition() const {
269 return impl().paint.template get<LineTranslateAnchor>().options;
270 }
271
getDefaultLineWidth()272 DataDrivenPropertyValue<float> LineLayer::getDefaultLineWidth() {
273 return { 1 };
274 }
275
getLineWidth() const276 DataDrivenPropertyValue<float> LineLayer::getLineWidth() const {
277 return impl().paint.template get<LineWidth>().value;
278 }
279
setLineWidth(DataDrivenPropertyValue<float> value)280 void LineLayer::setLineWidth(DataDrivenPropertyValue<float> value) {
281 if (value == getLineWidth())
282 return;
283 auto impl_ = mutableImpl();
284 impl_->paint.template get<LineWidth>().value = value;
285 baseImpl = std::move(impl_);
286 observer->onLayerChanged(*this);
287 }
288
setLineWidthTransition(const TransitionOptions & options)289 void LineLayer::setLineWidthTransition(const TransitionOptions& options) {
290 auto impl_ = mutableImpl();
291 impl_->paint.template get<LineWidth>().options = options;
292 baseImpl = std::move(impl_);
293 }
294
getLineWidthTransition() const295 TransitionOptions LineLayer::getLineWidthTransition() const {
296 return impl().paint.template get<LineWidth>().options;
297 }
298
getDefaultLineGapWidth()299 DataDrivenPropertyValue<float> LineLayer::getDefaultLineGapWidth() {
300 return { 0 };
301 }
302
getLineGapWidth() const303 DataDrivenPropertyValue<float> LineLayer::getLineGapWidth() const {
304 return impl().paint.template get<LineGapWidth>().value;
305 }
306
setLineGapWidth(DataDrivenPropertyValue<float> value)307 void LineLayer::setLineGapWidth(DataDrivenPropertyValue<float> value) {
308 if (value == getLineGapWidth())
309 return;
310 auto impl_ = mutableImpl();
311 impl_->paint.template get<LineGapWidth>().value = value;
312 baseImpl = std::move(impl_);
313 observer->onLayerChanged(*this);
314 }
315
setLineGapWidthTransition(const TransitionOptions & options)316 void LineLayer::setLineGapWidthTransition(const TransitionOptions& options) {
317 auto impl_ = mutableImpl();
318 impl_->paint.template get<LineGapWidth>().options = options;
319 baseImpl = std::move(impl_);
320 }
321
getLineGapWidthTransition() const322 TransitionOptions LineLayer::getLineGapWidthTransition() const {
323 return impl().paint.template get<LineGapWidth>().options;
324 }
325
getDefaultLineOffset()326 DataDrivenPropertyValue<float> LineLayer::getDefaultLineOffset() {
327 return { 0 };
328 }
329
getLineOffset() const330 DataDrivenPropertyValue<float> LineLayer::getLineOffset() const {
331 return impl().paint.template get<LineOffset>().value;
332 }
333
setLineOffset(DataDrivenPropertyValue<float> value)334 void LineLayer::setLineOffset(DataDrivenPropertyValue<float> value) {
335 if (value == getLineOffset())
336 return;
337 auto impl_ = mutableImpl();
338 impl_->paint.template get<LineOffset>().value = value;
339 baseImpl = std::move(impl_);
340 observer->onLayerChanged(*this);
341 }
342
setLineOffsetTransition(const TransitionOptions & options)343 void LineLayer::setLineOffsetTransition(const TransitionOptions& options) {
344 auto impl_ = mutableImpl();
345 impl_->paint.template get<LineOffset>().options = options;
346 baseImpl = std::move(impl_);
347 }
348
getLineOffsetTransition() const349 TransitionOptions LineLayer::getLineOffsetTransition() const {
350 return impl().paint.template get<LineOffset>().options;
351 }
352
getDefaultLineBlur()353 DataDrivenPropertyValue<float> LineLayer::getDefaultLineBlur() {
354 return { 0 };
355 }
356
getLineBlur() const357 DataDrivenPropertyValue<float> LineLayer::getLineBlur() const {
358 return impl().paint.template get<LineBlur>().value;
359 }
360
setLineBlur(DataDrivenPropertyValue<float> value)361 void LineLayer::setLineBlur(DataDrivenPropertyValue<float> value) {
362 if (value == getLineBlur())
363 return;
364 auto impl_ = mutableImpl();
365 impl_->paint.template get<LineBlur>().value = value;
366 baseImpl = std::move(impl_);
367 observer->onLayerChanged(*this);
368 }
369
setLineBlurTransition(const TransitionOptions & options)370 void LineLayer::setLineBlurTransition(const TransitionOptions& options) {
371 auto impl_ = mutableImpl();
372 impl_->paint.template get<LineBlur>().options = options;
373 baseImpl = std::move(impl_);
374 }
375
getLineBlurTransition() const376 TransitionOptions LineLayer::getLineBlurTransition() const {
377 return impl().paint.template get<LineBlur>().options;
378 }
379
getDefaultLineDasharray()380 PropertyValue<std::vector<float>> LineLayer::getDefaultLineDasharray() {
381 return { { } };
382 }
383
getLineDasharray() const384 PropertyValue<std::vector<float>> LineLayer::getLineDasharray() const {
385 return impl().paint.template get<LineDasharray>().value;
386 }
387
setLineDasharray(PropertyValue<std::vector<float>> value)388 void LineLayer::setLineDasharray(PropertyValue<std::vector<float>> value) {
389 if (value == getLineDasharray())
390 return;
391 auto impl_ = mutableImpl();
392 impl_->paint.template get<LineDasharray>().value = value;
393 baseImpl = std::move(impl_);
394 observer->onLayerChanged(*this);
395 }
396
setLineDasharrayTransition(const TransitionOptions & options)397 void LineLayer::setLineDasharrayTransition(const TransitionOptions& options) {
398 auto impl_ = mutableImpl();
399 impl_->paint.template get<LineDasharray>().options = options;
400 baseImpl = std::move(impl_);
401 }
402
getLineDasharrayTransition() const403 TransitionOptions LineLayer::getLineDasharrayTransition() const {
404 return impl().paint.template get<LineDasharray>().options;
405 }
406
getDefaultLinePattern()407 PropertyValue<std::string> LineLayer::getDefaultLinePattern() {
408 return { "" };
409 }
410
getLinePattern() const411 PropertyValue<std::string> LineLayer::getLinePattern() const {
412 return impl().paint.template get<LinePattern>().value;
413 }
414
setLinePattern(PropertyValue<std::string> value)415 void LineLayer::setLinePattern(PropertyValue<std::string> value) {
416 if (value == getLinePattern())
417 return;
418 auto impl_ = mutableImpl();
419 impl_->paint.template get<LinePattern>().value = value;
420 baseImpl = std::move(impl_);
421 observer->onLayerChanged(*this);
422 }
423
setLinePatternTransition(const TransitionOptions & options)424 void LineLayer::setLinePatternTransition(const TransitionOptions& options) {
425 auto impl_ = mutableImpl();
426 impl_->paint.template get<LinePattern>().options = options;
427 baseImpl = std::move(impl_);
428 }
429
getLinePatternTransition() const430 TransitionOptions LineLayer::getLinePatternTransition() const {
431 return impl().paint.template get<LinePattern>().options;
432 }
433
434 } // namespace style
435 } // namespace mbgl
436