added "outdoor" support to floorplan and grid-nodes

This commit is contained in:
2017-03-12 16:47:29 +01:00
parent e88f0b85a6
commit 7ec5fef697
5 changed files with 55 additions and 27 deletions

View File

@@ -298,15 +298,13 @@ namespace Floorplan {
OutlineMethod method;
std::string name;
Polygon2 poly;
FloorOutlinePolygon() : method(OutlineMethod::ADD), name(), poly() {;}
FloorOutlinePolygon(const OutlineMethod method, const std::string& name, const Polygon2& poly) : method(method), name(name), poly(poly) {;}
bool operator == (const FloorOutlinePolygon& o) const {return (o.method == method) && (o.name == name) && (o.poly == poly);}
bool outdoor; // special marker
FloorOutlinePolygon() : method(OutlineMethod::ADD), name(), poly(), outdoor(false) {;}
FloorOutlinePolygon(const OutlineMethod method, const std::string& name, const Polygon2& poly, bool outdoor) : method(method), name(name), poly(poly), outdoor(outdoor) {;}
bool operator == (const FloorOutlinePolygon& o) const {return (o.method == method) && (o.name == name) && (o.poly == poly) && (o.outdoor == outdoor);}
};
/** base-class for one obstacle (wall, door, window, pillar, ..) within a floor */
struct FloorObstacle {
Material material;

View File

@@ -412,6 +412,7 @@ namespace Floorplan {
static FloorOutlinePolygon* parseFloorPolygon(const XMLElem* el) {
FloorOutlinePolygon* poly = new FloorOutlinePolygon();
poly->name = el->Attribute("name");
poly->outdoor = el->BoolAttribute("outdoor");
poly->method = parseOutlineMethod(el->Attribute("method"));
poly->poly = parsePoly2(el);
return poly;

View File

@@ -227,6 +227,7 @@ namespace Floorplan {
XMLElem* polygon = doc.NewElement("polygon");
polygon->SetAttribute("name", poly->name.c_str());
polygon->SetAttribute("method", method.c_str());
polygon->SetAttribute("outdoor", poly->outdoor);
dst->InsertEndChild(polygon);
for (Point2 p : poly->poly.points) {