gui/xymap.h
changeset 1935 67b38d699ea7
parent 1606 dc4ea2010dee
equal deleted inserted replaced
0:fd2c26d0071b 1:af22938c8238
     1 #ifndef XYMAP_H
     1 #ifndef XYMAP_H
     2 #define XYMAP_H
     2 #define XYMAP_H
     3 
     3 
     4 #include <lemon/list_graph.h>
     4 #include <lemon/list_graph.h>
     5 #include <lemon/xy.h>
     5 #include <lemon/xy.h>
     6 
       
     7 using lemon::ListGraph;
       
     8 using lemon::xy;
       
     9 
     6 
    10 template<class M>
     7 template<class M>
    11 class XYMap
     8 class XYMap
    12 {
     9 {
    13   private:
    10   private:
    14     M *xmap, *ymap;
    11     M *xmap, *ymap;
    15 
    12 
    16   public:
    13   public:
    17     typedef typename M::Key Key;
    14     typedef typename M::Key Key;
    18     typedef xy<typename M::Value> Value;
    15     typedef lemon::xy<typename M::Value> Value;
    19     XYMap() {}
    16     XYMap() {}
    20     XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {}
    17     XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {}
    21     void setXMap(M &_xmap) { xmap = &_xmap; }
    18     void setXMap(M &_xmap) { xmap = &_xmap; }
    22     void setYMap(M &_ymap) { ymap = &_ymap; }
    19     void setYMap(M &_ymap) { ymap = &_ymap; }
    23     Value operator[](Key k) const
    20     Value operator[](Key k) const