forked from GLDsuh-a/qt-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseLine.h
40 lines (31 loc) · 845 Bytes
/
BaseLine.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
#ifndef _BASELINE_H
#define _BASELINE_H
#include <vector>
#include <QMouseEvent>
#include <qwidget.h>
#include "ITool.h"
class BaseLine : public ITool
{
public:
BaseLine(QImage* image, QColor* color, QWidget* parent);
void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
void updateImage(QImage* image);
void updateColor(QColor* color);
void setPoints(std::vector<QPoint> points);
protected:
void drawPoint(int x, int y, bool focus);
void removePoint(int x, int y);
virtual void drawLine(QColor color);
protected:
QImage* m_image;
QImage* m_unselected_icon;
QImage* m_selected_icon;
QColor* m_color;
QWidget* m_parent;
std::vector<QPoint> m_points;
int m_range;
int m_selected;
};
#endif