7#include "mapcssrule_p.h"
8#include "mapcssresult.h"
9#include "mapcssstate_p.h"
18MapCSSRule::MapCSSRule() =
default;
19MapCSSRule::~MapCSSRule() =
default;
23 m_selector->compile(dataSet);
24 for (
const auto &decl : m_declarations) {
25 decl->compile(dataSet);
29void MapCSSRule::evaluate(
const MapCSSState &state,
MapCSSResult &result)
const
32 m_selector->matches(state, result, m_declarations);
35void MapCSSRule::evaluateCanvas(
const MapCSSState &state,
MapCSSResult &result)
const
37 if (!m_selector->matchesCanvas(state)) {
41 for (
const auto &decl : m_declarations) {
42 if (decl->type() == MapCSSDeclaration::PropertyDeclaration) {
43 result[{}].addDeclaration(decl.get());
48void MapCSSRule::write(
QIODevice *out)
const
50 m_selector->write(out);
52 for (
const auto &decl : m_declarations) {
58void MapCSSRule::setSelector(MapCSSSelector *selector)
60 m_selector.reset(selector);
63void MapCSSRule::addDeclaration(MapCSSDeclaration *decl)
65 std::unique_ptr<MapCSSDeclaration> declPtr(decl);
66 if (declPtr->isValid()) {
67 m_declarations.push_back(std::move(declPtr));
Result of MapCSS stylesheet evaluation for all layer selectors.
A set of nodes, ways and relations.
OSM-based multi-floor indoor maps for buildings.
qint64 write(const QByteArray &data)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:55 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.