1#ifndef OSMSCOUT_MAP_MAPPAINTER_H
2#define OSMSCOUT_MAP_MAPPAINTER_H
105 using StepMethod = void (
MapPainter::*)(
const Projection &,
const MapParameter &,
const MapData &);
196 std::map<PathTextStyleRef,std::set<std::string>>
labels;
229 std::vector<StepMethod> stepMethods;
230 double errorTolerancePixel;
232 std::list<AreaData> areaData;
233 std::list<WayData> wayData;
234 std::list<WayPathData> wayPathData;
235 std::list<RouteLabelData> routeLabelData;
237 std::vector<TextStyleRef> textStyles;
238 std::vector<LineStyleRef> lineStyles;
239 std::vector<PathSymbolStyleRef> symbolStyles;
245 double standardFontSize;
246 double areaMinDimension;
287 const MapParameter& parameter,
292 const MapParameter& parameter,
293 const MapData& data);
295 void TransformPathData(
const Projection& projection,
296 const MapParameter& parameter,
300 double CalculateLineWith(
const Projection& projection,
301 const FeatureValueBuffer& buffer,
302 const LineStyle& lineStyle)
const;
304 double CalculateLineOffset(
const Projection& projection,
305 const LineStyle& lineStyle,
306 double lineWidth)
const;
308 Color CalculateLineColor(
const FeatureValueBuffer& buffer,
309 const LineStyle& lineStyle)
const;
311 int8_t CalculateLineLayer(
const FeatureValueBuffer& buffer)
const;
315 const MapParameter& parameter,
320 const MapParameter& parameter,
321 const std::vector<CoordBufferRange>& coordRanges,
323 const Area::Ring& ring,
329 const MapParameter& parameter,
334 const MapParameter& parameter,
337 void RegisterPointWayLabel(
const Projection& projection,
338 const MapParameter& parameter,
340 const std::string_view& text,
341 const std::vector<Point>& nodes);
343 void LayoutPointLabels(
const Projection& projection,
344 const MapParameter& parameter,
345 const ObjectFileRef& ref,
346 const FeatureValueBuffer& buffer,
348 const std::vector<TextStyleRef>& textStyles,
349 const Vertex2D& screenPos,
350 const ScreenBox& objectBox);
354 const MapParameter& parameter,
359 const MapParameter& parameter,
364 const MapParameter& parameter,
367 bool DrawWayContourLabel(
const Projection& projection,
368 const MapParameter& parameter,
371 const std::string_view &textLabel);
375 const MapParameter& parameter,
380 const MapParameter& parameter,
383 void DrawOSMTileGrid(
const Projection& projection,
384 const MapParameter& parameter,
385 const Magnification& magnification,
388 void DrawGroundTiles(
const Projection& projection,
389 const MapParameter& parameter,
390 const std::list<GroundTile> &groundTiles);
398 void InitializeRender(
const Projection& projection,
399 const MapParameter& parameter,
400 const MapData& data);
402 void DumpStatistics(
const Projection& projection,
403 const MapParameter& parameter,
404 const MapData& data);
406 void CalculatePaths(
const Projection& projection,
407 const MapParameter& parameter,
408 const MapData& data);
410 void CalculateWayShields(
const Projection& projection,
411 const MapParameter& parameter,
412 const MapData& data);
414 void ProcessAreas(
const Projection& projection,
415 const MapParameter& parameter,
416 const MapData& data);
418 void ProcessRoutes(
const Projection& projection,
419 const MapParameter& parameter,
420 const MapData& data);
422 void AfterPreprocessing(
const Projection& projection,
423 const MapParameter& parameter,
424 const MapData& data);
427 const MapParameter& parameter,
428 const MapData& data);
430 void DrawBaseMapTiles(
const Projection& projection,
431 const MapParameter& parameter,
432 const MapData& data);
434 void DrawGroundTiles(
const Projection& projection,
435 const MapParameter& parameter,
436 const MapData& data);
438 void DrawOSMTileGrids(
const Projection& projection,
439 const MapParameter& parameter,
440 const MapData& data);
443 const MapParameter& parameter,
444 const MapData& data);
447 const MapParameter& parameter,
448 const MapData& data);
450 void DrawWayDecorations(
const Projection& projection,
451 const MapParameter& parameter,
452 const MapData& data);
454 void DrawWayContourLabels(
const Projection& projection,
455 const MapParameter& parameter,
456 const MapData& data);
458 void PrepareAreaLabels(
const Projection& projection,
459 const MapParameter& parameter,
460 const MapData& data);
462 void DrawAreaBorderLabels(
const Projection& projection,
463 const MapParameter& parameter,
464 const MapData& data);
466 void DrawAreaBorderSymbols(
const Projection& projection,
467 const MapParameter& parameter,
468 const MapData& data);
470 void PrepareNodeLabels(
const Projection& projection,
471 const MapParameter& parameter,
472 const MapData& data);
474 void PrepareRouteLabels(
const Projection& projection,
475 const MapParameter& parameter,
476 const MapData& data);
479 const MapParameter& parameter,
480 const MapData& data);
489 const GeoBox& boundingBox,
490 double pixelOffset)
const;
493 const GeoBox& boundingBox,
494 double pixelOffset)
const;
529 const MapParameter& parameter,
530 const MapData& data);
533 const MapParameter& parameter,
534 const MapData& data);
537 const MapParameter& parameter,
538 const MapData& data);
550 const MapParameter& parameter,
551 IconStyle& style)= 0;
557 const MapParameter& parameter,
558 double fontSize) = 0;
566 const MapParameter& parameter,
567 const FillStyle& style) = 0;
574 const MapParameter ¶meter,
575 const ObjectFileRef& ref,
576 const std::vector<LabelData> &labels,
577 const Vertex2D &position,
578 double objectWidth) = 0;
584 const MapParameter ¶meter,
585 const ObjectFileRef& ref,
590 const MapParameter& parameter,
591 const MapData& data) = 0;
594 const MapParameter& parameter,
595 const MapData& data);
598 const MapParameter& parameter,
599 const MapData& data);
605 const Vertex2D& centerPos,
606 double width,
double height) = 0;
612 const MapParameter& parameter,
613 const Symbol& symbol,
614 const Vertex2D& screenPos,
615 double scaleFactor=1.0) = 0;
622 const MapParameter& parameter,
625 const std::vector<double>& dash,
626 LineStyle::CapStyle startCap,
627 LineStyle::CapStyle endCap,
628 const CoordBufferRange& coordRange) = 0;
634 const MapParameter& parameter,
635 const Symbol& symbol,
643 const MapParameter& parameter,
652 double averageCharWidth,
654 size_t stringLength);
658 const MapParameter& parameter,
670 const MapParameter& parameter,
676 const MapParameter& parameter,
677 const MapData& data);
#define OSMSCOUT_MAP_API
Definition MapImportExport.h:45
Definition LabelPath.h:44
Definition LanesFeature.h:33
Definition MapPainter.h:112
CoordBufferRange coordRange
Range of coordinates in transformation buffer.
Definition MapPainter.h:119
bool startIsClosed
Definition MapPainter.h:121
bool operator<(const WayData &other) const
Definition MapPainter.h:139
double lineWidth
Line width.
Definition MapPainter.h:120
LineStyleRef lineStyle
Line style.
Definition MapPainter.h:116
size_t wayPriority
Priority of way (from style sheet).
Definition MapPainter.h:118
const FeatureValueBuffer * buffer
Features of the line segment.
Definition MapPainter.h:114
Color color
Line color.
Definition MapPainter.h:117
bool endIsClosed
Definition MapPainter.h:123
int8_t layer
Layer this way is in.
Definition MapPainter.h:115
double shieldGridSizeHoriz
Width of a cell for shield label placement.
Definition MapPainter.h:276
FillStyleRef landFill
Definition MapPainter.h:223
virtual void DrawPath(const Projection &projection, const MapParameter ¶meter, const Color &color, double width, const std::vector< double > &dash, LineStyle::CapStyle startCap, LineStyle::CapStyle endCap, const CoordBufferRange &coordRange)=0
const std::list< WayData > & GetWayData() const
Definition MapPainter.h:507
WidthFeatureValueReader widthReader
Value reader for the 'width' feature.
Definition MapPainter.h:260
virtual void DrawGround(const Projection &projection, const MapParameter ¶meter, const FillStyle &style)=0
virtual void DrawIcon(const IconStyle *style, const Vertex2D ¢erPos, double width, double height)=0
LayerFeatureValueReader layerReader
Value reader for the 'layer' feature.
Definition MapPainter.h:259
AddressFeatureValueReader addressReader
Value reader for the 'address' feature.
Definition MapPainter.h:261
virtual double GetFontHeight(const Projection &projection, const MapParameter ¶meter, double fontSize)=0
virtual void DrawLabels(const Projection &projection, const MapParameter ¶meter, const MapData &data)=0
MapPainter(const StyleConfigRef &styleConfig)
virtual void DrawArea(const Projection &projection, const MapParameter ¶meter, const AreaData &area)=0
ColorFeatureValueReader colorReader
Value reader for the 'color' feature.
Definition MapPainter.h:264
std::vector< double > tunnelDash
Dash array for drawing tunnel border.
Definition MapPainter.h:272
NameFeatureValueReader nameReader
Value reader for the 'name' feature.
Definition MapPainter.h:256
virtual void DrawContourLines(const Projection &projection, const MapParameter ¶meter, const MapData &data)
LanesFeatureValueReader lanesReader
Value reader for the 'lanes' feature.
Definition MapPainter.h:262
virtual void AfterPreprocessing(const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const MapData &data)
virtual void DrawSymbol(const Projection &projection, const MapParameter ¶meter, const Symbol &symbol, const Vertex2D &screenPos, double scaleFactor=1.0)=0
TextStyleRef debugLabel
Definition MapPainter.h:217
virtual void BeforeDrawing(const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const MapData &data)
bool Draw(const Projection &projection, const MapParameter ¶meter, const MapData &data)
const std::list< AreaData > & GetAreaData() const
Definition MapPainter.h:512
RefFeatureValueReader refReader
Value reader for the 'ref' feature.
Definition MapPainter.h:258
double GetProjectedWidth(const Projection &projection, double minPixel, double width) const
virtual void DrawWay(const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const WayData &data)
virtual double GetProposedLabelWidth(const MapParameter ¶meter, double averageCharWidth, double objectWidth, size_t stringLength)
bool IsVisibleWay(const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const
double GetProjectedWidth(const Projection &projection, double width) const
Definition MapPainter.h:500
double shieldGridSizeVert
Height of a cell for shield label placement.
Definition MapPainter.h:277
FeatureValueBuffer coastlineSegmentAttributes
Definition MapPainter.h:225
std::vector< double > emptyDash
Empty dash array.
Definition MapPainter.h:271
virtual void DrawContourSymbol(const Projection &projection, const MapParameter ¶meter, const Symbol &symbol, const ContourSymbolData &data)=0
bool Draw(const Projection &projection, const MapParameter ¶meter, const MapData &data, RenderSteps startStep, RenderSteps endStep)
virtual bool HasIcon(const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, IconStyle &style)=0
double contourLabelOffset
Same value as in MapParameter but converted to pixel.
Definition MapPainter.h:274
FillStyleRef seaFill
Definition MapPainter.h:224
StyleConfigRef styleConfig
Reference to the style configuration to be used.
Definition MapPainter.h:250
TransBuffer transBuffer
Definition MapPainter.h:212
virtual void DrawHillShading(const Projection &projection, const MapParameter ¶meter, const MapData &data)
NameAltFeatureValueReader nameAltReader
Value reader for the 'alternative name' feature.
Definition MapPainter.h:257
std::vector< OffsetRel > ParseLaneTurns(const LanesFeatureValue &feature) const
FillStyle areaMarkStyle
Marker fill style for internal debugging.
Definition MapPainter.h:273
AccessFeatureValueReader accessReader
Value reader for the 'lanes' feature.
Definition MapPainter.h:263
bool IsVisibleArea(const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const
std::list< WayPathData >::iterator WayPathDataIt
Definition MapPainter.h:188
virtual void RegisterRegularLabel(const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const std::vector< LabelData > &labels, const Vertex2D &position, double objectWidth)=0
CoordBuffer coordBuffer
Coordinate buffer.
Definition MapPainter.h:214
virtual void AfterDrawing(const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const MapData &data)
virtual void RegisterContourLabel(const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const PathLabelData &label, const LabelPath &labelPath)=0
double contourLabelSpace
Same value as in MapParameter but converted to pixel.
Definition MapPainter.h:275
Definition LabelLayouter.h:46
Definition Projection.h:46
double GetPixelSize() const
Definition Projection.h:263
Index selectors by type and level.
Definition StyleConfig.h:552
uint64_t FileOffset
Definition OSMScoutTypes.h:46
std::shared_ptr< TextStyle > TextStyleRef
Definition Styles.h:632
FeatureValueReader< NameFeature, NameFeatureValue > NameFeatureValueReader
Definition NameFeature.h:97
FeatureValueReader< WidthFeature, WidthFeatureValue > WidthFeatureValueReader
Definition WidthFeature.h:87
std::shared_ptr< PathTextStyle > PathTextStyleRef
Definition Styles.h:890
FeatureValueReader< ColorFeature, ColorFeatureValue > ColorFeatureValueReader
Definition ColorFeature.h:101
std::shared_ptr< StyleConfig > StyleConfigRef
Definition StyleConfig.h:859
std::shared_ptr< Area > AreaRef
Definition Area.h:360
FeatureValueReader< LayerFeature, LayerFeatureValue > LayerFeatureValueReader
Definition LayerFeature.h:87
FeatureValueReader< RefFeature, RefFeatureValue > RefFeatureValueReader
Definition RefFeature.h:98
std::shared_ptr< BorderStyle > BorderStyleRef
Definition Styles.h:464
std::shared_ptr< LineStyle > LineStyleRef
Definition Styles.h:281
FeatureValueReader< AddressFeature, AddressFeatureValue > AddressFeatureValueReader
Definition AddressFeature.h:108
FeatureValueReader< LanesFeature, LanesFeatureValue > LanesFeatureValueReader
Definition LanesFeature.h:167
RenderSteps
Definition MapPainter.h:64
@ Postrender
Implementation specific final step.
Definition MapPainter.h:91
@ ProcessAreas
Process (complex) areas for rendering.
Definition MapPainter.h:72
@ ProcessRoutes
Process routes for rendering.
Definition MapPainter.h:73
@ DrawWays
Definition MapPainter.h:80
@ PrepareRouteLabels
Definition MapPainter.h:87
@ DrawWayDecorations
Definition MapPainter.h:81
@ CalculatePaths
Calculate the paths to draw based on the given ways.
Definition MapPainter.h:70
@ DrawContourLines
Definition MapPainter.h:88
@ LastStep
Definition MapPainter.h:92
@ DumpStatistics
Definition MapPainter.h:68
@ CalculateWayShields
Calculate the label shields on the ways.
Definition MapPainter.h:71
@ FirstStep
Definition MapPainter.h:65
@ PrepareAreaLabels
Definition MapPainter.h:83
@ DrawAreaBorderSymbols
Definition MapPainter.h:85
@ AfterPreprocessing
Additional postprocessing.
Definition MapPainter.h:74
@ DrawLabels
Definition MapPainter.h:90
@ PrepareNodeLabels
Definition MapPainter.h:86
@ DrawWayContourLabels
Definition MapPainter.h:82
@ DrawOSMTileGrids
If special style exists, renders grid corresponding to OSM tiles.
Definition MapPainter.h:78
@ DrawHillShading
Definition MapPainter.h:89
@ DrawBaseMapTiles
Draw unknown/sea/land tiles and tiles with "coastlines" from base map.
Definition MapPainter.h:76
@ DrawAreas
Definition MapPainter.h:79
@ Prerender
Implementation specific preparation.
Definition MapPainter.h:75
@ DrawAreaBorderLabels
Definition MapPainter.h:84
@ DrawGroundTiles
Same as previous, but from main db.
Definition MapPainter.h:77
@ Initialize
Definition MapPainter.h:66
std::shared_ptr< FillStyle > FillStyleRef
Definition Styles.h:356
std::shared_ptr< IconStyle > IconStyleRef
Definition Styles.h:987
std::shared_ptr< TypeInfo > TypeInfoRef
Definition TypeConfig.h:61
FeatureValueReader< AccessFeature, AccessFeatureValue > AccessFeatureValueReader
Definition AccessFeature.h:276
FeatureValueReader< NameAltFeature, NameAltFeatureValue > NameAltFeatureValueReader
Definition NameAltFeature.h:97
std::shared_ptr< Node > NodeRef
Definition Node.h:125
std::shared_ptr< PathShieldStyle > PathShieldStyleRef
Definition Styles.h:805
Definition MapPainter.h:174
BorderStyleRef borderStyle
Border style.
Definition MapPainter.h:180
std::optional< GeoCoord > center
"visual" polygon center (pole of inaccessibility)
Definition MapPainter.h:182
CoordBufferRange coordRange
Range of coordinates in transformation buffer.
Definition MapPainter.h:184
const FeatureValueBuffer * buffer
Definition MapPainter.h:177
GeoBox boundingBox
Bounding box of the area.
Definition MapPainter.h:181
std::list< CoordBufferRange > clippings
Clipping polygons to be used during drawing of this area.
Definition MapPainter.h:185
bool isOuter
flag if this area is outer ring of some relation
Definition MapPainter.h:183
TypeInfoRef type
Definition MapPainter.h:176
ObjectFileRef ref
Definition MapPainter.h:175
FillStyleRef fillStyle
Fill style.
Definition MapPainter.h:179
Definition MapPainter.h:200
double symbolScale
Potential magnification of the symbol.
Definition MapPainter.h:204
double symbolSpace
Space between individual symbols on the contour.
Definition MapPainter.h:202
CoordBufferRange coordRange
Range of coordinates of the path in transformation buffer.
Definition MapPainter.h:203
double symbolOffset
Initial offset of the symbol.
Definition MapPainter.h:201
Definition MapPainter.h:194
WayPathDataIt wayData
Definition MapPainter.h:195
std::map< PathTextStyleRef, std::set< std::string > > labels
Definition MapPainter.h:196
Definition MapPainter.h:163
CoordBufferRange coordRange
Range of coordinates in transformation buffer.
Definition MapPainter.h:166
FileOffset ref
Definition MapPainter.h:164
const FeatureValueBuffer * buffer
Features of the line segment. Not owned pointer.
Definition MapPainter.h:165
double mainSlotWidth
Width of main slot, used for relative positioning.
Definition MapPainter.h:167