[Lemon-commits] [lemon_svn] ladanyi: r2708 - hugo/trunk/gui

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:54:38 CET 2006


Author: ladanyi
Date: Wed Apr 19 00:59:33 2006
New Revision: 2708

Modified:
   hugo/trunk/gui/graph_displayer_canvas-event.cc
   hugo/trunk/gui/gui_reader.cc
   hugo/trunk/gui/gui_writer.cc
   hugo/trunk/gui/mapstorage.cc

Log:
id->label

Modified: hugo/trunk/gui/graph_displayer_canvas-event.cc
==============================================================================
--- hugo/trunk/gui/graph_displayer_canvas-event.cc	(original)
+++ hugo/trunk/gui/graph_displayer_canvas-event.cc	Wed Apr 19 00:59:33 2006
@@ -331,7 +331,7 @@
         }
       }
       // increment the id map's default value
-      (mytab.mapstorage).nodemap_default["id"] += 1.0;
+      (mytab.mapstorage).nodemap_default["label"] += 1.0;
 
       nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
           clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
@@ -441,7 +441,7 @@
                   (mytab.mapstorage).edgemap_default[it->first];
               }
               // increment the id map's default value
-              (mytab.mapstorage).edgemap_default["id"] += 1.0;
+              (mytab.mapstorage).edgemap_default["label"] += 1.0;
 
               //calculating coordinates of new edge
               Gnome::Canvas::Points coos;
