- Change ColorSet to Palette
authoralpar
Thu, 10 Aug 2006 10:18:04 +0000
changeset 21724b25e7003868
parent 2171 f40343b498ef
child 2173 b4de9aed7709
- Change ColorSet to Palette
- Minor change in graph_orientation demo.
demo/coloring.cc
demo/graph_orientation.cc
demo/graph_to_eps_demo.cc
demo/grid_ugraph_demo.cc
demo/topology_demo.cc
doc/graph_orientation.dox
lemon/color.h
lemon/graph_to_eps.h
     1.1 --- a/demo/coloring.cc	Thu Aug 10 10:11:07 2006 +0000
     1.2 +++ b/demo/coloring.cc	Thu Aug 10 10:18:04 2006 +0000
     1.3 @@ -97,11 +97,11 @@
     1.4      color[order[i]] = current;
     1.5    }
     1.6  
     1.7 -  ColorSet colorSet;
     1.8 +  Palette palette;
     1.9  
    1.10    graphToEps(graph, "coloring.eps").
    1.11      title("Six Colored Plan Graph").copyright("(C) 2006 LEMON Project").
    1.12 -    coords(coords).nodeColors(composeMap(colorSet, color)).
    1.13 +    coords(coords).nodeColors(composeMap(palette, color)).
    1.14      nodeScale(5.0).scaleToA4().run();
    1.15  
    1.16    return 0;
     2.1 --- a/demo/graph_orientation.cc	Thu Aug 10 10:11:07 2006 +0000
     2.2 +++ b/demo/graph_orientation.cc	Thu Aug 10 10:18:04 2006 +0000
     2.3 @@ -25,13 +25,7 @@
     2.4  
     2.5  using namespace lemon;
     2.6   
     2.7 -
     2.8 -typedef ListGraph::Node Node;
     2.9 -typedef ListGraph::NodeIt NodeIt;
    2.10 -typedef ListGraph::Edge Edge;
    2.11 -typedef ListGraph::EdgeIt EdgeIt;
    2.12 -typedef ListGraph::OutEdgeIt OutEdgeIt;
    2.13 -typedef ListGraph::InEdgeIt InEdgeIt;
    2.14 +GRAPH_TYPEDEFS(ListGraph)
    2.15  
    2.16  int main(int argc, char** argv) 
    2.17  {
    2.18 @@ -113,7 +107,7 @@
    2.19      nodeScale(15).
    2.20      coords(coords).
    2.21      negateY().
    2.22 -    edgeColors(composeMap(ColorSet(),rev)).
    2.23 +    edgeColors(composeMap(Palette(),rev)).
    2.24      edgeWidthScale(1).
    2.25      nodeTexts(f).nodeTextSize(20).
    2.26      drawArrows().arrowWidth(10).arrowLength(10).
     3.1 --- a/demo/graph_to_eps_demo.cc	Thu Aug 10 10:11:07 2006 +0000
     3.2 +++ b/demo/graph_to_eps_demo.cc	Thu Aug 10 10:18:04 2006 +0000
     3.3 @@ -41,7 +41,7 @@
     3.4  
     3.5  int main()
     3.6  {
     3.7 -  ColorSet colorSet;
     3.8 +  Palette palette;
     3.9  
    3.10    ListGraph g;
    3.11    typedef ListGraph::Node Node;
    3.12 @@ -88,8 +88,8 @@
    3.13      copyright("(C) 2006 LEMON Project").
    3.14      nodeScale(2).nodeSizes(sizes).
    3.15      nodeShapes(shapes).
    3.16 -    nodeColors(composeMap(colorSet,colors)).
    3.17 -    edgeColors(composeMap(colorSet,ecolors)).
    3.18 +    nodeColors(composeMap(palette,colors)).
    3.19 +    edgeColors(composeMap(palette,ecolors)).
    3.20      edgeWidthScale(.4).edgeWidths(widths).
    3.21      nodeTexts(id).nodeTextSize(3).
    3.22      run();
    3.23 @@ -100,11 +100,11 @@
    3.24      //scale(10).
    3.25      title("Sample .eps figure (with arrowheads)").
    3.26      copyright("(C) 2006 LEMON Project").
    3.27 -    nodeColors(composeMap(colorSet,colors)).
    3.28 +    nodeColors(composeMap(palette,colors)).
    3.29      coords(coords).
    3.30      nodeScale(2).nodeSizes(sizes).
    3.31      nodeShapes(shapes).
    3.32 -    edgeColors(composeMap(colorSet,ecolors)).
    3.33 +    edgeColors(composeMap(palette,ecolors)).
    3.34      edgeWidthScale(.4).edgeWidths(widths).
    3.35      nodeTexts(id).nodeTextSize(3).
    3.36      drawArrows().arrowWidth(1).arrowLength(1).
    3.37 @@ -129,8 +129,8 @@
    3.38      nodeShapes(shapes).
    3.39      coords(coords).
    3.40      nodeScale(2).nodeSizes(sizes).
    3.41 -    nodeColors(composeMap(colorSet,colors)).
    3.42 -    edgeColors(composeMap(colorSet,ecolors)).
    3.43 +    nodeColors(composeMap(palette,colors)).
    3.44 +    edgeColors(composeMap(palette,ecolors)).
    3.45      edgeWidthScale(.4).edgeWidths(widths).
    3.46      nodeTexts(id).nodeTextSize(3).
    3.47      enableParallel().parEdgeDist(1.5).
    3.48 @@ -144,8 +144,8 @@
    3.49      nodeScale(2).nodeSizes(sizes).
    3.50      coords(coords).
    3.51      nodeShapes(shapes).
    3.52 -    nodeColors(composeMap(colorSet,colors)).
    3.53 -    edgeColors(composeMap(colorSet,ecolors)).
    3.54 +    nodeColors(composeMap(palette,colors)).
    3.55 +    edgeColors(composeMap(palette,ecolors)).
    3.56      edgeWidthScale(.3).edgeWidths(widths).
    3.57      nodeTexts(id).nodeTextSize(3).
    3.58      enableParallel().parEdgeDist(1).
    3.59 @@ -159,8 +159,8 @@
    3.60      nodeScale(2).nodeSizes(sizes).
    3.61      coords(coords).
    3.62      nodeShapes(shapes).
    3.63 -    nodeColors(composeMap(colorSet,colors)).
    3.64 -    edgeColors(composeMap(colorSet,ecolors)).
    3.65 +    nodeColors(composeMap(palette,colors)).
    3.66 +    edgeColors(composeMap(palette,ecolors)).
    3.67      edgeWidthScale(.3).edgeWidths(widths).
    3.68      nodeTexts(id).nodeTextSize(3).
    3.69      enableParallel().parEdgeDist(1).
    3.70 @@ -171,8 +171,8 @@
    3.71    ListGraph::NodeMap<int> hcolors(h);
    3.72    ListGraph::NodeMap<Xy> hcoords(h);
    3.73    
    3.74 -  int cols=int(sqrt(double(colorSet.size())));
    3.75 -  for(int i=0;i<int(colorSet.size());i++) {
    3.76 +  int cols=int(sqrt(double(palette.size())));
    3.77 +  for(int i=0;i<int(palette.size());i++) {
    3.78      Node n=h.addNode();
    3.79      hcoords[n]=Xy(i%cols,i/cols);
    3.80      hcolors[n]=i;
    3.81 @@ -181,14 +181,14 @@
    3.82    cout << "Create 'graph_to_eps_demo_out_colors.eps'" << endl;
    3.83    graphToEps(h,"graph_to_eps_demo_out_colors.eps").
    3.84      //scale(60).
    3.85 -    title("Sample .eps figure (ColorSet demo)").
    3.86 +    title("Sample .eps figure (Palette demo)").
    3.87      copyright("(C) 2006 LEMON Project").
    3.88      coords(hcoords).
    3.89      nodeScale(.45).
    3.90      distantColorNodeTexts().
    3.91      //    distantBWNodeTexts().
    3.92      nodeTexts(hcolors).nodeTextSize(.6).
    3.93 -    nodeColors(composeMap(colorSet,hcolors)).
    3.94 +    nodeColors(composeMap(palette,hcolors)).
    3.95      run();
    3.96  
    3.97  
     4.1 --- a/demo/grid_ugraph_demo.cc	Thu Aug 10 10:11:07 2006 +0000
     4.2 +++ b/demo/grid_ugraph_demo.cc	Thu Aug 10 10:18:04 2006 +0000
     4.3 @@ -92,7 +92,7 @@
     4.4      enableParallel().
     4.5      nodeScale(0.5).
     4.6      drawArrows().
     4.7 -    edgeColors(composeMap(ColorSet(), path)).
     4.8 +    edgeColors(composeMap(Palette(), path)).
     4.9      run();
    4.10    
    4.11    std::cout << "The shortest path is written to grid_ugraph_demo.eps" 
     5.1 --- a/demo/topology_demo.cc	Thu Aug 10 10:11:07 2006 +0000
     5.2 +++ b/demo/topology_demo.cc	Thu Aug 10 10:18:04 2006 +0000
     5.3 @@ -56,7 +56,7 @@
     5.4      readNodeMap("coordinates_y", yMap(coords)).
     5.5      run();
     5.6    
     5.7 -  ColorSet colorSet;
     5.8 +  Palette palette;
     5.9  
    5.10    Graph::NodeMap<int> compMap(graph);
    5.11    connectedComponents(graph, compMap);
    5.12 @@ -64,7 +64,7 @@
    5.13    graphToEps(graph, "connected_components.eps").undirected().
    5.14      coords(coords).scaleToA4().enableParallel().
    5.15      parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
    5.16 -    nodeColors(composeMap(colorSet, compMap)).run();
    5.17 +    nodeColors(composeMap(palette, compMap)).run();
    5.18  
    5.19    std::cout << "Result: connected_components.eps" << std::endl;
    5.20  }
    5.21 @@ -81,7 +81,7 @@
    5.22      readNodeMap("coordinates_y", yMap(coords)).
    5.23      run();
    5.24    
    5.25 -  ColorSet colorSet;
    5.26 +  Palette palette;
    5.27  
    5.28    Graph::NodeMap<int> compMap(graph);
    5.29    Graph::EdgeMap<bool> cutMap(graph);
    5.30 @@ -92,7 +92,7 @@
    5.31      coords(coords).scaleToA4().enableParallel().
    5.32      drawArrows().arrowWidth(10.0).arrowLength(10.0).
    5.33      parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
    5.34 -    nodeColors(composeMap(colorSet, compMap)).
    5.35 +    nodeColors(composeMap(palette, compMap)).
    5.36      edgeColors(composeMap(functorMap(&color), cutMap)).run();
    5.37  
    5.38    std::cout << "Result: strongly_connected_components.eps" << std::endl;
    5.39 @@ -111,7 +111,7 @@
    5.40      readNodeMap("coordinates_y", yMap(coords)).
    5.41      run();
    5.42  
    5.43 -  ColorSet colorSet;
    5.44 +  Palette palette;
    5.45  
    5.46    Graph::UEdgeMap<int> compMap(graph);
    5.47    Graph::NodeMap<bool> cutMap(graph);
    5.48 @@ -121,7 +121,7 @@
    5.49    graphToEps(graph, "bi_node_connected_components.eps").undirected().
    5.50      coords(coords).scaleToA4().enableParallel().
    5.51      parEdgeDist(20.0).edgeWidthScale(5.0).nodeScale(20.0).
    5.52 -    edgeColors(composeMap(colorSet, compMap)).
    5.53 +    edgeColors(composeMap(palette, compMap)).
    5.54      nodeColors(composeMap(functorMap(&color), cutMap)).
    5.55      run();
    5.56  
    5.57 @@ -141,7 +141,7 @@
    5.58      readNodeMap("coordinates_y", yMap(coords)).
    5.59      run();
    5.60    
    5.61 -  ColorSet colorSet;
    5.62 +  Palette palette;
    5.63  
    5.64    Graph::NodeMap<int> compMap(graph);
    5.65    Graph::UEdgeMap<bool> cutMap(graph);
    5.66 @@ -151,7 +151,7 @@
    5.67    graphToEps(graph, "bi_edge_connected_components.eps").undirected().
    5.68      coords(coords).scaleToA4().enableParallel().
    5.69      parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
    5.70 -    nodeColors(composeMap(colorSet, compMap)).
    5.71 +    nodeColors(composeMap(palette, compMap)).
    5.72      edgeColors(composeMap(functorMap(&color), cutMap)).run();
    5.73    
    5.74    std::cout << "Result: bi_edge_connected_components.eps" << std::endl;
    5.75 @@ -170,7 +170,7 @@
    5.76      readNodeMap("coordinates_y", yMap(coords)).
    5.77      run();
    5.78    
    5.79 -  ColorSet colorSet;
    5.80 +  Palette palette;
    5.81  
    5.82    Graph::NodeMap<bool> partMap(graph);
    5.83    bipartitePartitions(graph, partMap);
     6.1 --- a/doc/graph_orientation.dox	Thu Aug 10 10:11:07 2006 +0000
     6.2 +++ b/doc/graph_orientation.dox	Thu Aug 10 10:18:04 2006 +0000
     6.3 @@ -53,9 +53,22 @@
     6.4  following line seems to be useful.
     6.5  \skipline namespace
     6.6  
     6.7 -The following <tt>typedef</tt>s will also save a lot of typing.
     6.8 -\skip typedef
     6.9 -\until InEdgeIt
    6.10 +The following macro will also save a lot of typing by defining some
    6.11 +convenience <tt>typedef</tt>s.
    6.12 +
    6.13 +\skipline TYPEDEF
    6.14 +
    6.15 +Actually, the macro above would be equivalent with the following
    6.16 +<tt>typedef</tt>s.
    6.17 +
    6.18 +\code
    6.19 +typedef ListGraph::Node Node;
    6.20 +typedef ListGraph::NodeIt NodeIt;
    6.21 +typedef ListGraph::Edge Edge;
    6.22 +typedef ListGraph::EdgeIt EdgeIt;
    6.23 +typedef ListGraph::OutEdgeIt OutEdgeIt;
    6.24 +typedef ListGraph::InEdgeIt InEdgeIt;
    6.25 +\endcode
    6.26  
    6.27  \subsection go-alg-main The main() function
    6.28  
    6.29 @@ -152,7 +165,7 @@
    6.30  \c bool values of
    6.31  \c rev are transformed into different \ref lemon::Color "RGB color"s
    6.32  using the class
    6.33 -\ref lemon::ColorSet "ColorSet"
    6.34 +\ref lemon::Palette "Palette"
    6.35  and the \ref map_adaptors "map adaptor" called
    6.36  \ref lemon::ComposeMap "composeMap".
    6.37  
     7.1 --- a/lemon/color.h	Thu Aug 10 10:11:07 2006 +0000
     7.2 +++ b/lemon/color.h	Thu Aug 10 10:18:04 2006 +0000
     7.3 @@ -81,7 +81,7 @@
     7.4  ///This is a true \ref concept::ReferenceMap "reference map", so you can also
     7.5  ///change the actual colors.
     7.6  
     7.7 -class ColorSet : public MapBase<int,Color>
     7.8 +class Palette : public MapBase<int,Color>
     7.9  {
    7.10    std::vector<Color> colors;
    7.11  public:
    7.12 @@ -96,7 +96,7 @@
    7.13    ///If \c num is less then 26/27 then the default color list is cut. Otherwise
    7.14    ///the color list is filled repeatedly with the default color list.
    7.15    ///(The colors can be changed later on.)
    7.16 -  ColorSet(bool have_white=false,int num=0)
    7.17 +  Palette(bool have_white=false,int num=0)
    7.18    {
    7.19      do {
    7.20        if(have_white) colors.push_back(Color(1,1,1));
     8.1 --- a/lemon/graph_to_eps.h	Thu Aug 10 10:11:07 2006 +0000
     8.2 +++ b/lemon/graph_to_eps.h	Thu Aug 10 10:18:04 2006 +0000
     8.3 @@ -426,7 +426,7 @@
     8.4    ///Sets the map of the node colors
     8.5    ///\param x must be a node map with \ref Color values.
     8.6    ///
     8.7 -  ///\sa ColorSet
     8.8 +  ///\sa Palette
     8.9    template<class X> GraphToEps<NodeColorsTraits<X> >
    8.10    nodeColors(const X &x)
    8.11    {
    8.12 @@ -442,7 +442,7 @@
    8.13    ///Sets the map of the node text colors
    8.14    ///\param x must be a node map with \ref Color values. 
    8.15    ///
    8.16 -  ///\sa ColorSet
    8.17 +  ///\sa Palette
    8.18    template<class X> GraphToEps<NodeTextColorsTraits<X> >
    8.19    nodeTextColors(const X &x)
    8.20    {
    8.21 @@ -460,7 +460,7 @@
    8.22    ///Sets the map of the edge colors
    8.23    ///\param x must be a edge map with \ref Color values. 
    8.24    ///
    8.25 -  ///\sa ColorSet
    8.26 +  ///\sa Palette
    8.27    template<class X> GraphToEps<EdgeColorsTraits<X> >
    8.28    edgeColors(const X &x)
    8.29    {