alaCarte Maps
Renderer for OpenStreetMap tiles
object_renderer.hpp
Go to the documentation of this file.
1 
21 #ifndef OBJECT_RENDERER_HPP
22 #define OBJECT_RENDERER_HPP
23 /*
24  * =====================================================================================
25  *
26  * Filename: way_renderer.hpp
27  *
28  * Description: Wrapper for way rendering operations.
29  *
30  * =====================================================================================
31  */
32 #include "settings.hpp"
33 
34 #include <cairo.h>
35 
36 class Geodata;
37 class Label;
38 class Shield;
39 
41 {
42 protected:
43  const shared_ptr<Geodata>& data;
44  const cairo_matrix_t* transform;
45  const Style* s;
48 
49  void paintLine(cairo_t* cr, const std::vector<NodeId>& nodeIDs, bool reverse=false, bool connect=false) const;
50  void addShield(std::list<shared_ptr<Shield> >& shields,
51  const FloatPoint& p,
52  const cairo_text_extents_t* textSize) const;
53  void addLabel(std::list<shared_ptr<Label> >& labels,
54  const FloatPoint& p,
55  const cairo_text_extents_t* textSize) const;
56 
57 public:
58  ObjectRenderer(const shared_ptr<Geodata>& data,
59  const Style* s,
60  const cairo_matrix_t* transform);
61 
62 };
63 
64 #endif
const cairo_matrix_t * transform
const shared_ptr< Geodata > & data
Stores bounding box and style of a label that needs to be placed.
A Style stores the MapCSS properties for a single Node or Way, or a Relation of type multipolygon...
Definition: style.hpp:35
FloatRect bounds
is set by addWayPath for ways or in transformLocation for nodes
void paintLine(cairo_t *cr, const std::vector< NodeId > &nodeIDs, bool reverse=false, bool connect=false) const
This file is part of alaCarte.
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.
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.
ObjectRenderer(const shared_ptr< Geodata > &data, const Style *s, const cairo_matrix_t *transform)
const Style * s