-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmousefingerprintscene.cpp
executable file
·63 lines (53 loc) · 1.66 KB
/
mousefingerprintscene.cpp
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
63
#include "mousefingerprintscene.h"
MouseFingerprintScene::MouseFingerprintScene()
{
//this->mode = "marker";
this->intPoint.setX(0);
this->intPoint.setY(0);
}
void MouseFingerprintScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
QPointF point = event->scenePos();
this->intPoint = {(int)point.x(), (int)point.y()};
if (point.x() >= 0 && point.y() >= 0 && point.x() < this->imgWidth && point.y() < imgHeight) {
if (this->mode == "marker") {
emit pushMinutiaSignal(this->intPoint, this->type);
}
else if (this->mode == "checker") {
emit predictMinutiaSignal(this->intPoint);
}
}
}
void MouseFingerprintScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
QPointF point = event->scenePos();
intPoint = {(int)point.x(), (int)point.y()};
//qDebug() << intPoint.x() << " " << intPoint.y();
if (point.x() >= 0 && point.y() >= 0 && point.x() < this->imgWidth && point.y() < this->imgHeight) {
if (this->mode == "marker") {
emit setActualPositionSignal(this->intPoint);
}
}
}
void MouseFingerprintScene::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Space) {
emit pushMinutiaSignal(this->intPoint, this->type);
}
}
void MouseFingerprintScene::setImgHeight(int value)
{
this->imgHeight = value;
}
void MouseFingerprintScene::setImgWidth(int value)
{
this->imgWidth = value;
}
void MouseFingerprintScene::setType(const QString &value)
{
this->type = value;
}
void MouseFingerprintScene::setMode(const QString &value)
{
this->mode = value;
}