gui/mapstorage.cc
changeset 2087 67258b5a057b
parent 2063 9535436aaa9f
equal deleted inserted replaced
24:20b0b5500044 25:9d29634b0381
   266         it != edgeMapNames.end(); ++it)
   266         it != edgeMapNames.end(); ++it)
   267     {
   267     {
   268       if (*it == "label")
   268       if (*it == "label")
   269       {
   269       {
   270         //std::cout << "read id edgemap" << std::endl;
   270         //std::cout << "read id edgemap" << std::endl;
       
   271         read_edge_id = true;
   271       }
   272       }
   272       else
   273       else
   273       {
   274       {
   274         edgemap_storage[*it] = new Graph::EdgeMap<double>(graph);
   275         edgemap_storage[*it] = new Graph::EdgeMap<double>(graph);
   275         //std::cout << "read " << *it << " edgemap" << std::endl;
   276         //std::cout << "read " << *it << " edgemap" << std::endl;
   364       else
   365       else
   365         edgemap_default["label"] = 1.0;
   366         edgemap_default["label"] = 1.0;
   366     }
   367     }
   367   }
   368   }
   368 
   369 
       
   370   // filter loop edges
       
   371   for (EdgeIt e(graph); e != INVALID; ++e)
       
   372   {
       
   373     if (graph.source(e) == graph.target(e))
       
   374     {
       
   375       std::cerr << "Removed loop edge " << (*edgemap_storage["label"])[e]
       
   376         << " (from " << (*nodemap_storage["label"])[graph.source(e)]
       
   377         << ", to " << (*nodemap_storage["label"])[graph.target(e)] << ")."
       
   378         << std::endl;
       
   379 
       
   380       graph.erase(e);
       
   381     }
       
   382   }
       
   383 
   369   return 0;
   384   return 0;
   370 }
   385 }
   371 
   386 
   372 void MapStorage::writeToFile(const std::string &filename)
   387 void MapStorage::writeToFile(const std::string &filename)
   373 {
   388 {