added support for adding fingerprint-locations with meta information
This commit is contained in:
@@ -105,6 +105,7 @@ namespace Floorplan {
|
||||
if (std::string("obstacles") == n->Name()) {floor->obstacles = parseFloorObstacles(n);}
|
||||
if (std::string("accesspoints") == n->Name()) {floor->accesspoints = parseFloorAccessPoints(n);}
|
||||
if (std::string("beacons") == n->Name()) {floor->beacons = parseFloorBeacons(n);}
|
||||
if (std::string("fingerprints") == n->Name()) {floor->fpLocations = parseFingerprintLocations(n);}
|
||||
if (std::string("regions") == n->Name()) {floor->regions = parseFloorRegions(n);}
|
||||
if (std::string("underlays") == n->Name()) {floor->underlays = parseFloorUnderlays(n);}
|
||||
if (std::string("pois") == n->Name()) {floor->pois = parseFloorPOIs(n);}
|
||||
@@ -291,6 +292,28 @@ namespace Floorplan {
|
||||
return b;
|
||||
}
|
||||
|
||||
/** parse <fingerprints> <location>s */
|
||||
static std::vector<FingerprintLocation*> parseFingerprintLocations(const XMLElem* el) {
|
||||
assertNode("fingerprints", el);
|
||||
std::vector<FingerprintLocation*> vec;
|
||||
FOREACH_NODE(n, el) {
|
||||
if (std::string("location") == n->Name()) { vec.push_back(parseFingerprintLocation(n)); }
|
||||
}
|
||||
return vec;
|
||||
}
|
||||
|
||||
/** parse one fingerprint <location> */
|
||||
static FingerprintLocation* parseFingerprintLocation(const XMLElem* n) {
|
||||
assertNode("location", n);
|
||||
FingerprintLocation* fpl = new FingerprintLocation();
|
||||
fpl->name = n->Attribute("name");
|
||||
fpl->posOnFloor.x = n->FloatAttribute("x");
|
||||
fpl->posOnFloor.y = n->FloatAttribute("y");
|
||||
fpl->heightAboveFloor = n->FloatAttribute("dz");
|
||||
const XMLElem* meta = n->FirstChildElement("meta");
|
||||
if (meta) {fpl->setMeta(parseMetaElement(meta));}
|
||||
return fpl;
|
||||
}
|
||||
|
||||
static std::vector<FloorRegion*> parseFloorRegions(const XMLElem* el) {
|
||||
std::vector<FloorRegion*> vec;
|
||||
|
||||
Reference in New Issue
Block a user