-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPathPlanning.h
37 lines (33 loc) · 1.05 KB
/
PathPlanning.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
#ifndef TRAPZOIDALMAP_H
#define TRAPZOIDALMAP_H
#include <QList>
#include <drawmap.h>
#include <QPainterPath>
class PathPlanning:public QObject
{
Q_OBJECT
public:
PathPlanning();
PathPlanning(CustomScene *scene,QList<DrawBlock *> block);
QList<QPointF> getCenterPointOfLine(QList<DrawBlock*> block);
void getAllLine(QList<DrawBlock *> block);
void sortLine(QList<QGraphicsLineItem*> *setOfLine);
void constructGraph (QList<QPointF> getCenterPointOfLine);
QPainterPath findPath(QList<QPointF> Allnode,QPointF start,QPointF end);
QList<QGraphicsLineItem*> *AllLine = new QList<QGraphicsLineItem*>;
QPointF getStart() const;
QPointF getEnd() const;
QPainterPath getMyPath() const;
public slots:
void setStart();
void setEnd();
void pathFinding();
private:
QPointF start,end;
QGraphicsRectItem *startNode = new QGraphicsRectItem();
QGraphicsRectItem *EndNode = new QGraphicsRectItem();
CustomScene *MyScene;
QPainterPath MyPath;
QList<DrawBlock *> MyBlock;
};
#endif // TRAPZOIDALMAP_H