demo/graph_to_eps_demo.cc
branch1.2
changeset 1275 e38c9a70375c
parent 463 88ed40ad0d4f
equal deleted inserted replaced
8:2eec778fbac0 9:0f3701f8592b
   180   // Create an .eps file showing the colors of a default Palette
   180   // Create an .eps file showing the colors of a default Palette
   181   ListDigraph h;
   181   ListDigraph h;
   182   ListDigraph::NodeMap<int> hcolors(h);
   182   ListDigraph::NodeMap<int> hcolors(h);
   183   ListDigraph::NodeMap<Point> hcoords(h);
   183   ListDigraph::NodeMap<Point> hcoords(h);
   184 
   184 
   185   int cols=int(sqrt(double(palette.size())));
   185   int cols=int(std::sqrt(double(palette.size())));
   186   for(int i=0;i<int(paletteW.size());i++) {
   186   for(int i=0;i<int(paletteW.size());i++) {
   187     Node n=h.addNode();
   187     Node n=h.addNode();
   188     hcoords[n]=Point(1+i%cols,1+i/cols);
   188     hcoords[n]=Point(1+i%cols,1+i/cols);
   189     hcolors[n]=i;
   189     hcolors[n]=i;
   190   }
   190   }