|
libosmscout 0.1
|
#include <MapPainterCairo.h>
Inheritance diagram for osmscout::MapPainterCairo:Classes | |
| struct | CairoNativeGlyph |
| struct | CairoNativeLabel |
Public Types | |
| using | CairoFont = cairo_scaled_font_t * |
| using | CairoGlyph = Glyph< CairoNativeGlyph > |
| using | CairoLabel = Label< CairoNativeGlyph, CairoNativeLabel > |
| using | CairoLabelInstance = LabelInstance< CairoNativeGlyph, CairoNativeLabel > |
| using | CairoLabelLayouter = LabelLayouter< CairoNativeGlyph, CairoNativeLabel, MapPainterCairo > |
Public Types inherited from osmscout::MapPainter | |
| using | WayPathDataIt = std::list< WayPathData >::iterator |
Public Member Functions | |
| bool | DrawMap (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data, cairo_t *draw, RenderSteps startStep=RenderSteps::FirstStep, RenderSteps endStep=RenderSteps::LastStep) |
| MapPainterCairo () | |
| ~MapPainterCairo () override | |
Public Member Functions inherited from osmscout::MapPainter | |
| bool | Draw (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data) |
| bool | Draw (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data, RenderSteps startStep, RenderSteps endStep) |
| MapPainter () | |
| virtual | ~MapPainter () |
Public Attributes | |
| friend | CairoLabelLayouter |
Protected Member Functions | |
| void | BeforeDrawingCallback (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data) override |
| void | DrawArea (const Projection &projection, const MapParameter ¶meter, const AreaData &area) override |
| Draw the given area using the given FillStyle for the area outline. | |
| void | DrawContourSymbol (const Projection &projection, const MapParameter ¶meter, const Symbol &symbol, const ContourSymbolData &data) override |
| Draw the given Symbol on top of the contour of the given path. | |
| void | DrawGlyphs (const Projection &projection, const MapParameter ¶meter, const osmscout::PathTextStyleRef &style, const std::vector< CairoGlyph > &glyphs) |
| void | DrawGround (const Projection &projection, const MapParameter ¶meter, const FillStyle &style) override |
| (Optionally) fills the area with the given default color for ground. | |
| void | DrawIcon (const IconStyle *style, const Vertex2D ¢erPos, double width, double height) override |
| Draw the Icon as defined by the IconStyle at the given pixel coordinate (icon center). | |
| void | DrawLabel (const Projection &projection, const MapParameter ¶meter, const ScreenVectorRectangle &labelRectangle, const LabelData &label, const CairoNativeLabel &layout) |
| void | DrawLabels (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data) 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 |
| Draw simple line with the given style,the given color, the given width and the given untransformed nodes. | |
| void | DrawSymbol (const Projection &projection, const MapParameter ¶meter, const Symbol &symbol, const Vertex2D &screenPos, double scaleFactor) override |
| Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate (symbol center). | |
| double | GetFontHeight (const Projection &projection, const MapParameter ¶meter, double fontSize) override |
| Returns the height of the font. | |
| osmscout::ScreenVectorRectangle | GlyphBoundingBox (const CairoNativeGlyph &glyph) const |
| bool | HasIcon (const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, IconStyle &style) override |
| Return true, if the icon in the IconStyle is available and can be drawn. | |
| bool | HasPattern (const MapParameter ¶meter, const FillStyle &style) |
| std::shared_ptr< CairoLabel > | Layout (const Projection &projection, const MapParameter ¶meter, const std::string &text, double fontSize, double objectWidth, bool enableWrapping=false, bool contourLabel=false) |
| void | RegisterContourLabel (const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const PathLabelData &label, const LabelPath &labelPath) override |
| Register contour label. | |
| void | RegisterRegularLabel (const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const std::vector< LabelData > &labels, const Vertex2D &position, double objectWidth) override |
| Register regular label with given text at the given pixel coordinate in a style defined by the given LabelStyle. | |
| void | StyleSheetChanged (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data) override |
| Low level drawing routines that have to be implemented by the concrete drawing engine. | |
Protected Member Functions inherited from osmscout::MapPainter | |
| virtual void | AfterDrawingCallback (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data) |
| virtual void | AfterPreprocessingCallback (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data) |
| virtual void | DrawContourLines (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data) |
| virtual void | DrawContourLines (size_t dbIndex, const Projection &projection, const MapParameter ¶meter, const MapData &data) |
| virtual void | DrawHillShading (const Projection &projection, const MapParameter ¶meter, const std::vector< MapData > &data) |
| virtual void | DrawHillShading (const StyleConfigRef &styleConfig, const Projection &projection, const MapParameter ¶meter, const MapData &data) |
| virtual void | DrawWay (const Projection &projection, const MapParameter ¶meter, const WayData &data) |
| const std::list< AreaData > & | GetAreaData () const |
| double | GetProjectedWidth (const Projection &projection, double minPixel, double width) const |
| double | GetProjectedWidth (const Projection &projection, double width) const |
| virtual double | GetProposedLabelWidth (const MapParameter ¶meter, double averageCharWidth, double objectWidth, size_t stringLength) |
| Compute suggested label width for given parameters. | |
| const std::list< WayData > & | GetWayData () const |
| bool | IsVisibleArea (const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const |
| Useful global helper functions. | |
| bool | IsVisibleWay (const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const |
| std::vector< OffsetRel > | ParseLaneTurns (const LanesFeatureValue &feature) const |
Additional Inherited Members | |
Protected Attributes inherited from osmscout::MapPainter | |
| FillStyle | areaMarkStyle |
| Marker fill style for internal debugging. | |
| FeatureValueBuffer | coastlineSegmentAttributes |
| double | contourLabelOffset |
| Same value as in MapParameter but converted to pixel. | |
| double | contourLabelSpace |
| Same value as in MapParameter but converted to pixel. | |
| CoordBuffer | coordBuffer |
| Coordinate buffer. | |
| std::vector< DatabaseCacheEntry > | databaseCache |
| Cache of database specific data for rendering, such as attribute readers and style config reference. | |
| TextStyleRef | debugLabel |
| std::vector< double > | emptyDash |
| Presets, precalculations and similar. | |
| FillStyleRef | landFill |
| Fallback styles in case they are missing for the style sheet. | |
| FillStyleRef | seaFill |
| double | shieldGridSizeHoriz |
| Width of a cell for shield label placement. | |
| double | shieldGridSizeVert |
| Height of a cell for shield label placement. | |
| TransBuffer | transBuffer |
| Internal coordinate transformation data structures. | |
| std::vector< double > | tunnelDash |
| Dash array for drawing tunnel border. | |
| using osmscout::MapPainterCairo::CairoFont = cairo_scaled_font_t* |
| using osmscout::MapPainterCairo::CairoLabelInstance = LabelInstance<CairoNativeGlyph, CairoNativeLabel> |
| using osmscout::MapPainterCairo::CairoLabelLayouter = LabelLayouter<CairoNativeGlyph, CairoNativeLabel, MapPainterCairo> |
| osmscout::MapPainterCairo::MapPainterCairo | ( | ) |
|
override |
|
overrideprotectedvirtual |
Reimplemented from osmscout::MapPainter.
References osmscout::Projection::ConvertWidthToPixel(), osmscout::MapParameter::GetLabelLayouterOverlap(), osmscout::ScreenVectorRectangle::height, osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::SetLayoutOverlap(), osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::SetViewport(), osmscout::ScreenVectorRectangle::width, osmscout::ScreenVectorRectangle::x, and osmscout::ScreenVectorRectangle::y.
|
overrideprotectedvirtual |
Draw the given area using the given FillStyle for the area outline.
Implements osmscout::MapPainter.
References osmscout::MapPainter::AreaData::borderStyle, osmscout::MapPainter::AreaData::clippings, osmscout::MapPainter::AreaData::coordRange, osmscout::MapPainter::AreaData::fillStyle, osmscout::CoordBufferRange::Get(), osmscout::CoordBufferRange::GetEnd(), osmscout::CoordBufferRange::GetFirst(), osmscout::CoordBufferRange::GetStart(), osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().
|
overrideprotectedvirtual |
Draw the given Symbol on top of the contour of the given path.
Implements osmscout::MapPainter.
References osmscout::MapPainter::ContourSymbolData::coordRange, osmscout::CoordBufferRange::Get(), osmscout::Symbol::GetBoundingBox(), osmscout::CoordBufferRange::GetEnd(), osmscout::CoordBufferRange::GetFirst(), osmscout::ScreenBox::GetHeight(), osmscout::CoordBufferRange::GetLength(), osmscout::CoordBufferRange::GetStart(), osmscout::ScreenBox::GetWidth(), osmscout::Vertex2D::GetX(), osmscout::Vertex2D::GetY(), osmscout::MapPathOnPath(), osmscout::SymbolRenderer::Render(), osmscout::MapPainter::ContourSymbolData::symbolOffset, osmscout::MapPainter::ContourSymbolData::symbolScale, and osmscout::MapPainter::ContourSymbolData::symbolSpace.
|
protected |
|
overrideprotectedvirtual |
(Optionally) fills the area with the given default color for ground.
In 2D backends this just fills the given area, 3D backends might draw a sphere or an infinite plane.
Implements osmscout::MapPainter.
References osmscout::Color::GetB(), osmscout::FillStyle::GetFillColor(), osmscout::Color::GetG(), osmscout::Projection::GetHeight(), osmscout::Color::GetR(), and osmscout::Projection::GetWidth().
|
overrideprotectedvirtual |
Draw the Icon as defined by the IconStyle at the given pixel coordinate (icon center).
Implements osmscout::MapPainter.
References osmscout::IconStyle::GetIconId(), osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().
|
protected |
References osmscout::LabelData::alpha, osmscout::MapPainterCairo::CairoNativeLabel::fontExtents, osmscout::ScreenVectorRectangle::height, osmscout::TextStyle::normal, osmscout::LabelData::style, osmscout::LabelData::text, osmscout::ScreenVectorRectangle::width, osmscout::ScreenVectorRectangle::x, and osmscout::ScreenVectorRectangle::y.
|
overrideprotectedvirtual |
| bool osmscout::MapPainterCairo::DrawMap | ( | const Projection & | projection, |
| const MapParameter & | parameter, | ||
| const std::vector< MapData > & | data, | ||
| cairo_t * | draw, | ||
| RenderSteps | startStep = RenderSteps::FirstStep, |
||
| RenderSteps | endStep = RenderSteps::LastStep |
||
| ) |
|
overrideprotectedvirtual |
Draw simple line with the given style,the given color, the given width and the given untransformed nodes.
Implements osmscout::MapPainter.
References osmscout::LineStyle::capButt, osmscout::LineStyle::capRound, osmscout::LineStyle::capSquare, osmscout::CoordBufferRange::Get(), osmscout::CoordBufferRange::GetEnd(), osmscout::CoordBufferRange::GetFirst(), osmscout::CoordBufferRange::GetLast(), osmscout::CoordBufferRange::GetStart(), osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().
|
overrideprotectedvirtual |
Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate (symbol center).
Implements osmscout::MapPainter.
References osmscout::SymbolRenderer::Render().
|
overrideprotectedvirtual |
Returns the height of the font.
Implements osmscout::MapPainter.
|
protected |
|
overrideprotectedvirtual |
Return true, if the icon in the IconStyle is available and can be drawn.
If this method returns false, possibly a fallback (using a Symbol) will be chosen.
Icon style dimensions and iconId may be setup for later usage.
Implements osmscout::MapPainter.
References osmscout::Projection::ConvertWidthToPixel(), osmscout::Log::Debug(), osmscout::Log::Error(), osmscout::IconStyle::GetIconId(), osmscout::MapParameter::GetIconMode(), osmscout::IconStyle::GetIconName(), osmscout::MapParameter::GetIconPaths(), osmscout::MapParameter::GetIconPixelSize(), osmscout::MapParameter::GetIconSize(), osmscout::IconStyle::GetWidth(), osmscout::LoadPNG(), osmscout::log, osmscout::MapParameter::OriginalPixmap, osmscout::MapParameter::Scalable, osmscout::MapParameter::ScaledPixmap, osmscout::IconStyle::SetHeight(), osmscout::IconStyle::SetIconId(), and osmscout::IconStyle::SetWidth().
|
protected |
|
protected |
References osmscout::UTF8StringToWString().
|
overrideprotectedvirtual |
Register contour label.
Implements osmscout::MapPainter.
References osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterContourLabel().
|
overrideprotectedvirtual |
Register regular label with given text at the given pixel coordinate in a style defined by the given LabelStyle.
Implements osmscout::MapPainter.
References osmscout::LabelLayouter< NativeGlyph, NativeLabel, TextLayouter >::RegisterLabel().
|
overrideprotectedvirtual |
Low level drawing routines that have to be implemented by the concrete drawing engine.
Some optional callbacks between individual processing steps. Stylesheet at least of one of the databases has changed, so the renderer can clear caches and similar.
Reimplemented from osmscout::MapPainter.