Changeset 94:adfdc2f70548 in glemon-0.x for new_map_win.cc
- Timestamp:
- 11/29/05 20:31:58 (19 years ago)
- Branch:
- gui
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2389
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new_map_win.cc
r90 r94 10 10 } 11 11 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")12 NewMapWin::NewMapWin(const std::string& title, MainWin & mw, bool itisedge, bool edgenode):Gtk::Dialog(title, true, true),mainwin(mw),node("Create NodeMap"),edge("Create EdgeMap") 13 13 { 14 14 set_default_size(200, 50); … … 84 84 { 85 85 //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); 87 87 88 88 std::stack<double> polishstack; 89 89 90 for(EdgeIt k( gdc.mapstorage.graph); k!=INVALID; ++k)90 for(EdgeIt k(mainwin.mapstorage.graph); k!=INVALID; ++k) 91 91 { 92 92 for(int i=0;i<(int)polishform.size();i++) … … 107 107 default: 108 108 //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; 110 110 bool itisvar=(ems.find(ch2var[ polishform[i] ])!=ems.end()); 111 111 if(itisvar) 112 112 { 113 polishstack.push( (*( gdc.mapstorage.edgemap_storage[ ch2var[ polishform[i] ] ]))[k]);113 polishstack.push( (*(mainwin.mapstorage.edgemap_storage[ ch2var[ polishform[i] ] ]))[k]); 114 114 } 115 115 else … … 154 154 //if addition was not successful addEdgeMap returns one. 155 155 //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)) 157 157 { 158 158 abortion=1; … … 160 160 161 161 //add it to the list of the displayable maps 162 gdc.mapwin.registerNewEdgeMap(mapname);162 mainwin.registerNewEdgeMap(mapname); 163 163 164 164 //display it 165 gdc.changeEdgeText(mapname);165 //gdc.changeEdgeText(mapname); 166 166 } 167 167 else //!edge.get_active() 168 168 { 169 169 //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); 171 171 172 172 std::stack<double> polishstack; 173 173 174 for(NodeIt k( gdc.mapstorage.graph); k!=INVALID; ++k)174 for(NodeIt k(mainwin.mapstorage.graph); k!=INVALID; ++k) 175 175 { 176 176 for(int i=0;i<(int)polishform.size();i++) … … 190 190 break; 191 191 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; 193 193 bool itisvar=(nms.find(ch2var[ polishform[i] ])!=nms.end()); 194 194 if(itisvar) 195 195 { 196 polishstack.push( (*( gdc.mapstorage.nodemap_storage[ ch2var[ polishform[i] ] ]))[k]);196 polishstack.push( (*(mainwin.mapstorage.nodemap_storage[ ch2var[ polishform[i] ] ]))[k]); 197 197 } 198 198 else … … 237 237 //if addition was not successful addNodeMap returns one. 238 238 //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)) 240 240 { 241 241 abortion=1; … … 243 243 244 244 //add it to the list of the displayable maps 245 gdc.mapwin.registerNewNodeMap(mapname);245 mainwin.registerNewNodeMap(mapname); 246 246 247 247 //display it … … 432 432 if(itisedge) 433 433 { 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()); 435 435 } 436 436 else 437 437 { 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()); 439 439 } 440 440 //maybe it is number
Note: See TracChangeset
for help on using the changeset viewer.