1 Star 1 Fork 0

h2magic/PathfindingTest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mainwindow.h 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
soleperson 提交于 2021-03-25 17:39 . Update overview images
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QLabel>
#include <QMainWindow>
#include <QMessageBox>
#include <QMouseEvent>
#include <QPainter>
#include <QPushButton>
#include <QRect>
#include <QTime>
#include "AStar.h"
class MainWindow : public QMainWindow
{
Q_OBJECT
int world[N][N];
int w = SQUARE / N;
int status = 0;
QPushButton *clearButton = new QPushButton("全部清空", this);
QPushButton *runButton = new QPushButton("开始寻路", this);
QLabel *statusLabel = new QLabel("当前状态: ", this);
QLabel *currentStatusLabel = new QLabel("设置障碍", this);
Position start;
Position end;
PositionList route;
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
bool positionToRowCol(int x, int y, int *row, int *col);
bool positionInWorld(int x, int y);
QRect rowColToIndex(int r, int c);
bool checkWorld();
bool pathFinding(Position start, Position end, int world[N][N], PositionList *result);
void paintEvent(QPaintEvent *);
void mouseDoubleClickEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void selfUpdate();
};
#endif // MAINWINDOW_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/h2magic/PathfindingTest.git
git@gitee.com:h2magic/PathfindingTest.git
h2magic
PathfindingTest
PathfindingTest
master

搜索帮助