COIN-OR::LEMON - Graph Library

Changeset 1837:8dd6160ff699 in lemon-0.x for gui/new_map_win.cc


Ignore:
Timestamp:
11/29/05 20:31:58 (14 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2389
Message:

Structure of GUI is now more clear-cut than before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/new_map_win.cc

    r1823 r1837  
    1010}
    1111
    12 NewMapWin::NewMapWin(const std::string& title, GraphDisplayerCanvas & grdispc, bool itisedge, bool edgenode):Gtk::Dialog(title, true, true),gdc(grdispc),node("Create NodeMap"),edge("Create EdgeMap")
     12NewMapWin::NewMapWin(const std::string& title, MainWin & mw, bool itisedge, bool edgenode):Gtk::Dialog(title, true, true),mainwin(mw),node("Create NodeMap"),edge("Create EdgeMap")
    1313{
    1414  set_default_size(200, 50);
     
    8484            {
    8585              //create the new map
    86               Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (gdc.mapstorage.graph);
     86              Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (mainwin.mapstorage.graph);
    8787
    8888              std::stack<double> polishstack;
    8989 
    90               for(EdgeIt k(gdc.mapstorage.graph); k!=INVALID; ++k)
     90              for(EdgeIt k(mainwin.mapstorage.graph); k!=INVALID; ++k)
    9191                {
    9292                  for(int i=0;i<(int)polishform.size();i++)
     
    107107                        default:
    108108                          //substitute variable
    109                           std::map< std::string,Graph::EdgeMap<double> * > ems=gdc.mapstorage.edgemap_storage;
     109                          std::map< std::string,Graph::EdgeMap<double> * > ems=mainwin.mapstorage.edgemap_storage;
    110110                          bool itisvar=(ems.find(ch2var[ polishform[i] ])!=ems.end());
    111111                          if(itisvar)
    112112                            {
    113                               polishstack.push( (*(gdc.mapstorage.edgemap_storage[ ch2var[ polishform[i] ] ]))[k]);
     113                              polishstack.push( (*(mainwin.mapstorage.edgemap_storage[ ch2var[ polishform[i] ] ]))[k]);
    114114                            }
    115115                          else
     
    154154              //if addition was not successful addEdgeMap returns one.
    155155              //cause can be that there is already a map named like the new one
    156               if(gdc.mapstorage.addEdgeMap(mapname, emptr, def_val))
     156              if(mainwin.mapstorage.addEdgeMap(mapname, emptr, def_val))
    157157                {
    158158                  abortion=1;
     
    160160
    161161              //add it to the list of the displayable maps
    162               gdc.mapwin.registerNewEdgeMap(mapname);
     162              mainwin.registerNewEdgeMap(mapname);
    163163
    164164              //display it
    165               gdc.changeEdgeText(mapname);
     165              //gdc.changeEdgeText(mapname);
    166166            }
    167167          else //!edge.get_active()
    168168            {
    169169              //create the new map
    170               Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (gdc.mapstorage.graph);
     170              Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (mainwin.mapstorage.graph);
    171171
    172172              std::stack<double> polishstack;
    173173 
    174               for(NodeIt k(gdc.mapstorage.graph); k!=INVALID; ++k)
     174              for(NodeIt k(mainwin.mapstorage.graph); k!=INVALID; ++k)
    175175                {
    176176                  for(int i=0;i<(int)polishform.size();i++)
     
    190190                          break;
    191191                        default:
    192                           std::map< std::string,Graph::NodeMap<double> * > nms=gdc.mapstorage.nodemap_storage;
     192                          std::map< std::string,Graph::NodeMap<double> * > nms=mainwin.mapstorage.nodemap_storage;
    193193                          bool itisvar=(nms.find(ch2var[ polishform[i] ])!=nms.end());
    194194                          if(itisvar)
    195195                            {
    196                               polishstack.push( (*(gdc.mapstorage.nodemap_storage[ ch2var[ polishform[i] ] ]))[k]);
     196                              polishstack.push( (*(mainwin.mapstorage.nodemap_storage[ ch2var[ polishform[i] ] ]))[k]);
    197197                            }
    198198                          else
     
    237237              //if addition was not successful addNodeMap returns one.
    238238              //cause can be that there is already a map named like the new one
    239               if(gdc.mapstorage.addNodeMap(mapname,emptr, def_val))
     239              if(mainwin.mapstorage.addNodeMap(mapname,emptr, def_val))
    240240                {
    241241                  abortion=1;
     
    243243
    244244              //add it to the list of the displayable maps
    245               gdc.mapwin.registerNewNodeMap(mapname);
     245              mainwin.registerNewNodeMap(mapname);
    246246
    247247              //display it
     
    432432  if(itisedge)
    433433    {
    434       cancel=(gdc.mapstorage.edgemap_storage.find(variable)==gdc.mapstorage.edgemap_storage.end());
     434      cancel=(mainwin.mapstorage.edgemap_storage.find(variable)==mainwin.mapstorage.edgemap_storage.end());
    435435    }
    436436  else
    437437    {
    438       cancel=(gdc.mapstorage.nodemap_storage.find(variable)==gdc.mapstorage.nodemap_storage.end());
     438      cancel=(mainwin.mapstorage.nodemap_storage.find(variable)==mainwin.mapstorage.nodemap_storage.end());
    439439    }
    440440  //maybe it is number
Note: See TracChangeset for help on using the changeset viewer.