COIN-OR::LEMON - Graph Library

Changeset 2063:9535436aaa9f in lemon-0.x for gui


Ignore:
Timestamp:
04/19/06 00:59:33 (18 years ago)
Author:
Akos Ladanyi
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2708
Message:

id->label

Location:
gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • gui/graph_displayer_canvas-event.cc

    r1943 r2063  
    332332      }
    333333      // increment the id map's default value
    334       (mytab.mapstorage).nodemap_default["id"] += 1.0;
     334      (mytab.mapstorage).nodemap_default["label"] += 1.0;
    335335
    336336      nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
     
    442442              }
    443443              // increment the id map's default value
    444               (mytab.mapstorage).edgemap_default["id"] += 1.0;
     444              (mytab.mapstorage).edgemap_default["label"] += 1.0;
    445445
    446446              //calculating coordinates of new edge
     
    674674          {
    675675            // the id map is not editable
    676             if (edgemap_to_edit == "id") return 0;
     676            if (edgemap_to_edit == "label") return 0;
    677677
    678678            //and there is activated map
     
    762762          {
    763763            // the id map is not editable
    764             if (nodemap_to_edit == "id") return 0;
     764            if (nodemap_to_edit == "label") return 0;
    765765
    766766            //and there is activated map
  • gui/gui_reader.cc

    r1860 r2063  
    2323  for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
    2424  {
    25     int edgeid = (int)(*mapstorage->edgemap_storage["id"])[e];
     25    int edgeid = (int)(*mapstorage->edgemap_storage["label"])[e];
    2626    mapstorage->arrow_pos.set(e, m[edgeid]);
    2727  }
  • gui/gui_writer.cc

    r1860 r2063  
    1616  for (EdgeIt e(mapstorage->graph); e != INVALID; ++e)
    1717  {
    18     int edgeid = (int)(*(mapstorage->edgemap_storage["id"]))[e];
     18    int edgeid = (int)(*(mapstorage->edgemap_storage["label"]))[e];
    1919    m[edgeid] = mapstorage->arrow_pos[e];
    2020  }
  • gui/mapstorage.cc

    r1939 r2063  
    1818  arrow_pos.setYMap(*edgemap_storage["arrow_pos_y"]);
    1919
    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;
    2525
    2626  active_nodemaps.resize(NODE_PROPERTY_NUM);
     
    252252        //std::cout << "read Y nodemap" << std::endl;
    253253      }
    254       else if (*it == "id")
     254      else if (*it == "label")
    255255      {
    256256        //std::cout << "read id nodemap" << std::endl;
     
    266266        it != edgeMapNames.end(); ++it)
    267267    {
    268       if (*it == "id")
     268      if (*it == "label")
    269269      {
    270270        //std::cout << "read id edgemap" << std::endl;
     
    288288  if (!read_edge_id)
    289289  {
    290     edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
     290    edgemap_storage["label"] = new Graph::EdgeMap<double>(graph);
    291291    int i = 1;
    292292    for (EdgeIt e(graph); e != INVALID; ++e)
    293293    {
    294       (*edgemap_storage["id"])[e] = i++;
     294      (*edgemap_storage["label"])[e] = i++;
    295295    }
    296296  }
     
    327327      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
    328328  {
    329     if ((it->first != "id") &&
     329    if ((it->first != "label") &&
    330330        (it->first != "coordiantes_x") &&
    331331        (it->first != "coordinates_y"))
     
    333333      nodemap_default[it->first] = 0.0;
    334334    }
    335     else if (it->first == "id")
     335    else if (it->first == "label")
    336336    {
    337337      NodeIt n(graph);
    338       double max = (*nodemap_storage["id"])[n];
     338      double max = (*nodemap_storage["label"])[n];
    339339      for (; n != INVALID; ++n)
    340340      {
    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;
    345345    }
    346346  }
     
    348348      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
    349349  {
    350     if (it->first != "id")
     350    if (it->first != "label")
    351351    {
    352352      edgemap_default[it->first] = 0.0;
     
    357357      for (EdgeIt e(graph); e != INVALID; ++e)
    358358      {
    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];
    361361      }
    362362      if (max > std::numeric_limits<double>::min())
    363         edgemap_default["id"] = max + 1.0;
     363        edgemap_default["label"] = max + 1.0;
    364364      else
    365         edgemap_default["id"] = 1.0;
     365        edgemap_default["label"] = 1.0;
    366366    }
    367367  }
     
    401401    if ((it->first != "coordinates_x") &&
    402402        (it->first != "coordinates_y") &&
    403         (it->first != "id"))
     403        (it->first != "label"))
    404404    {
    405405      delete it->second;
     
    410410      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
    411411  {
    412     if ((it->first != "id") &&
     412    if ((it->first != "label") &&
    413413        (it->first != "arrow_pos_x") &&
    414414        (it->first != "arrow_pos_y"))
     
    421421      nodemap_default.begin(); it != nodemap_default.end(); ++it)
    422422  {
    423     if (it->first != "id")
     423    if (it->first != "label")
    424424      nodemap_default.erase(it);
    425425  }
     
    427427      edgemap_default.begin(); it != edgemap_default.end(); ++it)
    428428  {
    429     if (it->first != "id")
     429    if (it->first != "label")
    430430      edgemap_default.erase(it);
    431431  }
Note: See TracChangeset for help on using the changeset viewer.