digraphview.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _DIGRAPHVIEW_H_
00013 #define _DIGRAPHVIEW_H_
00014
00015 #include <qptrlist.h>
00016 #include <qscrollview.h>
00017 #include <qstringlist.h>
00018
00019 class DigraphNode;
00020 class DigraphEdge;
00021
00022
00023 class DigraphView : public QScrollView
00024 {
00025 Q_OBJECT
00026
00027 public:
00028 DigraphView(QWidget *parent, const char *name);
00029 ~DigraphView();
00030
00031 void addEdge(const QString &name1, const QString &name2);
00032 void process();
00033 void clear();
00034 void setSelected(const QString &name);
00035 void ensureVisible(const QString &name);
00036
00037 signals:
00038 void selected(const QString &name);
00039
00040 protected:
00041 virtual void drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph);
00042 virtual void contentsMousePressEvent(QMouseEvent *e);
00043 virtual QSize sizeHint() const;
00044
00045 private:
00046 int toXPixel(double x);
00047 int toYPixel(double x);
00048
00049 void setRenderedExtent(double w, double h);
00050 void addRenderedNode(const QString &name,
00051 double x, double y, double w, double h);
00052 void addRenderedEdge(const QString &name1, const QString &name2,
00053 QMemArray<double> coords);
00054 static QStringList splitLine(QString str);
00055 void parseDotResults(const QStringList &list);
00056
00057 double xscale, yscale;
00058 int width, height;
00059 QStringList inputs;
00060 QPtrList<DigraphNode> nodes;
00061 QPtrList<DigraphEdge> edges;
00062 DigraphNode *selNode;
00063 };
00064
00065 #endif
This file is part of the documentation for KDevelop Version 3.1.2.