libosmscout  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
osmscout::MapPainterIOS Class Reference

#include <MapPainterIOS.h>

+ Inheritance diagram for osmscout::MapPainterIOS:

Public Member Functions

bool DrawMap (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data, CGContextRef paintCG)
 
 MapPainterIOS (const StyleConfigRef &styleConfig)
 
virtual ~MapPainterIOS ()
 
- Public Member Functions inherited from osmscout::MapPainter
 MapPainter (const StyleConfigRef &styleConfig, CoordBuffer *buffer)
 
virtual ~MapPainter ()
 

Protected Member Functions

void DrawArea (const Projection &projection, const MapParameter &parameter, const AreaData &area)
 Draw the given area using the given FillStyle for the area outline. More...
 
void DrawContourLabel (const Projection &projection, const MapParameter &parameter, const PathTextStyle &style, const std::string &text, size_t transStart, size_t transEnd)
 Draw the given text as a contour of the given path in a style defined by the given LabelStyle. More...
 
void DrawContourSymbol (const Projection &projection, const MapParameter &parameter, const Symbol &symbol, double space, size_t transStart, size_t transEnd)
 Draw the given text as a contour of the given path in a style defined by the given LabelStyle. More...
 
void DrawGround (const Projection &projection, const MapParameter &parameter, const FillStyle &style)
 (Optionally) fills the area with the given default color for ground. More...
 
void DrawIcon (const IconStyle *style, double x, double y)
 Draw the Icon as defined by the IconStyle at the given pixel coordinate. More...
 
void DrawLabel (const Projection &projection, const MapParameter &parameter, const LabelData &label)
 Draw the given text at the given pixel coordinate in a style defined by the given LabelStyle. More...
 
void DrawPath (const Projection &projection, const MapParameter &parameter, const Color &color, double width, const std::vector< double > &dash, LineStyle::CapStyle startCap, LineStyle::CapStyle endCap, size_t transStart, size_t transEnd)
 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, double x, double y)
 Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate. More...
 
void GetFontHeight (const Projection &projection, const MapParameter &parameter, double fontSize, double &height)
 Returns the height of the font. More...
 
void GetTextDimension (const Projection &projection, const MapParameter &parameter, double objectWidth, double fontSize, const std::string &text, double &xOff, double &yOff, double &width, double &height)
 Return the bounding box of the given text. More...
 
bool HasIcon (const StyleConfig &styleConfig, const MapParameter &parameter, IconStyle &style)
 Return true, if the icon in the IconStyle is available and can be drawn. More...
 
bool HasPattern (const MapParameter &parameter, const FillStyle &style)
 
void SetBorder (const Projection &projection, const MapParameter &parameter, const BorderStyle &borderStyle)
 
void SetFill (const Projection &projection, const MapParameter &parameter, const FillStyle &fillStyle, CGFloat xOffset=0.0, CGFloat yOffset=0.0)
 
void SetPen (const LineStyle &style, double lineWidth)
 
double textHeight (const Projection &projection, const MapParameter &parameter, double fontSize, std::string text)
 
double textLength (const Projection &projection, const MapParameter &parameter, double fontSize, std::string text)
 
- Protected Member Functions inherited from osmscout::MapPainter
const std::list< AreaData > & GetAreaData () const
 
const std::list< WayData > & GetWayData () const
 
virtual double proposedLabelWidth (const MapParameter &parameter, double averageCharWidth, double objectWidth, size_t stringLength)
 Compute suggested label width for given parameters. More...
 
bool IsVisibleArea (const Projection &projection, const GeoBox &boundingBox, double pixelOffset) const
 Useful global helper functions. More...
 
bool IsVisibleWay (const Projection &projection, const std::vector< Point > &nodes, double pixelOffset) const
 
void Transform (const Projection &projection, const MapParameter &parameter, const GeoCoord &coord, double &x, double &y)
 
double GetProjectedWidth (const Projection &projection, double minPixel, double width) const
 
double GetProjectedWidth (const Projection &projection, double width) const
 
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 BeforeDrawing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void AfterDrawing (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data)
 
virtual void DrawNodes (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const MapData &data)
 Med level drawing routines that are already implemented by the base class, but which can be overwritten by the driver if necessary. More...
 
virtual void DrawNode (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const NodeRef &node)
 
virtual void DrawWay (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter, const WayData &data)
 
virtual void DrawWays (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter)
 
virtual void DrawAreas (const StyleConfig &styleConfig, const Projection &projection, const MapParameter &parameter)
 
bool Draw (const Projection &projection, const MapParameter &parameter, const MapData &data)
 

Additional Inherited Members

- Protected Attributes inherited from osmscout::MapPainter
StyleConfigRef styleConfig
 Reference to the style configuration to be used. More...
 
TransBuffer transBuffer
 Scratch variables for path optimization algorithm. More...
 
NameFeatureValueReader nameReader
 Attribute readers. More...
 
NameAltFeatureValueReader nameAltReader
 Value reader for the 'alternative name' feature. More...
 
RefFeatureValueReader refReader
 Value reader for the 'ref' feature. More...
 
LayerFeatureValueReader layerReader
 Value reader for the 'layer' feature. More...
 
