demo/graph_to_eps_demo.cc
changeset 601 6b9c1f6eb1e5
parent 313 64f8f7cc6168
child 659 0c8e5c688440
equal deleted inserted replaced
7:b6d526e824ed 8:2eec778fbac0
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2008
     5  * Copyright (C) 2003-2009
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
    83   // Create .eps files showing the digraph with different options
    83   // Create .eps files showing the digraph with different options
    84   cout << "Create 'graph_to_eps_demo_out_1_pure.eps'" << endl;
    84   cout << "Create 'graph_to_eps_demo_out_1_pure.eps'" << endl;
    85   graphToEps(g,"graph_to_eps_demo_out_1_pure.eps").
    85   graphToEps(g,"graph_to_eps_demo_out_1_pure.eps").
    86     coords(coords).
    86     coords(coords).
    87     title("Sample .eps figure").
    87     title("Sample .eps figure").
    88     copyright("(C) 2003-2008 LEMON Project").
    88     copyright("(C) 2003-2009 LEMON Project").
    89     run();
    89     run();
    90 
    90 
    91   cout << "Create 'graph_to_eps_demo_out_2.eps'" << endl;
    91   cout << "Create 'graph_to_eps_demo_out_2.eps'" << endl;
    92   graphToEps(g,"graph_to_eps_demo_out_2.eps").
    92   graphToEps(g,"graph_to_eps_demo_out_2.eps").
    93     coords(coords).
    93     coords(coords).
    94     title("Sample .eps figure").
    94     title("Sample .eps figure").
    95     copyright("(C) 2003-2008 LEMON Project").
    95     copyright("(C) 2003-2009 LEMON Project").
    96     absoluteNodeSizes().absoluteArcWidths().
    96     absoluteNodeSizes().absoluteArcWidths().
    97     nodeScale(2).nodeSizes(sizes).
    97     nodeScale(2).nodeSizes(sizes).
    98     nodeShapes(shapes).
    98     nodeShapes(shapes).
    99     nodeColors(composeMap(palette,colors)).
    99     nodeColors(composeMap(palette,colors)).
   100     arcColors(composeMap(palette,acolors)).
   100     arcColors(composeMap(palette,acolors)).
   103     run();
   103     run();
   104 
   104 
   105   cout << "Create 'graph_to_eps_demo_out_3_arr.eps'" << endl;
   105   cout << "Create 'graph_to_eps_demo_out_3_arr.eps'" << endl;
   106   graphToEps(g,"graph_to_eps_demo_out_3_arr.eps").
   106   graphToEps(g,"graph_to_eps_demo_out_3_arr.eps").
   107     title("Sample .eps figure (with arrowheads)").
   107     title("Sample .eps figure (with arrowheads)").
   108     copyright("(C) 2003-2008 LEMON Project").
   108     copyright("(C) 2003-2009 LEMON Project").
   109     absoluteNodeSizes().absoluteArcWidths().
   109     absoluteNodeSizes().absoluteArcWidths().
   110     nodeColors(composeMap(palette,colors)).
   110     nodeColors(composeMap(palette,colors)).
   111     coords(coords).
   111     coords(coords).
   112     nodeScale(2).nodeSizes(sizes).
   112     nodeScale(2).nodeSizes(sizes).
   113     nodeShapes(shapes).
   113     nodeShapes(shapes).
   130   a=g.addArc(n1,n2); acolors[a]=7; widths[a]=1;
   130   a=g.addArc(n1,n2); acolors[a]=7; widths[a]=1;
   131 
   131 
   132   cout << "Create 'graph_to_eps_demo_out_4_par.eps'" << endl;
   132   cout << "Create 'graph_to_eps_demo_out_4_par.eps'" << endl;
   133   graphToEps(g,"graph_to_eps_demo_out_4_par.eps").
   133   graphToEps(g,"graph_to_eps_demo_out_4_par.eps").
   134     title("Sample .eps figure (parallel arcs)").
   134     title("Sample .eps figure (parallel arcs)").
   135     copyright("(C) 2003-2008 LEMON Project").
   135     copyright("(C) 2003-2009 LEMON Project").
   136     absoluteNodeSizes().absoluteArcWidths().
   136     absoluteNodeSizes().absoluteArcWidths().
   137     nodeShapes(shapes).
   137     nodeShapes(shapes).
   138     coords(coords).
   138     coords(coords).
   139     nodeScale(2).nodeSizes(sizes).
   139     nodeScale(2).nodeSizes(sizes).
   140     nodeColors(composeMap(palette,colors)).
   140     nodeColors(composeMap(palette,colors)).
   145     run();
   145     run();
   146 
   146 
   147   cout << "Create 'graph_to_eps_demo_out_5_par_arr.eps'" << endl;
   147   cout << "Create 'graph_to_eps_demo_out_5_par_arr.eps'" << endl;
   148   graphToEps(g,"graph_to_eps_demo_out_5_par_arr.eps").
   148   graphToEps(g,"graph_to_eps_demo_out_5_par_arr.eps").
   149     title("Sample .eps figure (parallel arcs and arrowheads)").
   149     title("Sample .eps figure (parallel arcs and arrowheads)").
   150     copyright("(C) 2003-2008 LEMON Project").
   150     copyright("(C) 2003-2009 LEMON Project").
   151     absoluteNodeSizes().absoluteArcWidths().
   151     absoluteNodeSizes().absoluteArcWidths().
   152     nodeScale(2).nodeSizes(sizes).
   152     nodeScale(2).nodeSizes(sizes).
   153     coords(coords).
   153     coords(coords).
   154     nodeShapes(shapes).
   154     nodeShapes(shapes).
   155     nodeColors(composeMap(palette,colors)).
   155     nodeColors(composeMap(palette,colors)).
   161     run();
   161     run();
   162 
   162 
   163   cout << "Create 'graph_to_eps_demo_out_6_par_arr_a4.eps'" << endl;
   163   cout << "Create 'graph_to_eps_demo_out_6_par_arr_a4.eps'" << endl;
   164   graphToEps(g,"graph_to_eps_demo_out_6_par_arr_a4.eps").
   164   graphToEps(g,"graph_to_eps_demo_out_6_par_arr_a4.eps").
   165     title("Sample .eps figure (fits to A4)").
   165     title("Sample .eps figure (fits to A4)").
   166     copyright("(C) 2003-2008 LEMON Project").
   166     copyright("(C) 2003-2009 LEMON Project").
   167     scaleToA4().
   167     scaleToA4().
   168     absoluteNodeSizes().absoluteArcWidths().
   168     absoluteNodeSizes().absoluteArcWidths().
   169     nodeScale(2).nodeSizes(sizes).
   169     nodeScale(2).nodeSizes(sizes).
   170     coords(coords).
   170     coords(coords).
   171     nodeShapes(shapes).
   171     nodeShapes(shapes).
   191 
   191 
   192   cout << "Create 'graph_to_eps_demo_out_7_colors.eps'" << endl;
   192   cout << "Create 'graph_to_eps_demo_out_7_colors.eps'" << endl;
   193   graphToEps(h,"graph_to_eps_demo_out_7_colors.eps").
   193   graphToEps(h,"graph_to_eps_demo_out_7_colors.eps").
   194     scale(60).
   194     scale(60).
   195     title("Sample .eps figure (Palette demo)").
   195     title("Sample .eps figure (Palette demo)").
   196     copyright("(C) 2003-2008 LEMON Project").
   196     copyright("(C) 2003-2009 LEMON Project").
   197     coords(hcoords).
   197     coords(hcoords).
   198     absoluteNodeSizes().absoluteArcWidths().
   198     absoluteNodeSizes().absoluteArcWidths().
   199     nodeScale(.45).
   199     nodeScale(.45).
   200     distantColorNodeTexts().
   200     distantColorNodeTexts().
   201     nodeTexts(hcolors).nodeTextSize(.6).
   201     nodeTexts(hcolors).nodeTextSize(.6).