32 #include <boost/unordered_map.hpp> 33 #include <boost/math/constants/constants.hpp> 47 const cairo_matrix_t* transform)
49 , node(data->getNode(nid))
91 std::list<shared_ptr<Label> >& labels,
102 cairo_select_font_face(cr,
108 cairo_text_extents_t textSize;
109 cairo_text_extents(cr,
s->
text.
c_str(), &textSize);
117 std::list<shared_ptr<Shield> >& shields,
128 cairo_select_font_face(cr,
134 cairo_text_extents_t textSize;
151 double surface_width = cairo_image_surface_get_width(image);
152 double surface_height = cairo_image_surface_get_height(image);
155 double x0 = floor(
location.
x - width/2.0);
156 double y0 = floor(
location.
y - height/2.0);
157 cairo_translate(cr, x0, y0);
158 cairo_scale(cr, width / surface_width,
159 height / surface_height);
160 cairo_set_source_surface(cr, image, 0, 0);
MaybeCachedString shield_text
basic_rect< double > FloatRect
void icon(cairo_t *cr, AssetCache &cache)
const string & str() const
Returns the internal string.
void label(cairo_t *cr, std::list< shared_ptr< Label > > &labels, AssetCache &cache)
NodeRenderer(const shared_ptr< Geodata > &data, NodeId nid, const Style *s, const cairo_matrix_t *transform)
This file is part of alaCarte.
MaybeCachedString font_family
A Style stores the MapCSS properties for a single Node or Way, or a Relation of type multipolygon...
TESTABLE const FixedPoint & getLocation() const
FloatRect bounds
is set by addWayPath for ways or in transformLocation for nodes
MaybeCachedString icon_image
basic_vector2< double > FloatPoint
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.
cairo_surface_t * getImage(string path)
const char * c_str() const
Returns the internal c string.
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.
void shield(cairo_t *cr, std::list< shared_ptr< Shield > > &shields, AssetCache &cache)