# HG changeset patch
# User alpar
# Date 1124372029 0
# Node ID 80eefca04b1ef0beb028347ac088b2690577d0fb
# Parent  d5668800f774d7d3aefad830c1359349b02a23ae
- The number of gcc-4.0 warnings has significantly decreases.
- Some code clean-up in gui

diff -r d5668800f774 -r 80eefca04b1e all_include.h
--- a/all_include.h	Wed Aug 17 15:20:18 2005 +0000
+++ b/all_include.h	Thu Aug 18 13:33:49 2005 +0000
@@ -40,6 +40,7 @@
 typedef ListGraph Graph;
 typedef Graph::NodeMap<Coordinates> CoordinatesMap;
 typedef Graph::Node Node;
+typedef Graph::Edge Edge;
 typedef Graph::EdgeIt EdgeIt;
 typedef Graph::NodeIt NodeIt;
 
diff -r d5668800f774 -r 80eefca04b1e graph_displayer_canvas-edge.cc
--- a/graph_displayer_canvas-edge.cc	Wed Aug 17 15:20:18 2005 +0000
+++ b/graph_displayer_canvas-edge.cc	Thu Aug 18 13:33:49 2005 +0000
@@ -3,7 +3,7 @@
 #include <cmath>
 
 
-int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge)
+int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Edge edge)
 {
   Graph::EdgeMap<double> * actual_map;
   double min, max;
@@ -49,7 +49,7 @@
   return 0;
 };
 
-int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Graph::Edge edge)
+int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Edge edge)
 {  
 
   //function maps the range of the maximum and
@@ -116,7 +116,7 @@
   return 0;
 };
 
