COIN-OR::LEMON - Graph Library

Changeset 1086:caa13d291528 in lemon-0.x for src/demo


Ignore:
Timestamp:
01/18/05 13:02:27 (16 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1482
Message:

In graphToEps(), nodes may have different shapes (circles or squares).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/demo/graph_to_eps_demo.cc

    r1073 r1086  
    6868  ListGraph::NodeMap<double> sizes(g);
    6969  ListGraph::NodeMap<int> colors(g);
     70  ListGraph::NodeMap<int> shapes(g);
    7071  ListGraph::EdgeMap<int> ecolors(g);
    7172  ListGraph::EdgeMap<int> widths(g);
    7273 
    73   coords[n1]=Xy(50,50);  sizes[n1]=1; colors[n1]=1;
    74   coords[n2]=Xy(50,70);  sizes[n2]=2; colors[n2]=2;
    75   coords[n3]=Xy(70,70);  sizes[n3]=1; colors[n3]=3;
    76   coords[n4]=Xy(70,50);  sizes[n4]=2; colors[n4]=4;
    77   coords[n5]=Xy(85,60);  sizes[n5]=3; colors[n5]=5;
     74  coords[n1]=Xy(50,50);  sizes[n1]=1; colors[n1]=1; shapes[n1]=0;
     75  coords[n2]=Xy(50,70);  sizes[n2]=2; colors[n2]=2; shapes[n2]=0;
     76  coords[n3]=Xy(70,70);  sizes[n3]=1; colors[n3]=3; shapes[n3]=0;
     77  coords[n4]=Xy(70,50);  sizes[n4]=2; colors[n4]=4; shapes[n4]=1;
     78  coords[n5]=Xy(85,60);  sizes[n5]=3; colors[n5]=5; shapes[n5]=0;
    7879 
    7980  Edge e;
     
    9192  graphToEps(g,"graph_to_eps_demo_out.eps").scale(10).coords(coords).
    9293    nodeScale(2).nodeSizes(sizes).
     94    nodeShapes(shapes).
    9395    nodeColors(composeMap(colorSet,colors)).
    9496    edgeColors(composeMap(colorSet,ecolors)).
     
    98100  graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).coords(coords).
    99101    nodeScale(2).nodeSizes(sizes).
     102    nodeShapes(shapes).
    100103    nodeColors(composeMap(colorSet,colors)).
    101104    edgeColors(composeMap(colorSet,ecolors)).
     
    117120  graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).coords(coords).
    118121    nodeScale(2).nodeSizes(sizes).
     122    nodeShapes(shapes).
    119123    nodeColors(composeMap(colorSet,colors)).
    120124    edgeColors(composeMap(colorSet,ecolors)).
     
    125129  graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).coords(coords).
    126130    nodeScale(2).nodeSizes(sizes).
     131    nodeShapes(shapes).
    127132    nodeColors(composeMap(colorSet,colors)).
    128133    edgeColors(composeMap(colorSet,ecolors)).
     
    130135    nodeTexts(id).nodeTextSize(3).
    131136    enableParallel().parEdgeDist(1).
     137    //    hideNodes().
    132138    drawArrows().arrowWidth(1).arrowLength(1);
    133139}
Note: See TracChangeset for help on using the changeset viewer.