KOSMIndoorMap

equipmentmodel.h
1/*
2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
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
15namespace KOSMIndoorMap {
16
17/** Elevator or escalator element. */
18class KOSMINDOORMAP_EXPORT Equipment
19{
20public:
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. */
31class KOSMINDOORMAP_EXPORT EquipmentModel : public AbstractOverlaySource
32{
34 Q_PROPERTY(KOSMIndoorMap::MapData mapData READ mapData WRITE setMapData NOTIFY mapDataChanged)
35public:
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
46 void mapDataChanged();
47
48protected:
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
69private:
70 void findEquipment();
71};
72
73}
74
75#endif // KOSMINDOORMAP_EQUIPMENTMODEL_H
void hiddenElements(std::vector< OSM::Element > &elems) const override
Adds hidden elements to.
void forEach(int floorLevel, const std::function< void(OSM::Element, int)> &func) const override
Iteration interface with floor level filtering.
Elevator or escalator element.
Raw OSM map data, separated by levels.
Definition mapdata.h:60
A set of nodes, ways and relations.
Definition datatypes.h:346
A reference to any of OSM::Node/OSMWay/OSMRelation.
Definition element.h:24
A key of an OSM tag.
Definition datatypes.h:179
A std::unique_ptr-like object for OSM element types.
Definition element.h:100
OSM-based multi-floor indoor maps for buildings.
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 28 2025 11:58:50 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.