-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathplateselector.h
77 lines (61 loc) · 1.57 KB
/
plateselector.h
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef PLATESELECTOR_H
#define PLATESELECTOR_H
#include <QPolygon>
#include <QDialog>
class QAbstractButton;
class QShortcut;
class PlateFile;
namespace Ui
{
class PlateSelector;
}
/*
* Dialog to select or edit a license plate with four points
*/
class PlateSelector : public QDialog
{
Q_OBJECT
public:
enum DeleteButtonExistense { WithDeleteButton, WithoutDeleteButton };
explicit PlateSelector(const QImage &image, DeleteButtonExistense deleteButtonExistense, QWidget *parent = 0);
~PlateSelector();
/*
* Set an existing plate to edit
*/
void setPlateFile(const PlateFile &plateFile);
/*
* Selection rectangle in the original (full) image. This rectangle is used to re-calculate
* correct relative dot coordinates and pass them into addDotInImageCoordinates() method
*/
void setSelectionRect(const QRect &rect);
/*
* Getters
*/
QString plateNumber() const;
QString plateRegion() const;
bool lightOnDark() const;
QPolygon selectedPolygon() const;
private slots:
void slotCheckData();
void slotSave();
void slotHelp();
void slotClicked(QAbstractButton *button);
private:
Ui::PlateSelector *ui;
QRect m_selection;
QPolygon m_selectedPolygon;
QShortcut *m_shortCutPlateNumber;
QShortcut *m_shortCutPlateRegion;
QShortcut *m_shortCutLightOnDark;
};
inline
void PlateSelector::setSelectionRect(const QRect &rect)
{
m_selection = rect;
}
inline
QPolygon PlateSelector::selectedPolygon() const
{
return m_selectedPolygon;
}
#endif // PLATESELECTOR_H