-int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Graph::Edge edge)
+int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Edge edge)
 {
   //the number in the map will be written on the edge
   //EXCEPT when the name of the map is Default, because
diff -r d5668800f774 -r 80eefca04b1e graph_displayer_canvas-event.cc
--- a/graph_displayer_canvas-event.cc	Wed Aug 17 15:20:18 2005 +0000
+++ b/graph_displayer_canvas-event.cc	Thu Aug 18 13:33:49 2005 +0000
@@ -225,7 +225,7 @@
 
       isbutton=1;
 
-      active_node=NodeIt(mapstorage.graph,mapstorage.graph.addNode());
+      active_node=mapstorage.graph.addNode();
 
       //initiating values corresponding to new node in maps
 
@@ -339,7 +339,7 @@
 	    {
 	      window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
 	      target_item=(get_item_at(clicked_x, clicked_y));
-	      Graph::NodeIt target_node=INVALID;
+	      Node target_node=INVALID;
 	      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 		{
 		  if(nodesmap[i]==target_item)
@@ -354,14 +354,17 @@
 		    {
           mapstorage.modified = true;
 
-		      *(nodesmap[target_node]) << Gnome::Canvas::Properties::fill_color("red");
+		      *(nodesmap[target_node]) <<
+			Gnome::Canvas::Properties::fill_color("red");
 
 		      //creating new edge
-		      active_edge=EdgeIt(mapstorage.graph,mapstorage.graph.addEdge(active_node, target_node));
+		      active_edge=mapstorage.graph.addEdge(active_node,
+							   target_node);
 
 		      //initiating values corresponding to new edge in maps
 		      mapstorage.initMapsForEdge(active_edge);
-                      (*mapstorage.edgemap_storage["id"])[active_edge] = mapstorage.graph.id(active_edge);
+                      (*mapstorage.edgemap_storage["id"])[active_edge] = 
+			mapstorage.graph.id(active_edge);
 	  
 		      //calculating coordinates of new edge
 		      Gnome::Canvas::Points coos;
@@ -555,7 +558,7 @@
 	  //If the click happened on an edge we place the entrywidget there and fill in the value of the activated map at that edge.
 	  {
 	    //for determine, whether it was an edge
-	    Graph::EdgeIt clicked_edge=INVALID;
+	    Edge clicked_edge=INVALID;
 
 	    //find the activated item between texts
 	    active_item=(get_item_at(e->button.x, e->button.y));
@@ -677,7 +680,7 @@
 	  //If the click happened on an edge we place the entrywidget there and fill in the value of the activated map at that edge.
 	  {
 	    //for determine, whether it was a node
-	    Graph::NodeIt clicked_node=INVALID;
+	    Node clicked_node=INVALID;
 
 	    //find the activated item between texts
 	    active_item=(get_item_at(e->button.x, e->button.y));
@@ -849,21 +852,14 @@
   return false;
 }
 
-void GraphDisplayerCanvas::deleteItem(NodeIt node_to_delete)
+void GraphDisplayerCanvas::deleteItem(Node node_to_delete)
 {
   delete(nodetextmap[node_to_delete]);
   delete(nodesmap[node_to_delete]);
   mapstorage.graph.erase(node_to_delete);
 }
 
-void GraphDisplayerCanvas::deleteItem(EdgeIt edge_to_delete)
-{
-  delete(edgetextmap[edge_to_delete]);
-  delete(edgesmap[edge_to_delete]);
-  mapstorage.graph.erase(edge_to_delete);
-}
-
-void GraphDisplayerCanvas::deleteItem(Graph::Edge edge_to_delete)
+void GraphDisplayerCanvas::deleteItem(Edge edge_to_delete)
 {
   delete(edgetextmap[edge_to_delete]);
   delete(edgesmap[edge_to_delete]);
diff -r d5668800f774 -r 80eefca04b1e graph_displayer_canvas-node.cc
--- a/graph_displayer_canvas-node.cc	Wed Aug 17 15:20:18 2005 +0000
+++ b/graph_displayer_canvas-node.cc	Thu Aug 18 13:33:49 2005 +0000
@@ -3,7 +3,7 @@
 #include <cmath>
 
 
-int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Graph::Node node)
+int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node)
 {
   Graph::NodeMap<double> * actual_map;
   double min, max;
@@ -69,7 +69,7 @@
   return 0;
 };
 
-int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Graph::Node node)
+int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Node node)
 {  
 
   //function maps the range of the maximum and
@@ -141,7 +141,7 @@
   return 0;
 };
 
-int GraphDisplayerCanvas::changeNodeText (std::string mapname, Graph::Node node)
+int GraphDisplayerCanvas::changeNodeText (std::string mapname, Node node)
 {
 
   //the number in the map will be written on the node
diff -r d5668800f774 -r 80eefca04b1e graph_displayer_canvas.h
--- a/graph_displayer_canvas.h	Wed Aug 17 15:20:18 2005 +0000
+++ b/graph_displayer_canvas.h	Thu Aug 18 13:33:49 2005 +0000
@@ -23,27 +23,27 @@
 
   ///Changes the linewidth attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
-  int changeEdgeWidth (std::string mapname, Graph::Edge new_item=INVALID);
+  int changeEdgeWidth (std::string mapname, Edge new_item=INVALID);
 
   ///Changes the linecolor attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
-  int changeEdgeColor (std::string mapname, Graph::Edge new_item=INVALID);
+  int changeEdgeColor (std::string mapname, Edge new_item=INVALID);
 
   ///Changes the text of line attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
-  int changeEdgeText (std::string mapname, Graph::Edge new_item=INVALID);
+  int changeEdgeText (std::string mapname, Edge new_item=INVALID);
 
   ///Changes the linewidth attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
-  int changeNodeRadius (std::string mapname, Graph::Node new_item=INVALID);
+  int changeNodeRadius (std::string mapname, Node new_item=INVALID);
 
   ///Changes the linecolor attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
-  int changeNodeColor (std::string mapname, Graph::Node new_item=INVALID);
+  int changeNodeColor (std::string mapname, Node new_item=INVALID);
 
   ///Changes the text of line attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
-  int changeNodeText (std::string mapname, Graph::Node new_item=INVALID);
+  int changeNodeText (std::string mapname, Node new_item=INVALID);
 
   ///Callback for 'ViewZoomIn' action.
   virtual void zoomIn();
@@ -119,11 +119,9 @@
 
 private:
   ///Deletes the given element.
-  void deleteItem(NodeIt);
+  void deleteItem(Node);
   ///Deletes the given element.
-  void deleteItem(EdgeIt);
-  ///Deletes the given element.
-  void deleteItem(Graph::Edge);
+  void deleteItem(Edge);
 
 private:
 
@@ -166,9 +164,9 @@
   ///1. we cannot query the item at he cursor as fast as it could not cause a Segmentation Fault
   ///2. we would like to handle only ony item per movement, therefore quering it is not a working solution
   Gnome::Canvas::Item * active_item, * target_item;
-  Graph::NodeIt active_node;
-  Graph::EdgeIt active_edge;
-  Graph::EdgeIt forming_edge;
+  Node active_node;
+  Edge active_edge;
+  Edge forming_edge;
 
   std::string nodemap_to_edit, edgemap_to_edit;
 
diff -r d5668800f774 -r 80eefca04b1e map_win.cc
--- a/map_win.cc	Wed Aug 17 15:20:18 2005 +0000
+++ b/map_win.cc	Thu Aug 18 13:33:49 2005 +0000
@@ -217,7 +217,7 @@
   }
 };
 
-void MapWin::updateNode(Graph::Node node)
+void MapWin::updateNode(Node node)
 {
   for(int i=0;i<NODE_PROPERTY_NUM;i++)
     {
@@ -250,7 +250,7 @@
     }
 }
 
-void MapWin::updateEdge(Graph::Edge edge)
+void MapWin::updateEdge(Edge edge)
 {
   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
     {
diff -r d5668800f774 -r 80eefca04b1e mapstorage.cc
--- a/mapstorage.cc	Wed Aug 17 15:20:18 2005 +0000
+++ b/mapstorage.cc	Thu Aug 18 13:33:49 2005 +0000
@@ -116,7 +116,7 @@
   return min;
 }
 
-void MapStorage::initMapsForEdge(Graph::Edge e)
+void MapStorage::initMapsForEdge(Edge e)
 {
   std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it;
   for(ems_it=edgemap_storage.begin();ems_it!=edgemap_storage.end();ems_it++)