Changeset 2063:9535436aaa9f in lemon-0.x
- Timestamp:
- 04/19/06 00:59:33 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2708
- Location:
- gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/graph_displayer_canvas-event.cc
r1943 r2063 332 332 } 333 333 // increment the id map's default value 334 (mytab.mapstorage).nodemap_default[" id"] += 1.0;334 (mytab.mapstorage).nodemap_default["label"] += 1.0; 335 335 336 336 nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph, … … 442 442 } 443 443 // increment the id map's default value 444 (mytab.mapstorage).edgemap_default[" id"] += 1.0;444 (mytab.mapstorage).edgemap_default["label"] += 1.0; 445 445 446 446 //calculating coordinates of new edge … … 674 674 { 675 675 // the id map is not editable 676 if (edgemap_to_edit == " id") return 0;676 if (edgemap_to_edit == "label") return 0; 677 677 678 678 //and there is activated map … … 762 762 { 763 763 // the id map is not editable 764 if (nodemap_to_edit == " id") return 0;764 if (nodemap_to_edit == "label") return 0; 765 765 766 766 //and there is activated map -
gui/gui_reader.cc
r1860 r2063 23 23 for (EdgeIt e(mapstorage->graph); e != INVALID; ++e) 24 24 { 25 int edgeid = (int)(*mapstorage->edgemap_storage[" id"])[e];25 int edgeid = (int)(*mapstorage->edgemap_storage["label"])[e]; 26 26 mapstorage->arrow_pos.set(e, m[edgeid]); 27 27 } -
gui/gui_writer.cc
r1860 r2063 16 16 for (EdgeIt e(mapstorage->graph); e != INVALID; ++e) 17 17 { 18 int edgeid = (int)(*(mapstorage->edgemap_storage[" id"]))[e];18 int edgeid = (int)(*(mapstorage->edgemap_storage["label"]))[e]; 19 19 m[edgeid] = mapstorage->arrow_pos[e]; 20 20 } -
gui/mapstorage.cc
r1939 r2063 18 18 arrow_pos.setYMap(*edgemap_storage["arrow_pos_y"]); 19 19 20 nodemap_storage[" id"] = new Graph::NodeMap<double>(graph);21 edgemap_storage[" id"] = new Graph::EdgeMap<double>(graph);22 23 nodemap_default[" id"] = 1.0;24 edgemap_default[" id"] = 1.0;20 nodemap_storage["label"] = new Graph::NodeMap<double>(graph); 21 edgemap_storage["label"] = new Graph::EdgeMap<double>(graph); 22 23 nodemap_default["label"] = 1.0; 24 edgemap_default["label"] = 1.0; 25 25 26 26 active_nodemaps.resize(NODE_PROPERTY_NUM); … … 252 252 //std::cout << "read Y nodemap" << std::endl; 253 253 } 254 else if (*it == " id")254 else if (*it == "label") 255 255 { 256 256 //std::cout << "read id nodemap" << std::endl; … … 266 266 it != edgeMapNames.end(); ++it) 267 267 { 268 if (*it == " id")268 if (*it == "label") 269 269 { 270 270 //std::cout << "read id edgemap" << std::endl; … … 288 288 if (!read_edge_id) 289 289 { 290 edgemap_storage[" id"] = new Graph::EdgeMap<double>(graph);290 edgemap_storage["label"] = new Graph::EdgeMap<double>(graph); 291 291 int i = 1; 292 292 for (EdgeIt e(graph); e != INVALID; ++e) 293 293 { 294 (*edgemap_storage[" id"])[e] = i++;294 (*edgemap_storage["label"])[e] = i++; 295 295 } 296 296 } … … 327 327 nodemap_storage.begin(); it != nodemap_storage.end(); ++it) 328 328 { 329 if ((it->first != " id") &&329 if ((it->first != "label") && 330 330 (it->first != "coordiantes_x") && 331 331 (it->first != "coordinates_y")) … … 333 333 nodemap_default[it->first] = 0.0; 334 334 } 335 else if (it->first == " id")335 else if (it->first == "label") 336 336 { 337 337 NodeIt n(graph); 338 double max = (*nodemap_storage[" id"])[n];338 double max = (*nodemap_storage["label"])[n]; 339 339 for (; n != INVALID; ++n) 340 340 { 341 if ((*nodemap_storage[" id"])[n] > max)342 max = (*nodemap_storage[" id"])[n];343 } 344 nodemap_default[" id"] = max + 1.0;341 if ((*nodemap_storage["label"])[n] > max) 342 max = (*nodemap_storage["label"])[n]; 343 } 344 nodemap_default["label"] = max + 1.0; 345 345 } 346 346 } … … 348 348 edgemap_storage.begin(); it != edgemap_storage.end(); ++it) 349 349 { 350 if (it->first != " id")350 if (it->first != "label") 351 351 { 352 352 edgemap_default[it->first] = 0.0; … … 357 357 for (EdgeIt e(graph); e != INVALID; ++e) 358 358 { 359 if ((*edgemap_storage[" id"])[e] > max)360 max = (*edgemap_storage[" id"])[e];359 if ((*edgemap_storage["label"])[e] > max) 360 max = (*edgemap_storage["label"])[e]; 361 361 } 362 362 if (max > std::numeric_limits<double>::min()) 363 edgemap_default[" id"] = max + 1.0;363 edgemap_default["label"] = max + 1.0; 364 364 else 365 edgemap_default[" id"] = 1.0;365 edgemap_default["label"] = 1.0; 366 366 } 367 367 } … … 401 401 if ((it->first != "coordinates_x") && 402 402 (it->first != "coordinates_y") && 403 (it->first != " id"))403 (it->first != "label")) 404 404 { 405 405 delete it->second; … … 410 410 edgemap_storage.begin(); it != edgemap_storage.end(); ++it) 411 411 { 412 if ((it->first != " id") &&412 if ((it->first != "label") && 413 413 (it->first != "arrow_pos_x") && 414 414 (it->first != "arrow_pos_y")) … … 421 421 nodemap_default.begin(); it != nodemap_default.end(); ++it) 422 422 { 423 if (it->first != " id")423 if (it->first != "label") 424 424 nodemap_default.erase(it); 425 425 } … … 427 427 edgemap_default.begin(); it != edgemap_default.end(); ++it) 428 428 { 429 if (it->first != " id")429 if (it->first != "label") 430 430 edgemap_default.erase(it); 431 431 }
Note: See TracChangeset
for help on using the changeset viewer.