Changeset 1525:6d94de269ab1 in lemon-0.x
- Timestamp:
- 06/29/05 21:44:30 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2011
- Location:
- gui
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/graph_displayer_canvas-edge.cc
r1512 r1525 6 6 int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge) 7 7 { 8 Graph::EdgeMap<double> * actual_map; 9 if(mapname=="Default") 10 { 11 actual_map=new Graph::EdgeMap<double>(g,edge_property_defaults[E_WIDTH]); 12 } 13 else 14 { 15 actual_map=(mapstorage.edgemap_storage)[mapname]; 16 } 17 8 18 if(edge==INVALID) 9 19 { 10 20 for (EdgeIt i(g); i!=INVALID; ++i) 11 21 { 12 int w=(int)(* (mapstorage.edgemap_storage)[mapname])[i];22 int w=(int)(*actual_map)[i]; 13 23 if(w>=0) 14 24 { … … 19 29 else 20 30 { 21 int w=(int)(* (mapstorage.edgemap_storage)[mapname])[edge];31 int w=(int)(*actual_map)[edge]; 22 32 if(w>=0) 23 33 { … … 34 44 //the minimum of the nodemap to the range of 35 45 //green in RGB 46 Graph::EdgeMap<double> * actual_map; 47 if(mapname=="Default") 48 { 49 actual_map=new Graph::EdgeMap<double>(g,edge_property_defaults[E_COLOR]); 50 } 51 else 52 { 53 actual_map=(mapstorage.edgemap_storage)[mapname]; 54 } 55 56 double max, min; 57 58 if(mapname!="Default") 59 { 60 max=mapstorage.maxOfEdgeMap(mapname); 61 min=mapstorage.minOfEdgeMap(mapname); 62 } 63 else 64 { 65 max=edge_property_defaults[E_COLOR]; 66 min=edge_property_defaults[E_COLOR]; 67 } 68 36 69 if(edge==INVALID) 37 70 { 38 39 71 for (EdgeIt i(g); i!=INVALID; ++i) 40 72 { 41 double w=(*(mapstorage.edgemap_storage)[mapname])[i]; 42 double max=mapstorage.maxOfEdgeMap(mapname); 43 double min=mapstorage.minOfEdgeMap(mapname); 44 45 //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl; 73 double w=(*actual_map)[i]; 74 46 75 Gdk::Color color; 47 76 if(max!=min) … … 53 82 color.set_rgb_p (0, 100, 0); 54 83 } 55 56 84 edgesmap[i]->property_fill_color_gdk().set_value(color); 57 85 } … … 59 87 else 60 88 { 61 double w=(*(mapstorage.edgemap_storage)[mapname])[edge];62 double max=mapstorage.maxOfEdgeMap(mapname);63 double min=mapstorage.minOfEdgeMap(mapname);64 65 //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl;66 89 Gdk::Color color; 90 91 double w=(*actual_map)[edge]; 92 67 93 if(max!=min) 68 94 { … … 86 112 //in that case empty string will be written, because 87 113 //that is the deleter map 88 //\todo isn't it a bit woodcutter?89 114 90 115 if(edge==INVALID) … … 92 117 for (EdgeIt i(g); i!=INVALID; ++i) 93 118 { 94 if(mapname!= edge_property_strings[E_TEXT])119 if(mapname!="Default") 95 120 { 96 121 double number=(*(mapstorage.edgemap_storage)[mapname])[i]; … … 129 154 else 130 155 { 131 if(mapname!= edge_property_strings[E_TEXT])156 if(mapname!="Default") 132 157 { 133 158 double number=(*(mapstorage.edgemap_storage)[mapname])[edge]; -
gui/graph_displayer_canvas-event.cc
r1524 r1525 29 29 { 30 30 case MOVE: 31 actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false); 32 break; 33 34 //it has to assigned to canvas, because all the canvas has to be monitored, not only the elements of the already drawn group 31 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false); 32 break; 33 35 34 case CREATE_NODE: 36 35 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createNodeEventHandler), false); … … 38 37 39 38 case CREATE_EDGE: 40 actual_handler= displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createEdgeEventHandler), false);39 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createEdgeEventHandler), false); 41 40 break; 42 41 43 42 case ERASER: 44 actual_handler= displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::eraserEventHandler), false);43 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::eraserEventHandler), false); 45 44 break; 46 45 … … 61 60 case GDK_BUTTON_PRESS: 62 61 //we mark the location of the event to be able to calculate parameters of dragging 63 clicked_x=e->button.x;64 clicked_y=e->button.y; 65 active_item=(get_item_at( e->button.x, e->button.y));62 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); 63 64 active_item=(get_item_at(clicked_x, clicked_y)); 66 65 active_node=INVALID; 67 66 for (NodeIt i(g); i!=INVALID; ++i) … … 86 85 active_item=NULL; 87 86 active_node=INVALID; 88 updateScrollRegion();89 87 break; 90 88 case GDK_MOTION_NOTIFY: … … 97 95 //has to be calculated from here 98 96 99 double dx=e->motion.x-clicked_x; 100 double dy=e->motion.y-clicked_y; 97 double new_x, new_y; 98 99 window_to_world (e->motion.x, e->motion.y, new_x, new_y); 100 101 double dx=new_x-clicked_x; 102 double dy=new_y-clicked_y; 101 103 102 104 //repositioning node and its text … … 104 106 nodetextmap[active_node]->move(dx, dy); 105 107 106 clicked_x= e->motion.x;107 clicked_y= e->motion.y;108 clicked_x=new_x; 109 clicked_y=new_y; 108 110 109 111 //all the edges connected to the moved point has to be redrawn … … 169 171 } 170 172 171 return true;173 return false; 172 174 } 173 175 … … 178 180 179 181 //draw the new node in red at the clicked place 182 case GDK_2BUTTON_PRESS: 183 std::cout << "double click" << std::endl; 184 break; 180 185 case GDK_BUTTON_PRESS: 181 186 isbutton=1; … … 184 189 185 190 //initiating values corresponding to new node in maps 186 187 191 188 192 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); 193 194 target_item=NULL; 195 target_item=get_item_at(clicked_x, clicked_y); 189 196 190 197 nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph, clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20); … … 206 213 double world_motion_x, world_motion_y; 207 214 GdkEvent * generated=new GdkEvent(); 208 window_to_world (e->motion.x, e->motion.y, world_motion_x, world_motion_y); 209 generated->motion.x=world_motion_x; 210 generated->motion.y=world_motion_y; 215 generated->motion.x=e->motion.x; 216 generated->motion.y=e->motion.y; 211 217 generated->type=GDK_MOTION_NOTIFY; 212 218 moveEventHandler(generated); … … 217 223 case GDK_BUTTON_RELEASE: 218 224 isbutton=0; 219 *active_item << Gnome::Canvas::Properties::fill_color("blue"); 225 if(!target_item) 226 { 227 //Its appropriate color is given by update. 228 //*active_item << Gnome::Canvas::Properties::fill_color("blue"); 229 } 230 else 231 { 232 //In this case the given color has to be overwritten, because the noe covers an other item. 233 *active_item << Gnome::Canvas::Properties::fill_color("lightblue"); 234 } 235 target_item=NULL; 220 236 active_item=NULL; 221 237 active_node=INVALID; 222 updateScrollRegion();223 238 break; 224 239 default: … … 240 255 { 241 256 //we mark the location of the event to be able to calculate parameters of dragging 242 clicked_x=e->button.x; 243 clicked_y=e->button.y; 244 active_item=(get_item_at(e->button.x, e->button.y)); 257 258 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); 259 260 active_item=(get_item_at(clicked_x, clicked_y)); 245 261 active_node=INVALID; 246 262 for (NodeIt i(g); i!=INVALID; ++i) … … 270 286 else 271 287 { 272 target_item=(get_item_at(e->button.x, e->button.y)); 288 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); 289 target_item=(get_item_at(clicked_x, clicked_y)); 273 290 Graph::NodeIt target_node=INVALID; 274 291 for (NodeIt i(g); i!=INVALID; ++i) … … 367 384 { 368 385 case GDK_BUTTON_PRESS: 369 active_item=(get_item_at(e->button.x, e->button.y)); 386 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); 387 active_item=(get_item_at(clicked_x, clicked_y)); 370 388 active_node=INVALID; 371 389 active_edge=INVALID; … … 387 405 } 388 406 } 389 *active_item << Gnome::Canvas::Properties::fill_color("red"); 407 if(active_item) 408 { 409 *active_item << Gnome::Canvas::Properties::fill_color("red"); 410 } 390 411 break; 391 412 392 413 case GDK_BUTTON_RELEASE: 393 if(active_item==(get_item_at(e->button.x, e->button.y))) 394 { 395 if(active_node!=INVALID) 396 { 397 398 //collecting edges to delete 399 EdgeIt e; 400 std::set<Graph::Edge> edges_to_delete; 401 402 g.firstOut(e,active_node); 403 for(;e!=INVALID;g.nextOut(e)) 404 { 414 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); 415 if(active_item) 416 { 417 if( active_item == ( get_item_at (clicked_x, clicked_y) ) ) 418 { 419 if(active_node!=INVALID) 420 { 421 422 //collecting edges to delete 423 EdgeIt e; 424 std::set<Graph::Edge> edges_to_delete; 425 426 g.firstOut(e,active_node); 427 for(;e!=INVALID;g.nextOut(e)) 428 { 405 429 edges_to_delete.insert(e); 406 }407 408 409 410 {430 } 431 432 g.firstIn(e,active_node); 433 for(;e!=INVALID;g.nextIn(e)) 434 { 411 435 edges_to_delete.insert(e); 412 } 413 414 //deleting collected edges 415 for(std::set<Graph::Edge>::iterator edge_set_it=edges_to_delete.begin();edge_set_it!=edges_to_delete.end();edge_set_it++) 416 { 417 deleteItem(*edge_set_it); 418 } 419 deleteItem(active_node); 420 } 421 //a simple edge was chosen 436 } 437 438 //deleting collected edges 439 for(std::set<Graph::Edge>::iterator edge_set_it=edges_to_delete.begin();edge_set_it!=edges_to_delete.end();edge_set_it++) 440 { 441 deleteItem(*edge_set_it); 442 } 443 deleteItem(active_node); 444 } 445 //a simple edge was chosen 446 else 447 { 448 deleteItem(active_edge); 449 } 450 } 451 //pointer was moved, deletion is cancelled 422 452 else 423 453 { 424 deleteItem(active_edge); 425 } 426 427 428 } 429 //pointer was moved, deletion is cancelled 430 else 431 { 432 if(active_node!=INVALID) 433 { 434 *active_item << Gnome::Canvas::Properties::fill_color("blue"); 435 } 436 else 437 { 438 *active_item << Gnome::Canvas::Properties::fill_color("green"); 454 if(active_node!=INVALID) 455 { 456 *active_item << Gnome::Canvas::Properties::fill_color("blue"); 457 } 458 else 459 { 460 *active_item << Gnome::Canvas::Properties::fill_color("green"); 461 } 439 462 } 440 463 } … … 451 474 break; 452 475 } 453 return true;476 return false; 454 477 } 455 478 -
gui/graph_displayer_canvas-node.cc
r1512 r1525 6 6 int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Graph::Node node) 7 7 { 8 Graph::NodeMap<double> * actual_map; 9 if(mapname=="Default") 10 { 11 actual_map=new Graph::NodeMap<double>(g,node_property_defaults[N_RADIUS]); 12 } 13 else 14 { 15 actual_map=(mapstorage.nodemap_storage)[mapname]; 16 } 17 8 18 if(node==INVALID) 9 19 { 10 20 for (NodeIt i(g); i!=INVALID; ++i) 11 21 { 12 int w=(int)(* (mapstorage.nodemap_storage)[mapname])[i];22 int w=(int)(*actual_map)[i]; 13 23 if(w>=0) 14 24 { 15 25 double x1, y1, x2, y2; 16 nodesmap[i]->get_bounds(x1, y1, x2, y2); 26 x1=nodesmap[i]->property_x1().get_value(); 27 x2=nodesmap[i]->property_x2().get_value(); 28 y1=nodesmap[i]->property_y1().get_value(); 29 y2=nodesmap[i]->property_y2().get_value(); 17 30 nodesmap[i]->property_x1().set_value((x1+x2)/2-w); 18 31 nodesmap[i]->property_x2().set_value((x1+x2)/2+w); … … 24 37 else 25 38 { 26 int w=(int)(*(mapstorage.nodemap_storage)[mapname])[node]; 39 //I think only new nodes use this case 40 // int w=(int)(*actual_map)[node]; 41 int w=(int)(node_property_defaults[N_RADIUS]); 27 42 if(w>=0) 28 43 { 29 44 double x1, y1, x2, y2; 30 nodesmap[node]->get_bounds(x1, y1, x2, y2); 45 x1=nodesmap[node]->property_x1().get_value(); 46 x2=nodesmap[node]->property_x2().get_value(); 47 y1=nodesmap[node]->property_y1().get_value(); 48 y2=nodesmap[node]->property_y2().get_value(); 31 49 nodesmap[node]->property_x1().set_value((x1+x2)/2-w); 32 50 nodesmap[node]->property_x2().set_value((x1+x2)/2+w); … … 45 63 //green in RGB 46 64 65 Graph::NodeMap<double> * actual_map; 66 if(mapname=="Default") 67 { 68 actual_map=new Graph::NodeMap<double>(g,node_property_defaults[N_COLOR]); 69 } 70 else 71 { 72 actual_map=(mapstorage.nodemap_storage)[mapname]; 73 } 74 75 double max, min; 76 77 if(mapname!="Default") 78 { 79 max=mapstorage.maxOfNodeMap(mapname); 80 min=mapstorage.minOfNodeMap(mapname); 81 } 82 else 83 { 84 max=node_property_defaults[N_COLOR]; 85 min=node_property_defaults[N_COLOR]; 86 } 87 88 47 89 if(node==INVALID) 48 90 { … … 50 92 for (NodeIt i(g); i!=INVALID; ++i) 51 93 { 52 double w=(*(mapstorage.nodemap_storage)[mapname])[i];53 double max=mapstorage.maxOfNodeMap(mapname);54 double min=mapstorage.minOfNodeMap(mapname);55 56 //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl;57 94 Gdk::Color color; 95 96 double w=(*actual_map)[i]; 97 58 98 if(max!=min) 59 99 { … … 70 110 else 71 111 { 72 double w=(*(mapstorage.nodemap_storage)[mapname])[node];73 double max=mapstorage.maxOfNodeMap(mapname);74 double min=mapstorage.minOfNodeMap(mapname);75 76 //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl;77 112 Gdk::Color color; 113 114 double w=(*actual_map)[node]; 115 78 116 if(max!=min) 79 117 { … … 97 135 //in that case empty string will be written, because 98 136 //that is the deleter map 99 //\todo isn't it a bit woodcutter? 137 138 Graph::NodeMap<double> * actual_map; 139 if(mapname=="Default") 140 { 141 actual_map=new Graph::NodeMap<double>(g,node_property_defaults[N_COLOR]); 142 } 143 else 144 { 145 actual_map=(mapstorage.nodemap_storage)[mapname]; 146 } 100 147 101 148 if(node==INVALID) … … 103 150 for (NodeIt i(g); i!=INVALID; ++i) 104 151 { 105 if(mapname!= node_property_strings[N_TEXT])106 { 107 double number=(* (mapstorage.nodemap_storage)[mapname])[i];152 if(mapname!="Default") 153 { 154 double number=(*actual_map)[i]; 108 155 int length=1; 109 156 //if number is smaller than one, length would be negative, or invalid … … 139 186 else 140 187 { 141 if(mapname!= node_property_strings[N_TEXT])142 { 143 double number=(* (mapstorage.nodemap_storage)[mapname])[node];188 if(mapname!="Default") 189 { 190 double number=(*actual_map)[node]; 144 191 int length=1; 145 192 //if number is smaller than one, length would be negative, or invalid -
gui/graph_displayer_canvas.cc
r1524 r1525 6 6 { 7 7 8 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas:: createNodeEventHandler), false);8 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false); 9 9 actual_tool=CREATE_NODE; 10 10 -
gui/map_win.cc
r1524 r1525 24 24 for(int i=0;i<EDGE_PROPERTY_NUM;i++) 25 25 { 26 27 std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();28 std::set<int> props;29 30 int actprop;31 32 //here we find out, which map is the default in MapStorage for this property, which are not33 for(int j=0;j<ms.numOfEdgeMaps();j++)34 {35 //this is the default value for this property36 if(emsi->second==&(ms.default_edgemaps[i]))37 {38 actprop=j;39 }40 //these are the maps NOT to show for this property41 for(int k=0;k<EDGE_PROPERTY_NUM;k++)42 {43 if(emsi->second==&(ms.default_edgemaps[k]))44 {45 props.insert(j);46 }47 }48 emsi++;49 }50 51 26 //filling in combo box with choices 52 27 std::list<Glib::ustring> listStrings; … … 54 29 listStrings.push_back("Default"); 55 30 56 emsi=ms.beginOfEdgeMaps(); 57 58 for(int j=0;j<ms.numOfEdgeMaps();j++) 59 { 60 if( ( props.find(j) )==( props.end() ) ) 61 { 31 std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps(); 32 for(;emsi!=ms.endOfEdgeMaps();emsi++) 33 { 62 34 listStrings.push_back(emsi->first); 63 }64 emsi++;65 35 } 66 36 … … 103 73 for(int i=0;i<NODE_PROPERTY_NUM;i++) 104 74 { 105 106 std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();107 std::set<int> props;108 109 int actprop;110 111 //here we find out, which map is the default in MapStorage for this property, which are not112 for(int j=0;j<ms.numOfNodeMaps();j++)113 {114 //these are the maps NOT to show for this property115 if(emsi->second==&(ms.default_nodemaps[i]))116 {117 actprop=j;118 }119 //this is the other maps to show for this property120 for(int k=0;k<NODE_PROPERTY_NUM;k++)121 {122 if(emsi->second==&(ms.default_nodemaps[k]))123 {124 props.insert(j);125 }126 }127 emsi++;128 }129 130 75 //filling in combo box with choices 131 76 std::list<Glib::ustring> listStrings; … … 133 78 listStrings.push_back("Default"); 134 79 135 emsi=ms.beginOfNodeMaps(); 136 137 for(int j=0;j<ms.numOfNodeMaps();j++) 138 { 139 if( ( props.find(j) )==( props.end() ) ) 140 { 141 listStrings.push_back(emsi->first); 142 } 143 emsi++; 80 std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps(); 81 82 for(;emsi!=ms.endOfNodeMaps();emsi++) 83 { 84 listStrings.push_back(emsi->first); 144 85 } 145 86 … … 189 130 if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty. 190 131 { 191 if(mapname=="Default") 192 { 193 mapname=edge_property_strings[prop]; 194 } 195 196 if( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) 132 if( ( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) || (mapname=="Default") ) 197 133 { 198 134 switch(prop) … … 225 161 if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty. 226 162 { 227 if(mapname=="Default") 228 { 229 mapname=node_property_strings[prop]; 230 } 231 232 if( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) 163 if( ( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) || (mapname=="Default") ) 233 164 { 234 165 switch(prop) … … 262 193 if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty. 263 194 { 264 if(mapname=="Default") 265 { 266 mapname=node_property_strings[i]; 267 } 268 269 if( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) 195 if( ( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) || (mapname=="Default") ) 270 196 { 271 197 switch(i) 272 198 { 273 199 case N_RADIUS: 274 //gdc.changeNodeRadius(mapname, node); 275 std::cout << "If default map-value problem is solved, uncomment line in MapWin::node_update!" << std::endl; 200 gdc.changeNodeRadius(mapname, node); 276 201 break; 277 202 case N_COLOR: … … 302 227 if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty. 303 228 { 304 if(mapname=="Default") 305 { 306 mapname=edge_property_strings[i]; 307 } 308 309 if( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) 229 230 if( ( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) || (mapname=="Default") ) 310 231 { 311 232 switch(i) 312 233 { 313 234 case E_WIDTH: 314 //gdc.changeEdgeWidth(mapname, edge); 315 std::cout << "If default map-value problem is solved, uncomment line in MapWin::edge_update!" << std::endl; 235 gdc.changeEdgeWidth(mapname, edge); 316 236 break; 317 237 case E_COLOR: -
gui/mapstorage.cc
r1524 r1525 3 3 MapStorage::MapStorage(Graph & graph):g(graph) 4 4 { 5 for(int i=0;i<EDGE_PROPERTY_NUM;i++)6 {7 Graph::EdgeMap<double> emd(g,edge_property_defaults[i]);8 default_edgemaps.push_back(emd);9 }10 11 for(int i=0;i<NODE_PROPERTY_NUM;i++)12 {13 Graph::NodeMap<double> nmd(g,node_property_defaults[i]);14 default_nodemaps.push_back(nmd);15 }16 17 for(int i=0;i<EDGE_PROPERTY_NUM;i++)18 {19 for (EdgeIt j(g); j!=INVALID; ++j)20 {21 (default_edgemaps[i])[j]=edge_property_defaults[i];22 }23 addEdgeMap(edge_property_strings[i],&(default_edgemaps[i]));24 }25 26 for(int i=0;i<NODE_PROPERTY_NUM;i++)27 {28 for (NodeIt j(g); j!=INVALID; ++j)29 {30 (default_nodemaps[i])[j]=node_property_defaults[i];31 }32 addNodeMap(node_property_strings[i],&(default_nodemaps[i]));33 }34 35 5 }; 36 6 … … 103 73 void MapStorage::initMapsForEdge(Graph::Edge e) 104 74 { 105 e=e; 106 // beragad, aztan csovez 107 // std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it; 108 // for(ems_it=edgemap_storage.begin();ems_it!=edgemap_storage.end();ems_it++) 109 // { 110 // std::cout << "szevasz\n"; 111 // (*((*ems_it).second))[e]=0; 112 // } 113 // std::cout << std::endl; 114 115 // g_closure_invoke... 116 // for(int i=0;i<EDGE_PROPERTY_NUM;i++) 117 // { 118 // (default_edgemaps[i])[e]=property_defaults[i]; 119 // } 75 std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it; 76 for(ems_it=edgemap_storage.begin();ems_it!=edgemap_storage.end();ems_it++) 77 { 78 (*((*ems_it).second))[e]=5; 79 } 120 80 } -
gui/mapstorage.h
r1524 r1525 82 82 std::map< std::string,Graph::EdgeMap<double> * >::iterator beginOfEdgeMaps(){return edgemap_storage.begin();}; 83 83 84 ///To be able to iterate through each maps this function returns an iterator pointing to the last nodemap in the storage. 85 std::map< std::string,Graph::NodeMap<double> * >::iterator endOfNodeMaps(){return nodemap_storage.end();}; 86 87 ///To be able to iterate through each maps this function returns an iterator pointing to the last edgemap in the storage. 88 std::map< std::string,Graph::EdgeMap<double> * >::iterator endOfEdgeMaps(){return edgemap_storage.end();}; 89 84 90 ///This function sets a default base value for the newly created node 85 91 void initMapsForNode(NodeIt);
Note: See TracChangeset
for help on using the changeset viewer.