1 #ifndef OSMSCOUT_MAP_MAPPAINTERQT_H 2 #define OSMSCOUT_MAP_MAPPAINTERQT_H 33 #include <QtGui/QTextLayout> 54 struct FollowPathHandle
70 bool operator<(
const FontDescriptor& other)
const 72 return std::tie(fontName, fontSize, weight, italic) < std::tie(other.fontName, other.fontSize, other.weight, other.italic);
77 QPainter *painter{
nullptr};
79 QtLabelLayouter labelLayouter;
86 QtLabelLayouter *delegateLabelLayouter{
nullptr};
88 std::map<std::string,QImage> images;
89 std::vector<QImage> patternImages;
91 std::vector<QBrush> patterns;
92 QMap<FontDescriptor,QFont> fonts;
93 std::vector<double> sin;
98 QFont GetFont(
const Projection& projection,
99 const MapParameter& parameter,
102 void SetFill(
const Projection& projection,
103 const MapParameter& parameter,
104 const FillStyle& fillStyle);
106 void SetBorder(
const Projection& projection,
107 const MapParameter& parameter,
108 const BorderStyle& borderStyle);
110 bool FollowPath(FollowPathHandle &hnd,
double l, Vertex2D &origin);
111 void FollowPathInit(FollowPathHandle &hnd, Vertex2D &origin,
size_t transStart,
size_t transEnd,
112 bool isClosed,
bool keepOrientation);
114 void SetupTransformation(QPainter* painter,
115 const QPointF center,
117 const qreal baseline)
const;
121 void DrawGlyph(QPainter *painter,
const Glyph<QGlyphRun> &glyph)
const;
123 void DrawGlyphs(
const Projection &projection,
124 const MapParameter ¶meter,
128 std::shared_ptr<QtLabel> Layout(
const Projection& projection,
129 const MapParameter& parameter,
130 const std::string& text,
133 bool enableWrapping =
false,
134 bool contourLabel =
false);
136 QtLabelLayouter& GetLayouter();
138 void DrawRectangle(
int x,
int y,
139 int width,
int height,
143 bool HasIcon(
const StyleConfig& styleConfig,
144 const Projection& projection,
145 const MapParameter& parameter,
146 IconStyle& style)
override;
148 bool HasPattern(
const Projection& projection,
149 const MapParameter& parameter,
150 const FillStyle& style);
152 double GetFontHeight(
const Projection& projection,
153 const MapParameter& parameter,
154 double fontSize)
override;
156 void DrawGround(
const Projection& projection,
157 const MapParameter& parameter,
158 const FillStyle& style)
override;
160 void DrawLabel(
const Projection& projection,
161 const MapParameter& parameter,
163 const LabelData& label,
164 const QTextLayout& textLayout);
166 void BeforeDrawing(
const StyleConfig& styleConfig,
167 const Projection& projection,
168 const MapParameter& parameter,
169 const MapData& data)
override;
175 void RegisterRegularLabel(
const Projection& projection,
176 const MapParameter& parameter,
177 const std::vector<LabelData>& labels,
178 const Vertex2D& position,
179 double objectWidth)
override;
184 void RegisterContourLabel(
const Projection& projection,
185 const MapParameter& parameter,
186 const PathLabelData& label,
187 const LabelPath& labelPath)
override;
190 const MapParameter& parameter,
191 const MapData& data)
override;
193 void DrawIcon(
const IconStyle* style,
194 double centerX,
double centerY,
195 double width,
double height)
override;
197 void DrawSymbol(
const Projection& projection,
198 const MapParameter& parameter,
199 const Symbol& symbol,
200 double x,
double y)
override;
202 void DrawPath(
const Projection& projection,
203 const MapParameter& parameter,
206 const std::vector<double>& dash,
209 size_t transStart,
size_t transEnd)
override;
211 void DrawContourSymbol(
const Projection& projection,
212 const MapParameter& parameter,
213 const Symbol& symbol,
215 size_t transStart,
size_t transEnd)
override;
217 void DrawArea(
const Projection& projection,
218 const MapParameter& parameter,
219 const AreaData& area)
override;
223 ~MapPainterQt()
override;
226 const MapParameter& parameter,
227 const std::list<GroundTile>& groundTiles,
230 bool DrawMap(
const Projection& projection,
231 const MapParameter& parameter,
251 const MapParameter& parameter,
Definition: LabelLayouter.h:144
Definition: MapPainterQt.h:243
#define OSMSCOUT_MAP_QT_API
Definition: MapQtImportExport.h:45
Definition: LabelLayouter.h:172
Definition: MapPainter.h:673
Definition: Projection.h:43
Definition: MapPainter.h:75
std::shared_ptr< PathTextStyle > PathTextStyleRef
Definition: Styles.h:877
bool operator<(const TileCacheKey &a, const TileCacheKey &b)
std::shared_ptr< StyleConfig > StyleConfigRef
Definition: StyleConfig.h:849
Definition: MapPainter.h:87
Definition: MapPainterQt.h:46
Definition: LabelLayouter.h:129
Rectangle< double > DoubleRectangle
Definition: LabelLayouter.h:85
Same as previous, but from main database.
Definition: MapPainter.h:62
CapStyle
Definition: Styles.h:69