Changeset 1643:9285f3777553 in lemon-0.x
- Timestamp:
- 08/18/05 15:33:49 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2156
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/all_include.h
r1599 r1643 41 41 typedef Graph::NodeMap<Coordinates> CoordinatesMap; 42 42 typedef Graph::Node Node; 43 typedef Graph::Edge Edge; 43 44 typedef Graph::EdgeIt EdgeIt; 44 45 typedef Graph::NodeIt NodeIt; -
gui/graph_displayer_canvas-edge.cc
r1632 r1643 4 4 5 5 6 int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge)6 int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Edge edge) 7 7 { 8 8 Graph::EdgeMap<double> * actual_map; … … 50 50 }; 51 51 52 int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Graph::Edge edge)52 int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Edge edge) 53 53 { 54 54 … … 117 117 }; 118 118 119 int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Graph::Edge edge)119 int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Edge edge) 120 120 { 121 121 //the number in the map will be written on the edge -
gui/graph_displayer_canvas-event.cc
r1632 r1643 226 226 isbutton=1; 227 227 228 active_node= NodeIt(mapstorage.graph,mapstorage.graph.addNode());228 active_node=mapstorage.graph.addNode(); 229 229 230 230 //initiating values corresponding to new node in maps … … 340 340 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); 341 341 target_item=(get_item_at(clicked_x, clicked_y)); 342 Graph::NodeIttarget_node=INVALID;342 Node target_node=INVALID; 343 343 for (NodeIt i(mapstorage.graph); i!=INVALID; ++i) 344 344 { … … 355 355 mapstorage.modified = true; 356 356 357 *(nodesmap[target_node]) << Gnome::Canvas::Properties::fill_color("red"); 357 *(nodesmap[target_node]) << 358 Gnome::Canvas::Properties::fill_color("red"); 358 359 359 360 //creating new edge 360 active_edge=EdgeIt(mapstorage.graph,mapstorage.graph.addEdge(active_node, target_node)); 361 active_edge=mapstorage.graph.addEdge(active_node, 362 target_node); 361 363 362 364 //initiating values corresponding to new edge in maps 363 365 mapstorage.initMapsForEdge(active_edge); 364 (*mapstorage.edgemap_storage["id"])[active_edge] = mapstorage.graph.id(active_edge); 366 (*mapstorage.edgemap_storage["id"])[active_edge] = 367 mapstorage.graph.id(active_edge); 365 368 366 369 //calculating coordinates of new edge … … 556 559 { 557 560 //for determine, whether it was an edge 558 Graph::EdgeItclicked_edge=INVALID;561 Edge clicked_edge=INVALID; 559 562 560 563 //find the activated item between texts … … 678 681 { 679 682 //for determine, whether it was a node 680 Graph::NodeItclicked_node=INVALID;683 Node clicked_node=INVALID; 681 684 682 685 //find the activated item between texts … … 850 853 } 851 854 852 void GraphDisplayerCanvas::deleteItem(Node Itnode_to_delete)855 void GraphDisplayerCanvas::deleteItem(Node node_to_delete) 853 856 { 854 857 delete(nodetextmap[node_to_delete]); … … 857 860 } 858 861 859 void GraphDisplayerCanvas::deleteItem(Edge Itedge_to_delete)862 void GraphDisplayerCanvas::deleteItem(Edge edge_to_delete) 860 863 { 861 864 delete(edgetextmap[edge_to_delete]); … … 864 867 } 865 868 866 void GraphDisplayerCanvas::deleteItem(Graph::Edge edge_to_delete)867 {868 delete(edgetextmap[edge_to_delete]);869 delete(edgesmap[edge_to_delete]);870 mapstorage.graph.erase(edge_to_delete);871 }872 873 869 void GraphDisplayerCanvas::textReposition(xy<double> new_place) 874 870 { -
gui/graph_displayer_canvas-node.cc
r1632 r1643 4 4 5 5 6 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Graph::Node node)6 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node) 7 7 { 8 8 Graph::NodeMap<double> * actual_map; … … 70 70 }; 71 71 72 int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Graph::Node node)72 int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Node node) 73 73 { 74 74 … … 142 142 }; 143 143 144 int GraphDisplayerCanvas::changeNodeText (std::string mapname, Graph::Node node)144 int GraphDisplayerCanvas::changeNodeText (std::string mapname, Node node) 145 145 { 146 146 -
gui/graph_displayer_canvas.h
r1614 r1643 24 24 ///Changes the linewidth attribute according to the given map. 25 25 ///\param mapname is the name of the map which contains the new values 26 int changeEdgeWidth (std::string mapname, Graph::Edge new_item=INVALID);26 int changeEdgeWidth (std::string mapname, Edge new_item=INVALID); 27 27 28 28 ///Changes the linecolor attribute according to the given map. 29 29 ///\param mapname is the name of the map which contains the new values 30 int changeEdgeColor (std::string mapname, Graph::Edge new_item=INVALID);30 int changeEdgeColor (std::string mapname, Edge new_item=INVALID); 31 31 32 32 ///Changes the text of line attribute according to the given map. 33 33 ///\param mapname is the name of the map which contains the new values 34 int changeEdgeText (std::string mapname, Graph::Edge new_item=INVALID);34 int changeEdgeText (std::string mapname, Edge new_item=INVALID); 35 35 36 36 ///Changes the linewidth attribute according to the given map. 37 37 ///\param mapname is the name of the map which contains the new values 38 int changeNodeRadius (std::string mapname, Graph::Node new_item=INVALID);38 int changeNodeRadius (std::string mapname, Node new_item=INVALID); 39 39 40 40 ///Changes the linecolor attribute according to the given map. 41 41 ///\param mapname is the name of the map which contains the new values 42 int changeNodeColor (std::string mapname, Graph::Node new_item=INVALID);42 int changeNodeColor (std::string mapname, Node new_item=INVALID); 43 43 44 44 ///Changes the text of line attribute according to the given map. 45 45 ///\param mapname is the name of the map which contains the new values 46 int changeNodeText (std::string mapname, Graph::Node new_item=INVALID);46 int changeNodeText (std::string mapname, Node new_item=INVALID); 47 47 48 48 ///Callback for 'ViewZoomIn' action. … … 120 120 private: 121 121 ///Deletes the given element. 122 void deleteItem(Node It);122 void deleteItem(Node); 123 123 ///Deletes the given element. 124 void deleteItem(EdgeIt); 125 ///Deletes the given element. 126 void deleteItem(Graph::Edge); 124 void deleteItem(Edge); 127 125 128 126 private: … … 167 165 ///2. we would like to handle only ony item per movement, therefore quering it is not a working solution 168 166 Gnome::Canvas::Item * active_item, * target_item; 169 Graph::NodeItactive_node;170 Graph::EdgeItactive_edge;171 Graph::EdgeItforming_edge;167 Node active_node; 168 Edge active_edge; 169 Edge forming_edge; 172 170 173 171 std::string nodemap_to_edit, edgemap_to_edit; -
gui/map_win.cc
r1606 r1643 218 218 }; 219 219 220 void MapWin::updateNode( Graph::Node node)220 void MapWin::updateNode(Node node) 221 221 { 222 222 for(int i=0;i<NODE_PROPERTY_NUM;i++) … … 251 251 } 252 252 253 void MapWin::updateEdge( Graph::Edge edge)253 void MapWin::updateEdge(Edge edge) 254 254 { 255 255 for(int i=0;i<EDGE_PROPERTY_NUM;i++) -
gui/mapstorage.cc
r1634 r1643 117 117 } 118 118 119 void MapStorage::initMapsForEdge( Graph::Edge e)119 void MapStorage::initMapsForEdge(Edge e) 120 120 { 121 121 std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it; -
lemon/concept/graph.h
r1631 r1643 405 405 /// This constructor sets the iterator to the first edge of \c g. 406 406 ///@param g the graph 407 EdgeIt(const StaticGraph& g) { }407 EdgeIt(const StaticGraph& g) { ignore_unused_variable_warning(g); } 408 408 /// Edge -> EdgeIt conversion 409 409 -
lemon/concept/path.h
r1624 r1643 25 25 26 26 #include <lemon/invalid.h> 27 #include <lemon/concept_check.h> 27 28 28 29 namespace lemon { … … 55 56 /// \param _g The graph in which the path is. 56 57 /// 57 Path(const Graph &_g) {} 58 Path(const Graph &_g) { 59 ignore_unused_variable_warning(_g); 60 } 58 61 59 62 /// Length of the path. -
lemon/concept/undir_graph.h
r1631 r1643 558 558 /// This constructor sets the iterator to the first edge of \c g. 559 559 ///@param g the graph 560 EdgeIt(const UndirGraph &g) { }560 EdgeIt(const UndirGraph &g) { ignore_unused_variable_warning(g); } 561 561 /// Edge -> EdgeIt conversion 562 562 … … 606 606 ///@param n the node 607 607 ///@param g the graph 608 OutEdgeIt(const UndirGraph& n, const Node& g) { } 608 OutEdgeIt(const UndirGraph& n, const Node& g) { 609 ignore_unused_variable_warning(n); 610 ignore_unused_variable_warning(g); 611 } 609 612 /// Edge -> OutEdgeIt conversion 610 613 … … 655 658 ///@param n the node 656 659 ///@param g the graph 657 InEdgeIt(const UndirGraph& g, const Node& n) { } 660 InEdgeIt(const UndirGraph& g, const Node& n) { 661 ignore_unused_variable_warning(n); 662 ignore_unused_variable_warning(g); 663 } 658 664 /// Edge -> InEdgeIt conversion 659 665 -
lemon/full_graph.h
r1566 r1643 126 126 protected: 127 127 int id; 128 Node(int _id) { id = _id;}128 Node(int _id) : id(_id) {} 129 129 public: 130 130 Node() {} 131 Node (Invalid) { id = -1;}131 Node (Invalid) : id(-1) {} 132 132 bool operator==(const Node node) const {return id == node.id;} 133 133 bool operator!=(const Node node) const {return id != node.id;} … … 261 261 Node source(Edge e) const { 262 262 /// \todo we may do it faster 263 return ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;263 return Node(((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2); 264 264 } 265 265 266 266 Node target(Edge e) const { 267 267 int source = ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;; 268 return e.id - (source) * (source - 1) / 2;268 return Node(e.id - (source) * (source - 1) / 2); 269 269 } 270 270
Note: See TracChangeset
for help on using the changeset viewer.