[Lemon-commits] ladanyi: r3389 - glemon/branches/akos

Lemon SVN svn at lemon.cs.elte.hu
Sun Nov 18 15:13:38 CET 2007


Author: ladanyi
Date: Sun Nov 18 15:13:37 2007
New Revision: 3389

Modified:
   glemon/branches/akos/new_map_win.cc

Log:
Remove unused code.

Modified: glemon/branches/akos/new_map_win.cc
==============================================================================
--- glemon/branches/akos/new_map_win.cc	(original)
+++ glemon/branches/akos/new_map_win.cc	Sun Nov 18 15:13:37 2007
@@ -267,218 +267,6 @@
   }
 }
 
-/*
-void NewMapWin::on_response(int response_id)
-{
-  if(response_id==Gtk::RESPONSE_OK)
-  {
-    double def_val=0;
-
-    //get and formulate text
-    std::string def_val_str=default_value.get_text();
-
-    bool only_nums=true;
-    for(int i=0;i<(int)def_val_str.size() && only_nums;i++)
-    {
-      if( def_val_str[i]<'0' || def_val_str[i]>'9' )
-      {
-        only_nums=false;
-      }
-    }
-    std::string polishform;
-
-    if(only_nums)
-    {
-      def_val=atof(def_val_str.c_str());
-    }
-    else
-    {
-      polishform=string2Polishform(def_val_str,edge.get_active());
-    }
-
-    //get name of text
-    std::string mapname=name.get_text();
-
-    if(!mapname.empty()&&(!polishform.empty()||only_nums))
-    {
-      int abortion=0;
-      if(edge.get_active())
-      {
-        //create the new map
-        Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (mytab.mapstorage.graph, def_val);
-
-        if(!only_nums)
-        {
-          std::stack<double> polishstack;
-
-          for(EdgeIt k(mytab.mapstorage.graph); k!=INVALID; ++k)
-          {
-            for(int i=0;i<(int)polishform.size();i++)
-            {
-              double op1=0, op2=0;
-              bool operation=true;
-              switch(polishform[i])
-              {
-                case '+':
-                case '-':
-                case '/':
-                case '*':
-                  op1=polishstack.top();
-                  polishstack.pop();
-                  op2=polishstack.top();
-                  polishstack.pop();
-                  break;
-                default:
-                  //substitute variable
-                  std::vector<std::string> ems = mytab.mapstorage.getEdgeMapList();
-                  bool itisvar=(std::find(ems.begin(), ems.end(), ch2var[ polishform[i] ]) != ems.end());
-                  if(itisvar)
-                  {
-                    polishstack.push(mytab.mapstorage.get(ch2var[ polishform[i] ], k));
-                  }
-                  else
-                  {
-                    polishstack.push(atof(ch2var[ polishform[i] ].c_str()));
-                  }
-                  operation=false;
-                  break;
-              }
-              if(operation)
-              {
-                double res;
-                switch(polishform[i])
-                {
-                  case '+':
-                    res=op1+op2;
-                    break;
-                  case '-':
-                    res=op2-op1;
-                    break;
-                  case '/':
-                    res=op2/op1;
-                    break;
-                  case '*':
-                    res=op1*op2;
-                    break;
-                  default:
-                    std::cout << "How could we get here?" << std::endl;
-                    break;
-                }
-                polishstack.push(res);
-              }
-            }//foreach letter in polishform
-            (*emptr)[k]=polishstack.top(); 
-          }//foreach edge
-        }//!only_nums
-
-        //if addition was not successful addEdgeMap returns one.
-        //cause can be that there is already a map named like the new one
-        if(mytab.mapstorage.addEdgeMap(mapname, emptr, def_val))
-        {
-          abortion=1;
-        }
-
-        //add it to the list of the displayable maps
-        //furthermore it is done by signals
-        //mytab.registerNewEdgeMap(mapname);
-
-        //display it
-        //gdc.changeEdgeText(mapname);
-      }
-      else //!edge.get_active()
-      {
-        //create the new map
-        Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (mytab.mapstorage.graph, def_val);
-
-        if(!only_nums)
-        {
-          std::stack<double> polishstack;
-
-          for(NodeIt k(mytab.mapstorage.graph); k!=INVALID; ++k)
-          {
-            for(int i=0;i<(int)polishform.size();i++)
-            {
-              double op1=0, op2=0;
-              bool operation=true;
-              switch(polishform[i])
-              {
-                case '+':
-                case '-':
-                case '/':
-                case '*':
-                  op1=polishstack.top();
-                  polishstack.pop();
-                  op2=polishstack.top();
-                  polishstack.pop();
-                  break;
-                default:
-                  std::vector<std::string> nms = mytab.mapstorage.getNodeMapList();
-                  bool itisvar=(std::find(nms.begin(), nms.end(), ch2var[ polishform[i] ])!=nms.end());
-                  if(itisvar)
-                  {
-                    polishstack.push( mytab.mapstorage.get(ch2var[ polishform[i] ],k));
-                  }
-                  else
-                  {
-                    polishstack.push(atof(ch2var[ polishform[i] ].c_str()));
-                  }
-                  operation=false;
-                  break;
-              }
-              if(operation)
-              {
-                double res;
-                switch(polishform[i])
-                {
-                  case '+':
-                    res=op1+op2;
-                    break;
-                  case '-':
-                    res=op2-op1;
-                    break;
-                  case '/':
-                    res=op2/op1;
-                    break;
-                  case '*':
-                    res=op1*op2;
-                    break;
-                  default:
-                    std::cout << "How could we get here?" << std::endl;
-                    break;
-                }
-                polishstack.push(res);
-              }
-            }
-            (*emptr)[k]=polishstack.top(); 
-          }
-        }
-        //if addition was not successful addNodeMap returns one.
-        //cause can be that there is already a map named like the new one
-        if(mytab.mapstorage.addNodeMap(mapname,emptr, def_val))
-        {
-          abortion=1;
-        }
-
-        //add it to the list of the displayable maps
-        //furthermore it is done by signals
-        //mytab.registerNewNodeMap(mapname);
-
-        //display it
-        //gdc.changeNodeText(mapname);
-      }
-      if(!abortion)
-      {
-        name.set_text("");
-        default_value.set_text("0");
-        edge.show();
-        node.show();
-        hide();
-      }
-    }
-  }
-}
-*/
-
 
 std::string NewMapWin::string2Polishform(std::string rawcommand, bool itisedge)
 {



More information about the Lemon-commits mailing list