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 
31 
32 
34 {
35  enum class EdgeDirection;
36 }
38 {
39  class VertexTableWidget : public QTableWidget
40  {
41  Q_OBJECT
42  using This = VertexTableWidget;
43 
44 
45  public:
47 
48 
49  QTableWidgetItem* addVertex();
50 
51  void updateVertex(GuiGraph::Vertex vertex);
52 
53  void removeVertex(GuiGraph::Vertex& vertex);
54 
55 
56  QList<QTableWidgetItem*> selectedVertexItems();
57 
58 
59  signals:
60 
61  void newVertexRequested();
62 
63  void newEdgesRequested(QList<QPair<QTableWidgetItem*, QTableWidgetItem*>> edges);
64  void edgeRemovalRequested(QList<QTableWidgetItem*> vertexItems,
65  utils::EdgeDirection direction);
66 
67 
68  public slots:
69 
70  void makeContextMenu(QPoint pos);
71 
72 
73  private:
74  static QString _nameOf(QTableWidgetItem* item);
75 
76 
77  public:
80  };
81 
82 } // namespace armarx::navigation::qt_plugins::location_graph_editor
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::updateVertex
void updateVertex(GuiGraph::Vertex vertex)
Definition: VertexTableWidget.cpp:93
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::addVertex
QTableWidgetItem * addVertex()
Definition: VertexTableWidget.cpp:58
armarx::navigation::qt_plugins::location_graph_editor::default_colors::tableBackgroundSelected
const QColor tableBackgroundSelected
Definition: default_colors.cpp:31
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::newVertexRequested
void newVertexRequested()
armarx::navigation::qt_plugins::location_graph_editor::default_colors::tableBackgroundDefault
const QColor tableBackgroundDefault
Definition: default_colors.cpp:30
armarx::navigation::qt_plugins::location_graph_editor::utils::EdgeDirection
EdgeDirection
Definition: utils.h:42
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::newEdgesRequested
void newEdgesRequested(QList< QPair< QTableWidgetItem *, QTableWidgetItem * >> edges)
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::bgColorSelected
QColor bgColorSelected
Definition: VertexTableWidget.h:79
armarx::navigation::qt_plugins::location_graph_editor
Definition: GuiGraph.cpp:29
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::selectedVertexItems
QList< QTableWidgetItem * > selectedVertexItems()
Definition: VertexTableWidget.cpp:144
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::removeVertex
void removeVertex(GuiGraph::Vertex &vertex)
Definition: VertexTableWidget.cpp:132
default_colors.h
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::edgeRemovalRequested
void edgeRemovalRequested(QList< QTableWidgetItem * > vertexItems, utils::EdgeDirection direction)
GuiGraph.h
armarx::navigation::qt_plugins::location_graph_editor::utils
Definition: WidgetController.h:54
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::bgColorDefault
QColor bgColorDefault
Definition: VertexTableWidget.h:78
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget
Definition: VertexTableWidget.h:39
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::VertexTableWidget
VertexTableWidget()
Definition: VertexTableWidget.cpp:36
armarx::navigation::qt_plugins::location_graph_editor::VertexTableWidget::makeContextMenu
void makeContextMenu(QPoint pos)
Definition: VertexTableWidget.cpp:156