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(); |