KOSMIndoorMap

mapcssstyle.h
1 /*
2  SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KOSMINDOORMAP_MAPCSSSTYLE_H
8 #define KOSMINDOORMAP_MAPCSSSTYLE_H
9 
10 #include "kosmindoormap_export.h"
11 
12 #include <memory>
13 
14 class QIODevice;
15 
16 namespace OSM {
17 class DataSet;
18 }
19 
20 namespace KOSMIndoorMap {
21 
22 class MapCSSResult;
23 class MapCSSState;
24 class MapCSSStylePrivate;
25 
26 /** A parsed MapCSS style sheet.
27  * @see MapCSSParser::parse for how to obtain a valid instance
28  */
29 class KOSMINDOORMAP_EXPORT MapCSSStyle
30 {
31 public:
32  /** Creates an invalid/empty style. */
33  explicit MapCSSStyle();
34  MapCSSStyle(const MapCSSStyle&) = delete;
36  ~MapCSSStyle();
37 
38  MapCSSStyle& operator=(const MapCSSStyle&) = delete;
39  MapCSSStyle& operator=(MapCSSStyle&&);
40 
41  /** Optimizes style sheet rules for application against @p dataSet.
42  * This does resolve tag keys and is therefore mandatory when changing the data set.
43  */
44  void compile(const OSM::DataSet &dataSet);
45 
46  /** Evaluates the style sheet for a given state @p state (OSM element, view state, element state, etc).
47  * The result is not returned but added to @p result for reusing allocated memory
48  * between evaluations.
49  */
50  void evaluate(const MapCSSState &state, MapCSSResult &result) const;
51 
52  /** Evaluate canvas style rules. */
53  void evaluateCanvas(const MapCSSState &state, MapCSSResult &result) const;
54 
55  /** Write this style as MapCSS to @p out.
56  * Mainly used for testing.
57  */
58  void write(QIODevice *out) const;
59 
60 private:
61  friend class MapCSSStylePrivate;
62  std::unique_ptr<MapCSSStylePrivate> d;
63 };
64 
65 }
66 
67 #endif // KOSMINDOORMAP_MAPCSSSTYLE_H
OSM-based multi-floor indoor maps for buildings.
A parsed MapCSS style sheet.
Definition: mapcssstyle.h:29
A set of nodes, ways and relations.
Definition: datatypes.h:283
Low-level types and functions to work with raw OSM data as efficiently as possible.
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.