1 #ifndef OSMSCOUT_MAP_MAPPAINTER_H 2 #define OSMSCOUT_MAP_MAPPAINTER_H 90 using StepMethod = void (
MapPainter::*)(
const Projection &,
const MapParameter &,
const MapData &);
100 size_t objectCount=0;
141 if (layer!=other.
layer)
143 return layer<other.
layer;
146 if (lineStyle->GetZIndex()!=other.
lineStyle->GetZIndex()) {
147 return lineStyle->GetZIndex()<other.
lineStyle->GetZIndex();
150 if (lineStyle->GetPriority()!=other.
lineStyle->GetPriority()) {
151 return lineStyle->GetPriority()<other.
lineStyle->GetPriority();
200 std::map<PathTextStyleRef,std::set<std::string>>
labels;
224 std::vector<StepMethod> stepMethods;
225 double errorTolerancePixel;
227 std::list<AreaData> areaData;
228 std::list<WayData> wayData;
229 std::list<WayPathData> wayPathData;
231 std::list<RouteLabelData> routeLabelData;
233 std::vector<TextStyleRef> textStyles;
234 std::vector<LineStyleRef> lineStyles;
240 double standardFontSize;
241 double areaMinDimension;
280 void DumpDataStatistics(
const Projection& projection,
281 const MapParameter& parameter,
282 const MapData& data);
291 const MapParameter& parameter,
296 const MapParameter& parameter,
297 const MapData& data);
299 void TransformPathData(
const Projection& projection,
300 const MapParameter& parameter,
304 void CalculatePaths(
const StyleConfig& styleConfig,
306 const MapParameter& parameter,
311 const MapParameter& parameter,
312 const MapData& data);
316 const MapParameter& parameter,
317 const MapData& data);
321 const MapParameter& parameter,
324 void PrepareAreaLabel(
const StyleConfig& styleConfig,
326 const MapParameter& parameter,
331 const MapParameter& parameter,
332 const MapData& data);
334 void RegisterPointWayLabel(
const Projection& projection,
335 const MapParameter& parameter,
337 const std::string& text,
338 const std::vector<Point>& nodes);
340 void LayoutPointLabels(
const Projection& projection,
341 const MapParameter& parameter,
342 const FeatureValueBuffer& buffer,
344 const std::vector<TextStyleRef>& textStyles,
346 double objectWidth=0,
347 double objectHeight=0);
349 bool DrawWayDecoration(
const StyleConfig& styleConfig,
351 const MapParameter& parameter,
354 bool CalculateWayShieldLabels(
const StyleConfig& styleConfig,
356 const MapParameter& parameter,
359 bool DrawWayContourLabel(
const StyleConfig& styleConfig,
361 const MapParameter& parameter,
364 bool DrawWayContourLabel(
const Projection& projection,
365 const MapParameter& parameter,
368 const std::string &textLabel);
370 bool DrawAreaBorderLabel(
const StyleConfig& styleConfig,
372 const MapParameter& parameter,
375 bool DrawAreaBorderSymbol(
const StyleConfig& styleConfig,
377 const MapParameter& parameter,
380 void DrawOSMTileGrid(
const Projection& projection,
381 const MapParameter& parameter,
382 const Magnification& magnification,
386 const MapParameter& parameter,
387 const std::list<GroundTile> &groundTiles);
395 void InitializeRender(
const Projection& projection,
396 const MapParameter& parameter,
397 const MapData& data);
400 const MapParameter& parameter,
401 const MapData& data);
404 const MapParameter& parameter,
405 const MapData& data);
408 const MapParameter& parameter,
409 const MapData& data);
412 const MapParameter& parameter,
413 const MapData& data);
416 const MapParameter& parameter,
417 const MapData& data);
420 const MapParameter& parameter,
421 const MapData& data);
424 const MapParameter& parameter,
425 const MapData& data);
428 const MapParameter& parameter,
429 const MapData& data);
432 const MapParameter& parameter,
433 const MapData& data);
436 const MapParameter& parameter,
437 const MapData& data);
440 const MapParameter& parameter,
441 const MapData& data);
444 const MapParameter& parameter,
445 const MapData& data);
448 const MapParameter& parameter,
449 const MapData& data);
452 const MapParameter& parameter,
453 const MapData& data);
456 const MapParameter& parameter,
457 const MapData& data);
460 const MapParameter& parameter,
461 const MapData& data);
469 bool IsVisibleArea(
const Projection& projection,
470 const GeoBox& boundingBox,
471 double pixelOffset)
const;
473 bool IsVisibleWay(
const Projection& projection,
474 const GeoBox& boundingBox,
475 double pixelOffset)
const;
478 const MapParameter& parameter,
479 const GeoCoord& coord,
483 double GetProjectedWidth(
const Projection& projection,
514 virtual void AfterPreprocessing(
const StyleConfig& styleConfig,
516 const MapParameter& parameter,
517 const MapData& data);
518 virtual void BeforeDrawing(
const StyleConfig& styleConfig,
520 const MapParameter& parameter,
521 const MapData& data);
522 virtual void AfterDrawing(
const StyleConfig& styleConfig,
524 const MapParameter& parameter,
525 const MapData& data);
535 virtual bool HasIcon(
const StyleConfig& styleConfig,
537 const MapParameter& parameter,
543 virtual double GetFontHeight(
const Projection& projection,
544 const MapParameter& parameter,
545 double fontSize) = 0;
552 virtual void DrawGround(
const Projection& projection,
553 const MapParameter& parameter,
560 virtual void RegisterRegularLabel(
const Projection &projection,
561 const MapParameter ¶meter,
562 const std::vector<LabelData> &labels,
563 const Vertex2D &position,
564 double objectWidth) = 0;
569 virtual void RegisterContourLabel(
const Projection &projection,
570 const MapParameter ¶meter,
575 const MapParameter& parameter,
576 const MapData& data) = 0;
579 const MapParameter& parameter,
580 const MapData& data);
583 const MapParameter& parameter,
584 const MapData& data);
589 virtual void DrawIcon(
const IconStyle* style,
590 double centerX,
double centerY,
591 double width,
double height) = 0;
596 virtual void DrawSymbol(
const Projection& projection,
597 const MapParameter& parameter,
599 double x,
double y) = 0;
605 virtual void DrawPath(
const Projection& projection,
606 const MapParameter& parameter,
609 const std::vector<double>& dash,
612 size_t transStart,
size_t transEnd) = 0;
618 virtual void DrawContourSymbol(
const Projection& projection,
619 const MapParameter& parameter,
622 size_t transStart,
size_t transEnd) = 0;
628 virtual void DrawArea(
const Projection& projection,
629 const MapParameter& parameter,
630 const AreaData& area) = 0;
637 virtual double GetProposedLabelWidth(
const MapParameter& parameter,
638 double averageCharWidth,
640 size_t stringLength);
642 virtual void DrawWay(
const StyleConfig& styleConfig,
644 const MapParameter& parameter,
645 const WayData& data);
656 const MapParameter& parameter,
662 const MapParameter& parameter,
663 const MapData& data);
672 template <
class Pa
interType>
689 const MapParameter& parameter)
696 for (
size_t i=0;i<
data.size(); i++){
697 const MapData &d=*(
data[i]);
698 success &=
painters[i]->Draw(projection,
711 data.reserve(expectedCount);
AddressFeatureValueReader addressReader
Value reader for the 'address' feature.
Definition: MapPainter.h:256
double lineWidth
Line width.
Definition: MapPainter.h:122
WayPathDataIt wayData
Definition: MapPainter.h:199
std::vector< MapDataRef > data
Definition: MapPainter.h:675
void addData(const MapDataRef &d, PainterType &painter)
Definition: MapPainter.h:717
Definition: MapPainter.h:74
bool operator<(const WayData &other) const
Definition: MapPainter.h:139
std::shared_ptr< FillStyle > FillStyleRef
Definition: Styles.h:349
Definition: MapPainter.h:65
WidthFeatureValueReader widthReader
Value reader for the 'width' feature.
Definition: MapPainter.h:255
double GetProjectedWidth(const Projection &projection, double width) const
Definition: MapPainter.h:487
size_t transEnd
End of coordinates in transformation buffer (inclusive)
Definition: MapPainter.h:173
std::shared_ptr< Node > NodeRef
Definition: Node.h:124
Definition: MapPainter.h:72
double GetPixelSize() const
Definition: Projection.h:251
Index selectors by type and level.
Definition: StyleConfig.h:553
std::list< PolyData > clippings
Clipping polygons to be used during drawing of this area.
Definition: MapPainter.h:189
MapPainterBatch(size_t expectedCount)
Definition: MapPainter.h:709
Implementation specific final step.
Definition: MapPainter.h:76
Definition: MapPainter.h:170
std::shared_ptr< LineStyle > LineStyleRef
Definition: Styles.h:273
Definition: MapPainter.h:71
CoordBuffer coordBuffer
Coordinate buffer.
Definition: MapPainter.h:209
Definition: LabelLayouter.h:87
RefFeatureValueReader refReader
Value reader for the 'ref' feature.
Definition: MapPainter.h:253
double contourLabelOffset
Same value as in MapParameter but converted to pixel.
Definition: MapPainter.h:269
RenderSteps
Definition: MapPainter.h:54
Convert geographical coordinates of object points to screen coordinates,.
Definition: MapPainter.h:59
FillStyleRef landFill
Definition: MapPainter.h:218
Definition: MapPainter.h:73
Prints details for debugging, if debug flag (performance, data) is set in renderer parameter...
Definition: MapPainter.h:58
FillStyleRef seaFill
Definition: MapPainter.h:219
ObjectFileRef ref
Definition: MapPainter.h:181
AccessFeatureValueReader accessReader
Value reader for the 'lanes' feature.
Definition: MapPainter.h:258
int8_t layer
Layer this way is in.
Definition: MapPainter.h:117
double shieldGridSizeHoriz
Width of a cell for shield label placement.
Definition: MapPainter.h:271
std::shared_ptr< BorderStyle > BorderStyleRef
Definition: Styles.h:458
std::shared_ptr< MapData > MapDataRef
Definition: MapData.h:63
Definition: MapPainter.h:77
Definition: MapPainter.h:673
double mainSlotWidth
Width of main slot, used for relative positioning.
Definition: MapPainter.h:167
NameAltFeatureValueReader nameAltReader
Value reader for the 'alternative name' feature.
Definition: MapPainter.h:252
Color color
Line color.
Definition: MapPainter.h:119
FillStyleRef fillStyle
Fill style.
Definition: MapPainter.h:184
NameFeatureValueReader nameReader
Value reader for the 'name' feature.
Definition: MapPainter.h:251
Definition: Projection.h:43
Definition: MapPainter.h:75
std::shared_ptr< PathTextStyle > PathTextStyleRef
Definition: Styles.h:877
If special style exists, renders grid corresponding to OSM tiles.
Definition: MapPainter.h:63
Definition: MapPainter.h:66
bool endIsClosed
The end of the way is closed, it does not lead to another way or area.
Definition: MapPainter.h:124
Definition: MapPainter.h:97
std::vector< double > emptyDash
Empty dash array.
Definition: MapPainter.h:266
size_t transStart
Start of coordinates in transformation buffer.
Definition: MapPainter.h:172
Definition: Styles.h:1135
Implementation specific preparison.
Definition: MapPainter.h:60
TransBuffer transBuffer
Internal buffer for coordinate transformation from geo coordinates to display coordinates.
Definition: MapPainter.h:208
StyleConfigRef styleConfig
Reference to the style configuration to be used.
Definition: MapPainter.h:245
const FeatureValueBuffer * buffer
Features of the line segment. Not owned pointer.
Definition: MapPainter.h:165
size_t wayPriority
Priority of way (from style sheet)
Definition: MapPainter.h:120
FillStyle areaMarkStyle
Marker fill style for internal debugging.
Definition: MapPainter.h:268
Definition: MapPainter.h:70
std::shared_ptr< Area > AreaRef
Definition: Area.h:358
std::shared_ptr< PathShieldStyle > PathShieldStyleRef
Definition: Styles.h:791
Setup internal state of renderer for executing next steps with current projection and parameters...
Definition: MapPainter.h:57
const FeatureValueBuffer * buffer
Features of the line segment, can be NULL in case of border only areas.
Definition: MapPainter.h:183
Definition: LabelPath.h:42
#define OSMSCOUT_MAP_API
Definition: MapImportExport.h:45
CoordBufferRange coordRange
Range of coordinates in transformation buffer.
Definition: MapPainter.h:188
TypeInfoRef type
Type.
Definition: MapPainter.h:99
std::shared_ptr< StyleConfig > StyleConfigRef
Definition: StyleConfig.h:849
FileOffset ref
Definition: MapPainter.h:164
bool isOuter
flag if this area is outer ring of some relation
Definition: MapPainter.h:187
TypeInfoRef type
Definition: MapPainter.h:182
Definition: MapPainter.h:87
std::vector< PainterType > painters
Definition: MapPainter.h:676
std::vector< double > tunnelDash
Dash array for drawing tunnel border.
Definition: MapPainter.h:267
Definition: MapPainter.h:68
Definition: MapPainter.h:67
Definition: MapPainter.h:114
bool batchPaintInternal(const Projection &projection, const MapParameter ¶meter)
Definition: MapPainter.h:688
Definition: MapPainter.h:162
const std::list< WayData > & GetWayData() const
Definition: MapPainter.h:494
LineStyleRef lineStyle
Line style.
Definition: MapPainter.h:118
std::shared_ptr< TypeInfo > TypeInfoRef
Definition: TypeConfig.h:58
GeoBox boundingBox
Bounding box of the area.
Definition: MapPainter.h:186
uint64_t FileOffset
Definition: OSMScoutTypes.h:47
double shieldGridSizeVert
Height of a cell for shield label placement.
Definition: MapPainter.h:272
double contourLabelSpace
Same value as in MapParameter but converted to pixel.
Definition: MapPainter.h:270
std::map< PathTextStyleRef, std::set< std::string > > labels
Definition: MapPainter.h:200
const FeatureValueBuffer * buffer
Features of the line segment.
Definition: MapPainter.h:116
std::list< WayPathData >::iterator WayPathDataIt
Definition: MapPainter.h:192
codepoint(*)(const character *, int context) Transform
functor implements desired transformation of the character It has 2 arguments:
Definition: utf8helper.h:49
CoordBufferRange coordRange
Range of coordinates in transformation buffer.
Definition: MapPainter.h:166
CoordBufferRange coordRange
Range of coordinates in transformation buffer.
Definition: MapPainter.h:121
LanesFeatureValueReader lanesReader
Value reader for the 'lanes' feature.
Definition: MapPainter.h:257
const std::list< AreaData > & GetAreaData() const
Definition: MapPainter.h:499
Definition: MapPainter.h:69
bool startIsClosed
The end of the way is closed, it does not lead to another way or area.
Definition: MapPainter.h:123
BorderStyleRef borderStyle
Border style.
Definition: MapPainter.h:185
Definition: MapPainter.h:56
FeatureValueBuffer coastlineSegmentAttributes
Definition: MapPainter.h:220
Definition: MapPainter.h:179
LayerFeatureValueReader layerReader
Value reader for the 'layer' feature.
Definition: MapPainter.h:254
virtual ~MapPainterBatch()=default
TextStyleRef debugLabel
Definition: MapPainter.h:212
Draw unknown/sea/land tiles and tiles with "coastlines" from base map.
Definition: MapPainter.h:61
Same as previous, but from main database.
Definition: MapPainter.h:62
Definition: TypeFeatures.h:1859
Definition: MapPainter.h:64
std::shared_ptr< IconStyle > IconStyleRef
Definition: Styles.h:975
std::shared_ptr< TextStyle > TextStyleRef
Definition: Styles.h:622
Definition: MapPainter.h:197
ColorFeatureValueReader colorReader
Value reader for the 'color' feature.
Definition: MapPainter.h:259
CapStyle
Definition: Styles.h:69