-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleealgorythm.h
39 lines (30 loc) · 1009 Bytes
/
leealgorythm.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
#ifndef LEEALGORYTHM_H
#define LEEALGORYTHM_H
#include <iostream>
#include <QVector>
#include <QQueue>
#include <QApplication>
#include <QPoint>
class LeeAlgorythm
{
private:
int W; // èØàØÝÐ àÐÑÞçÕÓÞ ßÞÛï
int H; // ÒëáÞâÐ àÐÑÞçÕÓÞ ßÞÛï
const int WALL = 1; // ÝÕßàÞåÞÔØÜÐï ïçÕÙÚÐ
const int BLANK = 0; // áÒÞÑÞÔÝÐï ÝÕßÞÜÕçÕÝÝÐï ïçÕÙÚÐ
const int hx[4] = {-1, +1, 0, 0 };
const int hy[4] = { 0, 0, -1, +1 };
const int mark = -1;
public:
LeeAlgorythm() {}
~LeeAlgorythm();
int getGridVal(const QPoint &pos) const;
void setGridVal(const QPoint &pos, const int &val);
void setRect(const QPoint &pos, const int &w, const int &h);
void SetSize(const size_t &W, const size_t &H);
QVector<QPoint> GetPath(const QPoint &endPoint);
bool CustomLee(const QPoint &, const QPoint &);
QVector<QVector<int>> grid;
QVector<QPoint> path; // ÚÞÞàÔØÝÐâë ïçÕÕÚ, ÒåÞÔïéØå Ò ßãâì
};
#endif // LEEALGORYTHM_H