gui/graph_displayer_canvas.cc
changeset 1524 587a823bcdd0
parent 1512 e54392395480
child 1525 6d94de269ab1
equal deleted inserted replaced
18:70e18dc86fea 19:aa4daa5d4362
     3 #include <math.h>
     3 #include <math.h>
     4 
     4 
     5 GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms, MapWin * mw):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),nodetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(0),active_item(NULL),target_item(NULL),mapwin(mw)
     5 GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms, MapWin * mw):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),nodetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(0),active_item(NULL),target_item(NULL),mapwin(mw)
     6 {
     6 {
     7   
     7   
     8   actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create_node_event_handler), false);
     8   actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createNodeEventHandler), false);
     9   actual_tool=CREATE_NODE;
     9   actual_tool=CREATE_NODE;
    10 
    10 
    11   active_node=INVALID;
    11   active_node=INVALID;
    12   active_edge=INVALID;
    12   active_edge=INVALID;
    13 
    13 
    28     *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green");
    28     *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green");
    29     edgesmap[i]->property_width_pixels().set_value(10);    
    29     edgesmap[i]->property_width_pixels().set_value(10);    
    30     
    30     
    31     //initializing edge-text as well, to empty string
    31     //initializing edge-text as well, to empty string
    32 
    32 
    33     xy<double> text_pos=edgesmap[i]->get_arrow_pos();
    33     xy<double> text_pos=edgesmap[i]->getArrowPos();
    34     text_pos+=(xy<double>(10,10));
    34     text_pos+=(xy<double>(10,10));
    35 
    35 
    36     edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, "");
    36     edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, "");
    37     edgetextmap[i]->property_fill_color().set_value("darkgreen");
    37     edgetextmap[i]->property_fill_color().set_value("darkgreen");
    38   }
    38   }