alaCarte Maps
Renderer for OpenStreetMap tiles
Go to the documentation of this file.
21 #pragma once
22 #ifndef RULE_HPP
23 #define RULE_HPP
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;
34 class Rule {
35  friend struct MapCssParser;
37 public:
39  {
40  Accept_Node = 0x1,
41  Accept_Way = 0x2,
44  };
46 private:
47  const shared_ptr<Geodata> geodata;
48  shared_ptr<Selector> first;
49  shared_ptr<StyleTemplate> styleTemplate;
53 public:
54  Rule(const shared_ptr<Geodata>& geodata);
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;
65  TESTABLE const shared_ptr<Geodata>& getGeodata() const;
70  TESTABLE const shared_ptr<StyleTemplate>& getStyleTemplate() const;
75  TESTABLE void setStyleTemplate(const shared_ptr<StyleTemplate>& styleTemplate);
80  TESTABLE void setFirstSelector(const shared_ptr<Selector>& first);
85  TESTABLE void setZoomBounds(int bottom, int top);
91 };
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
Definition: rule.hpp:38