graph_displayer_canvas.h
branchgui
changeset 89 4042761b21e3
parent 88 c397e85ec555
child 94 adfdc2f70548
equal deleted inserted replaced
27:ea724d8e1b71 28:ce84f94d14bc
     5 
     5 
     6 class GraphDisplayerCanvas;
     6 class GraphDisplayerCanvas;
     7 
     7 
     8 #include "all_include.h"
     8 #include "all_include.h"
     9 #include "mapstorage.h"
     9 #include "mapstorage.h"
    10 #include "broken_edge.h"
       
    11 #include "map_win.h"
    10 #include "map_win.h"
    12 #include <libgnomecanvasmm.h>
    11 #include <libgnomecanvasmm.h>
    13 #include <libgnomecanvasmm/polygon.h>
    12 #include <libgnomecanvasmm/polygon.h>
       
    13 #include <lemon/xy.h>
    14 
    14 
    15 ///This class is the canvas, on which the graph can be drawn.
    15 ///This class is the canvas, on which the graph can be drawn.
    16 class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA
    16 class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA
    17 {
    17 {
       
    18   class BrokenEdge : public Gnome::Canvas::Line
       
    19   {
       
    20     GraphDisplayerCanvas & gdc;
       
    21     Gnome::Canvas::Polygon * arrow;
       
    22     Gnome::Art::Point * my_points;
       
    23 
       
    24 
       
    25     ///Indicates whether the button of mouse is pressed or not
       
    26     bool isbutton;
       
    27 
       
    28     ///At this location was the mousebutton pressed.
       
    29     ///It helps to calculate the distance of dragging.
       
    30     double clicked_x, clicked_y;
       
    31 
       
    32     ///event handler for forming edges
       
    33     bool edgeFormerEventHandler(GdkEvent*);
       
    34   public:
       
    35     BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &);
       
    36     ~BrokenEdge();
       
    37     void setPoints(Gnome::Canvas::Points, bool move=false);
       
    38     xy<double> getArrowPos();
       
    39   };
    18   typedef Gnome::Canvas::CanvasAA Parent;
    40   typedef Gnome::Canvas::CanvasAA Parent;
    19 
    41 
    20 public:
    42 public:
    21   GraphDisplayerCanvas(MapStorage &, MapWin &, Gtk::Window *);
    43   GraphDisplayerCanvas(MapStorage &, MapWin &, Gtk::Window *);
    22   virtual ~GraphDisplayerCanvas();
    44   virtual ~GraphDisplayerCanvas();