Changeset 1496:c60369a1c987 in lemon-0.x for gui
- Timestamp:
- 06/15/05 13:15:01 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1977
- Location:
- gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/graph_displayer_canvas.cc
r1486 r1496 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 // 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 } 625 626 //collecting edges to delete 627 EdgeIt e; 628 std::set<Graph::Edge> edges_to_delete; 629 630 g.firstOut(e,active_node); 631 for(;e!=INVALID;g.nextOut(e)) 632 { 633 edges_to_delete.insert(e); 634 } 635 636 g.firstIn(e,active_node); 637 for(;e!=INVALID;g.nextIn(e)) 638 { 639 edges_to_delete.insert(e); 640 } 641 642 //deleting collected edges 643 for(std::set<Graph::Edge>::iterator edge_set_it=edges_to_delete.begin();edge_set_it!=edges_to_delete.end();edge_set_it++) 644 { 645 delete_item(*edge_set_it); 644 646 } 645 647 delete_item(active_node); 646 648 } 649 //a simple edge was chosen 647 650 else 648 651 { … … 652 655 653 656 } 657 //pointer was moved, deletion is cancelled 654 658 else 655 659 { … … 663 667 } 664 668 } 669 //reseting datas 665 670 active_item=NULL; 666 671 active_edge=INVALID; … … 689 694 } 690 695 696 void GraphDisplayerCanvas::delete_item(Graph::Edge edge_to_delete) 697 { 698 delete(edgesmap[edge_to_delete]); 699 g.erase(edge_to_delete); 700 } 701 -
gui/graph_displayer_canvas.h
r1486 r1496 74 74 ///Deletes the given element. 75 75 void delete_item(EdgeIt); 76 ///Deletes the given element. 77 void delete_item(Graph::Edge); 76 78 77 79 ///The graph, on which we work
Note: See TracChangeset
for help on using the changeset viewer.