templateviewer.h
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __TEMPLATEVIEWER_H
#define __TEMPLATEVIEWER_H
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QEvent>
#include <QImage>
#include <QList>
#include <QMouseEvent>
#include <QPointF>
#include <QString>
#include <QWidget>
#include <openbr_plugin.h>
#include "openbr-gui/imageviewer.h"
namespace br
{
class BR_EXPORT_GUI TemplateViewer : public br::ImageViewer
{
Q_OBJECT
br::File file;
QPointF mousePoint;
QString format;
bool editable;
QList<QPointF> landmarks;
int nearestLandmark;
public:
explicit TemplateViewer(QWidget *parent = 0);
public slots:
void setFile(const br::File &file);
void setEditable(bool enabled);
void setMousePoint(const QPointF &mousePoint);
void setFormat(const QString &format);
private:
void refreshImage();
QPointF getImagePoint(const QPointF &sp) const;
QPointF getScreenPoint(const QPointF &ip) const;
protected slots:
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
void leaveEvent(QEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void paintEvent(QPaintEvent *event);
signals:
void newInput(br::File input);
void newInput(QImage input);
void newMousePoint(QPointF mousePoint);
void selectedInput(br::File input);
};
}
#endif // TEMPLATEVIEWER_H