gepetto-viewer  4.13.0
An user-friendly Graphical Interface
decorator.hh
Go to the documentation of this file.
1 // Copyright (c) 2018, Joseph Mirabel
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of gepetto-viewer.
5 // gepetto-viewer is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // gepetto-viewer is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // gepetto-viewer. If not, see <http://www.gnu.org/licenses/>.
16 
17 #include <QObject>
18 
19 #include "qgv.h"
20 
21 class QGVScene;
22 class QGVSubGraph;
23 class QGVNode;
24 class QGVEdge;
25 
26 namespace PyQgv {
27 class QGVCORE_EXPORT QGVDecorator : public QObject {
28  Q_OBJECT
29 
30  public slots:
31 
32  // ------- QGVScene ------------------------------------------- //
33  QGVScene* new_QGVScene(const QString& name, QObject* parent = NULL);
34  void delete_QGVScene(QGVScene* s);
35 
36  void setGraphAttribute(QGVScene* s, const QString& name,
37  const QString& value);
38  void setNodeAttribute(QGVScene* s, const QString& name, const QString& value);
39  void setEdgeAttribute(QGVScene* s, const QString& name, const QString& value);
40 
41  QGVNode* addNode(QGVScene* s, const QString& label);
42  QGVEdge* addEdge(QGVScene* s, QGVNode* source, QGVNode* target,
43  const QString label = QString());
44  QGVSubGraph* addSubGraph(QGVScene* s, const QString& name,
45  bool cluster = true);
46 
47  void setRootNode(QGVScene* s, QGVNode* node);
48  void setNodePositionAttribute(QGVScene* s);
49 
50  void loadLayout(QGVScene* s, const QString& text);
51  void applyLayout(QGVScene* s, const QString& algorithm = "dot");
52  void render(QGVScene* s, const QString& algorithm);
53  void render(QGVScene* s, const QString& algorithm, const QString file);
54  bool writeGraph(QGVScene* s, const QString& filename);
55  void freeLayout(QGVScene* s);
56  void clear(QGVScene* s);
57  // ------- QGVScene ------------------------------------------- //
58 
59  // ------- QGVSubGraph ---------------------------------------- //
60  void setAttribute(QGVSubGraph* n, const QString& name, const QString& value);
61  QString getAttribute(QGVSubGraph* n, const QString& name);
62 
63  QGVNode* addNode(QGVSubGraph* s, const QString& label);
64  QGVSubGraph* addSubGraph(QGVSubGraph* s, const QString& name,
65  bool cluster = true);
66  // ------- QGVSubGraph ---------------------------------------- //
67 
68  // ------- QGVNode ------------------------------------------- //
69  void setAttribute(QGVNode* n, const QString& name, const QString& value);
70  QString getAttribute(QGVNode* n, const QString& name);
71  // ------- QGVNode ------------------------------------------- //
72 
73  // ------- QGVEdge ------------------------------------------- //
74  void setAttribute(QGVEdge* e, const QString& name, const QString& value);
75  QString getAttribute(QGVEdge* e, const QString& name);
76  // ------- QGVEdge ------------------------------------------- //
77 };
78 
80 void registerQGV();
81 } // namespace PyQgv
Definition: decorator.hh:27
Definition: decorator.hh:26
void registerQGV()
Register QGV to PythonQt.