src/demo/graph_to_eps_demo.cc
changeset 1170 fb0159aa582d
parent 1108 253b66e7e41d
child 1178 3c176c65d33b
equal deleted inserted replaced
5:af46d9268da4 6:b89c4402255d
     1 /* -*- C++ -*-
     1 /* -*- C++ -*-
     2  * src/lemon/demo/graph_to_eps.cc - 
     2  * src/lemon/demo/graph_to_eps.cc - 
     3  * Part of LEMON, a generic C++ optimization library
     3  * Part of LEMON, a generic C++ optimization library
     4  *
     4  *
     5  * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     5  * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * (Egervary Combinatorial Optimization Research Group, EGRES).
     6  * (Egervary Combinatorial Optimization Research Group, EGRES).
     7  *
     7  *
     8  * Permission to use, modify and distribute this software is granted
     8  * Permission to use, modify and distribute this software is granted
     9  * provided that this copyright notice appears in all copies. For
     9  * provided that this copyright notice appears in all copies. For
    10  * precise terms see the accompanying LICENSE file.
    10  * precise terms see the accompanying LICENSE file.
    89   
    89   
    90   IdMap id(g);
    90   IdMap id(g);
    91 
    91 
    92   graphToEps(g,"graph_to_eps_demo_out.eps").scale(10).coords(coords).
    92   graphToEps(g,"graph_to_eps_demo_out.eps").scale(10).coords(coords).
    93     title("Sample .eps figure").
    93     title("Sample .eps figure").
    94     copyright("(C) 2004 LEMON Project").
    94     copyright("(C) 2005 LEMON Project").
    95     nodeScale(2).nodeSizes(sizes).
    95     nodeScale(2).nodeSizes(sizes).
    96     nodeShapes(shapes).
    96     nodeShapes(shapes).
    97     nodeColors(composeMap(colorSet,colors)).
    97     nodeColors(composeMap(colorSet,colors)).
    98     edgeColors(composeMap(colorSet,ecolors)).
    98     edgeColors(composeMap(colorSet,ecolors)).
    99     edgeWidthScale(.4).edgeWidths(widths).
    99     edgeWidthScale(.4).edgeWidths(widths).
   100     nodeTexts(id).nodeTextSize(3).
   100     nodeTexts(id).nodeTextSize(3).
   101     run();
   101     run();
   102 
   102 
   103   graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).
   103   graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).
   104     title("Sample .eps figure (with arrowheads)").
   104     title("Sample .eps figure (with arrowheads)").
   105     copyright("(C) 2004 LEMON Project").
   105     copyright("(C) 2005 LEMON Project").
   106     nodeColors(composeMap(colorSet,colors)).
   106     nodeColors(composeMap(colorSet,colors)).
   107     coords(coords).
   107     coords(coords).
   108     nodeScale(2).nodeSizes(sizes).
   108     nodeScale(2).nodeSizes(sizes).
   109     nodeShapes(shapes).
   109     nodeShapes(shapes).
   110     edgeColors(composeMap(colorSet,ecolors)).
   110     edgeColors(composeMap(colorSet,ecolors)).
   124   e=g.addEdge(n1,n2); ecolors[e]=6; widths[e]=1;
   124   e=g.addEdge(n1,n2); ecolors[e]=6; widths[e]=1;
   125   e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
   125   e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
   126 
   126 
   127   graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
   127   graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
   128     title("Sample .eps figure (parallel edges)").
   128     title("Sample .eps figure (parallel edges)").
   129     copyright("(C) 2004 LEMON Project").
   129     copyright("(C) 2005 LEMON Project").
   130     nodeShapes(shapes).
   130     nodeShapes(shapes).
   131     coords(coords).
   131     coords(coords).
   132     nodeScale(2).nodeSizes(sizes).
   132     nodeScale(2).nodeSizes(sizes).
   133     nodeColors(composeMap(colorSet,colors)).
   133     nodeColors(composeMap(colorSet,colors)).
   134     edgeColors(composeMap(colorSet,ecolors)).
   134     edgeColors(composeMap(colorSet,ecolors)).
   137     enableParallel().parEdgeDist(1.5).
   137     enableParallel().parEdgeDist(1.5).
   138     run();
   138     run();
   139   
   139   
   140   graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).
   140   graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).
   141     title("Sample .eps figure (parallel edges and arrowheads)").
   141     title("Sample .eps figure (parallel edges and arrowheads)").
   142     copyright("(C) 2004 LEMON Project").
   142     copyright("(C) 2005 LEMON Project").
   143     nodeScale(2).nodeSizes(sizes).
   143     nodeScale(2).nodeSizes(sizes).
   144     coords(coords).
   144     coords(coords).
   145     nodeShapes(shapes).
   145     nodeShapes(shapes).
   146     nodeColors(composeMap(colorSet,colors)).
   146     nodeColors(composeMap(colorSet,colors)).
   147     edgeColors(composeMap(colorSet,ecolors)).
   147     edgeColors(composeMap(colorSet,ecolors)).
   151     drawArrows().arrowWidth(1).arrowLength(1).
   151     drawArrows().arrowWidth(1).arrowLength(1).
   152     run();
   152     run();
   153 
   153 
   154   graphToEps(g,"graph_to_eps_demo_out_a4.eps").scaleToA4().
   154   graphToEps(g,"graph_to_eps_demo_out_a4.eps").scaleToA4().
   155     title("Sample .eps figure (fits to A4)").
   155     title("Sample .eps figure (fits to A4)").
   156     copyright("(C) 2004 LEMON Project").
   156     copyright("(C) 2005 LEMON Project").
   157     nodeScale(2).nodeSizes(sizes).
   157     nodeScale(2).nodeSizes(sizes).
   158     coords(coords).
   158     coords(coords).
   159     nodeShapes(shapes).
   159     nodeShapes(shapes).
   160     nodeColors(composeMap(colorSet,colors)).
   160     nodeColors(composeMap(colorSet,colors)).
   161     edgeColors(composeMap(colorSet,ecolors)).
   161     edgeColors(composeMap(colorSet,ecolors)).