libosmscout
0.1
|
Abstract base class of all renders (though you can always write your own renderer without inheriting from this class) It implements the general rendering algorithm. More...
#include <MapPainter.h>
Classes | |
struct | AreaData |
Data structure for holding temporary data about areas. More... | |
struct | ContourSymbolData |
struct | RouteLabelData |
Data structure for holding temporary data route labels. More... | |
class | WayData |
Data structure for holding temporary data about ways. More... | |
struct | WayPathData |
Data structure for holding temporary data about way paths (a way may consist of multiple paths/lines rendered) More... | |
Public Types | |
using | WayPathDataIt = std::list< WayPathData >::iterator |
Public Member Functions | |
bool | Draw (const Projection &projection, const MapParameter ¶meter, const MapData &data) |
bool | Draw (const Projection &projection, const MapParameter ¶meter, const MapData &data, RenderSteps startStep, RenderSteps endStep) |
MapPainter (const StyleConfigRef &styleConfig) | |
virtual | ~MapPainter () |
Protected Member Functions | |
virtual void | AfterDrawing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const MapData &data) |
virtual void | AfterPreprocessing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const MapData &data) |
Low level drawing routines that have to be implemented by the concrete drawing engine. More... | |
virtual void | BeforeDrawing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const MapData &data) |
virtual void | DrawArea (const Projection &projection, const MapParameter ¶meter, const AreaData &area)=0 |
Draw the given area using the given FillStyle for the area outline. More... | |
virtual void | DrawContourLines (const Projection &projection, const MapParameter ¶meter, const MapData &data) |
virtual void | DrawContourSymbol (const Projection &projection, const MapParameter ¶meter, const Symbol &symbol, const ContourSymbolData &data)=0 |
Draw the given Symbol on top of the contour of the given path. More... | |
virtual void | DrawGround (const Projection &projection, const MapParameter ¶meter, const FillStyle &style)=0 |
(Optionally) fills the area with the given default color for ground. More... | |
virtual void | DrawHillShading (const Projection &projection, const MapParameter ¶meter, const MapData &data) |
virtual void | DrawIcon (const IconStyle *style, const Vertex2D ¢erPos, double width, double height)=0 |
Draw the Icon as defined by the IconStyle at the given pixel coordinate (icon center). More... | |
virtual void | DrawLabels (const Projection &projection, const MapParameter ¶meter, const MapData &data)=0 |
virtual 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)=0 |
Draw simple line with the given style,the given color, the given width and the given untransformed nodes. More... | |
virtual void | DrawSymbol (const Projection &projection, const MapParameter ¶meter, const Symbol &symbol, const Vertex2D &screenPos, double scaleFactor=1.0)=0 |
Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate (symbol center). More... | |
virtual void | DrawWay (const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, const WayData &data) |
const std::list< AreaData > & | GetAreaData () const |
virtual double | GetFontHeight (const Projection &projection, const MapParameter ¶meter, double fontSize)=0 |
Returns the height of the font. More... | |
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. More... | |
const std::list< WayData > & | GetWayData () const |
virtual bool | HasIcon (const StyleConfig &styleConfig, const Projection &projection, const MapParameter ¶meter, IconStyle &style)=0 |
Return true, if the icon in the IconStyle is available and can be drawn. More... | |
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< OffsetRel > | ParseLaneTurns (const LanesFeatureValue &feature) const |
virtual void | RegisterContourLabel (const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const PathLabelData &label, const LabelPath &labelPath)=0 |
Register contour label. More... | |
virtual void | RegisterRegularLabel (const Projection &projection, const MapParameter ¶meter, const ObjectFileRef &ref, const std::vector< LabelData > &labels, const Vertex2D &position, double objectWidth)=0 |
Register regular label with given text at the given pixel coordinate in a style defined by the given LabelStyle. More... | |
Protected Attributes | |
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... | |
Abstract base class of all renders (though you can always write your own renderer without inheriting from this class) It implements the general rendering algorithm.
Concrete renders are implemented by implementing the abstract methods defined by this class and used as callbacks to the concrete renderer.
using osmscout::MapPainter::WayPathDataIt = std::list<WayPathData>::iterator |
|
explicit |
References osmscout::AfterPreprocessing, areaMarkStyle, osmscout::CalculatePaths, osmscout::CalculateWayShields, osmscout::Log::Debug(), debugLabel, osmscout::DrawAreaBorderLabels, osmscout::DrawAreaBorderSymbols, osmscout::DrawAreas, osmscout::DrawBaseMapTiles, osmscout::DrawContourLines, DrawContourLines(), osmscout::DrawGroundTiles, osmscout::DrawHillShading, DrawHillShading(), osmscout::DrawLabels, DrawLabels(), osmscout::DrawOSMTileGrids, osmscout::DrawWayContourLabels, osmscout::DrawWayDecorations, osmscout::DrawWays, osmscout::DumpStatistics, osmscout::FirstStep, osmscout::Initialize, landFill, osmscout::LastStep, osmscout::log, osmscout::TextStyle::normal, osmscout::Postrender, osmscout::PrepareAreaLabels, osmscout::PrepareNodeLabels, osmscout::PrepareRouteLabels, osmscout::Prerender, osmscout::ProcessAreas, osmscout::ProcessRoutes, seaFill, osmscout::FillStyle::SetFillColor(), and tunnelDash.
|
virtual |
References osmscout::Log::Debug(), and osmscout::log.
|
protectedvirtual |
Reimplemented in osmscout::MapPainterSVG.
|
protectedvirtual |
Low level drawing routines that have to be implemented by the concrete drawing engine.
Some optional callbacks between individual processing steps.
Reimplemented in osmscout::MapPainterSVG.
|
protectedvirtual |
Reimplemented in osmscout::MapPainterAgg, osmscout::MapPainterQt, osmscout::MapPainterCairo, and osmscout::MapPainterSVG.
bool osmscout::MapPainter::Draw | ( | const Projection & | projection, |
const MapParameter & | parameter, | ||
const MapData & | data | ||
) |
References Draw(), osmscout::FirstStep, and osmscout::LastStep.
bool osmscout::MapPainter::Draw | ( | const Projection & | projection, |
const MapParameter & | parameter, | ||
const MapData & | data, | ||
RenderSteps | startStep, | ||
RenderSteps | endStep | ||
) |
References osmscout::FirstStep, osmscout::MapParameter::IsAborted(), and osmscout::LastStep.
Referenced by Draw(), osmscout::MapPainterQt::DrawGroundTiles(), osmscout::MapPainterNoOp::DrawMap(), osmscout::MapPainterCairo::DrawMap(), osmscout::MapPainterAgg::DrawMap(), osmscout::MapPainterQt::DrawMap(), osmscout::MapPainterSVG::DrawMap(), and osmscout::BatchMapPainterQt::paint().
|
protectedpure virtual |
Draw the given area using the given FillStyle for the area outline.
Implemented in osmscout::MapPainterSVG, osmscout::MapPainterQt, osmscout::MapPainterAgg, osmscout::MapPainterCairo, and osmscout::MapPainterNoOp.
Referenced by DrawContourLines(), and DrawHillShading().
|
protectedvirtual |
References osmscout::MapPainter::AreaData::borderStyle, osmscout::MapPainter::AreaData::boundingBox, osmscout::MapPainter::WayData::buffer, osmscout::MapPainter::WayData::color, osmscout::Projection::ConvertWidthToPixel(), coordBuffer, osmscout::MapPainter::WayData::coordRange, osmscout::MapPainter::AreaData::coordRange, osmscout::CrossesElevationLine(), DrawArea(), DrawWay(), osmscout::MapPainter::WayData::endIsClosed, osmscout::GeoBox::GetBottomLeft(), osmscout::GeoBox::GetBottomRight(), osmscout::Projection::GetDimensions(), osmscout::GeoBox::GetDisplayText(), osmscout::GeoBox::GetMaxLat(), osmscout::GeoBox::GetMaxLon(), osmscout::GeoBox::GetMinLat(), osmscout::GeoBox::GetMinLon(), GetProjectedWidth(), osmscout::MapParameter::GetRenderContourLines(), osmscout::GeoBox::GetTopLeft(), osmscout::GeoBox::GetTopRight(), osmscout::Log::Info(), osmscout::GeoBox::Intersects(), osmscout::MapPainter::WayData::layer, osmscout::MapPainter::WayData::lineStyle, osmscout::MapPainter::WayData::lineWidth, osmscout::log, osmscout::SRTM::nodata, osmscout::TransPolygon::none, osmscout::MapPainter::AreaData::ref, osmscout::RoundDown(), osmscout::RoundUp(), osmscout::FeatureValueBuffer::SetType(), osmscout::MapData::srtmTile, osmscout::MapPainter::WayData::startIsClosed, styleConfig, transBuffer, osmscout::TransformBoundingBox(), osmscout::TransformWay(), osmscout::Log::Warn(), and osmscout::MapPainter::WayData::wayPriority.
Referenced by MapPainter().
|
protectedpure virtual |
Draw the given Symbol on top of the contour of the given path.
Implemented in osmscout::MapPainterSVG, osmscout::MapPainterQt, osmscout::MapPainterAgg, osmscout::MapPainterCairo, and osmscout::MapPainterNoOp.
|
protectedpure virtual |
(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.
Implemented in osmscout::MapPainterSVG, osmscout::MapPainterQt, osmscout::MapPainterAgg, osmscout::MapPainterCairo, and osmscout::MapPainterNoOp.
|
protectedvirtual |
References osmscout::LabelData::alpha, osmscout::MapPainter::AreaData::boundingBox, coordBuffer, osmscout::MapPainter::AreaData::coordRange, DrawArea(), osmscout::MapPainter::AreaData::fillStyle, osmscout::LabelData::fontSize, osmscout::Projection::GeoToPixel(), osmscout::GeoBox::GetCenter(), osmscout::Projection::GetDimensions(), osmscout::GeoBox::GetDisplayText(), osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), osmscout::GeoBox::GetMaxLat(), osmscout::GeoBox::GetMaxLon(), osmscout::GeoBox::GetMinLat(), osmscout::GeoBox::GetMinLon(), osmscout::MapParameter::GetRenderHillShading(), osmscout::Log::Info(), osmscout::GeoBox::Intersects(), osmscout::log, osmscout::TransPolygon::none, osmscout::LabelData::priority, osmscout::MapPainter::AreaData::ref, RegisterRegularLabel(), osmscout::RoundDown(), osmscout::RoundUp(), osmscout::FeatureValueBuffer::SetType(), osmscout::MapData::srtmTile, osmscout::LabelData::style, styleConfig, osmscout::LabelData::text, transBuffer, osmscout::TransformBoundingBox(), and osmscout::Log::Warn().
Referenced by MapPainter().
|
protectedpure virtual |
Draw the Icon as defined by the IconStyle at the given pixel coordinate (icon center).
Implemented in osmscout::MapPainterQt, osmscout::MapPainterSVG, osmscout::MapPainterCairo, osmscout::MapPainterAgg, and osmscout::MapPainterNoOp.
|
protectedpure virtual |
Implemented in osmscout::MapPainterQt, osmscout::MapPainterSVG, osmscout::MapPainterAgg, osmscout::MapPainterCairo, and osmscout::MapPainterNoOp.
Referenced by MapPainter().
|
protectedpure virtual |
Draw simple line with the given style,the given color, the given width and the given untransformed nodes.
Implemented in osmscout::MapPainterQt, osmscout::MapPainterSVG, osmscout::MapPainterCairo, osmscout::MapPainterAgg, and osmscout::MapPainterNoOp.
Referenced by DrawWay().
|
protectedpure virtual |
Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate (symbol center).
Implemented in osmscout::MapPainterQt, osmscout::MapPainterCairo, osmscout::MapPainterAgg, osmscout::MapPainterNoOp, and osmscout::MapPainterSVG.
|
protectedvirtual |
Reimplemented in osmscout::MapPainterSVG.
References osmscout::MapPainter::WayData::color, osmscout::MapPainter::WayData::coordRange, DrawPath(), emptyDash, osmscout::MapPainter::WayData::endIsClosed, osmscout::MapPainter::WayData::lineStyle, osmscout::MapPainter::WayData::lineWidth, and osmscout::MapPainter::WayData::startIsClosed.
Referenced by DrawContourLines().
|
inlineprotected |
Referenced by osmscout::MapPainterSVG::AfterPreprocessing().
|
protectedpure virtual |
Returns the height of the font.
Implemented in osmscout::MapPainterSVG, osmscout::MapPainterQt, osmscout::MapPainterAgg, osmscout::MapPainterCairo, and osmscout::MapPainterNoOp.
|
protected |
References osmscout::Projection::GetPixelSize().
Referenced by osmscout::MapPainterSVG::AfterPreprocessing(), and DrawContourLines().
|
inlineprotected |
References osmscout::Projection::GetPixelSize().
|
protectedvirtual |
Compute suggested label width for given parameters.
It may be used by backend for layout labels with wrapping words.
References osmscout::MapParameter::GetLabelLineFitToArea(), osmscout::MapParameter::GetLabelLineFitToWidth(), osmscout::MapParameter::GetLabelLineMaxCharCount(), and osmscout::MapParameter::GetLabelLineMinCharCount().
|
inlineprotected |
Referenced by osmscout::MapPainterSVG::AfterPreprocessing().
|
protectedpure virtual |
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.
Implemented in osmscout::MapPainterSVG, osmscout::MapPainterQt, osmscout::MapPainterAgg, osmscout::MapPainterCairo, and osmscout::MapPainterNoOp.
|
protected |
Useful global helper functions.
References osmscout::Projection::BoundingBoxToPixel(), osmscout::ScreenBox::GetHeight(), osmscout::Projection::GetScreenBox(), osmscout::ScreenBox::GetWidth(), osmscout::ScreenBox::Intersects(), osmscout::GeoBox::IsValid(), and osmscout::ScreenBox::Resize().
|
protected |
|
protected |
References osmscout::base, osmscout::LanesFeatureValue::GetBackwardLanes(), osmscout::LanesFeatureValue::GetForwardLanes(), osmscout::LanesFeatureValue::GetLanes(), osmscout::LanesFeatureValue::GetTurnBackward(), osmscout::LanesFeatureValue::GetTurnForward(), osmscout::ParseBackwardTurnStringToOffset(), and osmscout::ParseForwardTurnStringToOffset().
|
protectedpure virtual |
Register contour label.
Implemented in osmscout::MapPainterQt, osmscout::MapPainterSVG, osmscout::MapPainterAgg, osmscout::MapPainterCairo, and osmscout::MapPainterNoOp.
|
protectedpure virtual |
Register regular label with given text at the given pixel coordinate in a style defined by the given LabelStyle.
Implemented in osmscout::MapPainterQt, osmscout::MapPainterSVG, osmscout::MapPainterAgg, osmscout::MapPainterCairo, and osmscout::MapPainterNoOp.
Referenced by DrawHillShading().
|
protected |
Value reader for the 'lanes' feature.
|
protected |
Value reader for the 'address' feature.
|
protected |
Marker fill style for internal debugging.
Referenced by MapPainter().
|
protected |
|
protected |
Value reader for the 'color' feature.
|
protected |
Same value as in MapParameter but converted to pixel.
|
protected |
Same value as in MapParameter but converted to pixel.
|
protected |
Coordinate buffer.
Referenced by osmscout::MapPainterAgg::DrawArea(), osmscout::MapPainterSVG::DrawArea(), DrawContourLines(), DrawHillShading(), osmscout::MapPainterAgg::DrawPath(), and osmscout::MapPainterSVG::DrawPath().
|
protected |
Referenced by MapPainter().
|
protected |
Presets, precalculations and similar.
Empty dash array
Referenced by osmscout::MapPainterSVG::DrawWay(), and DrawWay().
|
protected |
Fallback styles in case they are missing for the style sheet.
Referenced by osmscout::MapPainterSVG::AfterPreprocessing(), and MapPainter().
|
protected |
Value reader for the 'lanes' feature.
|
protected |
Value reader for the 'layer' feature.
|
protected |
Value reader for the 'alternative name' feature.
|
protected |
Attribute readers.
Value reader for the 'name' feature
|
protected |
Value reader for the 'ref' feature.
|
protected |
Referenced by osmscout::MapPainterSVG::AfterPreprocessing(), and MapPainter().
|
protected |
Width of a cell for shield label placement.
|
protected |
Height of a cell for shield label placement.
|
protected |
Reference to the style configuration to be used.
Referenced by osmscout::MapPainterSVG::AfterPreprocessing(), DrawContourLines(), DrawHillShading(), and osmscout::MapPainterSVG::DrawMap().
|
protected |
Internal coordinate transformation data structures.
Internal buffer for coordinate transformation from geo coordinates to display coordinates
Referenced by DrawContourLines(), and DrawHillShading().
|
protected |
Dash array for drawing tunnel border.
Referenced by MapPainter().
|
protected |
Value reader for the 'width' feature.