modified gitignore

This commit is contained in:
wmj committed 2017-12-13 20:53:24 +08:00
1 parent b65105a950
commit 9a2ab97a82
3 files changed
+6 -86

No files matched your search

+5
View File
@@ -37,3 +37,8 @@ Makefile*
# QtCtreator CMake
CMakeLists.txt.user*
.vs/
debug/
release/
*.vcxproj
*.vcxproj.*
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.4.1, 2017-12-13T20:10:27. -->
<!-- Written by QtCreator 4.4.1, 2017-12-13T20:49:28. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
-85
View File
@@ -30,91 +30,6 @@ ParkingLot::ParkingLot(const QString &fname, QWidget* parent)
// painter = new QPainter(map);
}
void ParkingLot::creatMap()
{/*
// painter = new QPainter(map);
QDomElement root =doc -> documentElement();
if (root.tagName() != "parkinglot") {
QMessageBox::critical(parent, QObject::tr("Error"),
QObject::tr("Not a parkinglot file"));
}
if (root.attribute("layout") == "vertical")
vertical = true;
else if (root.attribute("layout") == "horizontal")
vertical = false;
else
qDebug() << "XML文件错误:" << root.attribute("layout");
int currentX = 0, X = 0;
int currentY = 0, Y = 0;
int maxWidthOfColumn = 0;
int maxHeightOfLine = 0;
QPixmap roadPix(":/road/line");
QPixmap roomPix(":/road/room");
QPixmap *toDraw;
QMatrix rotate;
QDomNode line = root.firstChild();
while (!line.isNull()) { // <column>节点
QDomElement space = line.firstChild().toElement();
while(!space.isNull()) {
if (space.tagName() == "road") {
toDraw = &roadPix;
} else if (space.tagName() == "room") {
toDraw = &roomPix;
} else {
qDebug() << "文件错误" << space.tagName();
}
int n = space.attribute("number", "1").toInt();
painter->save();
switch(space.attribute("direction").at(0).unicode()) {
case 'E':
rotate.rotate(180);
break;
case 'S':
rotate =rotate.rotate(90);
break;
case 'W':
rotate =rotate.rotate(0);
break;
case 'N':
rotate =rotate.rotate(270);
break;
default:
qDebug() << "错误的方向" << space.attribute("direction").at(0).unicode();
}
for (int i = 0; i < n; i++) {
painter->drawPixmap(currentX, currentY, toDraw -> width(), toDraw -> height(),
toDraw->transformed(rotate));
if (vertical) {
currentY += toDraw -> height();
maxWidthOfColumn = std::max(maxWidthOfColumn, toDraw -> width());
} else {
currentX += toDraw -> width();
maxHeightOfLine = std::max(maxHeightOfLine, toDraw -> height());
}
}
painter->restore();
space = space.nextSibling().toElement();
}
if (vertical) {
Y = std::max(Y, currentY);
currentY = 0;
currentX += maxWidthOfColumn;
X = currentX;
maxWidthOfColumn = 0;
} else {
X = std::max(X, currentX);
currentX = 0;
currentY += maxHeightOfLine;
Y = currentY;
maxHeightOfLine = 0;
}
line = line.nextSibling();
}*/
}
QPixmap ParkingLot::creatMap2()
{
QDomElement root =doc -> documentElement();