gui/gui_reader.cc
author deba
Wed, 22 Feb 2006 18:26:56 +0000
changeset 1979 c2992fd74dad
child 2063 9535436aaa9f
permissions -rw-r--r--
Mergeing extendermerge branch
Changes:
the extender system
resize for static size graph
UGraphExtender => UndirectGraphExtender
UGraphExtenders with changed meaning
Some UGraphExtender /SubUGraphExtenders, DirectUGraphExtender/
GridGraph => GridUGraph
radix sort to ansi compatible
     1 #include "gui_reader.h"
     2 #include "xml.h"
     3 #include "mapstorage.h"
     4 #include <lemon/xy.h>
     5 #include <vector>
     6 
     7 bool GuiReader::header(const std::string& line)
     8 {
     9   std::istringstream ls(line);
    10   std::string head;
    11   ls >> head;
    12   return head == "@gui";
    13 }
    14 
    15 void GuiReader::read(std::istream& is)
    16 {
    17   XmlIo x(is);
    18   std::map<int, xy<double> > m;
    19   x("arrow_pos", m);
    20 
    21   if ((int)m.size() != countEdges(mapstorage->graph)) return;
    22 
    23   for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
    24   {
    25     int edgeid = (int)(*mapstorage->edgemap_storage["id"])[e];
    26     mapstorage->arrow_pos.set(e, m[edgeid]);
    27   }
    28   mapstorage->ArrowPosReadOK();
    29 }
    30 
    31 GuiReader::GuiReader(LemonReader& reader, MapStorage* ms) : Parent(reader), mapstorage(ms)
    32 {
    33 }