alaCarte Maps
Renderer for OpenStreetMap tiles
rule.hpp
Go to the documentation of this file.
1 
21 #pragma once
22 #ifndef RULE_HPP
23 #define RULE_HPP
24 
25 #include "settings.hpp"
26 class Selector;
27 class Geodata;
28 class Style;
29 class RenderAttributes;
30 class TileIdentifier;
31 class ApplySelector;
32 class StyleTemplate;
33 
34 class Rule {
35  friend struct MapCssParser;
36 
37 public:
39  {
40  Accept_Node = 0x1,
41  Accept_Way = 0x2,
44  };
45 
46 private:
47  const shared_ptr<Geodata> geodata;
48  shared_ptr<Selector> first;
49  shared_ptr<StyleTemplate> styleTemplate;
52 
53 public:
54  Rule(const shared_ptr<Geodata>& geodata);
55 
59  TESTABLE void match(const shared_ptr<std::vector<NodeId> >& nodeIDs,
60  const shared_ptr<std::vector<WayId> >& wayIDs,
61  const shared_ptr<std::vector<RelId> >& relIDs,
62  const shared_ptr<TileIdentifier>& ti,
63  RenderAttributes* renderAttributes) const;
64 
65  TESTABLE const shared_ptr<Geodata>& getGeodata() const;
66 
70  TESTABLE const shared_ptr<StyleTemplate>& getStyleTemplate() const;
71 
75  TESTABLE void setStyleTemplate(const shared_ptr<StyleTemplate>& styleTemplate);
76 
80  TESTABLE void setFirstSelector(const shared_ptr<Selector>& first);
81 
85  TESTABLE void setZoomBounds(int bottom, int top);
86 
91 };
92 
93 #endif
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 *renderAttributes) const
Definition: rule.cpp:41
AcceptableTypes accepableType
Definition: rule.hpp:51
int zoombottom
Definition: rule.hpp:50
A StyleTemplate is the "raw" / "unevaluated" form of a Style specified by a single MapCSS rule...
A RenderAttributes object contains mappings from NodeIDs and WayIDs to Style objects which define how...
TESTABLE const shared_ptr< StyleTemplate > & getStyleTemplate() const
Definition: rule.cpp:73
Definition: rule.hpp:34
A TileIdentifier identifies a Tile.
shared_ptr< StyleTemplate > styleTemplate
Definition: rule.hpp:49
TESTABLE void setFirstSelector(const shared_ptr< Selector > &first)
what is the first selector in the selector chain for this rule?
Definition: rule.cpp:81
TESTABLE const shared_ptr< Geodata > & getGeodata() const
Definition: rule.cpp:69
TESTABLE void setZoomBounds(int bottom, int top)
from which to which zoom level does this rule apply?
Definition: rule.cpp:85
TESTABLE void setAcceptableType(AcceptableTypes type)
what types of GeoObjects does this rule accept in the first selector?
Definition: rule.cpp:90
shared_ptr< Selector > first
Definition: rule.hpp:48
A Style stores the MapCSS properties for a single Node or Way, or a Relation of type multipolygon...
Definition: style.hpp:35
TESTABLE void setStyleTemplate(const shared_ptr< StyleTemplate > &styleTemplate)
sets the StyleTemplate representation of the attributes specified in the MapCSS file for this rule...
Definition: rule.cpp:77
const shared_ptr< Geodata > geodata
Definition: rule.hpp:47
#define TESTABLE
Definition: settings.hpp:85
Rule(const shared_ptr< Geodata > &geodata)
This file is part of alaCarte.
Definition: rule.cpp:33
int zoomtop
Definition: rule.hpp:50
AcceptableTypes
Definition: rule.hpp:38