1#ifndef OSMSCOUT_MAP_MAPPAINTERQT_H
2#define OSMSCOUT_MAP_MAPPAINTERQT_H
34#include <QtGui/QTextLayout>
52 friend QtLabelLayouter;
55 struct FollowPathHandle
71 bool operator<(
const FontDescriptor& other)
const
73 return std::tie(fontName, fontSize, weight, italic) < std::tie(other.fontName, other.fontSize, other.weight, other.italic);
78 QPainter *painter{
nullptr};
80 QtLabelLayouter labelLayouter;
87 QtLabelLayouter *delegateLabelLayouter{
nullptr};
89 std::map<std::string,QImage,std::less<>> images;
91 std::vector<QImage> patternImages;
92 std::vector<QBrush> patterns;
93 QMap<FontDescriptor,QFont> fonts;
94 std::vector<double> sin;
99 QFont GetFont(
const Projection& projection,
100 const MapParameter& parameter,
103 void SetFill(
const Projection& projection,
104 const MapParameter& parameter,
105 const FillStyle& fillStyle);
107 void SetBorder(
const Projection& projection,
108 const MapParameter& parameter,
109 const BorderStyle& borderStyle);
111 bool FollowPath(FollowPathHandle &hnd,
112 const CoordBufferRange& coordRange,
115 void FollowPathInit(FollowPathHandle &hnd,
116 const CoordBufferRange& coordRange,
119 bool keepOrientation);
121 void SetupTransformation(QPainter* painter,
122 const QPointF center,
124 const qreal baseline)
const;
126 osmscout::ScreenVectorRectangle GlyphBoundingBox(
const QGlyphRun &glyph)
const;
128 void DrawGlyph(QPainter *painter,
const Glyph<QGlyphRun> &glyph)
const;
130 void DrawGlyphs(
const Projection &projection,
131 const MapParameter ¶meter,
133 const std::vector<osmscout::Glyph<QGlyphRun>> &glyphs);
135 std::shared_ptr<QtLabel> Layout(
const Projection& projection,
136 const MapParameter& parameter,
137 const std::string& text,
140 bool enableWrapping =
false,
141 bool contourLabel =
false);
143 QtLabelLayouter& GetLayouter();
145 void DrawRectangle(
int x,
int y,
146 int width,
int height,
152 const MapParameter& parameter,
153 IconStyle& style)
override;
156 const MapParameter& parameter,
157 const FillStyle& style);
160 const MapParameter& parameter,
161 double fontSize)
override;
164 const MapParameter& parameter,
165 const FillStyle& style)
override;
168 const MapParameter& parameter,
171 const QTextLayout& textLayout);
175 const MapParameter& parameter,
176 const MapData& data)
override;
183 const MapParameter& parameter,
184 const ObjectFileRef& ref,
185 const std::vector<LabelData>& labels,
186 const Vertex2D& position,
187 double objectWidth)
override;
193 const MapParameter& parameter,
194 const ObjectFileRef& ref,
199 const MapParameter& parameter,
200 const MapData& data)
override;
203 const Vertex2D& centerPos,
204 double width,
double height)
override;
207 const MapParameter& parameter,
208 const Symbol& symbol,
209 const Vertex2D& screenPos,
210 double scaleFactor)
override;
213 const MapParameter& parameter,
216 const std::vector<double>& dash,
217 LineStyle::CapStyle startCap,
218 LineStyle::CapStyle endCap,
219 const CoordBufferRange& coordRange)
override;
222 const MapParameter& parameter,
223 const Symbol& symbol,
227 const MapParameter& parameter,
235 const MapParameter& parameter,
236 const std::list<GroundTile>& groundTiles,
240 const MapParameter& parameter,
262 const MapParameter& parameter,
#define OSMSCOUT_MAP_QT_API
Definition MapQtImportExport.h:45
BatchMapPainter(size_t expectedCount)
Definition BatchMapPainter.h:81
Definition MapPainterQt.h:255
~BatchMapPainterQt() override
bool paint(const Projection &projection, const MapParameter ¶meter, QPainter *painter)
BatchMapPainterQt(size_t expectedCount)
Definition LabelLayouter.h:103
Definition LabelLayouter.h:57
Definition LabelLayouter.h:119
Definition LabelLayouter.h:147
Definition LabelLayouter.h:230
Definition LabelPath.h:44
MapPainter(const StyleConfigRef &styleConfig)
StyleConfigRef styleConfig
Reference to the style configuration to be used.
Definition MapPainter.h:250
void DrawContourSymbol(const Projection &projection, const MapParameter ¶meter, const Symbol &symbol, const ContourSymbolData &data) override
void DrawLabels(const Projection &projection, const MapParameter ¶meter, const MapData &data) override
void RegisterRegularLabel(const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const std::vector< LabelData > &labels, const Vertex2D &position, double objectWidth) override
double GetFontHeight(const Projection &projection, const MapParameter ¶meter, double fontSize) override
void DrawIcon(const IconStyle *style, const Vertex2D ¢erPos, double width, double height) override
bool HasPattern(const Projection &projection, const MapParameter ¶meter, const FillStyle &style)
void BeforeDrawing(const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const MapData &data) override
friend class BatchMapPainterQt
Definition MapPainterQt.h:49
bool DrawMap(const Projection &projection, const MapParameter ¶meter, const MapData &data, QPainter *painter, RenderSteps startStep=RenderSteps::FirstStep, RenderSteps endStep=RenderSteps::LastStep)
void DrawLabel(const Projection &projection, const MapParameter ¶meter, const ScreenVectorRectangle &labelRectangle, const LabelData &label, const QTextLayout &textLayout)
void DrawArea(const Projection &projection, const MapParameter ¶meter, const AreaData &area) override
void RegisterContourLabel(const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const PathLabelData &label, const LabelPath &labelPath) override
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) override
void DrawGround(const Projection &projection, const MapParameter ¶meter, const FillStyle &style) override
void DrawGroundTiles(const Projection &projection, const MapParameter ¶meter, const std::list< GroundTile > &groundTiles, QPainter *painter)
MapPainterQt(const StyleConfigRef &styleConfig)
void DrawSymbol(const Projection &projection, const MapParameter ¶meter, const Symbol &symbol, const Vertex2D &screenPos, double scaleFactor) override
bool HasIcon(const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, IconStyle &style) override
Definition LabelLayouter.h:46
Definition Projection.h:46
Index selectors by type and level.
Definition StyleConfig.h:552
LabelInstance< QGlyphRun, QTextLayout > QtLabelInstance
Definition MapPainterQt.h:40
std::shared_ptr< PathTextStyle > PathTextStyleRef
Definition Styles.h:890
std::shared_ptr< StyleConfig > StyleConfigRef
Definition StyleConfig.h:859
Label< QGlyphRun, QTextLayout > QtLabel
Definition MapPainterQt.h:39
RenderSteps
Definition MapPainter.h:64
@ LastStep
Definition MapPainter.h:92
@ FirstStep
Definition MapPainter.h:65
Glyph< QGlyphRun > QtGlyph
Definition MapPainterQt.h:38
bool operator<(const TileCacheKey &a, const TileCacheKey &b)
Definition MapPainter.h:174
Definition MapPainter.h:200
Definition LabelLayouterHelper.h:73