1 #include "broken_edge.h" |
1 #include "graph_displayer_canvas.h" |
2 #include <cmath> |
2 #include <cmath> |
3 |
3 |
4 BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p, GraphDisplayerCanvas & gc) : Line(g), gdc(gc), isbutton(false) |
4 GraphDisplayerCanvas::BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p, GraphDisplayerCanvas & gc) : Line(g), gdc(gc), isbutton(false) |
5 { |
5 { |
6 my_points=new Gnome::Art::Point[3]; |
6 my_points=new Gnome::Art::Point[3]; |
7 |
7 |
8 arrow=new Gnome::Canvas::Polygon(g); |
8 arrow=new Gnome::Canvas::Polygon(g); |
9 *arrow << Gnome::Canvas::Properties::fill_color("red"); |
9 *arrow << Gnome::Canvas::Properties::fill_color("red"); |
10 arrow->signal_event().connect(sigc::mem_fun(*this, &BrokenEdge::edgeFormerEventHandler)); |
10 arrow->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::BrokenEdge::edgeFormerEventHandler)); |
11 arrow->lower_to_bottom(); |
11 arrow->lower_to_bottom(); |
12 setPoints(p); |
12 setPoints(p); |
13 } |
13 } |
14 |
14 |
15 BrokenEdge::~BrokenEdge() |
15 GraphDisplayerCanvas::BrokenEdge::~BrokenEdge() |
16 { |
16 { |
17 if(arrow)delete(arrow); |
17 if(arrow)delete(arrow); |
18 } |
18 } |
19 |
19 |
20 void BrokenEdge::setPoints(Gnome::Canvas::Points p, bool move) |
20 void GraphDisplayerCanvas::BrokenEdge::setPoints(Gnome::Canvas::Points p, bool move) |
21 { |
21 { |
22 bool set_arrow=false; |
22 bool set_arrow=false; |
23 //red arrow losts its position-right button |
23 //red arrow losts its position-right button |
24 if(!move) |
24 if(!move) |
25 { |
25 { |