-
Notifications
You must be signed in to change notification settings - Fork 0
/
command.h
69 lines (61 loc) · 1.42 KB
/
command.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
#ifndef COMMAND_H
#define COMMAND_H
#include "myview.h"
#include "Dialogs/brushdlg.h"
#include "Dialogs/selectdlg.h"
#include <QTimeLine>
class MyView;
class MyScene;
class MainWindow;
class Command
{
public:
Command(MyScene* scene);
Command(MyView* view);
MyScene* getScene();
enum TransDirection
{
UP, //不能再有同名的枚举变量
DOWN,
LEFT,
RIGHT,
};
enum{
range = 2
};
public slots:
void Delete();
void Rotate(float angle);
void Translate(int direction, int pace);
void Translate(QPointF pt);
void Zoom(bool in);
void SelectAll(bool state);
void FillBrush();
void SetMovable(bool state);
void Stretch();
void changeStyle();
void SetSymmetry(Qt::Axis axis);
void ShowItemInfo();
void SmartZoom();
QList<QPointF> getDividePts();
void CatchPt();
qreal getLinesAngle();
void InsertPix();
void InsertWidget(QWidget* w);
void Animation();
void test(qreal value);
private:
MyView* m_view;
MyScene* m_scene;
QList<QGraphicsItem*> chosenItems;
QTransform m_translate;
int pace;
bool m_up, m_down;
BrushDlg* brush_dlg;
SelectDlg* select_dlg;
QTimeLine* timeLine;
QString getItemInfo(QString type, QPointF pos, QSizeF size, QColor c);
qreal getSlope(QGraphicsLineItem* line);
bool inCatchRange(QPointF src, QPointF des);
};
#endif // COMMAND_H