23 #include <boost/unordered_map.hpp> 40 const cairo_matrix_t* transform)
42 , relation(data->getRelation(rid))
66 const std::vector<NodeId>& nodeIDs =
data->getWay(ids[i])->getNodeIDs();
69 if (i == idx || nodeIDs.front() == lastNode)
71 else if (nodeIDs.back() == lastNode)
76 paintLine(cr, nodeIDs, reverse, i != idx);
79 startNode = nodeIDs.front();
82 lastNode = nodeIDs.front();
84 lastNode = nodeIDs.back();
86 closed = (startNode == lastNode);
89 }
while (++i < ids.size() && !closed);
104 bool* used =
new bool[n]();
106 for (
int i = 0; i < n; i++)
109 cairo_new_sub_path(cr);
114 cairo_push_group(cr);
116 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
119 cairo_pattern_t* pattern = cairo_pattern_create_for_surface(cache.
getImage(bg));
120 cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT);
121 cairo_set_source(cr, pattern);
123 cairo_pattern_destroy(pattern);
129 cairo_pop_group_to_source(cr);
void fill(cairo_t *cr, AssetCache &cache)
const string & str() const
Returns the internal string.
MaybeCachedString fill_image
const shared_ptr< Geodata > & data
TESTABLE const std::vector< WayId > & getWayIDs() const
A Style stores the MapCSS properties for a single Node or Way, or a Relation of type multipolygon...
void addRingPath(cairo_t *cr, const std::vector< WayId > &ids, int &idx, bool *used)
tries to paint a ring starting at ids[idx].
void paintLine(cairo_t *cr, const std::vector< NodeId > &nodeIDs, bool reverse=false, bool connect=false) const
This file is part of alaCarte.
cairo_surface_t * getImage(string path)
RelationRenderer(const shared_ptr< Geodata > &data, RelId rid, const Style *s, const cairo_matrix_t *transform)
This file is part of alaCarte.