3个更新
+ 路径的角度现在都是正确的 + 修正PathPoint的复制构造函数 + 现在不会在直线上创建辅助节点
This commit is contained in:
1 parent
39c5bf6f33
commit
ee16965d97
4 files changed
+62
-33
No files matched your search
@@ -99,10 +99,18 @@ ParkingLotGraph::Node::Type getType(int n) {
|
||||
|
||||
void ParkingLotManager::drawPath(int n1, int n2)
|
||||
{
|
||||
QPen pen(QColor(242, 23, 242));
|
||||
pen.setWidth(3);
|
||||
Path *p = m_graph[m_current_floor]->finaPath(getType(n1), n1, getType(n2), n2);
|
||||
for(int i = 1; i < p->pointsCount(); i++) {
|
||||
QLineF line(p->getPoint(i-1).point, p->getPoint(i).point);
|
||||
QPointF dir(qCos(qDegreesToRadians(p->getPoint(i-1).dir)) * 10,
|
||||
qSin(qDegreesToRadians(p->getPoint(i-1).dir)) * 10);
|
||||
QLineF dirLine(p->getPoint(i-1).point, p->getPoint(i-1).point + dir);
|
||||
m_scene->addLine(line);
|
||||
m_scene->addLine(dirLine, pen);
|
||||
m_scene->addText(QString::number(p->getPoint(i-1).dir))->moveBy(p->getPoint(i-1).point.x(),
|
||||
p->getPoint(i-1).point.y());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user