gui_writer.cc
author hegyi
Fri, 06 Jan 2006 14:36:46 +0000
branchgui
changeset 112 3689cb170d3e
child 134 82e19031c319
permissions -rw-r--r--
MapSelector has become a standalone class.
ladanyi@98
     1
#include "gui_writer.h"
ladanyi@98
     2
#include "xml.h"
ladanyi@98
     3
#include "mapstorage.h"
ladanyi@98
     4
#include <lemon/xy.h>
ladanyi@98
     5
#include <vector>
ladanyi@98
     6
ladanyi@98
     7
std::string GuiWriter::header()
ladanyi@98
     8
{
ladanyi@98
     9
  return "@gui";
ladanyi@98
    10
}
ladanyi@98
    11
ladanyi@98
    12
void GuiWriter::write(std::ostream& os)
ladanyi@98
    13
{
ladanyi@98
    14
  XmlIo x(os);
ladanyi@98
    15
  std::map<int, xy<double> > m;
ladanyi@98
    16
  for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
ladanyi@98
    17
  {
ladanyi@98
    18
    int edgeid = (int)(*(mapstorage->edgemap_storage["id"]))[e];
ladanyi@98
    19
    m[edgeid] = mapstorage->arrow_pos[e];
ladanyi@98
    20
  }
ladanyi@98
    21
  x("arrow_pos", m);
ladanyi@98
    22
}
ladanyi@98
    23
ladanyi@98
    24
GuiWriter::GuiWriter(LemonWriter& writer, MapStorage* ms) : Parent(writer), mapstorage(ms)
ladanyi@98
    25
{
ladanyi@98
    26
}