gepetto-viewer  4.12.1
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 "qgv.h"
18 #include <QObject>
19 
20 class QGVScene;
21 class QGVSubGraph;
22 class QGVNode;
23 class QGVEdge;
24 
25 namespace PyQgv {
26  class QGVCORE_EXPORT QGVDecorator : public QObject
27  {
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, const QString &value);
37  void setNodeAttribute (QGVScene* s, const QString &name, const QString &value);
38  void setEdgeAttribute (QGVScene* s, const QString &name, const QString &value);
39 
40  QGVNode* addNode(QGVScene* s, const QString& label);
41  QGVEdge* addEdge(QGVScene* s, QGVNode* source, QGVNode* target, const QString label = QString());
42  QGVSubGraph* addSubGraph(QGVScene* s, const QString& name, bool cluster=true);
43 
44  void setRootNode(QGVScene* s, QGVNode *node);
45  void setNodePositionAttribute (QGVScene* s);
46 
47  void loadLayout (QGVScene* s, const QString &text);
48  void applyLayout(QGVScene* s, const QString &algorithm = "dot");
49  void render (QGVScene* s, const QString &algorithm);
50  void render (QGVScene* s, const QString &algorithm, const QString file);
51  bool writeGraph (QGVScene* s, const QString &filename);
52  void freeLayout (QGVScene* s);
53  void clear (QGVScene* s);
54  // ------- QGVScene ------------------------------------------- //
55 
56  // ------- QGVSubGraph ---------------------------------------- //
57  void setAttribute (QGVSubGraph* n, const QString &name, const QString &value);
58  QString getAttribute (QGVSubGraph* n, const QString &name);
59 
60  QGVNode* addNode(QGVSubGraph* s, const QString& label);
61  QGVSubGraph* addSubGraph(QGVSubGraph* s, const QString& name, bool cluster=true);
62  // ------- QGVSubGraph ---------------------------------------- //
63 
64  // ------- QGVNode ------------------------------------------- //
65  void setAttribute (QGVNode* n, const QString &name, const QString &value);
66  QString getAttribute (QGVNode* n, const QString &name);
67  // ------- QGVNode ------------------------------------------- //
68 
69  // ------- QGVEdge ------------------------------------------- //
70  void setAttribute (QGVEdge* e, const QString &name, const QString &value);
71  QString getAttribute (QGVEdge* e, const QString &name);
72  // ------- QGVEdge ------------------------------------------- //
73  };
74 
76  void registerQGV ();
77 } // namespace PyQgv
Definition: decorator.hh:27
void setAttribute(QGVEdge *e, const QString &name, const QString &value)
QString getAttribute(QGVEdge *e, const QString &name)
QString getAttribute(QGVNode *n, const QString &name)
void applyLayout(QGVScene *s, const QString &algorithm="dot")
void clear(QGVScene *s)
void setRootNode(QGVScene *s, QGVNode *node)
QGVSubGraph * addSubGraph(QGVScene *s, const QString &name, bool cluster=true)
void setNodePositionAttribute(QGVScene *s)
void render(QGVScene *s, const QString &algorithm, const QString file)
void setEdgeAttribute(QGVScene *s, const QString &name, const QString &value)
void setAttribute(QGVSubGraph *n, const QString &name, const QString &value)
void render(QGVScene *s, const QString &algorithm)
QGVEdge * addEdge(QGVScene *s, QGVNode *source, QGVNode *target, const QString label=QString())
void freeLayout(QGVScene *s)
bool writeGraph(QGVScene *s, const QString &filename)
void delete_QGVScene(QGVScene *s)
void setGraphAttribute(QGVScene *s, const QString &name, const QString &value)
void setAttribute(QGVNode *n, const QString &name, const QString &value)
QString getAttribute(QGVSubGraph *n, const QString &name)
QGVScene * new_QGVScene(const QString &name, QObject *parent=NULL)
QGVSubGraph * addSubGraph(QGVSubGraph *s, const QString &name, bool cluster=true)
void setNodeAttribute(QGVScene *s, const QString &name, const QString &value)
void loadLayout(QGVScene *s, const QString &text)
QGVNode * addNode(QGVScene *s, const QString &label)
QGVNode * addNode(QGVSubGraph *s, const QString &label)
Definition: decorator.hh:25
void registerQGV()
Register QGV to PythonQt.