COIN-OR::LEMON - Graph Library

Changeset 1091:c756973cd53c in lemon-0.x for src


Ignore:
Timestamp:
01/20/05 15:16:40 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1488
Message:

Now, the actual drawing is made by run() instead of the destructor.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/demo/graph_to_eps_demo.cc

    r1088 r1091  
    9696    edgeColors(composeMap(colorSet,ecolors)).
    9797    edgeWidthScale(.4).edgeWidths(widths).
    98     nodeTexts(id).nodeTextSize(3);
     98    nodeTexts(id).nodeTextSize(3).
     99    run();
    99100
    100   graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).coords(coords).
     101  graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).
     102    nodeColors(composeMap(colorSet,colors)).
     103    coords(coords).
    101104    nodeScale(2).nodeSizes(sizes).
    102105    nodeShapes(shapes).
    103     nodeColors(composeMap(colorSet,colors)).
    104106    edgeColors(composeMap(colorSet,ecolors)).
    105107    edgeWidthScale(.4).edgeWidths(widths).
    106108    nodeTexts(id).nodeTextSize(3).
    107     drawArrows().arrowWidth(1).arrowLength(1);
     109    drawArrows().arrowWidth(1).arrowLength(1).
     110    run();
    108111
    109112  e=g.addEdge(n1,n4); ecolors[e]=2; widths[e]=1;
     
    118121  e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
    119122
    120   graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).coords(coords).
     123  graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
     124    nodeShapes(shapes).
     125    coords(coords).
    121126    nodeScale(2).nodeSizes(sizes).
    122     nodeShapes(shapes).
    123127    nodeColors(composeMap(colorSet,colors)).
    124128    edgeColors(composeMap(colorSet,ecolors)).
    125129    edgeWidthScale(.4).edgeWidths(widths).
    126130    nodeTexts(id).nodeTextSize(3).
    127     enableParallel().parEdgeDist(1.5);
    128 
    129   graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).coords(coords).
     131    enableParallel().parEdgeDist(1.5).
     132    run();
     133 
     134  graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).
    130135    nodeScale(2).nodeSizes(sizes).
     136    coords(coords).
    131137    nodeShapes(shapes).
    132138    nodeColors(composeMap(colorSet,colors)).
     
    136142    enableParallel().parEdgeDist(1).
    137143    //    hideNodes().
    138     drawArrows().arrowWidth(1).arrowLength(1);
     144    drawArrows().arrowWidth(1).arrowLength(1).
     145    run();;
    139146}
  • src/lemon/graph_to_eps.h

    r1089 r1091  
    422422
    423423public:
    424   ~GraphToEps()
    425   {
     424  ~GraphToEps() { }
     425 
     426  ///Draws the graph.
     427
     428  ///Like other functions using
     429  ///\ref named-templ-func-param "named template parameters",
     430  ///this function calles the algorithm itself, i.e. in this case
     431  ///it draws the graph.
     432  void run() {
    426433    if(dontPrint) return;
    427434   
     
    668675///By default it is <tt>std::cout</tt>
    669676///
    670 ///This function also has a lot of \ref named-templ-param "named parameters",
     677///This function also has a lot of
     678///\ref named-templ-func-param "named parameters",
    671679///they are declared as the members of class \ref GraphToEps. The following
    672680///example shows how to use these parameters.
     
    674682/// graphToEps(g).scale(10).coords(coords)
    675683///              .nodeScale(2).nodeSizes(sizes)
    676 ///              .edgeWidthScale(.4);
     684///              .edgeWidthScale(.4).run();
    677685///\endcode
     686///\warning Don't forget to put the \ref GraphToEps::run() "run()"
     687///to the end of the parameter list.
    678688///\sa GraphToEps
    679689///\sa graphToEps(G &g, char *file_name)
Note: See TracChangeset for help on using the changeset viewer.