graph_displayer_canvas.h
branchgui
changeset 22 c4d09637b2f8
parent 20 a3bd39d50930
child 25 c45a34eaa118
equal deleted inserted replaced
10:e6f34b0ac7c8 11:6aba1e061eb8
     1 // -*- C++ -*- //
     1 // -*- C++ -*- //
     2 
     2 
     3 #ifndef GRAPH_DISPLAYER_CANVAS_H
     3 #ifndef GRAPH_DISPLAYER_CANVAS_H
     4 #define GRAPH_DISPLAYER_CANVAS_H
     4 #define GRAPH_DISPLAYER_CANVAS_H
       
     5 
       
     6 class GraphDisplayerCanvas;
     5 
     7 
     6 #include <all_include.h>
     8 #include <all_include.h>
     7 #include <mapstorage.h>
     9 #include <mapstorage.h>
     8 #include <broken_edge.h>
    10 #include <broken_edge.h>
     9 #include <libgnomecanvasmm.h>
    11 #include <libgnomecanvasmm.h>
    67   bool create_node_event_handler(GdkEvent*);
    69   bool create_node_event_handler(GdkEvent*);
    68   ///event handler for the case when create_edge-tool is active
    70   ///event handler for the case when create_edge-tool is active
    69   bool create_edge_event_handler(GdkEvent*);
    71   bool create_edge_event_handler(GdkEvent*);
    70   ///event handler for the case when eraser-tool is active
    72   ///event handler for the case when eraser-tool is active
    71   bool eraser_event_handler(GdkEvent*);
    73   bool eraser_event_handler(GdkEvent*);
       
    74   ///event handler for the case when eraser-tool is active
       
    75   bool edge_map_edit_event_handler(GdkEvent*);
    72 
    76 
       
    77 public:
       
    78   ///\return the actual tool in hand
       
    79   int get_actual_tool();
       
    80 
       
    81 private:
    73   ///Deletes the given element.
    82   ///Deletes the given element.
    74   void delete_item(NodeIt);
    83   void delete_item(NodeIt);
    75   ///Deletes the given element.
    84   ///Deletes the given element.
    76   void delete_item(EdgeIt);
    85   void delete_item(EdgeIt);
    77   ///Deletes the given element.
    86   ///Deletes the given element.
    78   void delete_item(Graph::Edge);
    87   void delete_item(Graph::Edge);
       
    88 
       
    89 private:
    79 
    90 
    80   ///The graph, on which we work
    91   ///The graph, on which we work
    81   Graph g;
    92   Graph g;
    82 
    93 
    83   ///Map of nodes of graph
    94   ///Map of nodes of graph
    96   MapStorage mapstorage;
   107   MapStorage mapstorage;
    97 
   108 
    98   ///Indicates whether the button of mouse is pressed or not
   109   ///Indicates whether the button of mouse is pressed or not
    99   int isbutton;
   110   int isbutton;
   100 
   111 
       
   112   ///Stores the actual tool in hand
       
   113   int actual_tool;
       
   114 
   101   ///At this location was the mousebutton pressed.
   115   ///At this location was the mousebutton pressed.
   102   ///It helps to calculate the distance of dragging.
   116   ///It helps to calculate the distance of dragging.
   103   double clicked_x, clicked_y;
   117   double clicked_x, clicked_y;
   104 
   118 
   105   ///Remembers which Gnome::Canvas::Item was pressed.
   119   ///Remembers which Gnome::Canvas::Item was pressed.