Changeset 96:e664d8aa3f72 in glemon-0.x for graph_displayer_canvas.cc
- Timestamp:
- 12/06/05 11:53:38 (18 years ago)
- Branch:
- gui
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2414
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graph_displayer_canvas.cc
r94 r96 2 2 #include <cmath> 3 3 4 GraphDisplayerCanvas::GraphDisplayerCanvas( MainWin& mainw) :4 GraphDisplayerCanvas::GraphDisplayerCanvas(NoteBookTab & mainw) : 5 5 nodesmap(mainw.mapstorage.graph), edgesmap(mainw.mapstorage.graph), edgetextmap(mainw.mapstorage.graph), 6 6 nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0), 7 7 isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""), 8 edgemap_to_edit(""), m ainwin(mainw)8 edgemap_to_edit(""), mytab(mainw) 9 9 { 10 10 //base event handler is move tool … … 19 19 GraphDisplayerCanvas::~GraphDisplayerCanvas() 20 20 { 21 for (NodeIt n((m ainwin.mapstorage).graph); n != INVALID; ++n)21 for (NodeIt n((mytab.mapstorage).graph); n != INVALID; ++n) 22 22 { 23 23 delete nodesmap[n]; … … 25 25 } 26 26 27 for (EdgeIt e((m ainwin.mapstorage).graph); e != INVALID; ++e)27 for (EdgeIt e((mytab.mapstorage).graph); e != INVALID; ++e) 28 28 { 29 29 delete edgesmap[e]; … … 64 64 dummy=dummy; 65 65 66 std::string mapname=m ainwin.getActiveNodeMap(prop);66 std::string mapname=mytab.getActiveNodeMap(prop); 67 67 68 68 if(mapname!="") 69 69 { 70 if( ( ((m ainwin.mapstorage).nodemap_storage).find(mapname) != ((mainwin.mapstorage).nodemap_storage).end() ) )70 if( ( ((mytab.mapstorage).nodemap_storage).find(mapname) != ((mytab.mapstorage).nodemap_storage).end() ) ) 71 71 { 72 72 switch(prop) … … 111 111 dummy=dummy; 112 112 113 std::string mapname=m ainwin.getActiveEdgeMap(prop);113 std::string mapname=mytab.getActiveEdgeMap(prop); 114 114 115 115 if(mapname!="") 116 116 { 117 if( ( ((m ainwin.mapstorage).edgemap_storage).find(mapname) != ((mainwin.mapstorage).edgemap_storage).end() ) )117 if( ( ((mytab.mapstorage).edgemap_storage).find(mapname) != ((mytab.mapstorage).edgemap_storage).end() ) ) 118 118 { 119 119 switch(prop) … … 156 156 //first edges are drawn, to hide joining with nodes later 157 157 158 for (EdgeIt i((m ainwin.mapstorage).graph); i!=INVALID; ++i)158 for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) 159 159 { 160 160 … … 163 163 Gnome::Canvas::Points coos; 164 164 coos.push_back(Gnome::Art::Point( 165 (m ainwin.mapstorage).coords[(mainwin.mapstorage).graph.source(i)].x,166 (m ainwin.mapstorage).coords[(mainwin.mapstorage).graph.source(i)].y));165 (mytab.mapstorage).coords[(mytab.mapstorage).graph.source(i)].x, 166 (mytab.mapstorage).coords[(mytab.mapstorage).graph.source(i)].y)); 167 167 coos.push_back(Gnome::Art::Point( 168 (m ainwin.mapstorage).coords[(mainwin.mapstorage).graph.target(i)].x,169 (m ainwin.mapstorage).coords[(mainwin.mapstorage).graph.target(i)].y));168 (mytab.mapstorage).coords[(mytab.mapstorage).graph.target(i)].x, 169 (mytab.mapstorage).coords[(mytab.mapstorage).graph.target(i)].y)); 170 170 171 171 edgesmap[i]=new BrokenEdge(displayed_graph, coos, *this); … … 187 187 //afterwards nodes come to be drawn 188 188 189 for (NodeIt i((m ainwin.mapstorage).graph); i!=INVALID; ++i)189 for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i) 190 190 { 191 191 //drawing bule nodes, with black line around them … … 193 193 nodesmap[i]=new Gnome::Canvas::Ellipse( 194 194 displayed_graph, 195 (m ainwin.mapstorage).coords[i].x-20,196 (m ainwin.mapstorage).coords[i].y-20,197 (m ainwin.mapstorage).coords[i].x+20,198 (m ainwin.mapstorage).coords[i].y+20);195 (mytab.mapstorage).coords[i].x-20, 196 (mytab.mapstorage).coords[i].y-20, 197 (mytab.mapstorage).coords[i].x+20, 198 (mytab.mapstorage).coords[i].y+20); 199 199 *(nodesmap[i]) << Gnome::Canvas::Properties::fill_color("blue"); 200 200 *(nodesmap[i]) << Gnome::Canvas::Properties::outline_color("black"); … … 204 204 205 205 xy<double> text_pos( 206 ((m ainwin.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5),207 ((m ainwin.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5));206 ((mytab.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5), 207 ((mytab.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5)); 208 208 209 209 nodetextmap[i]=new Gnome::Canvas::Text(displayed_graph, … … 223 223 forming_edge=INVALID; 224 224 225 for (NodeIt n((m ainwin.mapstorage).graph); n != INVALID; ++n)225 for (NodeIt n((mytab.mapstorage).graph); n != INVALID; ++n) 226 226 { 227 227 delete nodesmap[n]; … … 229 229 } 230 230 231 for (EdgeIt e((m ainwin.mapstorage).graph); e != INVALID; ++e)231 for (EdgeIt e((mytab.mapstorage).graph); e != INVALID; ++e) 232 232 { 233 233 delete edgesmap[e];
Note: See TracChangeset
for help on using the changeset viewer.