[Lemon-commits] [lemon_svn] alpar: r2887 - in hugo/trunk: demo doc lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 21:51:03 CET 2006
Author: alpar
Date: Thu Aug 10 12:18:04 2006
New Revision: 2887
Modified:
hugo/trunk/demo/coloring.cc
hugo/trunk/demo/graph_orientation.cc
hugo/trunk/demo/graph_to_eps_demo.cc
hugo/trunk/demo/grid_ugraph_demo.cc
hugo/trunk/demo/topology_demo.cc
hugo/trunk/doc/graph_orientation.dox
hugo/trunk/lemon/color.h
hugo/trunk/lemon/graph_to_eps.h
Log:
- Change ColorSet to Palette
- Minor change in graph_orientation demo.
Modified: hugo/trunk/demo/coloring.cc
==============================================================================
--- hugo/trunk/demo/coloring.cc (original)
+++ hugo/trunk/demo/coloring.cc Thu Aug 10 12:18:04 2006
@@ -97,11 +97,11 @@
color[order[i]] = current;
}
- ColorSet colorSet;
+ Palette palette;
graphToEps(graph, "coloring.eps").
title("Six Colored Plan Graph").copyright("(C) 2006 LEMON Project").
- coords(coords).nodeColors(composeMap(colorSet, color)).
+ coords(coords).nodeColors(composeMap(palette, color)).
nodeScale(5.0).scaleToA4().run();
return 0;
Modified: hugo/trunk/demo/graph_orientation.cc
==============================================================================
--- hugo/trunk/demo/graph_orientation.cc (original)
+++ hugo/trunk/demo/graph_orientation.cc Thu Aug 10 12:18:04 2006
@@ -25,13 +25,7 @@
using namespace lemon;
-
-typedef ListGraph::Node Node;
-typedef ListGraph::NodeIt NodeIt;
-typedef ListGraph::Edge Edge;
-typedef ListGraph::EdgeIt EdgeIt;
-typedef ListGraph::OutEdgeIt OutEdgeIt;
-typedef ListGraph::InEdgeIt InEdgeIt;
+GRAPH_TYPEDEFS(ListGraph)
int main(int argc, char** argv)
{
@@ -113,7 +107,7 @@
nodeScale(15).
coords(coords).
negateY().
- edgeColors(composeMap(ColorSet(),rev)).
+ edgeColors(composeMap(Palette(),rev)).
edgeWidthScale(1).
nodeTexts(f).nodeTextSize(20).
drawArrows().arrowWidth(10).arrowLength(10).
Modified: hugo/trunk/demo/graph_to_eps_demo.cc
==============================================================================
--- hugo/trunk/demo/graph_to_eps_demo.cc (original)
+++ hugo/trunk/demo/graph_to_eps_demo.cc Thu Aug 10 12:18:04 2006
@@ -41,7 +41,7 @@
int main()
{
- ColorSet colorSet;
+ Palette palette;
ListGraph g;
typedef ListGraph::Node Node;
@@ -88,8 +88,8 @@
copyright("(C) 2006 LEMON Project").
nodeScale(2).nodeSizes(sizes).
nodeShapes(shapes).
- nodeColors(composeMap(colorSet,colors)).
- edgeColors(composeMap(colorSet,ecolors)).
+ nodeColors(composeMap(palette,colors)).
+ edgeColors(composeMap(palette,ecolors)).
edgeWidthScale(.4).edgeWidths(widths).
nodeTexts(id).nodeTextSize(3).
run();
@@ -100,11 +100,11 @@
//scale(10).
title("Sample .eps figure (with arrowheads)").
copyright("(C) 2006 LEMON Project").
- nodeColors(composeMap(colorSet,colors)).
+ nodeColors(composeMap(palette,colors)).
coords(coords).
nodeScale(2).nodeSizes(sizes).
nodeShapes(shapes).
- edgeColors(composeMap(colorSet,ecolors)).
+ edgeColors(composeMap(palette,ecolors)).
edgeWidthScale(.4).edgeWidths(widths).
nodeTexts(id).nodeTextSize(3).
drawArrows().arrowWidth(1).arrowLength(1).
@@ -129,8 +129,8 @@
nodeShapes(shapes).
coords(coords).
nodeScale(2).nodeSizes(sizes).
- nodeColors(composeMap(colorSet,colors)).
- edgeColors(composeMap(colorSet,ecolors)).
+ nodeColors(composeMap(palette,colors)).
+ edgeColors(composeMap(palette,ecolors)).
edgeWidthScale(.4).edgeWidths(widths).
nodeTexts(id).nodeTextSize(3).
enableParallel().parEdgeDist(1.5).
@@ -144,8 +144,8 @@
nodeScale(2).nodeSizes(sizes).
coords(coords).
nodeShapes(shapes).
- nodeColors(composeMap(colorSet,colors)).
- edgeColors(composeMap(colorSet,ecolors)).
+ nodeColors(composeMap(palette,colors)).
+ edgeColors(composeMap(palette,ecolors)).
edgeWidthScale(.3).edgeWidths(widths).
nodeTexts(id).nodeTextSize(3).
enableParallel().parEdgeDist(1).
@@ -159,8 +159,8 @@
nodeScale(2).nodeSizes(sizes).
coords(coords).
nodeShapes(shapes).
- nodeColors(composeMap(colorSet,colors)).
- edgeColors(composeMap(colorSet,ecolors)).
+ nodeColors(composeMap(palette,colors)).
+ edgeColors(composeMap(palette,ecolors)).
edgeWidthScale(.3).edgeWidths(widths).
nodeTexts(id).nodeTextSize(3).
enableParallel().parEdgeDist(1).
@@ -171,8 +171,8 @@
ListGraph::NodeMap<int> hcolors(h);
ListGraph::NodeMap<Xy> hcoords(h);
- int cols=int(sqrt(double(colorSet.size())));
- for(int i=0;i<int(colorSet.size());i++) {
+ int cols=int(sqrt(double(palette.size())));
+ for(int i=0;i<int(palette.size());i++) {
Node n=h.addNode();
hcoords[n]=Xy(i%cols,i/cols);
hcolors[n]=i;
@@ -181,14 +181,14 @@
cout << "Create 'graph_to_eps_demo_out_colors.eps'" << endl;
graphToEps(h,"graph_to_eps_demo_out_colors.eps").
//scale(60).
- title("Sample .eps figure (ColorSet demo)").
+ title("Sample .eps figure (Palette demo)").
copyright("(C) 2006 LEMON Project").
coords(hcoords).
nodeScale(.45).
distantColorNodeTexts().
// distantBWNodeTexts().
nodeTexts(hcolors).nodeTextSize(.6).
- nodeColors(composeMap(colorSet,hcolors)).
+ nodeColors(composeMap(palette,hcolors)).
run();
Modified: hugo/trunk/demo/grid_ugraph_demo.cc
==============================================================================
--- hugo/trunk/demo/grid_ugraph_demo.cc (original)
+++ hugo/trunk/demo/grid_ugraph_demo.cc Thu Aug 10 12:18:04 2006
@@ -92,7 +92,7 @@
enableParallel().
nodeScale(0.5).
drawArrows().
- edgeColors(composeMap(ColorSet(), path)).
+ edgeColors(composeMap(Palette(), path)).
run();
std::cout << "The shortest path is written to grid_ugraph_demo.eps"
Modified: hugo/trunk/demo/topology_demo.cc
==============================================================================
--- hugo/trunk/demo/topology_demo.cc (original)
+++ hugo/trunk/demo/topology_demo.cc Thu Aug 10 12:18:04 2006
@@ -56,7 +56,7 @@
readNodeMap("coordinates_y", yMap(coords)).
run();
- ColorSet colorSet;
+ Palette palette;
Graph::NodeMap<int> compMap(graph);
connectedComponents(graph, compMap);
@@ -64,7 +64,7 @@
graphToEps(graph, "connected_components.eps").undirected().
coords(coords).scaleToA4().enableParallel().
parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
- nodeColors(composeMap(colorSet, compMap)).run();
+ nodeColors(composeMap(palette, compMap)).run();
std::cout << "Result: connected_components.eps" << std::endl;
}
@@ -81,7 +81,7 @@
readNodeMap("coordinates_y", yMap(coords)).
run();
- ColorSet colorSet;
+ Palette palette;
Graph::NodeMap<int> compMap(graph);
Graph::EdgeMap<bool> cutMap(graph);
@@ -92,7 +92,7 @@
coords(coords).scaleToA4().enableParallel().
drawArrows().arrowWidth(10.0).arrowLength(10.0).
parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
- nodeColors(composeMap(colorSet, compMap)).
+ nodeColors(composeMap(palette, compMap)).
edgeColors(composeMap(functorMap(&color), cutMap)).run();
std::cout << "Result: strongly_connected_components.eps" << std::endl;
@@ -111,7 +111,7 @@
readNodeMap("coordinates_y", yMap(coords)).
run();
- ColorSet colorSet;
+ Palette palette;
Graph::UEdgeMap<int> compMap(graph);
Graph::NodeMap<bool> cutMap(graph);
@@ -121,7 +121,7 @@
graphToEps(graph, "bi_node_connected_components.eps").undirected().
coords(coords).scaleToA4().enableParallel().
parEdgeDist(20.0).edgeWidthScale(5.0).nodeScale(20.0).
- edgeColors(composeMap(colorSet, compMap)).
+ edgeColors(composeMap(palette, compMap)).
nodeColors(composeMap(functorMap(&color), cutMap)).
run();
@@ -141,7 +141,7 @@
readNodeMap("coordinates_y", yMap(coords)).
run();
- ColorSet colorSet;
+ Palette palette;
Graph::NodeMap<int> compMap(graph);
Graph::UEdgeMap<bool> cutMap(graph);
@@ -151,7 +151,7 @@
graphToEps(graph, "bi_edge_connected_components.eps").undirected().
coords(coords).scaleToA4().enableParallel().
parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0).
- nodeColors(composeMap(colorSet, compMap)).
+ nodeColors(composeMap(palette, compMap)).
edgeColors(composeMap(functorMap(&color), cutMap)).run();
std::cout << "Result: bi_edge_connected_components.eps" << std::endl;
@@ -170,7 +170,7 @@
readNodeMap("coordinates_y", yMap(coords)).
run();
- ColorSet colorSet;
+ Palette palette;
Graph::NodeMap<bool> partMap(graph);
bipartitePartitions(graph, partMap);
Modified: hugo/trunk/doc/graph_orientation.dox
==============================================================================
--- hugo/trunk/doc/graph_orientation.dox (original)
+++ hugo/trunk/doc/graph_orientation.dox Thu Aug 10 12:18:04 2006
@@ -53,9 +53,22 @@
following line seems to be useful.
\skipline namespace
-The following <tt>typedef</tt>s will also save a lot of typing.
-\skip typedef
-\until InEdgeIt
+The following macro will also save a lot of typing by defining some
+convenience <tt>typedef</tt>s.
+
+\skipline TYPEDEF
+
+Actually, the macro above would be equivalent with the following
+<tt>typedef</tt>s.
+
+\code
+typedef ListGraph::Node Node;
+typedef ListGraph::NodeIt NodeIt;
+typedef ListGraph::Edge Edge;
+typedef ListGraph::EdgeIt EdgeIt;
+typedef ListGraph::OutEdgeIt OutEdgeIt;
+typedef ListGraph::InEdgeIt InEdgeIt;
+\endcode
\subsection go-alg-main The main() function
@@ -152,7 +165,7 @@
\c bool values of
\c rev are transformed into different \ref lemon::Color "RGB color"s
using the class
-\ref lemon::ColorSet "ColorSet"
+\ref lemon::Palette "Palette"
and the \ref map_adaptors "map adaptor" called
\ref lemon::ComposeMap "composeMap".
Modified: hugo/trunk/lemon/color.h
==============================================================================
--- hugo/trunk/lemon/color.h (original)
+++ hugo/trunk/lemon/color.h Thu Aug 10 12:18:04 2006
@@ -81,7 +81,7 @@
///This is a true \ref concept::ReferenceMap "reference map", so you can also
///change the actual colors.
-class ColorSet : public MapBase<int,Color>
+class Palette : public MapBase<int,Color>
{
std::vector<Color> colors;
public:
@@ -96,7 +96,7 @@
///If \c num is less then 26/27 then the default color list is cut. Otherwise
///the color list is filled repeatedly with the default color list.
///(The colors can be changed later on.)
- ColorSet(bool have_white=false,int num=0)
+ Palette(bool have_white=false,int num=0)
{
do {
if(have_white) colors.push_back(Color(1,1,1));
Modified: hugo/trunk/lemon/graph_to_eps.h
==============================================================================
--- hugo/trunk/lemon/graph_to_eps.h (original)
+++ hugo/trunk/lemon/graph_to_eps.h Thu Aug 10 12:18:04 2006
@@ -426,7 +426,7 @@
///Sets the map of the node colors
///\param x must be a node map with \ref Color values.
///
- ///\sa ColorSet
+ ///\sa Palette
template<class X> GraphToEps<NodeColorsTraits<X> >
nodeColors(const X &x)
{
@@ -442,7 +442,7 @@
///Sets the map of the node text colors
///\param x must be a node map with \ref Color values.
///
- ///\sa ColorSet
+ ///\sa Palette
template<class X> GraphToEps<NodeTextColorsTraits<X> >
nodeTextColors(const X &x)
{
@@ -460,7 +460,7 @@
///Sets the map of the edge colors
///\param x must be a edge map with \ref Color values.
///
- ///\sa ColorSet
+ ///\sa Palette
template<class X> GraphToEps<EdgeColorsTraits<X> >
edgeColors(const X &x)
{
More information about the Lemon-commits
mailing list