KOSMIndoorMap

hitdetector.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_HITDETECTOR_H
8#define KOSMINDOORMAP_HITDETECTOR_H
9
10#include "kosmindoormap_export.h"
11
12#include <vector>
13
14class QPointF;
15
16namespace KOSMIndoorMap {
17
18class LabelItem;
19class MultiPolygonItem;
20class PolygonItem;
21class PolylineItem;
22class SceneGraph;
23class SceneGraphItem;
24class View;
25
26/** Picking hit detector.
27 * Ie. find scene graph items at a given screen position.
28 */
29class KOSMINDOORMAP_EXPORT HitDetector
30{
31public:
32 /** Highest (in z-order) item at the given screen position. */
33 const SceneGraphItem* itemAt(QPointF pos, const SceneGraph &sg, const View *view) const;
34
35 /** All items (in z-order) at the given screen position. */
36 std::vector<const SceneGraphItem*> itemsAt(QPointF pos, const SceneGraph &sg, const View *view) const;
37
38private:
39 /** Precise bounds check for @p item. */
40 bool itemContainsPoint(const SceneGraphItem &item, QPointF screenPos, const View *view) const;
41 bool itemContainsPoint(const MultiPolygonItem *item, QPointF scenePos) const;
42 bool itemContainsPoint(const PolygonItem *item, QPointF scenePos) const;
43 bool itemContainsPoint(const PolylineItem *item, QPointF scenePos, const View *view) const;
44 bool itemContainsPoint(const LabelItem *item, QPointF screenPos, const View *view) const;
45
46 float itemFillAlpha(const SceneGraphItem *item) const;
47};
48
49}
50
51#endif // KOSMINDOORMAP_HITDETECTOR_H
Picking hit detector.
Definition hitdetector.h:30
A text or icon label.
Multi-polygon item, used for polygons with "holes" in them.
A single filled polygon.
A path/way/line item in the scenegraph.
Scene graph item description and handle for its content.
Scene graph of the currently displayed level.
Definition scenegraph.h:29
View transformations and transformation manipulation.
Definition view.h:40
OSM-based multi-floor indoor maps for buildings.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.