KOSMIndoorMap

routeoverlay.h
1/*
2 SPDX-FileCopyrightText: 2024 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef KOSMINDOORROUTING_ROUTEOVERLAY_H
7#define KOSMINDOORROUTING_ROUTEOVERLAY_H
8
9#include "kosmindoorrouting_export.h"
10#include "route.h"
11
12#include <KOSMIndoorMap/MapData>
13#include <KOSMIndoorMap/OverlaySource>
14
15namespace KOSMIndoorRouting {
16
17class KOSMINDOORROUTING_EXPORT RouteOverlay : public KOSMIndoorMap::AbstractOverlaySource
18{
19 Q_OBJECT
20public:
21 explicit RouteOverlay(QObject *parent = nullptr);
22 ~RouteOverlay();
23
24 void setMapData(const KOSMIndoorMap::MapData &mapData);
25
26 void setStart(OSM::Coordinate c, int level);
27 void setEnd(OSM::Coordinate c, int level);
28 void setRoute(const Route &route);
29
30 void forEach(int floorLevel, const std::function<void(OSM::Element, int)> &func) const override;
31 void endSwap() override;
32 [[nodiscard]] const std::vector<OSM::Node>* transientNodes() const override;
33
34private:
36 OSM::TagKey m_mxRouteKey;
37
38 OSM::UniqueElement m_startNode;
39 OSM::UniqueElement m_endNode;
40 std::vector<OSM::UniqueElement> m_routeWays;
41 std::vector<int> m_routeWayFloorLevels;
42 std::vector<OSM::Node> m_transientNodes;
43
44 int m_startLevel = 0;
45 int m_endLevel = 0;
46 Route m_route;
47
48 std::vector<OSM::UniqueElement> m_gc;
49 std::vector<std::vector<OSM::Node>> m_transientNodesGC;
50};
51
52}
53
54#endif
A source for overlay elements, drawn on top of the static map data.
Raw OSM map data, separated by levels.
Definition mapdata.h:60
Coordinate, stored as 1e7 * degree to avoid floating point precision issues, and offset to unsigned v...
Definition datatypes.h:37
A reference to any of OSM::Node/OSM::Way/OSM::Relation.
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
void forEach(const typename Trait::template Vector< ItemType > &types, std::shared_ptr< Document< Trait > > doc, ItemFunctor< Trait > func, unsigned int maxNestingLevel=0)
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.