gui/mapstorage.cc
changeset 2063 9535436aaa9f
parent 1939 591e717155ac
child 2065 780e27579198
     1.1 --- a/gui/mapstorage.cc	Tue Apr 18 13:25:41 2006 +0000
     1.2 +++ b/gui/mapstorage.cc	Tue Apr 18 22:59:33 2006 +0000
     1.3 @@ -17,11 +17,11 @@
     1.4    edgemap_storage["arrow_pos_y"] = new Graph::EdgeMap<double>(graph);
     1.5    arrow_pos.setYMap(*edgemap_storage["arrow_pos_y"]);
     1.6  
     1.7 -  nodemap_storage["id"] = new Graph::NodeMap<double>(graph);
     1.8 -  edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
     1.9 +  nodemap_storage["label"] = new Graph::NodeMap<double>(graph);
    1.10 +  edgemap_storage["label"] = new Graph::EdgeMap<double>(graph);
    1.11  
    1.12 -  nodemap_default["id"] = 1.0;
    1.13 -  edgemap_default["id"] = 1.0;
    1.14 +  nodemap_default["label"] = 1.0;
    1.15 +  edgemap_default["label"] = 1.0;
    1.16  
    1.17    active_nodemaps.resize(NODE_PROPERTY_NUM);
    1.18    for(int i=0;i<NODE_PROPERTY_NUM;i++)
    1.19 @@ -251,7 +251,7 @@
    1.20          read_y = true;
    1.21          //std::cout << "read Y nodemap" << std::endl;
    1.22        }
    1.23 -      else if (*it == "id")
    1.24 +      else if (*it == "label")
    1.25        {
    1.26          //std::cout << "read id nodemap" << std::endl;
    1.27        }
    1.28 @@ -265,7 +265,7 @@
    1.29      for (std::vector<std::string>::const_iterator it = edgeMapNames.begin();
    1.30          it != edgeMapNames.end(); ++it)
    1.31      {
    1.32 -      if (*it == "id")
    1.33 +      if (*it == "label")
    1.34        {
    1.35          //std::cout << "read id edgemap" << std::endl;
    1.36        }
    1.37 @@ -287,11 +287,11 @@
    1.38  
    1.39    if (!read_edge_id)
    1.40    {
    1.41 -    edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
    1.42 +    edgemap_storage["label"] = new Graph::EdgeMap<double>(graph);
    1.43      int i = 1;
    1.44      for (EdgeIt e(graph); e != INVALID; ++e)
    1.45      {
    1.46 -      (*edgemap_storage["id"])[e] = i++;
    1.47 +      (*edgemap_storage["label"])[e] = i++;
    1.48      }
    1.49    }
    1.50  
    1.51 @@ -326,28 +326,28 @@
    1.52    for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
    1.53        nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
    1.54    {
    1.55 -    if ((it->first != "id") &&
    1.56 +    if ((it->first != "label") &&
    1.57          (it->first != "coordiantes_x") &&
    1.58          (it->first != "coordinates_y"))
    1.59      {
    1.60        nodemap_default[it->first] = 0.0;
    1.61      }
    1.62 -    else if (it->first == "id")
    1.63 +    else if (it->first == "label")
    1.64      {
    1.65        NodeIt n(graph);
    1.66 -      double max = (*nodemap_storage["id"])[n];
    1.67 +      double max = (*nodemap_storage["label"])[n];
    1.68        for (; n != INVALID; ++n)
    1.69        {
    1.70 -        if ((*nodemap_storage["id"])[n] > max)
    1.71 -          max = (*nodemap_storage["id"])[n];
    1.72 +        if ((*nodemap_storage["label"])[n] > max)
    1.73 +          max = (*nodemap_storage["label"])[n];
    1.74        }
    1.75 -      nodemap_default["id"] = max + 1.0;
    1.76 +      nodemap_default["label"] = max + 1.0;
    1.77      }
    1.78    }
    1.79    for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
    1.80        edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
    1.81    {
    1.82 -    if (it->first != "id")
    1.83 +    if (it->first != "label")
    1.84      {
    1.85        edgemap_default[it->first] = 0.0;
    1.86      }
    1.87 @@ -356,13 +356,13 @@
    1.88        double max = std::numeric_limits<double>::min();
    1.89        for (EdgeIt e(graph); e != INVALID; ++e)
    1.90        {
    1.91 -        if ((*edgemap_storage["id"])[e] > max)
    1.92 -          max = (*edgemap_storage["id"])[e];
    1.93 +        if ((*edgemap_storage["label"])[e] > max)
    1.94 +          max = (*edgemap_storage["label"])[e];
    1.95        }
    1.96        if (max > std::numeric_limits<double>::min())
    1.97 -        edgemap_default["id"] = max + 1.0;
    1.98 +        edgemap_default["label"] = max + 1.0;
    1.99        else
   1.100 -        edgemap_default["id"] = 1.0;
   1.101 +        edgemap_default["label"] = 1.0;
   1.102      }
   1.103    }
   1.104  
   1.105 @@ -400,7 +400,7 @@
   1.106    {
   1.107      if ((it->first != "coordinates_x") &&
   1.108          (it->first != "coordinates_y") &&
   1.109 -        (it->first != "id"))
   1.110 +        (it->first != "label"))
   1.111      {
   1.112        delete it->second;
   1.113        nodemap_storage.erase(it);
   1.114 @@ -409,7 +409,7 @@
   1.115    for (std::map<std::string, Graph::EdgeMap<double>*>::iterator it =
   1.116        edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
   1.117    {
   1.118 -    if ((it->first != "id") &&
   1.119 +    if ((it->first != "label") &&
   1.120          (it->first != "arrow_pos_x") &&
   1.121          (it->first != "arrow_pos_y"))
   1.122      {
   1.123 @@ -420,13 +420,13 @@
   1.124    for (std::map<std::string, double>::iterator it =
   1.125        nodemap_default.begin(); it != nodemap_default.end(); ++it)
   1.126    {
   1.127 -    if (it->first != "id")
   1.128 +    if (it->first != "label")
   1.129        nodemap_default.erase(it);
   1.130    }
   1.131    for (std::map<std::string, double>::iterator it =
   1.132        edgemap_default.begin(); it != edgemap_default.end(); ++it)
   1.133    {
   1.134 -    if (it->first != "id")
   1.135 +    if (it->first != "label")
   1.136        edgemap_default.erase(it);
   1.137    }
   1.138    graph.clear();