gui/new_map_win.cc
changeset 1887 22fdc00894aa
parent 1884 9c061834b33b
child 1888 eed01ce27087
equal deleted inserted replaced
10:27055267d99d 11:1c9a8dfe7244
   157 	      //furthermore it is done by signals
   157 	      //furthermore it is done by signals
   158 	      //mytab.registerNewEdgeMap(mapname);
   158 	      //mytab.registerNewEdgeMap(mapname);
   159 
   159 
   160 	      //display it
   160 	      //display it
   161 	      //gdc.changeEdgeText(mapname);
   161 	      //gdc.changeEdgeText(mapname);
   162 
       
   163 	      //delete emptr;
       
   164 	    }
   162 	    }
   165 	  else //!edge.get_active()
   163 	  else //!edge.get_active()
   166 	    {
   164 	    {
   167 	      //create the new map
   165 	      //create the new map
   168 	      Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (mytab.mapstorage.graph);
   166 	      Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (mytab.mapstorage.graph);
   238 	      //furthermore it is done by signals
   236 	      //furthermore it is done by signals
   239 	      //mytab.registerNewNodeMap(mapname);
   237 	      //mytab.registerNewNodeMap(mapname);
   240 
   238 
   241 	      //display it
   239 	      //display it
   242 	      //gdc.changeNodeText(mapname);
   240 	      //gdc.changeNodeText(mapname);
   243 
       
   244 	      //delete emptr;
       
   245 	    }
   241 	    }
   246 	  if(!abortion)
   242 	  if(!abortion)
   247 	    {
   243 	    {
   248 	      name.set_text("");
   244 	      name.set_text("");
   249 	      default_value.set_text("0");
   245 	      default_value.set_text("0");
   372 
   368 
   373       tree_node * root=weightedString2Tree(comm_nobr, p, 0);
   369       tree_node * root=weightedString2Tree(comm_nobr, p, 0);
   374 
   370 
   375       std::string polishform=postOrder(root);
   371       std::string polishform=postOrder(root);
   376 
   372 
       
   373       deleteTree(root);
       
   374 
   377       return polishform;
   375       return polishform;
   378     }
   376     }
   379   return "";
   377   return "";
       
   378 }
       
   379 
       
   380 void NewMapWin::deleteTree(NewMapWin::tree_node * node)
       
   381 {
       
   382   if(node->left_child!=NULL)
       
   383     {
       
   384       deleteTree(node->left_child);
       
   385     }
       
   386   if(node->right_child!=NULL)
       
   387     {
       
   388       deleteTree(node->right_child);
       
   389     }
       
   390   delete node;
   380 }
   391 }
   381 
   392 
   382 NewMapWin::tree_node * NewMapWin::weightedString2Tree(std::string to_tree, std::vector<unsigned int> & p, int offset)
   393 NewMapWin::tree_node * NewMapWin::weightedString2Tree(std::string to_tree, std::vector<unsigned int> & p, int offset)
   383 {
   394 {
   384   unsigned int min=p[offset];
   395   unsigned int min=p[offset];