alaCarte Maps
Renderer for OpenStreetMap tiles
WayRenderer Class Reference

#include <way_renderer.hpp>

Inheritance diagram for WayRenderer:
ObjectRenderer

Public Member Functions

 WayRenderer (const shared_ptr< Geodata > &data, WayId wid, const Style *s, const cairo_matrix_t *transform)
 
virtual ~WayRenderer ()
 
void fill (cairo_t *cr, AssetCache &cache)
 
void casing (cairo_t *cr)
 
void stroke (cairo_t *cr, AssetCache &cache)
 
void label (cairo_t *cr, std::list< shared_ptr< Label > > &labels, AssetCache &cache)
 
void shield (cairo_t *cr, std::list< shared_ptr< Shield > > &shields, AssetCache &cache)
 
- Public Member Functions inherited from ObjectRenderer
 ObjectRenderer (const shared_ptr< Geodata > &data, const Style *s, const cairo_matrix_t *transform)
 

Private Member Functions

void addWayPath (cairo_t *cr)
 This file is part of alaCarte. More...
 
void setLineCap (cairo_t *cr, Style::LineCap cap)
 
void setLineJoin (cairo_t *cr, Style::LineJoin join)
 
bool getTextPosition (cairo_path_t *transformedPath, int width, FloatPoint &best, double &angle)
 Find the best fitting segment on a cairo path and return angle. More...
 
void getShieldPosition (cairo_path_t *transformedPath, std::list< FloatPoint > &positions)
 Find the best fitting segment on a cairo path for a shield. More...
 

Private Attributes

cairo_path_t * path
 
Wayway
 

Additional Inherited Members

- Protected Member Functions inherited from ObjectRenderer
void paintLine (cairo_t *cr, const std::vector< NodeId > &nodeIDs, bool reverse=false, bool connect=false) const
 This file is part of alaCarte. More...
 
void addShield (std::list< shared_ptr< Shield > > &shields, const FloatPoint &p, const cairo_text_extents_t *textSize) const
 used by node and way renderer to place a shield. More...
 
void addLabel (std::list< shared_ptr< Label > > &labels, const FloatPoint &p, const cairo_text_extents_t *textSize) const
 used by node and way renderer to place a shield. More...
 
- Protected Attributes inherited from ObjectRenderer
const shared_ptr< Geodata > & data
 
const cairo_matrix_t * transform
 
const Styles
 
FloatRect bounds
 is set by addWayPath for ways or in transformLocation for nodes More...
 

Detailed Description

Definition at line 45 of file way_renderer.hpp.

Constructor & Destructor Documentation

WayRenderer::WayRenderer ( const shared_ptr< Geodata > &  data,
WayId  wid,
const Style s,
const cairo_matrix_t *  transform 
)

Definition at line 144 of file way_renderer.cpp.

WayRenderer::~WayRenderer ( )
virtual

Definition at line 154 of file way_renderer.cpp.

Member Function Documentation

void WayRenderer::addWayPath ( cairo_t *  cr)
private

This file is part of alaCarte.

alaCarte is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

alaCarte is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with alaCarte. If not, see http://www.gnu.org/licenses/.

Copyright alaCarte 2012-2013 Simon Dreher, Florian Jacob, Tobias Kahlert, Patrick Niklaus, Bernhard Scheirle, Lisa Winter Maintainer: Patrick Niklaus Adds the path of the given way to current path, if path is not set it creates it form the data

Parameters
crthe cairo contetx to add the path to

Definition at line 41 of file way_renderer.cpp.

void WayRenderer::casing ( cairo_t *  cr)

Definition at line 184 of file way_renderer.cpp.

void WayRenderer::fill ( cairo_t *  cr,
AssetCache cache 
)

Definition at line 160 of file way_renderer.cpp.

void WayRenderer::getShieldPosition ( cairo_path_t *  transformedPath,
std::list< FloatPoint > &  positions 
)
private

Find the best fitting segment on a cairo path for a shield.

Definition at line 108 of file way_renderer.cpp.

bool WayRenderer::getTextPosition ( cairo_path_t *  transformedPath,
int  width,
FloatPoint best,
double &  angle 
)
private

Find the best fitting segment on a cairo path and return angle.

Definition at line 60 of file way_renderer.cpp.

void WayRenderer::label ( cairo_t *  cr,
std::list< shared_ptr< Label > > &  labels,
AssetCache cache 
)

Definition at line 238 of file way_renderer.cpp.

void WayRenderer::setLineCap ( cairo_t *  cr,
Style::LineCap  cap 
)
inlineprivate

Definition at line 52 of file way_renderer.hpp.

void WayRenderer::setLineJoin ( cairo_t *  cr,
Style::LineJoin  join 
)
inlineprivate

Definition at line 66 of file way_renderer.hpp.

void WayRenderer::shield ( cairo_t *  cr,
std::list< shared_ptr< Shield > > &  shields,
AssetCache cache 
)

Definition at line 297 of file way_renderer.cpp.

void WayRenderer::stroke ( cairo_t *  cr,
AssetCache cache 
)

Definition at line 206 of file way_renderer.cpp.

Member Data Documentation

cairo_path_t* WayRenderer::path
private

Definition at line 48 of file way_renderer.hpp.

Way* WayRenderer::way
private

Definition at line 49 of file way_renderer.hpp.


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