libosmscout  0.1
osmscout::MapPainterQt Class Reference

Implementation of MapPainter for Qt. More...

#include <MapPainterQt.h>

+ Inheritance diagram for osmscout::MapPainterQt:

Public Member Functions

void DrawGroundTiles (const Projection &projection, const MapParameter &parameter, const std::list< GroundTile > &groundTiles, QPainter *painter)
 
bool DrawMap (const Projection &projection, const MapParameter &parameter, const MapData &data, QPainter *painter, RenderSteps startStep=RenderSteps::FirstStep, RenderSteps endStep=RenderSteps::LastStep)
 
 MapPainterQt (const StyleConfigRef &styleConfig)
 
 ~MapPainterQt () override
 
- Public Member Functions inherited from osmscout::MapPainter
bool Draw (const Projection &projection, const MapParameter &parameter, const MapData &data)
 
bool Draw (const Projection &projection, const MapParameter &parameter, const MapData &data, RenderSteps startStep, RenderSteps endStep)
 
 MapPainter (const StyleConfigRef &styleConfig)
 
virtual ~MapPainter ()
 

Protected Member Functions

void BeforeDrawing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data) override
 
void DrawArea (const Projection &projection, const MapParameter &parameter, const AreaData &area) override
 Draw the given area using the given FillStyle for the area outline. More...
 
void DrawContourSymbol (const Projection &projection, const MapParameter &parameter, const Symbol &symbol, const ContourSymbolData &data) override
 Draw the given Symbol on top of the contour of the given path. More...
 
void DrawGround (const Projection &projection, const MapParameter &parameter, const FillStyle &style) override
 (Optionally) fills the area with the given default color for ground. More...
 
void DrawIcon (const IconStyle *style, const Vertex2D &centerPos, double width, double height) override
 Draw the Icon as defined by the IconStyle at the given pixel coordinate (icon center). More...
 
void DrawLabel (const Projection &projection, const MapParameter &parameter, const DoubleRectangle &labelRectangle, const LabelData &label, const QTextLayout &textLayout)
 
void DrawLabels (const Projection &projection, const MapParameter &parameter, const MapData &data) override
 
