33 Stylesheet::Stylesheet(
const shared_ptr<Geodata>& geodata,
const std::vector<shared_ptr<Rule> >& rules,
const shared_ptr<StyleTemplate>& canvasStyle)
36 , canvasStyle(canvasStyle)
42 const shared_ptr<std::vector<WayId> >& wayIDs,
43 const shared_ptr<std::vector<RelId> >& relIDs,
44 const shared_ptr<TileIdentifier>& ti,
47 for(
auto& rule :
rules)
49 rule->match(nodeIDs, wayIDs, relIDs, ti, styleMap);
54 pair.second->finish(
geodata->getNode(pair.first), shared_from_this());
59 pair.second->finish(
geodata->getWay(pair.first), shared_from_this());
64 pair.second->finish(
geodata->getRelation(pair.first), shared_from_this());
70 s->
finish(
nullptr, shared_from_this());
void finish(GeoObject *associatedObject, shared_ptr< const Stylesheet > stylesheet)
Performs finishing operations on the style, like resolve tags for texts or check for icon path existe...
TESTABLE void overmerge(GeoObject *obj, const shared_ptr< StyleTemplate > &style)
Takes all non-"null" (meaning only properties that were explicitely set) properties from the given St...
TESTABLE const boost::unordered_map< WayId, Style * > & getWayMap() const
Stylesheet(const shared_ptr< Geodata > &geodata, const std::vector< shared_ptr< Rule > > &rules, const shared_ptr< StyleTemplate > &canvasStyle)
This file is part of alaCarte.
A RenderAttributes object contains mappings from NodeIDs and WayIDs to Style objects which define how...
TESTABLE Style * getCanvasStyle()
boost::filesystem::path path
TESTABLE const boost::unordered_map< RelId, Style * > & getRelationMap() const
shared_ptr< Geodata > geodata
const std::vector< shared_ptr< Rule > > rules
TESTABLE const boost::unordered_map< NodeId, Style * > & getNodeMap() const
TESTABLE const boost::filesystem::path getPath() const
shared_ptr< StyleTemplate > canvasStyle
A Style stores the MapCSS properties for a single Node or Way, or a Relation of type multipolygon...
TESTABLE void match(const shared_ptr< std::vector< NodeId > > &nodeIDs, const shared_ptr< std::vector< WayId > > &wayIDs, const shared_ptr< std::vector< RelId > > &relIDs, const shared_ptr< TileIdentifier > &ti, RenderAttributes *styleMap) const
Returns a new RenderAttributes with a Style object for each given Node and Way.