id->label gui
authorladanyi
Tue, 18 Apr 2006 22:59:33 +0000
branchgui
changeset 13482e19031c319
parent 133 b289ba51506f
child 135 84996003b01c
id->label
graph_displayer_canvas-event.cc
gui_reader.cc
gui_writer.cc
mapstorage.cc
     1.1 --- a/graph_displayer_canvas-event.cc	Fri Apr 14 18:31:16 2006 +0000
     1.2 +++ b/graph_displayer_canvas-event.cc	Tue Apr 18 22:59:33 2006 +0000
     1.3 @@ -331,7 +331,7 @@
     1.4          }
     1.5        }
     1.6        // increment the id map's default value
     1.7 -      (mytab.mapstorage).nodemap_default["id"] += 1.0;
     1.8 +      (mytab.mapstorage).nodemap_default["label"] += 1.0;
     1.9  
    1.10        nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
    1.11            clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
    1.12 @@ -441,7 +441,7 @@
    1.13                    (mytab.mapstorage).edgemap_default[it->first];
    1.14                }
    1.15                // increment the id map's default value
    1.16 -              (mytab.mapstorage).edgemap_default["id"] += 1.0;
    1.17 +              (mytab.mapstorage).edgemap_default["label"] += 1.0;
    1.18  
    1.19                //calculating coordinates of new edge
    1.20                Gnome::Canvas::Points coos;
    1.21 @@ -673,7 +673,7 @@
    1.22            if(clicked_edge!=INVALID)
    1.23            {
    1.24              // the id map is not editable
    1.25 -            if (edgemap_to_edit == "id") return 0;
    1.26 +            if (edgemap_to_edit == "label") return 0;
    1.27  
    1.28              //and there is activated map
    1.29              if(edgetextmap[clicked_edge]->property_text().get_value()!="")
    1.30 @@ -761,7 +761,7 @@
    1.31            if(clicked_node!=INVALID)
    1.32            {
    1.33              // the id map is not editable
    1.34 -            if (nodemap_to_edit == "id") return 0;
    1.35 +            if (nodemap_to_edit == "label") return 0;
    1.36  
    1.37              //and there is activated map
    1.38              if(nodetextmap[clicked_node]->property_text().get_value()!="")
     2.1 --- a/gui_reader.cc	Fri Apr 14 18:31:16 2006 +0000
     2.2 +++ b/gui_reader.cc	Tue Apr 18 22:59:33 2006 +0000
     2.3 @@ -22,7 +22,7 @@
     2.4  
     2.5    for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
     2.6    {
     2.7 -    int edgeid = (int)(*mapstorage->edgemap_storage["id"])[e];
     2.8 +    int edgeid = (int)(*mapstorage->edgemap_storage["label"])[e];
     2.9      mapstorage->arrow_pos.set(e, m[edgeid]);
    2.10    }
    2.11    mapstorage->ArrowPosReadOK();
     3.1 --- a/gui_writer.cc	Fri Apr 14 18:31:16 2006 +0000
     3.2 +++ b/gui_writer.cc	Tue Apr 18 22:59:33 2006 +0000
     3.3 @@ -15,7 +15,7 @@
     3.4    std::map<int, xy<double> > m;
     3.5    for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
     3.6    {
     3.7 -    int edgeid = (int)(*(mapstorage->edgemap_storage["id"]))[e];
     3.8 +    int edgeid = (int)(*(mapstorage->edgemap_storage["label"]))[e];
     3.9      m[edgeid] = mapstorage->arrow_pos[e];
    3.10    }
    3.11    x("arrow_pos", m);
     4.1 --- a/mapstorage.cc	Fri Apr 14 18:31:16 2006 +0000
     4.2 +++ b/mapstorage.cc	Tue Apr 18 22:59:33 2006 +0000
     4.3 @@ -17,11 +17,11 @@
     4.4    edgemap_storage["arrow_pos_y"] = new Graph::EdgeMap<double>(graph);
     4.5    arrow_pos.setYMap(*edgemap_storage["arrow_pos_y"]);
     4.6  
     4.7 -  nodemap_storage["id"] = new Graph::NodeMap<double>(graph);
     4.8 -  edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
     4.9 +  nodemap_storage["label"] = new Graph::NodeMap<double>(graph);
    4.10 +  edgemap_storage["label"] = new Graph::EdgeMap<double>(graph);
    4.11  
    4.12 -  nodemap_default["id"] = 1.0;
    4.13 -  edgemap_default["id"] = 1.0;
    4.14 +  nodemap_default["label"] = 1.0;
    4.15 +  edgemap_default["label"] = 1.0;
    4.16  
    4.17    active_nodemaps.resize(NODE_PROPERTY_NUM);
    4.18    for(int i=0;i<NODE_PROPERTY_NUM;i++)
    4.19 @@ -251,7 +251,7 @@
    4.20          read_y = true;
    4.21          //std::cout << "read Y nodemap" << std::endl;
    4.22        }
    4.23 -      else if (*it == "id")
    4.24 +      else if (*it == "label")
    4.25        {
    4.26          //std::cout << "read id nodemap" << std::endl;
    4.27        }
    4.28 @@ -265,7 +265,7 @@
    4.29      for (std::vector<std::string>::const_iterator it = edgeMapNames.begin();
    4.30          it != edgeMapNames.end(); ++it)
    4.31      {
    4.32 -      if (*it == "id")
    4.33 +      if (*it == "label")
    4.34        {
    4.35          //std::cout << "read id edgemap" << std::endl;
    4.36        }
    4.37 @@ -287,11 +287,11 @@
    4.38  
    4.39    if (!read_edge_id)
    4.40    {
    4.41 -    edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
    4.42 +    edgemap_storage["label"] = new Graph::EdgeMap<double>(graph);
    4.43      int i = 1;
    4.44      for (EdgeIt e(graph); e != INVALID; ++e)
    4.45      {
    4.46 -      (*edgemap_storage["id"])[e] = i++;
    4.47 +      (*edgemap_storage["label"])[e] = i++;
    4.48      }
    4.49    }
    4.50  
    4.51 @@ -326,28 +326,28 @@
    4.52    for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
    4.53        nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
    4.54    {
    4.55 -    if ((it->first != "id") &&
    4.56 +    if ((it->first != "label") &&
    4.57          (it->first != "coordiantes_x") &&
    4.58          (it->first != "coordinates_y"))
    4.59      {
    4.60        nodemap_default[it->first] = 0.0;
    4.61      }
    4.62 -    else if (it->first == "id")
    4.63 +    else if (it->first == "label")
    4.64      {
    4.65        NodeIt n(graph);
    4.66 -      double max = (*nodemap_storage["id"])[n];
    4.67 +      double max = (*nodemap_storage["label"])[n];
    4.68        for (; n != INVALID; ++n)
    4.69        {
    4.70 -        if ((*nodemap_storage["id"])[n] > max)
    4.71 -          max = (*nodemap_storage["id"])[n];
    4.72 +        if ((*nodemap_storage["label"])[n] > max)
    4.73 +          max = (*nodemap_storage["label"])[n];
    4.74        }
    4.75 -      nodemap_default["id"] = max + 1.0;
    4.76 +      nodemap_default["label"] = max + 1.0;
    4.77      }
    4.78    }
    4.79    for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
    4.80        edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
    4.81    {
    4.82 -    if (it->first != "id")
    4.83 +    if (it->first != "label")
    4.84      {
    4.85        edgemap_default[it->first] = 0.0;
    4.86      }
    4.87 @@ -356,13 +356,13 @@
    4.88        double max = std::numeric_limits<double>::min();
    4.89        for (EdgeIt e(graph); e != INVALID; ++e)
    4.90        {
    4.91 -        if ((*edgemap_storage["id"])[e] > max)
    4.92 -          max = (*edgemap_storage["id"])[e];
    4.93 +        if ((*edgemap_storage["label"])[e] > max)
    4.94 +          max = (*edgemap_storage["label"])[e];
    4.95        }
    4.96        if (max > std::numeric_limits<double>::min())
    4.97 -        edgemap_default["id"] = max + 1.0;
    4.98 +        edgemap_default["label"] = max + 1.0;
    4.99        else
   4.100 -        edgemap_default["id"] = 1.0;
   4.101 +        edgemap_default["label"] = 1.0;
   4.102      }
   4.103    }
   4.104  
   4.105 @@ -400,7 +400,7 @@
   4.106    {
   4.107      if ((it->first != "coordinates_x") &&
   4.108          (it->first != "coordinates_y") &&
   4.109 -        (it->first != "id"))
   4.110 +        (it->first != "label"))
   4.111      {
   4.112        delete it->second;
   4.113        nodemap_storage.erase(it);
   4.114 @@ -409,7 +409,7 @@
   4.115    for (std::map<std::string, Graph::EdgeMap<double>*>::iterator it =
   4.116        edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
   4.117    {
   4.118 -    if ((it->first != "id") &&
   4.119 +    if ((it->first != "label") &&
   4.120          (it->first != "arrow_pos_x") &&
   4.121          (it->first != "arrow_pos_y"))
   4.122      {
   4.123 @@ -420,13 +420,13 @@
   4.124    for (std::map<std::string, double>::iterator it =
   4.125        nodemap_default.begin(); it != nodemap_default.end(); ++it)
   4.126    {
   4.127 -    if (it->first != "id")
   4.128 +    if (it->first != "label")
   4.129        nodemap_default.erase(it);
   4.130    }
   4.131    for (std::map<std::string, double>::iterator it =
   4.132        edgemap_default.begin(); it != edgemap_default.end(); ++it)
   4.133    {
   4.134 -    if (it->first != "id")
   4.135 +    if (it->first != "label")
   4.136        edgemap_default.erase(it);
   4.137    }
   4.138    graph.clear();