KOSMIndoorMap

equipmentmodel.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_EQUIPMENTMODEL_H
8 #define KOSMINDOORMAP_EQUIPMENTMODEL_H
9 
10 #include "kosmindoormap_export.h"
11 
12 #include <KOSMIndoorMap/MapData>
13 #include <KOSMIndoorMap/OverlaySource>
14 
15 namespace KOSMIndoorMap {
16 
17 /** Elevator or escalator element. */
18 class KOSMINDOORMAP_EXPORT Equipment
19 {
20 public:
21  enum Type { Elevator, Escalator };
22  std::vector<OSM::Element> sourceElements;
23  std::vector<int> levels;
24  OSM::UniqueElement syntheticElement;
25  Type type;
26 
27  float distanceTo(const OSM::DataSet &dataSet, float lat, float lon) const;
28 };
29 
30 /** Overlay source for elevators and escalators. */
31 class KOSMINDOORMAP_EXPORT EquipmentModel : public AbstractOverlaySource
32 {
33  Q_OBJECT
34  Q_PROPERTY(KOSMIndoorMap::MapData mapData READ mapData WRITE setMapData NOTIFY mapDataChanged)
35 public:
36  explicit EquipmentModel(QObject *parent = nullptr);
37  ~EquipmentModel();
38 
39  MapData mapData() const;
40  void setMapData(const MapData &data);
41 
42  void forEach(int floorLevel, const std::function<void(OSM::Element, int)> &func) const override;
43  void hiddenElements(std::vector<OSM::Element> &elems) const override;
44 
45 Q_SIGNALS:
46  void mapDataChanged();
47 
48 protected:
49  void createSyntheticElement(Equipment &eq) const;
50 
51  MapData m_data;
52  std::vector<Equipment> m_equipment;
53 
54  struct {
55  OSM::TagKey building;
56  OSM::TagKey buildling_part;
57  OSM::TagKey conveying;
58  OSM::TagKey elevator;
59  OSM::TagKey highway;
60  OSM::TagKey indoor;
61  OSM::TagKey level;
62  OSM::TagKey room;
63  OSM::TagKey stairwell;
64 
65  OSM::TagKey mxoid;
66  OSM::TagKey realtimeStatus;
67  } m_tagKeys;
68 
69 private:
70  void findEquipment();
71 };
72 
73 }
74 
75 #endif // KOSMINDOORMAP_EQUIPMENTMODEL_H
OSM-based multi-floor indoor maps for buildings.
A reference to any of OSM::Node/OSMWay/OSMRelation.
Definition: element.h:22
A key of an OSM tag.
Definition: datatypes.h:179
Elevator or escalator element.
Raw OSM map data, separated by levels.
Definition: mapdata.h:59
Overlay source for elevators and escalators.
A source for overlay elements, drawn on top of the static map data.
Definition: overlaysource.h:26
A set of nodes, ways and relations.
Definition: datatypes.h:283
A std::unique_ptr-like object for OSM element types.
Definition: element.h:98
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Sep 27 2021 23:05:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.