SemanticRelationViewerWidgetController.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::gui-plugins::SemanticRelationViewerWidgetController
17 * @author Fabian Paus ( fabian dot paus at kit dot edu )
18 * @date 2019
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22#pragma once
23
24#include <QTimer>
25
27
31
33
34#include <VisionX/gui-plugins/SemanticRelationViewer/ui_SemanticRelationViewerWidget.h>
35#include <VisionX/interface/components/SemanticRelationAnalyzer.h>
36#include <VisionX/interface/libraries/SemanticObjectRelations/GraphStorage.h>
37
41#include <SemanticObjectRelations/RelationGraph/json/AttributedGraph.h>
42
43namespace armarx
44{
46
47 /**
48 \page VisionX-GuiPlugins-SemanticRelationViewer SemanticRelationViewer
49 \brief The SemanticRelationViewer allows visualizing ...
50
51 \image html SemanticRelationViewer.png
52 The user can
53
54 API Documentation \ref SemanticRelationViewerWidgetController
55
56 \see SemanticRelationViewerGuiPlugin
57 */
58
59 /**
60 * \class SemanticRelationViewerWidgetController
61 * \brief SemanticRelationViewerWidgetController brief one line description
62 *
63 * Detailed description
64 */
67 SemanticRelationViewerWidgetController>
68 {
69 Q_OBJECT
70
71 public:
72 /**
73 * Controller Constructor
74 */
76
77 /**
78 * Controller destructor
79 */
81
82 /**
83 * @see ArmarXWidgetController::loadSettings()
84 */
85 void loadSettings(QSettings* settings) override;
86
87 /**
88 * @see ArmarXWidgetController::saveSettings()
89 */
90 void saveSettings(QSettings* settings) override;
91
92 QPointer<QDialog> getConfigDialog(QWidget* parent) override;
93
94 /**
95 * Returns the Widget name displayed in the ArmarXGui to create an
96 * instance of this class.
97 */
98 static QString
100 {
101 return "VisionX.SemanticRelationViewer";
102 }
103
104 /**
105 * \see armarx::Component::onInitComponent()
106 */
107 void onInitComponent() override;
108
109 /**
110 * \see armarx::Component::onConnectComponent()
111 */
112 void onConnectComponent() override;
113 void onDisconnectComponent() override;
114
115
116 public slots:
117 /* QT slot declarations */
118 void onUpdateGraphs();
119 void onAutoUpdateChanged();
120
121 void onLeftClickVertex(SemanticGraphVertexItem* item);
122 void onLeftClickEdge(SemanticGraphEdgeItem* item);
123 void onLeftClickGlobal(SemanticGraphGlobalItem* item);
124
125 signals:
126 /* QT signal declarations */
127
128 private:
129 void drawGraph(QGraphicsScene* graphicsScene,
130 GraphvizLayoutedGraph const& layoutedGraph,
131 semrel::AttributedGraph const& graph);
132
133 void setPropertyView(nlohmann::json const& attrs);
134
135 void highlightSelected(QGraphicsItem* selected);
136
137 void onZoomChanged(double newZoom);
138
139 private:
140 Ui::SemanticRelationViewerWidget widget;
141 QTimer* timer = nullptr;
142 QGraphicsScene graphicsScene;
143 double graphicsSceneScale = 1.0;
144 QPointer<SimpleConfigDialog> configDialog;
145
146 armarx::semantic::GraphStorageInterfacePrx storage;
147
148 std::map<std::string, semrel::AttributedGraph> graphMap;
149 JSONTreeModel propertyModel;
150 };
151} // namespace armarx
#define ARMARXCOMPONENT_IMPORT_EXPORT
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
QPointer< QDialog > getConfigDialog(QWidget *parent) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
This file offers overloads of toIce() and fromIce() functions for STL container types.