- The number of gcc-4.0 warnings has significantly decreases. gui
authoralpar
Thu, 18 Aug 2005 13:33:49 +0000
branchgui
changeset 6280eefca04b1e
parent 61 d5668800f774
child 63 59768817442a
- The number of gcc-4.0 warnings has significantly decreases.
- Some code clean-up in gui
all_include.h
graph_displayer_canvas-edge.cc
graph_displayer_canvas-event.cc
graph_displayer_canvas-node.cc
graph_displayer_canvas.h
map_win.cc
mapstorage.cc
     1.1 --- a/all_include.h	Wed Aug 17 15:20:18 2005 +0000
     1.2 +++ b/all_include.h	Thu Aug 18 13:33:49 2005 +0000
     1.3 @@ -40,6 +40,7 @@
     1.4  typedef ListGraph Graph;
     1.5  typedef Graph::NodeMap<Coordinates> CoordinatesMap;
     1.6  typedef Graph::Node Node;
     1.7 +typedef Graph::Edge Edge;
     1.8  typedef Graph::EdgeIt EdgeIt;
     1.9  typedef Graph::NodeIt NodeIt;
    1.10  
     2.1 --- a/graph_displayer_canvas-edge.cc	Wed Aug 17 15:20:18 2005 +0000
     2.2 +++ b/graph_displayer_canvas-edge.cc	Thu Aug 18 13:33:49 2005 +0000
     2.3 @@ -3,7 +3,7 @@
     2.4  #include <cmath>
     2.5  
     2.6  
     2.7 -int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge)
     2.8 +int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Edge edge)
     2.9  {
    2.10    Graph::EdgeMap<double> * actual_map;
    2.11    double min, max;
    2.12 @@ -49,7 +49,7 @@
    2.13    return 0;
    2.14  };
    2.15  
    2.16 -int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Graph::Edge edge)
    2.17 +int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Edge edge)
    2.18  {  
    2.19  
    2.20    //function maps the range of the maximum and
    2.21 @@ -116,7 +116,7 @@
    2.22    return 0;
    2.23  };
    2.24  
    2.25 -int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Graph::Edge edge)
    2.26 +int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Edge edge)
    2.27  {
    2.28    //the number in the map will be written on the edge
    2.29    //EXCEPT when the name of the map is Default, because
     3.1 --- a/graph_displayer_canvas-event.cc	Wed Aug 17 15:20:18 2005 +0000
     3.2 +++ b/graph_displayer_canvas-event.cc	Thu Aug 18 13:33:49 2005 +0000
     3.3 @@ -225,7 +225,7 @@
     3.4  
     3.5        isbutton=1;
     3.6  
     3.7 -      active_node=NodeIt(mapstorage.graph,mapstorage.graph.addNode());
     3.8 +      active_node=mapstorage.graph.addNode();
     3.9  
    3.10        //initiating values corresponding to new node in maps
    3.11  
    3.12 @@ -339,7 +339,7 @@
    3.13  	    {
    3.14  	      window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
    3.15  	      target_item=(get_item_at(clicked_x, clicked_y));
    3.16 -	      Graph::NodeIt target_node=INVALID;
    3.17 +	      Node target_node=INVALID;
    3.18  	      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
    3.19  		{
    3.20  		  if(nodesmap[i]==target_item)
    3.21 @@ -354,14 +354,17 @@
    3.22  		    {
    3.23            mapstorage.modified = true;
    3.24  
    3.25 -		      *(nodesmap[target_node]) << Gnome::Canvas::Properties::fill_color("red");
    3.26 +		      *(nodesmap[target_node]) <<
    3.27 +			Gnome::Canvas::Properties::fill_color("red");
    3.28  
    3.29  		      //creating new edge
    3.30 -		      active_edge=EdgeIt(mapstorage.graph,mapstorage.graph.addEdge(active_node, target_node));
    3.31 +		      active_edge=mapstorage.graph.addEdge(active_node,
    3.32 +							   target_node);
    3.33  
    3.34  		      //initiating values corresponding to new edge in maps
    3.35  		      mapstorage.initMapsForEdge(active_edge);
    3.36 -                      (*mapstorage.edgemap_storage["id"])[active_edge] = mapstorage.graph.id(active_edge);
    3.37 +                      (*mapstorage.edgemap_storage["id"])[active_edge] = 
    3.38 +			mapstorage.graph.id(active_edge);
    3.39  	  
    3.40  		      //calculating coordinates of new edge
    3.41  		      Gnome::Canvas::Points coos;
    3.42 @@ -555,7 +558,7 @@
    3.43  	  //If the click happened on an edge we place the entrywidget there and fill in the value of the activated map at that edge.
    3.44  	  {
    3.45  	    //for determine, whether it was an edge
    3.46 -	    Graph::EdgeIt clicked_edge=INVALID;
    3.47 +	    Edge clicked_edge=INVALID;
    3.48  
    3.49  	    //find the activated item between texts
    3.50  	    active_item=(get_item_at(e->button.x, e->button.y));
    3.51 @@ -677,7 +680,7 @@
    3.52  	  //If the click happened on an edge we place the entrywidget there and fill in the value of the activated map at that edge.
    3.53  	  {
    3.54  	    //for determine, whether it was a node
    3.55 -	    Graph::NodeIt clicked_node=INVALID;
    3.56 +	    Node clicked_node=INVALID;
    3.57  
    3.58  	    //find the activated item between texts
    3.59  	    active_item=(get_item_at(e->button.x, e->button.y));
    3.60 @@ -849,21 +852,14 @@
    3.61    return false;
    3.62  }
    3.63  
    3.64 -void GraphDisplayerCanvas::deleteItem(NodeIt node_to_delete)
    3.65 +void GraphDisplayerCanvas::deleteItem(Node node_to_delete)
    3.66  {
    3.67    delete(nodetextmap[node_to_delete]);
    3.68    delete(nodesmap[node_to_delete]);
    3.69    mapstorage.graph.erase(node_to_delete);
    3.70  }
    3.71  
    3.72 -void GraphDisplayerCanvas::deleteItem(EdgeIt edge_to_delete)
    3.73 -{
    3.74 -  delete(edgetextmap[edge_to_delete]);
    3.75 -  delete(edgesmap[edge_to_delete]);
    3.76 -  mapstorage.graph.erase(edge_to_delete);
    3.77 -}
    3.78 -
    3.79 -void GraphDisplayerCanvas::deleteItem(Graph::Edge edge_to_delete)
    3.80 +void GraphDisplayerCanvas::deleteItem(Edge edge_to_delete)
    3.81  {
    3.82    delete(edgetextmap[edge_to_delete]);
    3.83    delete(edgesmap[edge_to_delete]);
     4.1 --- a/graph_displayer_canvas-node.cc	Wed Aug 17 15:20:18 2005 +0000
     4.2 +++ b/graph_displayer_canvas-node.cc	Thu Aug 18 13:33:49 2005 +0000
     4.3 @@ -3,7 +3,7 @@
     4.4  #include <cmath>
     4.5  
     4.6  
     4.7 -int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Graph::Node node)
     4.8 +int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node)
     4.9  {
    4.10    Graph::NodeMap<double> * actual_map;
    4.11    double min, max;
    4.12 @@ -69,7 +69,7 @@
    4.13    return 0;
    4.14  };
    4.15  
    4.16 -int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Graph::Node node)
    4.17 +int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Node node)
    4.18  {  
    4.19  
    4.20    //function maps the range of the maximum and
    4.21 @@ -141,7 +141,7 @@
    4.22    return 0;
    4.23  };
    4.24  
    4.25 -int GraphDisplayerCanvas::changeNodeText (std::string mapname, Graph::Node node)
    4.26 +int GraphDisplayerCanvas::changeNodeText (std::string mapname, Node node)
    4.27  {
    4.28  
    4.29    //the number in the map will be written on the node
     5.1 --- a/graph_displayer_canvas.h	Wed Aug 17 15:20:18 2005 +0000
     5.2 +++ b/graph_displayer_canvas.h	Thu Aug 18 13:33:49 2005 +0000
     5.3 @@ -23,27 +23,27 @@
     5.4  
     5.5    ///Changes the linewidth attribute according to the given map.
     5.6    ///\param mapname is the name of the map which contains the new values
     5.7 -  int changeEdgeWidth (std::string mapname, Graph::Edge new_item=INVALID);
     5.8 +  int changeEdgeWidth (std::string mapname, Edge new_item=INVALID);
     5.9  
    5.10    ///Changes the linecolor attribute according to the given map.
    5.11    ///\param mapname is the name of the map which contains the new values
    5.12 -  int changeEdgeColor (std::string mapname, Graph::Edge new_item=INVALID);
    5.13 +  int changeEdgeColor (std::string mapname, Edge new_item=INVALID);
    5.14  
    5.15    ///Changes the text of line attribute according to the given map.
    5.16    ///\param mapname is the name of the map which contains the new values
    5.17 -  int changeEdgeText (std::string mapname, Graph::Edge new_item=INVALID);
    5.18 +  int changeEdgeText (std::string mapname, Edge new_item=INVALID);
    5.19  
    5.20    ///Changes the linewidth attribute according to the given map.
    5.21    ///\param mapname is the name of the map which contains the new values
    5.22 -  int changeNodeRadius (std::string mapname, Graph::Node new_item=INVALID);
    5.23 +  int changeNodeRadius (std::string mapname, Node new_item=INVALID);
    5.24  
    5.25    ///Changes the linecolor attribute according to the given map.
    5.26    ///\param mapname is the name of the map which contains the new values
    5.27 -  int changeNodeColor (std::string mapname, Graph::Node new_item=INVALID);
    5.28 +  int changeNodeColor (std::string mapname, Node new_item=INVALID);
    5.29  
    5.30    ///Changes the text of line attribute according to the given map.
    5.31    ///\param mapname is the name of the map which contains the new values
    5.32 -  int changeNodeText (std::string mapname, Graph::Node new_item=INVALID);
    5.33 +  int changeNodeText (std::string mapname, Node new_item=INVALID);
    5.34  
    5.35    ///Callback for 'ViewZoomIn' action.
    5.36    virtual void zoomIn();
    5.37 @@ -119,11 +119,9 @@
    5.38  
    5.39  private:
    5.40    ///Deletes the given element.
    5.41 -  void deleteItem(NodeIt);
    5.42 +  void deleteItem(Node);
    5.43    ///Deletes the given element.
    5.44 -  void deleteItem(EdgeIt);
    5.45 -  ///Deletes the given element.
    5.46 -  void deleteItem(Graph::Edge);
    5.47 +  void deleteItem(Edge);
    5.48  
    5.49  private:
    5.50  
    5.51 @@ -166,9 +164,9 @@
    5.52    ///1. we cannot query the item at he cursor as fast as it could not cause a Segmentation Fault
    5.53    ///2. we would like to handle only ony item per movement, therefore quering it is not a working solution
    5.54    Gnome::Canvas::Item * active_item, * target_item;
    5.55 -  Graph::NodeIt active_node;
    5.56 -  Graph::EdgeIt active_edge;
    5.57 -  Graph::EdgeIt forming_edge;
    5.58 +  Node active_node;
    5.59 +  Edge active_edge;
    5.60 +  Edge forming_edge;
    5.61  
    5.62    std::string nodemap_to_edit, edgemap_to_edit;
    5.63  
     6.1 --- a/map_win.cc	Wed Aug 17 15:20:18 2005 +0000
     6.2 +++ b/map_win.cc	Thu Aug 18 13:33:49 2005 +0000
     6.3 @@ -217,7 +217,7 @@
     6.4    }
     6.5  };
     6.6  
     6.7 -void MapWin::updateNode(Graph::Node node)
     6.8 +void MapWin::updateNode(Node node)
     6.9  {
    6.10    for(int i=0;i<NODE_PROPERTY_NUM;i++)
    6.11      {
    6.12 @@ -250,7 +250,7 @@
    6.13      }
    6.14  }
    6.15  
    6.16 -void MapWin::updateEdge(Graph::Edge edge)
    6.17 +void MapWin::updateEdge(Edge edge)
    6.18  {
    6.19    for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    6.20      {
     7.1 --- a/mapstorage.cc	Wed Aug 17 15:20:18 2005 +0000
     7.2 +++ b/mapstorage.cc	Thu Aug 18 13:33:49 2005 +0000
     7.3 @@ -116,7 +116,7 @@
     7.4    return min;
     7.5  }
     7.6  
     7.7 -void MapStorage::initMapsForEdge(Graph::Edge e)
     7.8 +void MapStorage::initMapsForEdge(Edge e)
     7.9  {
    7.10    std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it;
    7.11    for(ems_it=edgemap_storage.begin();ems_it!=edgemap_storage.end();ems_it++)