libosmscout 1.1.1
Loading...
Searching...
No Matches
MapParameter.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_MAP_MAPPARAMETER_H
2#define OSMSCOUT_MAP_MAPPARAMETER_H
3
4/*
5 This source is part of the libosmscout-map library
6 Copyright (C) 2009, 2015 Tim Teulings
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/
22
23#include <list>
24#include <locale>
25#include <string>
26
28
30
33
34namespace osmscout {
35
41 class OSMSCOUT_MAP_API MapParameter CLASS_FINAL
42 {
43 public:
44 enum class IconMode
45 {
46 FixedSizePixmap, // !< raster icons should be used, iconPixelSize will be used for rendering
47 ScaledPixmap, // !< raster icons should be used, icons will be scaled to iconSize
48 OriginalPixmap, // !< raster icons should be used, icons will keep dimensions of original image
49 Scalable // !< vector icons should be used, icons will be scaled to iconSize
50 };
51
52 enum class PatternMode
53 {
54 OriginalPixmap, // !< raster pattern should be used, it will keep dimensions of original image
55 Scalable // !< vector pattern should be used, it will be scaled to patternSize
56 };
57
58 private:
59 std::string fontName;
60 double fontSize;
61
62 std::list<std::string> iconPaths;
63 std::list<std::string> patternPaths;
64
65 double lineMinWidthPixel;
66 double areaMinDimensionMM;
67
68 double sidecarMaxDistanceMM;
69 double sidecarDistance;
70 double sidecarMinDistanceMM;
71
72 TransPolygon::OptimizeMethod optimizeWayNodes;
73 TransPolygon::OptimizeMethod optimizeAreaNodes;
74 double optimizeErrorToleranceMm;
75 bool drawFadings;
76 bool drawWaysWithFixedWidth;
77
78 // Node and area labels, icons
79 size_t labelLineMinCharCount;
80 size_t labelLineMaxCharCount;
81 bool labelLineFitToArea;
82 double labelLineFitToWidth;
83
84 double labelPadding;
85 double plateLabelPadding;
86 double overlayLabelPadding;
87
88 IconMode iconMode;
89 double iconSize;
90 double iconPixelSize;
91 double iconPadding;
92
93 PatternMode patternMode;
94 double patternSize;
95
96 double labelLayouterOverlap;
97
98 private:
99// Contour labels
100 double contourLabelOffset;
101 double contourLabelSpace;
102 double contourLabelPadding;
103
104 std::string routeLabelSeparator;
105
106 bool renderBackground;
107 bool renderSeaLand;
108 bool renderUnknowns;
109 bool renderContourLines;
110 bool renderHillShading;
111
112 bool debugData;
113 bool debugPerformance;
114
115 size_t warnObjectCountLimit;
116 size_t warnCoordCountLimit;
117
118 bool showAltLanguage;
119
120 Locale locale;
121
122 std::vector<FillStyleProcessorRef > fillProcessors;
123
124 BreakerRef breaker;
125
126 public:
128
129 void SetFontName(const std::string& fontName);
130 void SetFontSize(double fontSize);
131
132 void SetIconPaths(const std::list<std::string>& paths);
133 void SetPatternPaths(const std::list<std::string>& paths);
134
135 void SetLineMinWidthPixel(double lineMinWidthPixel);
136 void SetAreaMinDimensionMM(double areaMinDimensionMM);
137
141
142 void SetOptimizeWayNodes(TransPolygon::OptimizeMethod optimize);
143 void SetOptimizeAreaNodes(TransPolygon::OptimizeMethod optimize);
144 void SetOptimizeErrorToleranceMm(double errorToleranceMm);
145
146 void SetDrawFadings(bool drawFadings);
147 void SetDrawWaysWithFixedWidth(bool drawWaysWithFixedWidth);
148
149 void SetLabelLineMinCharCount(size_t labelLineMinCharCount);
150 void SetLabelLineMaxCharCount(size_t labelLineMaxCharCount);
151 void SetLabelLineFitToArea(bool labelLineFitToArea);
152 void SetLabelLineFitToWidth(double labelLineFitToWidth);
153
154 void SetLabelPadding(double labelPadding);
155 void SetPlateLabelPadding(double plateLabelPadding);
156 void SetOverlayLabelPadding(double padding);
157
158 void SetIconMode(const IconMode &mode);
159 void SetIconSize(double size);
160 void SetIconPixelSize(double size);
161 void SetIconPadding(double padding);
162
163 void SetPatternMode(const PatternMode &mode);
164 void SetPatternSize(double size);
165
166 void SetContourLabelPadding(double padding);
167
168 void SetRouteLabelSeparator(const std::string &separator);
169
170 void SetLabelLayouterOverlap(double labelLayouterOverlap);
171
172 void SetContourLabelOffset(double contourLabelOffset);
173 void SetContourLabelSpace(double contourLabelSpace);
174
175 void SetRenderBackground(bool render);
176 void SetRenderSeaLand(bool render);
177 void SetRenderUnknowns(bool render);
178 void SetRenderContourLines(bool render);
179 void SetRenderHillShading(bool render);
180
181 void SetDebugData(bool debug);
182 void SetDebugPerformance(bool debug);
183
184 void SetWarningObjectCountLimit(size_t limit);
185 void SetWarningCoordCountLimit(size_t limit);
186
187 void SetShowAltLanguage(bool showAltLanguage);
188
189 void SetLocale(const Locale &locale);
190
191 void RegisterFillStyleProcessor(size_t typeIndex,
192 const FillStyleProcessorRef& processor);
193
195
196 void SetBreaker(const BreakerRef& breaker);
197
198
199 std::string GetFontName() const
200 {
201 return fontName;
202 }
203
204 double GetFontSize() const
205 {
206 return fontSize;
207 }
208
209 const std::list<std::string>& GetIconPaths() const
210 {
211 return iconPaths;
212 }
213
214 const std::list<std::string>& GetPatternPaths() const
215 {
216 return patternPaths;
217 }
218
219 double GetLineMinWidthPixel() const
220 {
221 return lineMinWidthPixel;
222 }
223
225 {
226 return areaMinDimensionMM;
227 }
228
230 {
231 return sidecarMaxDistanceMM;
232 }
233
234 double GetSidecarDistance() const
235 {
236 return sidecarDistance;
237 }
238
240 {
241 return sidecarMinDistanceMM;
242 }
243
244 TransPolygon::OptimizeMethod GetOptimizeWayNodes() const
245 {
246 return optimizeWayNodes;
247 }
248
249 TransPolygon::OptimizeMethod GetOptimizeAreaNodes() const
250 {
251 return optimizeAreaNodes;
252 }
253
255 {
256 return optimizeErrorToleranceMm;
257 }
258
259 bool GetDrawFadings() const
260 {
261 return drawFadings;
262 }
263
265 {
266 return drawWaysWithFixedWidth;
267 }
268
270 {
271 return labelLineMinCharCount;
272 }
273
275 {
276 return labelLineMaxCharCount;
277 }
278
280 {
281 return labelLineFitToArea;
282 }
283
285 {
286 return labelLineFitToWidth;
287 }
288
289 double GetLabelPadding() const
290 {
291 return labelPadding;
292 }
293
294 double GetPlateLabelPadding() const
295 {
296 return plateLabelPadding;
297 }
298
300 {
301 return overlayLabelPadding;
302 }
303
305 {
306 return iconMode;
307 }
308
309 double GetIconSize() const
310 {
311 return iconSize;
312 }
313
314 double GetIconPixelSize() const
315 {
316 return iconPixelSize;
317 }
318
319 double GetIconPadding() const
320 {
321 return iconPadding;
322 }
323
325 {
326 return patternMode;
327 }
328
329 double GetPatternSize() const
330 {
331 return patternSize;
332 }
333
335 {
336 return contourLabelPadding;
337 }
338
339 std::string GetRouteLabelSeparator() const
340 {
341 return routeLabelSeparator;
342 }
343
345 {
346 return labelLayouterOverlap;
347 }
348
350 {
351 return contourLabelOffset;
352 }
353
354 double GetContourLabelSpace() const
355 {
356 return contourLabelSpace;
357 }
358
360 {
361 return renderBackground;
362 }
363
364 bool GetRenderSeaLand() const
365 {
366 return renderSeaLand;
367 }
368
369 bool GetRenderUnknowns() const
370 {
371 return renderUnknowns;
372 }
373
375 {
376 return renderContourLines;
377 }
378
380 {
381 return renderHillShading;
382 }
383
385 {
386 return debugPerformance;
387 }
388
389 bool IsDebugData() const
390 {
391 return debugData;
392 }
393
395 {
396 return warnObjectCountLimit;
397 }
398
400 {
401 return warnCoordCountLimit;
402 }
403
405 {
406 return showAltLanguage;
407 }
408
410 {
411 return locale;
412 }
413
415 {
416 return locale;
417 }
418
419 bool IsAborted() const
420 {
421 if (breaker) {
422 return breaker->IsAborted();
423 }
424
425 return false;
426 }
427 };
428}
429
430#endif
#define OSMSCOUT_MAP_API
Definition MapImportExport.h:45
Definition Area.h:88
void SetContourLabelSpace(double contourLabelSpace)
void SetOptimizeWayNodes(TransPolygon::OptimizeMethod optimize)
IconMode
Definition MapParameter.h:45
bool IsDebugPerformance() const
Definition MapParameter.h:384
double GetLabelLineFitToWidth() const
Definition MapParameter.h:284
void SetPlateLabelPadding(double plateLabelPadding)
void SetFontName(const std::string &fontName)
void SetRenderSeaLand(bool render)
void SetOptimizeErrorToleranceMm(double errorToleranceMm)
double GetAreaMinDimensionMM() const
Definition MapParameter.h:224
TransPolygon::OptimizeMethod GetOptimizeAreaNodes() const
Definition MapParameter.h:249
double GetSidecarMinDistanceMM() const
Definition MapParameter.h:239
void SetOptimizeAreaNodes(TransPolygon::OptimizeMethod optimize)
double GetContourLabelSpace() const
Definition MapParameter.h:354
PatternMode
Definition MapParameter.h:53
void SetLabelPadding(double labelPadding)
void SetRenderContourLines(bool render)
size_t GetLabelLineMinCharCount() const
Definition MapParameter.h:269
void SetPatternMode(const PatternMode &mode)
double GetPlateLabelPadding() const
Definition MapParameter.h:294
bool GetRenderContourLines() const
Definition MapParameter.h:374
void SetAreaMinDimensionMM(double areaMinDimensionMM)
bool GetShowAltLanguage() const
Definition MapParameter.h:404
double GetSidecarMaxDistanceMM() const
Definition MapParameter.h:229
void SetRenderHillShading(bool render)
double GetPatternSize() const
Definition MapParameter.h:329
bool GetRenderHillShading() const
Definition MapParameter.h:379
double GetIconPixelSize() const
Definition MapParameter.h:314
double GetFontSize() const
Definition MapParameter.h:204
void SetLineMinWidthPixel(double lineMinWidthPixel)
bool IsAborted() const
Definition MapParameter.h:419
void SetIconSize(double size)
TransPolygon::OptimizeMethod GetOptimizeWayNodes() const
Definition MapParameter.h:244
void SetWarningObjectCountLimit(size_t limit)
void SetLabelLineFitToArea(bool labelLineFitToArea)
size_t GetWarningCoordCountLimit() const
Definition MapParameter.h:399
size_t GetWarningObjectCountLimit() const
Definition MapParameter.h:394
Locale & GetLocaleRef()
Definition MapParameter.h:414
double GetLabelPadding() const
Definition MapParameter.h:289
Locale GetLocale() const
Definition MapParameter.h:409
void SetIconPadding(double padding)
void SetLabelLineMinCharCount(size_t labelLineMinCharCount)
void SetFontSize(double fontSize)
void SetLabelLineFitToWidth(double labelLineFitToWidth)
size_t GetLabelLineMaxCharCount() const
Definition MapParameter.h:274
bool GetRenderUnknowns() const
Definition MapParameter.h:369
void SetLabelLayouterOverlap(double labelLayouterOverlap)
bool GetRenderBackground() const
Definition MapParameter.h:359
double GetSidecarDistance() const
Definition MapParameter.h:234
double GetOverlayLabelPadding() const
Definition MapParameter.h:299
PatternMode GetPatternMode() const
Definition MapParameter.h:324
void SetWarningCoordCountLimit(size_t limit)
void SetLabelLineMaxCharCount(size_t labelLineMaxCharCount)
void SetIconPixelSize(double size)
void SetDebugData(bool debug)
std::string GetRouteLabelSeparator() const
Definition MapParameter.h:339
IconMode GetIconMode() const
Definition MapParameter.h:304
FillStyleProcessorRef GetFillStyleProcessor(size_t typeIndex) const
double GetIconPadding() const
Definition MapParameter.h:319
void SetBreaker(const BreakerRef &breaker)
double GetOptimizeErrorToleranceMm() const
Definition MapParameter.h:254
void SetDebugPerformance(bool debug)
bool IsDebugData() const
Definition MapParameter.h:389
const std::list< std::string > & GetIconPaths() const
Definition MapParameter.h:209
double GetLabelLayouterOverlap() const
Definition MapParameter.h:344
void SetShowAltLanguage(bool showAltLanguage)
double GetIconSize() const
Definition MapParameter.h:309
const std::list< std::string > & GetPatternPaths() const
Definition MapParameter.h:214
void SetContourLabelOffset(double contourLabelOffset)
void SetDrawFadings(bool drawFadings)
void SetPatternPaths(const std::list< std::string > &paths)
double GetContourLabelOffset() const
Definition MapParameter.h:349
void SetRenderUnknowns(bool render)
void RegisterFillStyleProcessor(size_t typeIndex, const FillStyleProcessorRef &processor)
void SetPatternSize(double size)
double GetLineMinWidthPixel() const
Definition MapParameter.h:219
void SetContourLabelPadding(double padding)
void SetDrawWaysWithFixedWidth(bool drawWaysWithFixedWidth)
void SetIconPaths(const std::list< std::string > &paths)
bool GetDrawWaysWithFixedWidth() const
Definition MapParameter.h:264
bool GetDrawFadings() const
Definition MapParameter.h:259
double GetContourLabelPadding() const
Definition MapParameter.h:334
bool GetLabelLineFitToArea() const
Definition MapParameter.h:279
void SetRouteLabelSeparator(const std::string &separator)
void SetOverlayLabelPadding(double padding)
void SetLocale(const Locale &locale)
bool GetRenderSeaLand() const
Definition MapParameter.h:364
void SetRenderBackground(bool render)
void SetIconMode(const IconMode &mode)
std::string GetFontName() const
Definition MapParameter.h:199
Definition Area.h:39
std::shared_ptr< Breaker > BreakerRef
Definition Breaker.h:64
std::shared_ptr< FillStyleProcessor > FillStyleProcessorRef
Definition StyleProcessor.h:39