VertexTableWidget.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 * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
17 * @date 2021
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
24#include <QColor>
25#include <QList>
26#include <QPair>
27#include <QTableWidget>
28#include <qhashfunctions.h>
29#include <qlist.h>
30#include <qobjectdefs.h>
31#include <qpair.h>
32#include <qpoint.h>
33#include <qtablewidget.h>
34
37
39{
40 enum class EdgeDirection;
41}
42
44{
45 class VertexTableWidget : public QTableWidget
46 {
47 Q_OBJECT
48 using This = VertexTableWidget;
49
50
51 public:
53
54
55 QTableWidgetItem* addVertex();
56
57 void updateVertex(GuiGraph::Vertex vertex);
58
59 void removeVertex(GuiGraph::Vertex& vertex);
60
61
62 QList<QTableWidgetItem*> selectedVertexItems();
63
64
65 signals:
66
68
69 void newEdgesRequested(QList<QPair<QTableWidgetItem*, QTableWidgetItem*>> edges);
70 void edgeRemovalRequested(QList<QTableWidgetItem*> vertexItems,
71 utils::EdgeDirection direction);
72
73
74 public slots:
75
76 void makeContextMenu(QPoint pos);
77
78
79 private:
80 static QString _nameOf(QTableWidgetItem* item);
81
82
83 public:
86 };
87
88} // namespace armarx::navigation::qt_plugins::location_graph_editor
void edgeRemovalRequested(QList< QTableWidgetItem * > vertexItems, utils::EdgeDirection direction)
void newEdgesRequested(QList< QPair< QTableWidgetItem *, QTableWidgetItem * > > edges)