worked on windows

This commit is contained in:
k-a-z-u
2018-07-25 18:12:48 +02:00
parent 0d22d91470
commit baeb8bef11
4 changed files with 91 additions and 12 deletions

View File

@@ -415,7 +415,7 @@ namespace Floorplan {
FloorObstacleWallDoor* door = new FloorObstacleWallDoor(
parseDoorType(n->Attribute("type")),
parseMaterial(n->Attribute("material")),
n->FloatAttribute("at"),
n->FloatAttribute("x01"),
n->FloatAttribute("width"),
n->FloatAttribute("height"),
n->BoolAttribute("lr"),
@@ -425,6 +425,22 @@ namespace Floorplan {
}
}
// windows
FOREACH_NODE(n, el) {
if (std::string("window") == n->Name()) {
FloorObstacleWallWindow* win = new FloorObstacleWallWindow(
parseWindowType(n->Attribute("type")),
parseMaterial(n->Attribute("material")),
n->FloatAttribute("x01"),
n->FloatAttribute("y"),
n->FloatAttribute("width"),
n->FloatAttribute("height"),
n->BoolAttribute("io")
);
wall->windows.push_back(win);
}
}
return wall;
}
@@ -534,6 +550,10 @@ namespace Floorplan {
try { return (DoorType) std::stoi(type); } catch (...) { return DoorType::UNKNOWN; }
}
static WindowType parseWindowType(const std::string type) {
try { return (WindowType) std::stoi(type); } catch (...) { return WindowType::UNKNOWN; }
}
static Material parseMaterial(const std::string material) {
try {
return (Material) std::stoi(material);