added "outdoor" support to floorplan and grid-nodes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user