COIN-OR::LEMON - Graph Library

Changeset 2172:4b25e7003868 in lemon-0.x


Ignore:
Timestamp:
08/10/06 12:18:04 (13 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2887
Message:
  • Change ColorSet? to Palette
  • Minor change in graph_orientation demo.
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • demo/coloring.cc

    r2116 r2172  
    9898  }
    9999
    100   ColorSet colorSet;
     100  Palette palette;
    101101
    102102  graphToEps(graph, "coloring.eps").
    103103    title("Six Colored Plan Graph").copyright("(C) 2006 LEMON Project").
    104     coords(coords).nodeColors(composeMap(colorSet, color)).
     104    coords(coords).nodeColors(composeMap(palette, color)).
    105105    nodeScale(5.0).scaleToA4().run();
    106106
  • demo/graph_orientation.cc

    r2158 r2172  
    2626using namespace lemon;
    2727 
    28 
    29 typedef ListGraph::Node Node;
    30 typedef ListGraph::NodeIt NodeIt;
    31 typedef ListGraph::Edge Edge;
    32 typedef ListGraph::EdgeIt EdgeIt;
    33 typedef ListGraph::OutEdgeIt OutEdgeIt;
    34 typedef ListGraph::InEdgeIt InEdgeIt;
     28GRAPH_TYPEDEFS(ListGraph)
    3529
    3630int main(int argc, char** argv)
     
    114108    coords(coords).
    115109    negateY().
    116     edgeColors(composeMap(ColorSet(),rev)).
     110    edgeColors(composeMap(Palette(),rev)).
    117111    edgeWidthScale(1).
    118112    nodeTexts(f).nodeTextSize(20).
  • demo/graph_to_eps_demo.cc

    r1956 r2172  
    4242int main()
    4343{
    44   ColorSet colorSet;
     44  Palette palette;
    4545
    4646  ListGraph g;
     
    8989    nodeScale(2).nodeSizes(sizes).
    9090    nodeShapes(shapes).
    91     nodeColors(composeMap(colorSet,colors)).
    92     edgeColors(composeMap(colorSet,ecolors)).
     91    nodeColors(composeMap(palette,colors)).
     92    edgeColors(composeMap(palette,ecolors)).
    9393    edgeWidthScale(.4).edgeWidths(widths).
    9494    nodeTexts(id).nodeTextSize(3).
     
    101101    title("Sample .eps figure (with arrowheads)").
    102102    copyright("(C) 2006 LEMON Project").
    103     nodeColors(composeMap(colorSet,colors)).
     103    nodeColors(composeMap(palette,colors)).
    104104    coords(coords).
    105105    nodeScale(2).nodeSizes(sizes).
    106106    nodeShapes(shapes).
    107     edgeColors(composeMap(colorSet,ecolors)).
     107    edgeColors(composeMap(palette,ecolors)).
    108108    edgeWidthScale(.4).edgeWidths(widths).
    109109    nodeTexts(id).nodeTextSize(3).
     
    130130    coords(coords).
    131131    nodeScale(2).nodeSizes(sizes).
    132     nodeColors(composeMap(colorSet,colors)).
    133     edgeColors(composeMap(colorSet,ecolors)).
     132    nodeColors(composeMap(palette,colors)).
     133    edgeColors(composeMap(palette,ecolors)).
    134134    edgeWidthScale(.4).edgeWidths(widths).
    135135    nodeTexts(id).nodeTextSize(3).
     
    145145    coords(coords).
    146146    nodeShapes(shapes).
    147     nodeColors(composeMap(colorSet,colors)).
    148     edgeColors(composeMap(colorSet,ecolors)).
     147    nodeColors(composeMap(palette,colors)).
     148    edgeColors(composeMap(palette,ecolors)).
    149149    edgeWidthScale(.3).edgeWidths(widths).
    150150    nodeTexts(id).nodeTextSize(3).
     
    160160    coords(coords).
    161161    nodeShapes(shapes).
    162     nodeColors(composeMap(colorSet,colors)).
    163     edgeColors(composeMap(colorSet,ecolors)).
     162    nodeColors(composeMap(palette,colors)).
     163    edgeColors(composeMap(palette,ecolors)).
    164164    edgeWidthScale(.3).edgeWidths(widths).
    165165    nodeTexts(id).nodeTextSize(3).
     
    172172  ListGraph::NodeMap<Xy> hcoords(h);
    173173 
    174   int cols=int(sqrt(double(colorSet.size())));
    175   for(int i=0;i<int(colorSet.size());i++) {
     174  int cols=int(sqrt(double(palette.size())));
     175  for(int i=0;i<int(palette.size());i++) {
    176176    Node n=h.addNode();
    177177    hcoords[n]=Xy(i%cols,i/cols);
     
    182182  graphToEps(h,"graph_to_eps_demo_out_colors.eps").
    183183    //scale(60).
    184     title("Sample .eps figure (ColorSet demo)").
     184    title("Sample .eps figure (Palette demo)").
    185185    copyright("(C) 2006 LEMON Project").
    186186    coords(hcoords).
     
    189189    //    distantBWNodeTexts().
    190190    nodeTexts(hcolors).nodeTextSize(.6).
    191     nodeColors(composeMap(colorSet,hcolors)).
     191    nodeColors(composeMap(palette,hcolors)).
    192192    run();
    193193
  • demo/grid_ugraph_demo.cc

    r1979 r2172  
    9393    nodeScale(0.5).
    9494    drawArrows().
    95     edgeColors(composeMap(ColorSet(), path)).
     95    edgeColors(composeMap(Palette(), path)).
    9696    run();
    9797 
  • demo/topology_demo.cc

    r2116 r2172  
    5757    run();
    5858 
    59   ColorSet colorSet;
     59  Palette palette;
    6060
    6161  Graph::NodeMap<int> compMap(graph);
     
    6565    coords(coords).scaleToA4().enableParallel().
    6666    parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
    67     nodeColors(composeMap(colorSet, compMap)).run();
     67    nodeColors(composeMap(palette, compMap)).run();
    6868
    6969  std::cout << "Result: connected_components.eps" << std::endl;
     
    8282    run();
    8383 
    84   ColorSet colorSet;
     84  Palette palette;
    8585
    8686  Graph::NodeMap<int> compMap(graph);
     
    9393    drawArrows().arrowWidth(10.0).arrowLength(10.0).
    9494    parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
    95     nodeColors(composeMap(colorSet, compMap)).
     95    nodeColors(composeMap(palette, compMap)).
    9696    edgeColors(composeMap(functorMap(&color), cutMap)).run();
    9797
     
    112112    run();
    113113
    114   ColorSet colorSet;
     114  Palette palette;
    115115
    116116  Graph::UEdgeMap<int> compMap(graph);
     
    122122    coords(coords).scaleToA4().enableParallel().
    123123    parEdgeDist(20.0).edgeWidthScale(5.0).nodeScale(20.0).
    124     edgeColors(composeMap(colorSet, compMap)).
     124    edgeColors(composeMap(palette, compMap)).
    125125    nodeColors(composeMap(functorMap(&color), cutMap)).
    126126    run();
     
    142142    run();
    143143 
    144   ColorSet colorSet;
     144  Palette palette;
    145145
    146146  Graph::NodeMap<int> compMap(graph);
     
    152152    coords(coords).scaleToA4().enableParallel().
    153153    parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
    154     nodeColors(composeMap(colorSet, compMap)).
     154    nodeColors(composeMap(palette, compMap)).
    155155    edgeColors(composeMap(functorMap(&color), cutMap)).run();
    156156 
     
    171171    run();
    172172 
    173   ColorSet colorSet;
     173  Palette palette;
    174174
    175175  Graph::NodeMap<bool> partMap(graph);
  • doc/graph_orientation.dox

    r2158 r2172  
    5454\skipline namespace
    5555
    56 The following <tt>typedef</tt>s will also save a lot of typing.
    57 \skip typedef
    58 \until InEdgeIt
     56The following macro will also save a lot of typing by defining some
     57convenience <tt>typedef</tt>s.
     58
     59\skipline TYPEDEF
     60
     61Actually, the macro above would be equivalent with the following
     62<tt>typedef</tt>s.
     63
     64\code
     65typedef ListGraph::Node Node;
     66typedef ListGraph::NodeIt NodeIt;
     67typedef ListGraph::Edge Edge;
     68typedef ListGraph::EdgeIt EdgeIt;
     69typedef ListGraph::OutEdgeIt OutEdgeIt;
     70typedef ListGraph::InEdgeIt InEdgeIt;
     71\endcode
    5972
    6073\subsection go-alg-main The main() function
     
    153166\c rev are transformed into different \ref lemon::Color "RGB color"s
    154167using the class
    155 \ref lemon::ColorSet "ColorSet"
     168\ref lemon::Palette "Palette"
    156169and the \ref map_adaptors "map adaptor" called
    157170\ref lemon::ComposeMap "composeMap".
  • lemon/color.h

    r2159 r2172  
    8282///change the actual colors.
    8383
    84 class ColorSet : public MapBase<int,Color>
     84class Palette : public MapBase<int,Color>
    8585{
    8686  std::vector<Color> colors;
     
    9797  ///the color list is filled repeatedly with the default color list.
    9898  ///(The colors can be changed later on.)
    99   ColorSet(bool have_white=false,int num=0)
     99  Palette(bool have_white=false,int num=0)
    100100  {
    101101    do {
  • lemon/graph_to_eps.h

    r2084 r2172  
    427427  ///\param x must be a node map with \ref Color values.
    428428  ///
    429   ///\sa ColorSet
     429  ///\sa Palette
    430430  template<class X> GraphToEps<NodeColorsTraits<X> >
    431431  nodeColors(const X &x)
     
    443443  ///\param x must be a node map with \ref Color values.
    444444  ///
    445   ///\sa ColorSet
     445  ///\sa Palette
    446446  template<class X> GraphToEps<NodeTextColorsTraits<X> >
    447447  nodeTextColors(const X &x)
     
    461461  ///\param x must be a edge map with \ref Color values.
    462462  ///
    463   ///\sa ColorSet
     463  ///\sa Palette
    464464  template<class X> GraphToEps<EdgeColorsTraits<X> >
    465465  edgeColors(const X &x)
Note: See TracChangeset for help on using the changeset viewer.