Force Directed Edge Bundling
 All Classes Functions Pages
renderthread.h
1 #ifndef RENDERTHREAD_H
2 #define RENDERTHREAD_H
3 
4 #include "graph.h"
5 #include <QMutex>
6 #include <QSize>
7 #include <QThread>
8 #include <QPen>
9 #include <QBrush>
10 #include <QWaitCondition>
11 
12 class QImage;
13 
18 class RenderThread : public QThread {
19  Q_OBJECT
20 
21 public:
25  RenderThread(QObject *parent = 0);
29  ~RenderThread();
30 
44  void render(Graph* g, QSize resSize, QPen ePen, QBrush nBrush, QPen nPen, double nRad, bool vEdges = true, bool vNodes = true, bool vDescr = true, bool w = false, bool b = false);
45 
46 signals:
48  void renderedImage(const QImage &image);
50  void setStatus(QString s);
51 
52 protected:
54  void run();
55 
56  Graph* graph;
57  QMutex mutex;
58  QWaitCondition condition;
59  QSize resultSize;
60  bool restart;
61  bool abort;
62 
63  /* GRAPH VARIABLES */
64  bool visibleEdges;
65  bool visibleNodes;
66  bool showDescriptions;
67  bool wrap;
68  bool bundle;
69 
70  QPen edgePen;
71  QBrush nodeBrush;
72  QPen nodePen;
73  double nodeRadius;
74 
76  QPointF getWindowCoordinate(QPointF point) {return QPointF(point.x() * resultSize.width(), point.y() * resultSize.height());}
78  QPolygonF getWindowCoordinates(QPolygonF poly) {QMatrix transform; transform.scale(resultSize.width(), resultSize.height()); return transform.map(poly);};
79 };
80 
81 #endif // RENDERTHREAD_H
void run()
Definition: renderthread.cpp:44
~RenderThread()
Definition: renderthread.cpp:12
Definition: graph.h:115
QPolygonF getWindowCoordinates(QPolygonF poly)
Definition: renderthread.h:78
RenderThread(QObject *parent=0)
Definition: renderthread.cpp:6
QPointF getWindowCoordinate(QPointF point)
Definition: renderthread.h:76
void setStatus(QString s)
void render(Graph *g, QSize resSize, QPen ePen, QBrush nBrush, QPen nPen, double nRad, bool vEdges=true, bool vNodes=true, bool vDescr=true, bool w=false, bool b=false)
Definition: renderthread.cpp:21
void renderedImage(const QImage &image)
Definition: renderthread.h:18