00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #ifndef QVIMAGECANVAS_H
00026 #define QVIMAGECANVAS_H
00027
00028 #include <QPointF>
00029 #include <QVWorker>
00030 #include <QVPolyline>
00031 #include <qvgui/qvcanvas.h>
00032
00045 class QVImageCanvas: public QVCanvas, public QVPropertyContainer
00046 {
00047 Q_OBJECT
00048 public:
00049 QVImageCanvas(const QString name = QString (), QWidget *parent=0);
00050 bool linkProperty(QVWorker &worker, const QString propertyName, QColor color = Qt::red, bool printTags = false);
00051 bool linkROI(QVWorker *worker, const QString propertyName);
00052 bool linkPolyline(QVWorker *worker, const QString propertyName);
00053 bool unlink(QVWorker *worker, const QString propertyName);
00054 void setLowHigh(float low,float high);
00055 #ifndef DOXYGEN_IGNORE_THIS
00056 void viewer();
00057 #endif
00058 virtual void custom_viewer() { };
00059
00060 public slots:
00061 void rectSelectedSlot(QRect rect);
00062 void polySelectedSlot(QPoint point, bool reset, TPolyMode mode);
00063 void circleSelectedSlot(QPoint center, float radius);
00064
00065 private:
00066 float _low,_high;
00067 QPoint circleCenter;
00068 void draw(const QList<QPoint> &pointList, QColor color = Qt::red, bool printTags = false);
00069 void draw(const QList<QPointF> &pointList, QColor color = Qt::red, bool printTags = false);
00070 void draw(const QList< QList< QPointF > > &pointList, QColor color = Qt::red, bool printTags = false);
00071 void draw(const QVPolyline &contours, QColor color = Qt::red, bool printTags = false, TPolyMode mode = LINE);
00072 void draw(const QPoint ¢er, float radius, QColor color = Qt::red, bool printTags = false);
00073 void draw(const QList<QVPolyline> &contours, QColor color = Qt::red, bool printTags = false);
00074 };
00075
00076 Q_DECLARE_METATYPE(TPolyMode);
00077
00078 #endif