Force Directed Edge Bundling
 All Classes Functions Pages
renderwidget.h
1 #ifndef RENDERWIDGET_H
2 #define RENDERWIDGET_H
3 
4 #include <QPixmap>
5 #include <QWidget>
6 #include "renderthread.h"
7 
9 class RenderWidget : public QWidget {
10  Q_OBJECT
11 
12 public:
17  RenderWidget(QWidget *parent, Graph* g);
19  void useBackgroundImage(QString path);
20  void useBackgroundColor(QColor color);
21 
22  bool getBackgroundActive(void) {return visibleBackgroundImage;};
23  bool getNodesVisible(void) {return visibleNodes;};
24  bool getEdgesVisible(void) {return visibleEdges;};
25  bool getDescriptionsVisible(void) {return visibleDescriptions;};
26  bool getWrap(void) {return wrap;};
27  void refresh(void);
28  void clearWidget() {clear = true; repaint();};
29 protected:
31  void paintEvent(QPaintEvent *event);
33  void resizeEvent(QResizeEvent *event);
34 
35 public slots:
36  void useBackground(bool set) {visibleBackgroundImage = set; repaint();};
37  void drawNodes(bool draw) {visibleNodes = draw; refresh();};
38  void drawEdges(bool draw) {visibleEdges = draw; refresh();};
39  void showDescriptions(bool show) {visibleDescriptions = show; refresh();};
40  void wrapEdges(bool w) {wrap = w; refresh();};
41  void bundleEdges(bool b) {bundle = b;};
42 
44  void setNodeProperties(double radius, QColor fillColor, QColor lineColor, double lineWidth);
46  void setEdgeProperties(QColor lineColor, double lineWidth);
47 
48 protected slots:
50  void updatePixmap(const QImage &image);
51 
52 protected:
53  /* BACKGROUND */
54  QString backgroundImagePath;
55  bool visibleBackgroundImage;
56  QPixmap backgroundImage;
57  QBrush backgroundSolid;
58 
59  /* NODE PROPERTIES */
60  bool visibleNodes;
61  QBrush nodeBrush;
62  QPen nodePen;
63  double nodeRadius;
64  bool visibleDescriptions;
65 
66  /* EDGE PROPERTIES */
67  bool visibleEdges;
68  QPen edgePen;
69  bool wrap;
70  bool bundle;
71 
72  bool clear;
73  Graph* graph;
74  RenderThread thread;
75  QPixmap pixmap;
76 };
77 
78 #endif // RENDERWIDGET_H
RenderWidget(QWidget *parent, Graph *g)
Definition: renderwidget.cpp:7
Definition: renderwidget.h:9
void setNodeProperties(double radius, QColor fillColor, QColor lineColor, double lineWidth)
Definition: renderwidget.cpp:40
Definition: graph.h:115
void setEdgeProperties(QColor lineColor, double lineWidth)
Definition: renderwidget.cpp:47
void updatePixmap(const QImage &image)
Definition: renderwidget.cpp:95
void useBackgroundImage(QString path)
Definition: renderwidget.cpp:16
void paintEvent(QPaintEvent *event)
Definition: renderwidget.cpp:52
void resizeEvent(QResizeEvent *event)
Definition: renderwidget.cpp:81
Definition: renderthread.h:18