algobox.cc
changeset 201 879e47e5b731
parent 194 6b2b718420eb
equal deleted inserted replaced
7:4228c50d1e1b 8:3d72429d7c19
    80 }
    80 }
    81 
    81 
    82 void AlgoBox::update_maplist(MapStorage * ms)
    82 void AlgoBox::update_maplist(MapStorage * ms)
    83 {
    83 {
    84   mapstorage=ms;
    84   mapstorage=ms;
    85   std::vector<std::string> nml;
    85   std::vector<std::string> n_nml;
    86   std::vector<std::string> eml;
    86   std::vector<std::string> s_nml;
       
    87   std::vector<std::string> n_eml;
       
    88   std::vector<std::string> s_eml;
    87   if(mapstorage!=NULL)
    89   if(mapstorage!=NULL)
    88     {
    90     {
    89       mapstorage->signal_node_map_ch().connect(sigc::mem_fun(*this, &AlgoBox::nodemaplist_changed));
    91       mapstorage->signal_node_map_ch().connect(sigc::mem_fun(*this, &AlgoBox::nodemaplist_changed));
    90       mapstorage->signal_edge_map_ch().connect(sigc::mem_fun(*this, &AlgoBox::edgemaplist_changed));
    92       mapstorage->signal_edge_map_ch().connect(sigc::mem_fun(*this, &AlgoBox::edgemaplist_changed));
    91       nml=mapstorage->getNodeMapList();
    93       n_nml=mapstorage->getNodeMapList(NUM);
    92       eml=mapstorage->getEdgeMapList();
    94       s_nml=mapstorage->getNodeMapList(STR);
       
    95       n_eml=mapstorage->getEdgeMapList(NUM);
       
    96       s_eml=mapstorage->getEdgeMapList(STR);
    93     }
    97     }
    94   for(int i=0;i<(int)nodemapcbts.size();i++)
    98   for(int i=0;i<(int)nodemapcbts.size();i++)
    95     {
    99     {
    96       (nodemapcbts[i])->update_list(nml);
   100       (nodemapcbts[i])->update_list(n_nml, s_nml);
    97       //update_cbt(nml, *(nodemapcbts[i]));
   101       //update_cbt(nml, *(nodemapcbts[i]));
    98     }
   102     }
    99   for(int i=0;i<(int)edgemapcbts.size();i++)
   103   for(int i=0;i<(int)edgemapcbts.size();i++)
   100     {
   104     {
   101       (edgemapcbts[i])->update_list(eml);
   105       (edgemapcbts[i])->update_list(n_eml, s_eml);
   102       //update_cbt(eml, *(edgemapcbts[i]));
   106       //update_cbt(eml, *(edgemapcbts[i]));
   103     }
   107     }
   104   signal_maplist_updated.emit();
   108   signal_maplist_updated.emit();
   105 }
   109 }
   106 
   110 
   107 void AlgoBox::nodemaplist_changed(std::string newmap)
   111 void AlgoBox::nodemaplist_changed(std::string newmap, MapValue::Type type)
   108 {
   112 {
   109   for(int i=0;i<(int)nodemapcbts.size();i++)
   113   for(int i=0;i<(int)nodemapcbts.size();i++)
   110     {
   114     {
   111       (nodemapcbts[i])->append_text(newmap);
   115       (nodemapcbts[i])->append_text(newmap, type);
   112     }
   116     }
   113 }
   117 }
   114 
   118 
   115 void AlgoBox::edgemaplist_changed(std::string newmap)
   119 void AlgoBox::edgemaplist_changed(std::string newmap, MapValue::Type type)
   116 {
   120 {
   117   for(int i=0;i<(int)edgemapcbts.size();i++)
   121   for(int i=0;i<(int)edgemapcbts.size();i++)
   118     {
   122     {
   119       (edgemapcbts[i])->append_text(newmap);
   123       (edgemapcbts[i])->append_text(newmap, type);
   120     }
   124     }
   121 }
   125 }
   122 
   126 
   123 void AlgoBox::run()
   127 void AlgoBox::run()
   124 {
   128 {
   158     }
   162     }
   159 
   163 
   160   pack_start(*(new Gtk::HSeparator()));
   164   pack_start(*(new Gtk::HSeparator()));
   161 }
   165 }
   162 
   166 
   163 void AlgoBox::addMapSelector(std::string inputname, bool itisedge)
   167 void AlgoBox::addMapSelector(std::string inputname, bool itisedge, MapType type)
   164 {
   168 {
   165   std::vector<std::string> empty_vector;
   169   std::vector<std::string> empty_vector;
   166 
   170 
   167   MapSelector * msp=new MapSelector(empty_vector,"",inputname,itisedge, false);
   171   MapSelector * msp=new MapSelector(empty_vector,empty_vector,"",inputname,itisedge, false, type);
   168 
   172 
   169   if(itisedge)
   173   if(itisedge)
   170     {
   174     {
   171       edgemapcbts.resize(edgemapcbts.size()+1);
   175       edgemapcbts.resize(edgemapcbts.size()+1);
   172       edgemapcbts[edgemapcbts.size()-1]=msp;
   176       edgemapcbts[edgemapcbts.size()-1]=msp;