graph_displayer_canvas-event.cc
branchgui
changeset 112 3689cb170d3e
parent 98 f60f89147531
child 113 7c2e71835de7
equal deleted inserted replaced
33:5656c4e559d7 34:31ba432f5767
   848       else
   848       else
   849 	{
   849 	{
   850 	  std::cerr << "ERROR!!!! Invalid edge found!" << std::endl;
   850 	  std::cerr << "ERROR!!!! Invalid edge found!" << std::endl;
   851 	}
   851 	}
   852     }
   852     }
   853 
   853 }
   854 }
       
   855 
       
   856 int GraphDisplayerCanvas::addNewEdgeMap(double default_value, std::string mapname)
       
   857 {
       
   858   //create the new map
       
   859   Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> ((mytab.mapstorage).graph, default_value);
       
   860 
       
   861   //if addition was not successful addEdgeMap returns one.
       
   862   //cause can be that there is already a map named like the new one
       
   863   if((mytab.mapstorage).addEdgeMap(mapname,emptr, default_value))
       
   864     {
       
   865       return 1;
       
   866     }
       
   867 
       
   868 
       
   869   //add it to the list of the displayable maps
       
   870   mytab.registerNewEdgeMap(mapname);
       
   871 
       
   872   //display it
       
   873   changeEdgeText(mapname);
       
   874 
       
   875   return 0;
       
   876 }
       
   877 
       
   878 int GraphDisplayerCanvas::addNewNodeMap(double default_value, std::string mapname)
       
   879 {
       
   880   //create the new map
       
   881   Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> ((mytab.mapstorage).graph,default_value);
       
   882 
       
   883   //if addition was not successful addNodeMap returns one.
       
   884   //cause can be that there is already a map named like the new one
       
   885   if((mytab.mapstorage).addNodeMap(mapname,emptr, default_value))
       
   886     {
       
   887       return 1;
       
   888     }
       
   889 
       
   890   //add it to the list of the displayable maps
       
   891   mytab.registerNewNodeMap(mapname);
       
   892 
       
   893   //display it
       
   894   changeNodeText(mapname);
       
   895 
       
   896   return 0;
       
   897 }
       
   898