mapstorage.cc
branchgui
changeset 77 ba023627ff1a
parent 67 052cfd7832b1
child 79 e6619f95c97e
equal deleted inserted replaced
14:89099480817f 15:cab147404b6b
     1 #include "mapstorage.h"
     1 #include "mapstorage.h"
     2 #include <gtkmm.h>
     2 #include <gtkmm.h>
       
     3 #include <cmath>
       
     4 
     3 #include <cmath>
     5 #include <cmath>
     4 
     6 
     5 MapStorage::MapStorage() : modified(false), file_name("")
     7 MapStorage::MapStorage() : modified(false), file_name("")
     6 {
     8 {
     7   nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph);
     9   nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph);
   206     const double pi = 3.142;
   208     const double pi = 3.142;
   207     double step = 2 * pi / (double) node_num;
   209     double step = 2 * pi / (double) node_num;
   208     int i = 0;
   210     int i = 0;
   209     for (NodeIt n(graph); n != INVALID; ++n)
   211     for (NodeIt n(graph); n != INVALID; ++n)
   210     {
   212     {
   211       nodemap_storage["coordinates_x"]->set(n, 250.0 * cos(i * step));
   213       nodemap_storage["coordinates_x"]->set(n, 250.0 * std::cos(i * step));
   212       nodemap_storage["coordinates_y"]->set(n, 250.0 * sin(i * step));
   214       nodemap_storage["coordinates_y"]->set(n, 250.0 * std::sin(i * step));
   213       i++;
   215       i++;
   214     }
   216     }
   215   }
   217   }
   216 
   218 
   217   // fill in the default values for the maps
   219   // fill in the default values for the maps