alaCarte Maps
Renderer for OpenStreetMap tiles
childnodes_selector.cpp
Go to the documentation of this file.
1 
24 #include "server/rule.hpp"
25 #include "general/geodata.hpp"
26 #include "general/node.hpp"
27 #include "general/way.hpp"
28 #include "general/relation.hpp"
30 
31 ChildNodesSelector::ChildNodesSelector(const shared_ptr<Rule>& rule, const shared_ptr<Selector>& next) : Selector(rule, next)
32 {
33 }
34 
35 void ChildNodesSelector::matchNode(NodeId nodeID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
36 }
37 
38 void ChildNodesSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
39  for (NodeId nodeID : geodata->getWay(wayID)->getNodeIDs()) {
40  next->matchNode(nodeID, ti, attributes);
41  }
42 }
43 
44 void ChildNodesSelector::matchRelation(RelId relID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
45  for (NodeId nodeID : geodata->getRelation(relID)->getNodeIDs()) {
46  next->matchNode(nodeID, ti, attributes);
47  }
48 }
virtual void matchRelation(RelId relID, const shared_ptr< TileIdentifier > &ti, RenderAttributes *attributes) const
A RenderAttributes object contains mappings from NodeIDs and WayIDs to Style objects which define how...
const shared_ptr< Selector > next
Definition: selector.hpp:54
virtual void matchWay(WayId wayID, const shared_ptr< TileIdentifier > &ti, RenderAttributes *attributes) const
const shared_ptr< Geodata > geodata
Definition: selector.hpp:55
ChildNodesSelector(const shared_ptr< Rule > &rule, const shared_ptr< Selector > &next)
This file is part of alaCarte.
virtual void matchNode(NodeId nodeID, const shared_ptr< TileIdentifier > &ti, RenderAttributes *attributes) const