SelectableImageViewer.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package VisionX::ArmarXObjects::SelectableImageViewer
17 * @author Rainer Kartmann ( rainer dot kartmann at student dot kit dot edu )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <QMouseEvent>
26#include <QWidget>
27
29
30namespace armarx
31{
32 /**
33 * @defgroup Library-SelectableImageViewer SelectableImageViewer
34 * @ingroup VisionX-Components
35 * Offers the SelectableImageViewer widget.
36 *
37 * @class SelectableImageViewer
38 * @ingroup VisionX-Libraries
39 * @brief A clickable, i.e. selectable, visionx::ImageViewerArea.
40 *
41 * The SelectableImageViewer is a visionx::ImageViewerArea which can be clicked
42 * on to make a selection in the displayed image
43 */
45 {
46 Q_OBJECT
47 public:
48 explicit SelectableImageViewer(QWidget* parent = 0);
49
50 void mousePressEvent(QMouseEvent* ev) override;
51
52 signals:
53
54 /**
55 * @brief Signals that a pixel was selected in the image viewer.
56 */
57 void selected();
58
59 /**
60 * @brief Signals that a pixel was selected in the image viewer.
61 * @param imageIndex the index of the selected image, in [0 .. numImages-1]
62 * @param x the relative x coordinate, in [0 .. 1)
63 * @param y the relative y coordinate, in [0 .. 1)
64 */
65 void selected(int imageIndex, float x, float y);
66
67 public slots:
68 };
69
70} // namespace armarx
void selected(int imageIndex, float x, float y)
Signals that a pixel was selected in the image viewer.
void mousePressEvent(QMouseEvent *ev) override
void selected()
Signals that a pixel was selected in the image viewer.
This file offers overloads of toIce() and fromIce() functions for STL container types.