@@ -673,7 +673,7 @@
           if(clicked_edge!=INVALID)
           {
             // the id map is not editable
-            if (edgemap_to_edit == "id") return 0;
+            if (edgemap_to_edit == "label") return 0;
 
             //and there is activated map
             if(edgetextmap[clicked_edge]->property_text().get_value()!="")
@@ -761,7 +761,7 @@
           if(clicked_node!=INVALID)
           {
             // the id map is not editable
-            if (nodemap_to_edit == "id") return 0;
+            if (nodemap_to_edit == "label") return 0;
 
             //and there is activated map
             if(nodetextmap[clicked_node]->property_text().get_value()!="")

Modified: hugo/trunk/gui/gui_reader.cc
==============================================================================
--- hugo/trunk/gui/gui_reader.cc	(original)
+++ hugo/trunk/gui/gui_reader.cc	Wed Apr 19 00:59:33 2006
@@ -22,7 +22,7 @@
 
   for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
   {
-    int edgeid = (int)(*mapstorage->edgemap_storage["id"])[e];
+    int edgeid = (int)(*mapstorage->edgemap_storage["label"])[e];
     mapstorage->arrow_pos.set(e, m[edgeid]);
   }
   mapstorage->ArrowPosReadOK();

Modified: hugo/trunk/gui/gui_writer.cc
==============================================================================
--- hugo/trunk/gui/gui_writer.cc	(original)
+++ hugo/trunk/gui/gui_writer.cc	Wed Apr 19 00:59:33 2006
@@ -15,7 +15,7 @@
   std::map<int, xy<double> > m;
   for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
   {
-    int edgeid = (int)(*(mapstorage->edgemap_storage["id"]))[e];
+    int edgeid = (int)(*(mapstorage->edgemap_storage["label"]))[e];
     m[edgeid] = mapstorage->arrow_pos[e];
   }
   x("arrow_pos", m);

Modified: hugo/trunk/gui/mapstorage.cc
==============================================================================
--- hugo/trunk/gui/mapstorage.cc	(original)
+++ hugo/trunk/gui/mapstorage.cc	Wed Apr 19 00:59:33 2006
@@ -17,11 +17,11 @@
   edgemap_storage["arrow_pos_y"] = new Graph::EdgeMap<double>(graph);
   arrow_pos.setYMap(*edgemap_storage["arrow_pos_y"]);
 
-  nodemap_storage["id"] = new Graph::NodeMap<double>(graph);
-  edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
+  nodemap_storage["label"] = new Graph::NodeMap<double>(graph);
+  edgemap_storage["label"] = new Graph::EdgeMap<double>(graph);
 
-  nodemap_default["id"] = 1.0;
-  edgemap_default["id"] = 1.0;
+  nodemap_default["label"] = 1.0;
+  edgemap_default["label"] = 1.0;
 
   active_nodemaps.resize(NODE_PROPERTY_NUM);
   for(int i=0;i<NODE_PROPERTY_NUM;i++)
@@ -251,7 +251,7 @@
         read_y = true;
         //std::cout << "read Y nodemap" << std::endl;
       }
-      else if (*it == "id")
+      else if (*it == "label")
       {
         //std::cout << "read id nodemap" << std::endl;
       }
@@ -265,7 +265,7 @@
     for (std::vector<std::string>::const_iterator it = edgeMapNames.begin();
         it != edgeMapNames.end(); ++it)
     {
-      if (*it == "id")
+      if (*it == "label")
       {
         //std::cout << "read id edgemap" << std::endl;
       }
@@ -287,11 +287,11 @@
 
   if (!read_edge_id)
   {
-    edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
+    edgemap_storage["label"] = new Graph::EdgeMap<double>(graph);
     int i = 1;
     for (EdgeIt e(graph); e != INVALID; ++e)
     {
-      (*edgemap_storage["id"])[e] = i++;
+      (*edgemap_storage["label"])[e] = i++;
     }
   }
 
@@ -326,28 +326,28 @@
   for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
       nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
   {
-    if ((it->first != "id") &&
+    if ((it->first != "label") &&
         (it->first != "coordiantes_x") &&
         (it->first != "coordinates_y"))
     {
       nodemap_default[it->first] = 0.0;
     }
-    else if (it->first == "id")
+    else if (it->first == "label")
     {
       NodeIt n(graph);
-      double max = (*nodemap_storage["id"])[n];
+      double max = (*nodemap_storage["label"])[n];
       for (; n != INVALID; ++n)
       {
-        if ((*nodemap_storage["id"])[n] > max)
-          max = (*nodemap_storage["id"])[n];
+        if ((*nodemap_storage["label"])[n] > max)
+          max = (*nodemap_storage["label"])[n];
       }
-      nodemap_default["id"] = max + 1.0;
+      nodemap_default["label"] = max + 1.0;
     }
   }
   for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
       edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
   {
-    if (it->first != "id")
+    if (it->first != "label")
     {
       edgemap_default[it->first] = 0.0;
     }
@@ -356,13 +356,13 @@
       double max = std::numeric_limits<double>::min();
       for (EdgeIt e(graph); e != INVALID; ++e)
       {
-        if ((*edgemap_storage["id"])[e] > max)
-          max = (*edgemap_storage["id"])[e];
+        if ((*edgemap_storage["label"])[e] > max)
+          max = (*edgemap_storage["label"])[e];
       }
       if (max > std::numeric_limits<double>::min())
-        edgemap_default["id"] = max + 1.0;
+        edgemap_default["label"] = max + 1.0;
       else
-        edgemap_default["id"] = 1.0;
+        edgemap_default["label"] = 1.0;
     }
   }
 
@@ -400,7 +400,7 @@
   {
     if ((it->first != "coordinates_x") &&
         (it->first != "coordinates_y") &&
-        (it->first != "id"))
+        (it->first != "label"))
     {
       delete it->second;
       nodemap_storage.erase(it);
@@ -409,7 +409,7 @@
   for (std::map<std::string, Graph::EdgeMap<double>*>::iterator it =
       edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
   {
-    if ((it->first != "id") &&
+    if ((it->first != "label") &&
         (it->first != "arrow_pos_x") &&
         (it->first != "arrow_pos_y"))
     {
@@ -420,13 +420,13 @@
   for (std::map<std::string, double>::iterator it =
       nodemap_default.begin(); it != nodemap_default.end(); ++it)
   {
-    if (it->first != "id")
+    if (it->first != "label")
       nodemap_default.erase(it);
   }
   for (std::map<std::string, double>::iterator it =
       edgemap_default.begin(); it != edgemap_default.end(); ++it)
   {
-    if (it->first != "id")
+    if (it->first != "label")
       edgemap_default.erase(it);
   }
   graph.clear();



More information about the Lemon-commits mailing list