Changeset 1486:5f87111056b8 in lemon-0.x
- Timestamp:
- 06/14/05 18:56:37 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1967
- Location:
- gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/graph_displayer_canvas.cc
r1485 r1486 623 623 if(active_node!=INVALID) 624 624 { 625 EdgeIt e; 626 g.firstOut(e,active_node); 627 for(;e!=INVALID;g.nextOut(e)) 628 { 629 delete_item(edgesmap[e]); 630 //edgesmap[e]->property_points().set_value(coos); 631 //edgetextmap[e]->property_y().set_value((y1+y2)/2); 632 } 633 634 g.firstIn(e,active_node); 635 for(;e!=INVALID;g.nextIn(e)) 636 { 637 delete_item(edgesmap[e]); 638 //edgesmap[e]->get_bounds(x1, y1, x2, y2); 639 //edgetextmap[e]->property_y().set_value((y1+y2)/2); 640 } 641 } 642 delete_item(active_item); 625 // EdgeIt e; 626 // g.firstOut(e,active_node); 627 // for(;e!=INVALID;g.nextOut(e)) 628 // { 629 // if(e!=INVALID)delete_item(e); 630 // } 631 632 // g.firstIn(e,active_node); 633 // for(;e!=INVALID;g.nextIn(e)) 634 // { 635 // if(e!=INVALID)delete_item(e); 636 // } 637 for (EdgeIt i(g); i!=INVALID; ++i) 638 { 639 //std::cout << g.source(i).id << "-" << g.target(i).id << " " << active_node.id << std::endl; 640 if((g.source(i)==active_node)||(g.target(i)==active_node)) 641 { 642 delete_item(i); 643 } 644 } 645 delete_item(active_node); 646 } 647 else 648 { 649 delete_item(active_edge); 650 } 651 643 652 644 653 } … … 668 677 } 669 678 670 void GraphDisplayerCanvas::delete_item(Gnome::Canvas::Item * item_to_delete) 671 { 672 //item_to_delete->hide(); 673 delete(item_to_delete); 674 } 675 679 void GraphDisplayerCanvas::delete_item(NodeIt node_to_delete) 680 { 681 delete(nodesmap[node_to_delete]); 682 g.erase(node_to_delete); 683 } 684 685 void GraphDisplayerCanvas::delete_item(EdgeIt edge_to_delete) 686 { 687 delete(edgesmap[edge_to_delete]); 688 g.erase(edge_to_delete); 689 } 690 -
gui/graph_displayer_canvas.h
r1485 r1486 70 70 bool eraser_event_handler(GdkEvent*); 71 71 72 ///Deletes the given item. 73 void delete_item(Gnome::Canvas::Item *); 72 ///Deletes the given element. 73 void delete_item(NodeIt); 74 ///Deletes the given element. 75 void delete_item(EdgeIt); 74 76 75 77 ///The graph, on which we work
Note: See TracChangeset
for help on using the changeset viewer.