graph_displayer_canvas.cc
branchgui
changeset 17 c95aff79e893
parent 16 319a4fa65e05
child 19 164783ceb9be
equal deleted inserted replaced
10:598abebb8745 11:ba576ccf3781
     1 #include <graph_displayer_canvas.h>
     1 #include <graph_displayer_canvas.h>
       
     2 #include <broken_edge.h>
     2 #include <math.h>
     3 #include <math.h>
     3 
     4 
     4 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)
     5 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)
     5 {
     6 {
     6   
     7   
    20 
    21 
    21     Gnome::Canvas::Points coos;
    22     Gnome::Canvas::Points coos;
    22     coos.push_back(Gnome::Art::Point(cm[g.source(i)].x,cm[g.source(i)].y));
    23     coos.push_back(Gnome::Art::Point(cm[g.source(i)].x,cm[g.source(i)].y));
    23     coos.push_back(Gnome::Art::Point(cm[g.target(i)].x,cm[g.target(i)].y));
    24     coos.push_back(Gnome::Art::Point(cm[g.target(i)].x,cm[g.target(i)].y));
    24     
    25     
    25     edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos);
    26     //edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos);
       
    27     edgesmap[i]=new BrokenEdge(displayed_graph, coos);
    26     *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green");
    28     *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green");
    27     edgesmap[i]->property_width_pixels().set_value(10);    
    29     edgesmap[i]->property_width_pixels().set_value(10);    
    28     
    30     
    29     //initializing edge-text as well, to empty string
    31     //initializing edge-text as well, to empty string
    30 
    32