# HG changeset patch # User hegyi # Date 1118840709 0 # Node ID 529e48eb97864372fadb102c09c510d3e8f35479 # Parent c60369a1c987f439a86d6b99948c55fff0d46f2a Broken edges are appearing. diff -r c60369a1c987 -r 529e48eb9786 gui/Makefile.am --- a/gui/Makefile.am Wed Jun 15 11:15:01 2005 +0000 +++ b/gui/Makefile.am Wed Jun 15 13:05:09 2005 +0000 @@ -15,7 +15,10 @@ map_win.cc \ map_win.h \ edit_win.cc \ - edit_win.h + edit_win.h \ + broken_edge.cc \ + broken_edge.h + gd_CXXFLAGS = $(GTK_CFLAGS) gd_LDFLAGS = $(GTK_LIBS) diff -r c60369a1c987 -r 529e48eb9786 gui/broken_edge.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/broken_edge.cc Wed Jun 15 13:05:09 2005 +0000 @@ -0,0 +1,14 @@ +#include + +BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p) : Line(g) +{ + if(p.size()==2) + { + Gnome::Canvas::Points points_with_center; + points_with_center.push_back(p[0]); + points_with_center.push_back(Gnome::Art::Point( (p[0].get_x()+p[1].get_x())/2+30 , (p[0].get_y()+p[1].get_y())/2 )+30 ); + points_with_center.push_back(p[1]); + + property_points().set_value(points_with_center); + } +} diff -r c60369a1c987 -r 529e48eb9786 gui/broken_edge.cc~ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/broken_edge.cc~ Wed Jun 15 13:05:09 2005 +0000 @@ -0,0 +1,3 @@ +BrokenEdge::BrokenEdge(Group g, Points p) +{ +} diff -r c60369a1c987 -r 529e48eb9786 gui/broken_edge.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/broken_edge.h Wed Jun 15 13:05:09 2005 +0000 @@ -0,0 +1,18 @@ +// -*- C++ -*- // + +#ifndef BROKEN_EDGE_H +#define BROKEN_EDGE_H + +#include +#include +#include + +class BrokenEdge : public Gnome::Canvas::Line +{ + public: + BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points); +}; + + +#endif //BROKEN_EDGE_H + diff -r c60369a1c987 -r 529e48eb9786 gui/broken_edge.h~ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui/broken_edge.h~ Wed Jun 15 13:05:09 2005 +0000 @@ -0,0 +1,5 @@ +// -*- C++ -*- // + +#ifndef BORKEN_EDGE_H +#define BORKEN_EDGE_H + diff -r c60369a1c987 -r 529e48eb9786 gui/graph_displayer_canvas.cc --- a/gui/graph_displayer_canvas.cc Wed Jun 15 11:15:01 2005 +0000 +++ b/gui/graph_displayer_canvas.cc Wed Jun 15 13:05:09 2005 +0000 @@ -1,4 +1,5 @@ #include +#include #include GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(false),active_item(NULL),target_item(NULL) @@ -22,7 +23,8 @@ coos.push_back(Gnome::Art::Point(cm[g.source(i)].x,cm[g.source(i)].y)); coos.push_back(Gnome::Art::Point(cm[g.target(i)].x,cm[g.target(i)].y)); - edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos); + //edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos); + edgesmap[i]=new BrokenEdge(displayed_graph, coos); *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green"); edgesmap[i]->property_width_pixels().set_value(10);