added earth-registration load/save
This commit is contained in:
@@ -49,11 +49,34 @@ namespace Floorplan {
|
||||
root->SetAttribute("width", map->width);
|
||||
root->SetAttribute("depth", map->depth);
|
||||
|
||||
// add earth registration to the map
|
||||
addEarthReg(doc, root, map);
|
||||
|
||||
// add all floors to the map
|
||||
addFloors(doc, root, map);
|
||||
|
||||
}
|
||||
|
||||
/** add earth registration to the map */
|
||||
static void addEarthReg(XMLDoc& doc, XMLElem* root, const IndoorMap* map) {
|
||||
XMLElem* earthReg = doc.NewElement("earthReg"); {
|
||||
XMLElem* correspondences = doc.NewElement("correspondences");
|
||||
for (const Floorplan::EarthPosMapPos* reg : map->earthReg.correspondences) {
|
||||
XMLElem* point = doc.NewElement("point");
|
||||
point->SetAttribute("lat", reg->posOnEarth.lat);
|
||||
point->SetAttribute("lon", reg->posOnEarth.lon);
|
||||
point->SetAttribute("alt", reg->posOnEarth.height);
|
||||
point->SetAttribute("mx", reg->posOnMap_m.x);
|
||||
point->SetAttribute("my", reg->posOnMap_m.y);
|
||||
point->SetAttribute("mz", reg->posOnMap_m.z);
|
||||
correspondences->InsertEndChild(point);
|
||||
}
|
||||
earthReg->InsertEndChild(correspondences);
|
||||
} root->InsertEndChild(earthReg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** add all floors to the map */
|
||||
static void addFloors(XMLDoc& doc, XMLElem* root, const IndoorMap* map) {
|
||||
XMLElem* floors = doc.NewElement("floors");
|
||||
|
||||
Reference in New Issue
Block a user