author | hegyi |
Wed, 25 Oct 2006 13:21:24 +0000 | |
changeset 172 | fc1e478697d3 |
parent 150 | 86273bfe0e4d |
child 174 | 95872af46fc4 |
permissions | -rw-r--r-- |
ladanyi@98 | 1 |
#include "gui_writer.h" |
ladanyi@98 | 2 |
#include "xml.h" |
ladanyi@98 | 3 |
#include "mapstorage.h" |
hegyi@150 | 4 |
#include <lemon/dim2.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); |
hegyi@150 | 15 |
std::map<int, XY > m; |
ladanyi@98 | 16 |
for (EdgeIt e(mapstorage->graph); e != INVALID; ++e) |
ladanyi@98 | 17 |
{ |
ladanyi@134 | 18 |
int edgeid = (int)(*(mapstorage->edgemap_storage["label"]))[e]; |
ladanyi@98 | 19 |
m[edgeid] = mapstorage->arrow_pos[e]; |
ladanyi@98 | 20 |
} |
ladanyi@98 | 21 |
x("arrow_pos", m); |
hegyi@172 | 22 |
|
hegyi@172 | 23 |
std::map<int, std::string> nm; |
hegyi@172 | 24 |
for(int i=0;i<NODE_PROPERTY_NUM;i++) |
hegyi@172 | 25 |
{ |
hegyi@172 | 26 |
nm[i]=mapstorage->active_nodemaps[i]; |
hegyi@172 | 27 |
} |
hegyi@172 | 28 |
x("active_nodemaps", nm); |
hegyi@172 | 29 |
|
hegyi@172 | 30 |
std::map<int, std::string> em; |
hegyi@172 | 31 |
for(int i=0;i<EDGE_PROPERTY_NUM;i++) |
hegyi@172 | 32 |
{ |
hegyi@172 | 33 |
em[i]=mapstorage->active_edgemaps[i]; |
hegyi@172 | 34 |
} |
hegyi@172 | 35 |
x("active_edgemaps", em); |
ladanyi@98 | 36 |
} |
ladanyi@98 | 37 |
|
ladanyi@98 | 38 |
GuiWriter::GuiWriter(LemonWriter& writer, MapStorage* ms) : Parent(writer), mapstorage(ms) |
ladanyi@98 | 39 |
{ |
ladanyi@98 | 40 |
} |