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 <qvgui/qvcanvas.h>
00029 #include <qvcore/qvpropertycontainer.h>
00030 #include <qvcore/qvworker.h>
00031 #include <qvip/qvpolyline.h>
00032
00033 #include <QPointF>
00034
00107 class QVImageCanvas: public QVCanvas, public QVPropertyContainer
00108 {
00109 Q_OBJECT
00110 public:
00111 QVImageCanvas(const QString name = QString (), QWidget *parent=0);
00112 void linkProperty(QVWorker &worker, const QString propertyName, QColor color = Qt::red, bool printTags = false);
00113 bool linkROI(QVWorker *worker, const QString propertyName);
00114 bool linkPolyline(QVWorker *worker, const QString propertyName);
00115 void setLowHigh(float low,float high);
00116 #ifndef DOXYGEN_IGNORE_THIS
00117 void viewer();
00118 #endif
00119 virtual void custom_viewer() { };
00120
00121 public slots:
00122 void rectSelectedSlot(QRect rect);
00123 void polySelectedSlot(QPoint point, bool reset, TPolyMode mode);
00124 void circleSelectedSlot(QPoint center, float radius);
00125
00126 private:
00127 float _low,_high;
00128 QPoint circleCenter;
00129 void draw(const QList<QPoint> &pointList, QColor color = Qt::red, bool printTags = false);
00130 void draw(const QList<QPointF> &pointList, QColor color = Qt::red, bool printTags = false);
00131 void draw(const QList< QList< QPointF > > &pointList, QColor color = Qt::red, bool printTags = false);
00132 void draw(const QVPolyline &contours, QColor color = Qt::red, bool printTags = false, TPolyMode mode = LINE);
00133 void draw(const QPoint ¢er, float radius, QColor color = Qt::red, bool printTags = false);
00134 void draw(const QList<QVPolyline> &contours, QColor color = Qt::red, bool printTags = false);
00135 };
00136
00137 Q_DECLARE_METATYPE(QList<QPoint>);
00138 Q_DECLARE_METATYPE(QList<QPointF>);
00139 Q_DECLARE_METATYPE(QList< QList< QPointF > >);
00140 Q_DECLARE_METATYPE(QVPolyline);
00141 Q_DECLARE_METATYPE(TPolyMode);
00142
00143 #endif