#include "gui_reader.h" #include "xml.h" #include "mapstorage.h" #include #include bool GuiReader::header(const std::string& line) { std::istringstream ls(line); std::string head; ls >> head; return head == "@gui"; } void GuiReader::read(std::istream& is) { XmlIo x(is); std::map m; x("arrow_pos", m); if ((int)m.size() != countEdges(mapstorage->graph)) return; for (EdgeIt e(mapstorage->graph); e != INVALID; ++e) { int edgeid = (int)(*mapstorage->edgemap_storage["label"])[e]; mapstorage->arrow_pos.set(e, m[edgeid]); } mapstorage->ArrowPosReadOK(); std::map nm; x("active_nodemaps", nm); for(int i=0;ichangeActiveMap(false, i, nm[i]); } std::map em; x("active_edgemaps", em); for(int i=0;ichangeActiveMap(true, i, em[i]); } } GuiReader::GuiReader(LemonReader& reader, MapStorage* ms) : Parent(reader), mapstorage(ms) { }