Changeset 2172:4b25e7003868 in lemon-0.x
- Timestamp:
- 08/10/06 12:18:04 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2887
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/coloring.cc
r2116 r2172 98 98 } 99 99 100 ColorSet colorSet;100 Palette palette; 101 101 102 102 graphToEps(graph, "coloring.eps"). 103 103 title("Six Colored Plan Graph").copyright("(C) 2006 LEMON Project"). 104 coords(coords).nodeColors(composeMap( colorSet, color)).104 coords(coords).nodeColors(composeMap(palette, color)). 105 105 nodeScale(5.0).scaleToA4().run(); 106 106 -
demo/graph_orientation.cc
r2158 r2172 26 26 using namespace lemon; 27 27 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; 28 GRAPH_TYPEDEFS(ListGraph) 35 29 36 30 int main(int argc, char** argv) … … 114 108 coords(coords). 115 109 negateY(). 116 edgeColors(composeMap( ColorSet(),rev)).110 edgeColors(composeMap(Palette(),rev)). 117 111 edgeWidthScale(1). 118 112 nodeTexts(f).nodeTextSize(20). -
demo/graph_to_eps_demo.cc
r1956 r2172 42 42 int main() 43 43 { 44 ColorSet colorSet;44 Palette palette; 45 45 46 46 ListGraph g; … … 89 89 nodeScale(2).nodeSizes(sizes). 90 90 nodeShapes(shapes). 91 nodeColors(composeMap( colorSet,colors)).92 edgeColors(composeMap( colorSet,ecolors)).91 nodeColors(composeMap(palette,colors)). 92 edgeColors(composeMap(palette,ecolors)). 93 93 edgeWidthScale(.4).edgeWidths(widths). 94 94 nodeTexts(id).nodeTextSize(3). … … 101 101 title("Sample .eps figure (with arrowheads)"). 102 102 copyright("(C) 2006 LEMON Project"). 103 nodeColors(composeMap( colorSet,colors)).103 nodeColors(composeMap(palette,colors)). 104 104 coords(coords). 105 105 nodeScale(2).nodeSizes(sizes). 106 106 nodeShapes(shapes). 107 edgeColors(composeMap( colorSet,ecolors)).107 edgeColors(composeMap(palette,ecolors)). 108 108 edgeWidthScale(.4).edgeWidths(widths). 109 109 nodeTexts(id).nodeTextSize(3). … … 130 130 coords(coords). 131 131 nodeScale(2).nodeSizes(sizes). 132 nodeColors(composeMap( colorSet,colors)).133 edgeColors(composeMap( colorSet,ecolors)).132 nodeColors(composeMap(palette,colors)). 133 edgeColors(composeMap(palette,ecolors)). 134 134 edgeWidthScale(.4).edgeWidths(widths). 135 135 nodeTexts(id).nodeTextSize(3). … … 145 145 coords(coords). 146 146 nodeShapes(shapes). 147 nodeColors(composeMap( colorSet,colors)).148 edgeColors(composeMap( colorSet,ecolors)).147 nodeColors(composeMap(palette,colors)). 148 edgeColors(composeMap(palette,ecolors)). 149 149 edgeWidthScale(.3).edgeWidths(widths). 150 150 nodeTexts(id).nodeTextSize(3). … … 160 160 coords(coords). 161 161 nodeShapes(shapes). 162 nodeColors(composeMap( colorSet,colors)).163 edgeColors(composeMap( colorSet,ecolors)).162 nodeColors(composeMap(palette,colors)). 163 edgeColors(composeMap(palette,ecolors)). 164 164 edgeWidthScale(.3).edgeWidths(widths). 165 165 nodeTexts(id).nodeTextSize(3). … … 172 172 ListGraph::NodeMap<Xy> hcoords(h); 173 173 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++) { 176 176 Node n=h.addNode(); 177 177 hcoords[n]=Xy(i%cols,i/cols); … … 182 182 graphToEps(h,"graph_to_eps_demo_out_colors.eps"). 183 183 //scale(60). 184 title("Sample .eps figure ( ColorSetdemo)").184 title("Sample .eps figure (Palette demo)"). 185 185 copyright("(C) 2006 LEMON Project"). 186 186 coords(hcoords). … … 189 189 // distantBWNodeTexts(). 190 190 nodeTexts(hcolors).nodeTextSize(.6). 191 nodeColors(composeMap( colorSet,hcolors)).191 nodeColors(composeMap(palette,hcolors)). 192 192 run(); 193 193 -
demo/grid_ugraph_demo.cc
r1979 r2172 93 93 nodeScale(0.5). 94 94 drawArrows(). 95 edgeColors(composeMap( ColorSet(), path)).95 edgeColors(composeMap(Palette(), path)). 96 96 run(); 97 97 -
demo/topology_demo.cc
r2116 r2172 57 57 run(); 58 58 59 ColorSet colorSet;59 Palette palette; 60 60 61 61 Graph::NodeMap<int> compMap(graph); … … 65 65 coords(coords).scaleToA4().enableParallel(). 66 66 parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0). 67 nodeColors(composeMap( colorSet, compMap)).run();67 nodeColors(composeMap(palette, compMap)).run(); 68 68 69 69 std::cout << "Result: connected_components.eps" << std::endl; … … 82 82 run(); 83 83 84 ColorSet colorSet;84 Palette palette; 85 85 86 86 Graph::NodeMap<int> compMap(graph); … … 93 93 drawArrows().arrowWidth(10.0).arrowLength(10.0). 94 94 parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0). 95 nodeColors(composeMap( colorSet, compMap)).95 nodeColors(composeMap(palette, compMap)). 96 96 edgeColors(composeMap(functorMap(&color), cutMap)).run(); 97 97 … … 112 112 run(); 113 113 114 ColorSet colorSet;114 Palette palette; 115 115 116 116 Graph::UEdgeMap<int> compMap(graph); … … 122 122 coords(coords).scaleToA4().enableParallel(). 123 123 parEdgeDist(20.0).edgeWidthScale(5.0).nodeScale(20.0). 124 edgeColors(composeMap( colorSet, compMap)).124 edgeColors(composeMap(palette, compMap)). 125 125 nodeColors(composeMap(functorMap(&color), cutMap)). 126 126 run(); … … 142 142 run(); 143 143 144 ColorSet colorSet;144 Palette palette; 145 145 146 146 Graph::NodeMap<int> compMap(graph); … … 152 152 coords(coords).scaleToA4().enableParallel(). 153 153 parEdgeDist(20.0).edgeWidthScale(2.0).nodeScale(20.0). 154 nodeColors(composeMap( colorSet, compMap)).154 nodeColors(composeMap(palette, compMap)). 155 155 edgeColors(composeMap(functorMap(&color), cutMap)).run(); 156 156 … … 171 171 run(); 172 172 173 ColorSet colorSet;173 Palette palette; 174 174 175 175 Graph::NodeMap<bool> partMap(graph); -
doc/graph_orientation.dox
r2158 r2172 54 54 \skipline namespace 55 55 56 The following <tt>typedef</tt>s will also save a lot of typing. 57 \skip typedef 58 \until InEdgeIt 56 The following macro will also save a lot of typing by defining some 57 convenience <tt>typedef</tt>s. 58 59 \skipline TYPEDEF 60 61 Actually, the macro above would be equivalent with the following 62 <tt>typedef</tt>s. 63 64 \code 65 typedef ListGraph::Node Node; 66 typedef ListGraph::NodeIt NodeIt; 67 typedef ListGraph::Edge Edge; 68 typedef ListGraph::EdgeIt EdgeIt; 69 typedef ListGraph::OutEdgeIt OutEdgeIt; 70 typedef ListGraph::InEdgeIt InEdgeIt; 71 \endcode 59 72 60 73 \subsection go-alg-main The main() function … … 153 166 \c rev are transformed into different \ref lemon::Color "RGB color"s 154 167 using the class 155 \ref lemon:: ColorSet "ColorSet"168 \ref lemon::Palette "Palette" 156 169 and the \ref map_adaptors "map adaptor" called 157 170 \ref lemon::ComposeMap "composeMap". -
lemon/color.h
r2159 r2172 82 82 ///change the actual colors. 83 83 84 class ColorSet: public MapBase<int,Color>84 class Palette : public MapBase<int,Color> 85 85 { 86 86 std::vector<Color> colors; … … 97 97 ///the color list is filled repeatedly with the default color list. 98 98 ///(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) 100 100 { 101 101 do { -
lemon/graph_to_eps.h
r2084 r2172 427 427 ///\param x must be a node map with \ref Color values. 428 428 /// 429 ///\sa ColorSet429 ///\sa Palette 430 430 template<class X> GraphToEps<NodeColorsTraits<X> > 431 431 nodeColors(const X &x) … … 443 443 ///\param x must be a node map with \ref Color values. 444 444 /// 445 ///\sa ColorSet445 ///\sa Palette 446 446 template<class X> GraphToEps<NodeTextColorsTraits<X> > 447 447 nodeTextColors(const X &x) … … 461 461 ///\param x must be a edge map with \ref Color values. 462 462 /// 463 ///\sa ColorSet463 ///\sa Palette 464 464 template<class X> GraphToEps<EdgeColorsTraits<X> > 465 465 edgeColors(const X &x)
Note: See TracChangeset
for help on using the changeset viewer.