-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharea.h
executable file
·104 lines (77 loc) · 2.13 KB
/
area.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef AREA_H
#define AREA_H
#include <QWidget>
#include "util.h"
#include <set>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_list.hpp>
#include <QtCore/QTimer>
#include <QtGui/QPainter>
#include <QtGui/QPalette>
#include <QtGui/QMouseEvent>
namespace Ui {
class Area;
}
class Area : public QWidget
{
Q_OBJECT
public:
explicit Area(QWidget *parent = 0);
~Area();
void drawAreaSlot(QPainter *painter);
void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
public slots:
// single step slots
void forwardStepAreaSlot();
void backStepAreaSlot();
// continuous step slots
void qforwardStepAreaSlot();
void qbackStepAreaSlot();
// single steps slots
void forwardStepsAreaSlot();
void backStepsAreaSlot();
// continuous step slots
void qforwardStepsAreaSlot();
void qbackStepsAreaSlot();
// step control slots
void pauseAreaSlot();
void stopAreaSlot();
void finishAreaSlot();
// draw control slots
void drawAreaSlot();
void stopDrawAreaSlot();
void undoAreaSlot();
void redoAreaSlot();
// file control steps
void loadFromFileAreaSlot(QString file);
void saveToFileAreaSlot(QString file);
void saveResultToFileAreaSlot(QString file);
// generation control steps
void generetePointsAreaSlot(int numSegments, bool vert, bool multi, bool full);
void computeIntersections();
void cleanSegments();
signals:
// generation signals
void generationFailAreaSignal();
private:
QTimer *forwardTimer;
QTimer *backTimer;
QTimer *qforwardTimer;
QTimer *qbackTimer;
int timerSpeed;
int qtimerSpeed;
boost::ptr_vector<Segment> mSegments;
boost::ptr_vector<Intersection> mIntersections;
std::set<int> mSuperSegments; // vert, multi intersec
int mCurLine;
int mCurIntersection;
bool drawMode;
Point2d* mCurDrawPoint;
Point2d* mCurDrawingPoint;
boost::ptr_list<Segment> history;
boost::ptr_list<Segment> future;
};
#endif // AREA_H