WidthFeatureValueReader widthReader
 Value reader for the 'width' feature. More...
 
AddressFeatureValueReader addressReader
 Value reader for the 'address' feature. More...
 
std::vector< double > emptyDash
 Presets, precalculations and similar. More...
 
std::vector< double > tunnelDash
 Dash array for drawing tunnel border. More...
 
FillStyle areaMarkStyle
 Marker fill style for internal debugging. 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...
 
double shieldGridSizeHoriz
 Width of a cell for shield label placement. More...
 
double shieldGridSizeVert
 Height of a cell for shield label placement. More...
 

Constructor & Destructor Documentation

osmscout::MapPainterIOS::MapPainterIOS ( const StyleConfigRef styleConfig)
virtual osmscout::MapPainterIOS::~MapPainterIOS ( )
virtual

Member Function Documentation

void osmscout::MapPainterIOS::DrawArea ( const Projection projection,
const MapParameter parameter,
const AreaData area 
)
protectedvirtual

Draw the given area using the given FillStyle for the area outline.

Implements osmscout::MapPainter.

void osmscout::MapPainterIOS::DrawContourLabel ( const Projection projection,
const MapParameter parameter,
const PathTextStyle style,
const std::string &  text,
size_t  transStart,
size_t  transEnd 
)
protectedvirtual

Draw the given text as a contour of the given path in a style defined by the given LabelStyle.

Implements osmscout::MapPainter.

void osmscout::MapPainterIOS::DrawContourSymbol ( const Projection projection,
const MapParameter parameter,
const Symbol symbol,
double  space,
size_t  transStart,
size_t  transEnd 
)
protectedvirtual

Draw the given text as a contour of the given path in a style defined by the given LabelStyle.

Implements osmscout::MapPainter.

void osmscout::MapPainterIOS::DrawGround ( const Projection projection,
const MapParameter parameter,
const FillStyle style 
)
protectedvirtual

(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.

void osmscout::MapPainterIOS::DrawIcon ( const IconStyle style,
double  x,
double  y 
)
protectedvirtual

Draw the Icon as defined by the IconStyle at the given pixel coordinate.

Implements osmscout::MapPainter.

void osmscout::MapPainterIOS::DrawLabel ( const Projection projection,
const MapParameter parameter,
const LabelData label 
)
protectedvirtual

Draw the given text at the given pixel coordinate in a style defined by the given LabelStyle.

Implements osmscout::MapPainter.

bool osmscout::MapPainterIOS::DrawMap ( const StyleConfig styleConfig,
const Projection projection,
const MapParameter parameter,
const MapData &  data,
CGContextRef  paintCG 
)
void osmscout::MapPainterIOS::DrawPath ( const Projection projection,
const MapParameter parameter,
const Color color,
double  width,
const std::vector< double > &  dash,
LineStyle::CapStyle  startCap,
LineStyle::CapStyle  endCap,
size_t  transStart,
size_t  transEnd 
)
protectedvirtual

Draw simple line with the given style,the given color, the given width and the given untransformed nodes.

Implements osmscout::MapPainter.

void osmscout::MapPainterIOS::DrawSymbol ( const Projection projection,
const MapParameter parameter,
const Symbol symbol,
double  x,
double  y 
)
protectedvirtual

Draw the Symbol as defined by the SymbolStyle at the given pixel coordinate.

Implements osmscout::MapPainter.

void osmscout::MapPainterIOS::GetFontHeight ( const Projection projection,
const MapParameter parameter,
double  fontSize,
double &  height 
)
protectedvirtual

Returns the height of the font.

Implements osmscout::MapPainter.

void osmscout::MapPainterIOS::GetTextDimension ( const Projection projection,
const MapParameter parameter,
double  objectWidth,
double  fontSize,
const std::string &  text,
double &  xOff,
double &  yOff,
double &  width,
double &  height 
)
protectedvirtual

Return the bounding box of the given text.

The method is call every time a label for a node or an area has to be drawn (which means "not for contour labels").

The backend may decide to relayout the given text, however it must assure that later calls to corresponding DrawXXX methods will honour the initial bounding box.

Implements osmscout::MapPainter.

bool osmscout::MapPainterIOS::HasIcon ( const StyleConfig styleConfig,
const MapParameter parameter,
IconStyle style 
)
protectedvirtual

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.

Implements osmscout::MapPainter.

bool osmscout::MapPainterIOS::HasPattern ( const MapParameter parameter,
const FillStyle style 
)
protected
void osmscout::MapPainterIOS::SetBorder ( const Projection projection,
const MapParameter parameter,
const BorderStyle borderStyle 
)
protected
void osmscout::MapPainterIOS::SetFill ( const Projection projection,
const MapParameter parameter,
const FillStyle fillStyle,
CGFloat  xOffset = 0.0,
CGFloat  yOffset = 0.0 
)
protected
void osmscout::MapPainterIOS::SetPen ( const LineStyle style,
double  lineWidth 
)
protected
double osmscout::MapPainterIOS::textHeight ( const Projection projection,
const MapParameter parameter,
double  fontSize,
std::string  text 
)
protected
double osmscout::MapPainterIOS::textLength ( const Projection projection,
const MapParameter parameter,
double  fontSize,
std::string  text 
)
protected

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