KOSMIndoorMap

mapcssstyle.cpp
1 /*
2  SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "mapcssstyle.h"
8 #include "mapcssstyle_p.h"
9 #include "mapcssparser.h"
10 #include "mapcssresult_p.h"
11 #include "mapcssrule_p.h"
12 #include "mapcssstate_p.h"
13 
14 #include <QDebug>
15 #include <QIODevice>
16 
17 using namespace KOSMIndoorMap;
18 
20  : d(new MapCSSStylePrivate)
21 {}
22 
24 MapCSSStyle::~MapCSSStyle() = default;
25 MapCSSStyle& MapCSSStyle::operator=(MapCSSStyle&&) = default;
26 
27 void MapCSSStyle::compile(const OSM::DataSet &dataSet)
28 {
29  for (const auto &rule : d->m_rules) {
30  rule->compile(dataSet);
31  }
32 }
33 
34 void MapCSSStyle::evaluate(const MapCSSState &state, MapCSSResult &result) const
35 {
36  result.clear();
37  for (const auto &rule : d->m_rules) {
38  rule->evaluate(state, result);
39  }
40 }
41 
42 void MapCSSStyle::evaluateCanvas(const MapCSSState &state, MapCSSResult &result) const
43 {
44  result.clear();
45  for (const auto &rule : d->m_rules) {
46  rule->evaluateCanvas(state, result);
47  }
48 }
49 
50 void MapCSSStyle::write(QIODevice *out) const
51 {
52  for (const auto &rule : d->m_rules) {
53  rule->write(out);
54  }
55 }
OSM-based multi-floor indoor maps for buildings.
A parsed MapCSS style sheet.
Definition: mapcssstyle.h:29
void compile(const OSM::DataSet &dataSet)
Optimizes style sheet rules for application against dataSet.
Definition: mapcssstyle.cpp:27
void evaluateCanvas(const MapCSSState &state, MapCSSResult &result) const
Evaluate canvas style rules.
Definition: mapcssstyle.cpp:42
void evaluate(const MapCSSState &state, MapCSSResult &result) const
Evaluates the style sheet for a given state state (OSM element, view state, element state...
Definition: mapcssstyle.cpp:34
A set of nodes, ways and relations.
Definition: datatypes.h:283
MapCSSStyle()
Creates an invalid/empty style.
Definition: mapcssstyle.cpp:19
void write(QIODevice *out) const
Write this style as MapCSS to out.
Definition: mapcssstyle.cpp:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 25 2021 23:04:00 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.