Added two new classes.
1 #include "gui_reader.h"
3 #include "mapstorage.h"
4 #include <lemon/dim2.h>
7 bool GuiReader::header(const std::string& line)
9 std::istringstream ls(line);
12 return head == "@gui";
15 void GuiReader::read(std::istream& is)
21 if ((int)m.size() != countEdges(mapstorage->graph)) return;
23 for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
25 int edgeid = (int)(*mapstorage->edgemap_storage["label"])[e];
26 mapstorage->arrow_pos.set(e, m[edgeid]);
28 mapstorage->ArrowPosReadOK();
30 std::map<int, std::string> nm;
31 x("active_nodemaps", nm);
33 for(int i=0;i<NODE_PROPERTY_NUM;i++)
35 mapstorage->changeActiveMap(false, i, nm[i]);
38 std::map<int, std::string> em;
39 x("active_edgemaps", em);
40 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
42 mapstorage->changeActiveMap(true, i, em[i]);
46 GuiReader::GuiReader(LemonReader& reader, MapStorage* ms) : Parent(reader), mapstorage(ms)