src/work/peter/xy-reader.cc
changeset 1285 bf1840562c67
parent 1277 e4cc8e996912
child 1286 692948b894e8
equal deleted inserted replaced
0:054b3f278fa9 1:956e029c9089
     1 #include <fstream>
     1 #include <fstream>
     2 #include <iostream>
     2 #include <iostream>
     3 
     3 
     4 #include <lemon/xy.h>
     4 #include <lemon/xy.h>
     5 #include <lemon/concept/maps.h>
     5 #include <lemon/maps.h>
     6 #include <lemon/error.h>
     6 #include <lemon/error.h>
     7 #include <lemon/list_graph.h>
     7 #include <lemon/list_graph.h>
     8 #include <lemon/graph_reader.h>
     8 #include <lemon/graph_reader.h>
     9 #include <lemon/graph_utils.h>
     9 #include <lemon/graph_utils.h>
    10 
    10 
    13 typedef ListGraph Graph;
    13 typedef ListGraph Graph;
    14 typedef xy<double> Coordinates;
    14 typedef xy<double> Coordinates;
    15 typedef Graph::NodeMap<Coordinates> CoordinatesMap;
    15 typedef Graph::NodeMap<Coordinates> CoordinatesMap;
    16 typedef Graph::Node Node;
    16 typedef Graph::Node Node;
    17 
    17 
    18 class CoordReaderMap: public concept::WriteMap<Node, double>
    18 class CoordReaderMap: public MapBase<Node, double>
    19 {
    19 {
    20     CoordinatesMap * cm;
    20     CoordinatesMap * cm;
    21     char xoy;
    21     char xoy;
    22 
    22 
    23 public:
    23 public:
    24     CoordReaderMap(char xory, CoordinatesMap * coordmap): concept::WriteMap<Node, double>() ,cm(coordmap)
    24     CoordReaderMap(char xory, CoordinatesMap * coordmap): cm(coordmap)
    25     {
    25     {
    26 	switch(xory)
    26 	switch(xory)
    27 	{
    27 	{
    28 	    case 'x':
    28 	    case 'x':
    29 	    case 'y':
    29 	    case 'y':