void DrawPath (const Projection &projection, const MapParameter &parameter, 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. More...
 
void DrawSymbol (const Projection &projection, const MapParameter &parameter, const Symbol &symbol, const Vertex2D &screenPos, double scaleFactor) override
 Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate (symbol center). More...
 
double GetFontHeight (const Projection &projection, const MapParameter &parameter, double fontSize) override
 Returns the height of the font. More...
 
bool HasIcon (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, IconStyle &style) override
 Return true, if the icon in the IconStyle is available and can be drawn. More...
 
bool HasPattern (const Projection &projection, const MapParameter &parameter, const FillStyle &style)
 
void RegisterContourLabel (const Projection &projection, const MapParameter &parameter, const PathLabelData &label, const LabelPath &labelPath) override
 Register contour label. More...
 
void RegisterRegularLabel (const Projection &projection, const MapParameter &parameter, 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. More...
 
- Protected Member Functions inherited from osmscout::MapPainter
virtual void AfterDrawing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void AfterPreprocessing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data)
 Low level drawing routines that have to be implemented by the concrete drawing engine. More...
 
virtual void DrawContourLines (const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void DrawHillShading (const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void DrawWay (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, 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 &parameter, double averageCharWidth, double objectWidth, size_t stringLength)
 Compute suggested label width for given parameters. More...
 
const std::list< WayData > & GetWayData () const
 
bool IsVisibleArea (const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const
 Useful global helper functions. More...
 
bool IsVisibleWay (const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const
 
std::vector< OffsetRelParseLaneTurns (const LanesFeatureValue &feature) const
 

Friends

class BatchMapPainterQt
 

Additional Inherited Members

- Public Types inherited from osmscout::MapPainter
using WayPathDataIt = std::list< WayPathData >::iterator
 
- Protected Attributes inherited from osmscout::MapPainter
AccessFeatureValueReader accessReader
 Value reader for the 'lanes' feature. More...
 
AddressFeatureValueReader addressReader
 Value reader for the 'address' feature. More...
 
FillStyle areaMarkStyle
 Marker fill style for internal debugging. More...
 
FeatureValueBuffer coastlineSegmentAttributes
 
ColorFeatureValueReader colorReader
 Value reader for the 'color' feature. More...
 
double contourLabelOffset
 Same value as in MapParameter but converted to pixel. More...
 
double contourLabelSpace
 Same value as in MapParameter but converted to pixel. More...
 
CoordBuffer coordBuffer
 Coordinate buffer. More...
 
TextStyleRef debugLabel
 
std::vector< double > emptyDash
 Presets, precalculations and similar. More...
 
FillStyleRef landFill
 Fallback styles in case they are missing for the style sheet. More...
 
LanesFeatureValueReader lanesReader
 Value reader for the 'lanes' feature. More...
 
LayerFeatureValueReader layerReader
 Value reader for the 'layer' feature. More...
 
NameAltFeatureValueReader nameAltReader
 Value reader for the 'alternative name' feature. More...
 
NameFeatureValueReader nameReader
 Attribute readers. More...
 
RefFeatureValueReader refReader
 Value reader for the 'ref' feature. More...
 
FillStyleRef seaFill
 
double shieldGridSizeHoriz
 Width of a cell for shield label placement. More...
 
double shieldGridSizeVert
 Height of a cell for shield label placement. More...
 
StyleConfigRef styleConfig
 Reference to the style configuration to be used. More...
 
TransBuffer transBuffer
 Internal coordinate transformation data structures. More...
 
std::vector< double > tunnelDash
 Dash array for drawing tunnel border. More...
 
WidthFeatureValueReader widthReader
 Value reader for the 'width' feature. More...
 

Detailed Description

Implementation of MapPainter for Qt.

Constructor & Destructor Documentation

◆ MapPainterQt()

osmscout::MapPainterQt::MapPainterQt ( const StyleConfigRef styleConfig)
explicit

◆ ~MapPainterQt()

osmscout::MapPainterQt::~MapPainterQt ( )
override

Member Function Documentation

◆ BeforeDrawing()

◆ DrawArea()

◆ DrawContourSymbol()

◆ DrawGround()

void osmscout::MapPainterQt::DrawGround ( const Projection projection,
const MapParameter parameter,
const FillStyle style 
)
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().

◆ DrawGroundTiles()

void osmscout::MapPainterQt::DrawGroundTiles ( const Projection projection,
const MapParameter parameter,
const std::list< GroundTile > &  groundTiles,
QPainter *  painter 
)

◆ DrawIcon()

void osmscout::MapPainterQt::DrawIcon ( const IconStyle style,
const Vertex2D centerPos,
double  width,
double  height 
)
overrideprotectedvirtual

Draw the Icon as defined by the IconStyle at the given pixel coordinate (icon center).

Implements osmscout::MapPainter.

References osmscout::IconStyle::GetIconName(), osmscout::Vertex2D::GetX(), and osmscout::Vertex2D::GetY().

◆ DrawLabel()

void osmscout::MapPainterQt::DrawLabel ( const Projection projection,
const MapParameter parameter,
const DoubleRectangle labelRectangle,
const LabelData label,
const QTextLayout &  textLayout 
)
protected

Use text outline for emphasize is better (QTextLayout::FormatRange::setTextOutline), but it has terribly performance. So we draw text multiple times with move, it will create similar effect.

References osmscout::LabelData::alpha, osmscout::TextStyle::emphasize, osmscout::Rectangle< T >::height, osmscout::log, osmscout::TextStyle::normal, osmscout::LabelData::style, osmscout::Log::Warn(), osmscout::Rectangle< T >::width, osmscout::Rectangle< T >::x, and osmscout::Rectangle< T >::y.

◆ DrawLabels()

◆ DrawMap()

bool osmscout::MapPainterQt::DrawMap ( const Projection projection,
const MapParameter parameter,
const MapData data,
QPainter *  painter,
RenderSteps  startStep = RenderSteps::FirstStep,
RenderSteps  endStep = RenderSteps::LastStep 
)

◆ DrawPath()

void osmscout::MapPainterQt::DrawPath ( const Projection projection,
const MapParameter parameter,
const Color color,
double  width,
const std::vector< double > &  dash,
LineStyle::CapStyle  startCap,
LineStyle::CapStyle  endCap,
const CoordBufferRange coordRange 
)
overrideprotectedvirtual

◆ DrawSymbol()

void osmscout::MapPainterQt::DrawSymbol ( const Projection projection,
const MapParameter parameter,
const Symbol symbol,
const Vertex2D screenPos,
double  scaleFactor 
)
overrideprotectedvirtual

Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate (symbol center).

Implements osmscout::MapPainter.

References osmscout::SymbolRenderer::Render().

Referenced by DrawContourSymbol().

◆ GetFontHeight()

double osmscout::MapPainterQt::GetFontHeight ( const Projection projection,
const MapParameter parameter,
double  fontSize 
)
overrideprotectedvirtual

Returns the height of the font.

Implements osmscout::MapPainter.

◆ HasIcon()

◆ HasPattern()

◆ RegisterContourLabel()

void osmscout::MapPainterQt::RegisterContourLabel ( const Projection projection,
const MapParameter parameter,
const PathLabelData label,
const LabelPath labelPath 
)
overrideprotectedvirtual

◆ RegisterRegularLabel()

void osmscout::MapPainterQt::RegisterRegularLabel ( const Projection projection,
const MapParameter parameter,
const std::vector< LabelData > &  labels,
const Vertex2D position,
double  objectWidth 
)
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().

Friends And Related Function Documentation

◆ BatchMapPainterQt

friend class BatchMapPainterQt
friend

The documentation for this class was generated from the following files: