Broken edges are appearing. gui
authorhegyi
Wed, 15 Jun 2005 13:05:09 +0000
branchgui
changeset 17c95aff79e893
parent 16 319a4fa65e05
child 18 6bf9a0be1802
Broken edges are appearing.
Makefile.am
broken_edge.cc
broken_edge.cc~
broken_edge.h
broken_edge.h~
graph_displayer_canvas.cc
     1.1 --- a/Makefile.am	Wed Jun 15 11:15:01 2005 +0000
     1.2 +++ b/Makefile.am	Wed Jun 15 13:05:09 2005 +0000
     1.3 @@ -15,7 +15,10 @@
     1.4  	map_win.cc \
     1.5  	map_win.h \
     1.6  	edit_win.cc \
     1.7 -	edit_win.h
     1.8 +	edit_win.h \
     1.9 +	broken_edge.cc \
    1.10 +	broken_edge.h
    1.11 +
    1.12  
    1.13  gd_CXXFLAGS = $(GTK_CFLAGS)
    1.14  gd_LDFLAGS = $(GTK_LIBS)
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/broken_edge.cc	Wed Jun 15 13:05:09 2005 +0000
     2.3 @@ -0,0 +1,14 @@
     2.4 +#include <broken_edge.h>
     2.5 +
     2.6 +BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p) : Line(g)
     2.7 +{
     2.8 +  if(p.size()==2)
     2.9 +    {
    2.10 +      Gnome::Canvas::Points points_with_center;
    2.11 +      points_with_center.push_back(p[0]);
    2.12 +      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 );
    2.13 +      points_with_center.push_back(p[1]);
    2.14 +      
    2.15 +      property_points().set_value(points_with_center);
    2.16 +    }
    2.17 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/broken_edge.cc~	Wed Jun 15 13:05:09 2005 +0000
     3.3 @@ -0,0 +1,3 @@
     3.4 +BrokenEdge::BrokenEdge(Group g, Points p)
     3.5 +{
     3.6 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/broken_edge.h	Wed Jun 15 13:05:09 2005 +0000
     4.3 @@ -0,0 +1,18 @@
     4.4 +// -*- C++ -*- //
     4.5 +
     4.6 +#ifndef BROKEN_EDGE_H
     4.7 +#define BROKEN_EDGE_H
     4.8 +
     4.9 +#include <all_include.h>
    4.10 +#include <libgnomecanvasmm.h>
    4.11 +#include <libgnomecanvasmm/polygon.h>
    4.12 +
    4.13 +class BrokenEdge : public Gnome::Canvas::Line
    4.14 +{
    4.15 + public:
    4.16 +  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points);
    4.17 +};
    4.18 +
    4.19 +
    4.20 +#endif //BROKEN_EDGE_H
    4.21 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/broken_edge.h~	Wed Jun 15 13:05:09 2005 +0000
     5.3 @@ -0,0 +1,5 @@
     5.4 +// -*- C++ -*- //
     5.5 +
     5.6 +#ifndef BORKEN_EDGE_H
     5.7 +#define BORKEN_EDGE_H
     5.8 +
     6.1 --- a/graph_displayer_canvas.cc	Wed Jun 15 11:15:01 2005 +0000
     6.2 +++ b/graph_displayer_canvas.cc	Wed Jun 15 13:05:09 2005 +0000
     6.3 @@ -1,4 +1,5 @@
     6.4  #include <graph_displayer_canvas.h>
     6.5 +#include <broken_edge.h>
     6.6  #include <math.h>
     6.7  
     6.8  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)
     6.9 @@ -22,7 +23,8 @@
    6.10      coos.push_back(Gnome::Art::Point(cm[g.source(i)].x,cm[g.source(i)].y));
    6.11      coos.push_back(Gnome::Art::Point(cm[g.target(i)].x,cm[g.target(i)].y));
    6.12      
    6.13 -    edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos);
    6.14 +    //edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos);
    6.15 +    edgesmap[i]=new BrokenEdge(displayed_graph, coos);
    6.16      *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green");
    6.17      edgesmap[i]->property_width_pixels().set_value(10);    
    6.18