gui/mapstorage.cc
changeset 1686 a5b8e0fde2be
parent 1649 95c8cd25a456
child 1708 8fea0e60f855
equal deleted inserted replaced
14:ebe41893e2fd 15:19af7afa12ca
     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