Changeset 1693:269f0cbfbcc8 in lemon-0.x for demo/grid_graph_demo.cc
- Timestamp:
- 09/30/05 15:15:28 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2219
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/grid_graph_demo.cc
r1681 r1693 42 42 bfs.run(start, stop) << std::endl; 43 43 44 GridGraph::NodeMap<xy<double> > coord(graph); 45 for (int i = 0; i < graph.width(); ++i) { 46 for (int j = 0; j < graph.height(); ++j) { 47 coord[graph(i, j)] = xy<double>( i * 10.0, j * 10.0); 48 } 49 } 50 51 FilteredGraph::EdgeMap<Color> color(filtered, Color(0.0, 0.0, 0.0)); 44 FilteredGraph::EdgeMap<bool> path(filtered, false); 52 45 53 46 for (GridGraph::Node node = stop; 54 47 node != start; node = bfs.predNode(node)) { 55 color[bfs.pred(node)] = Color(1.0, 0.0, 0.0);48 path[bfs.pred(node)] = true; 56 49 } 57 50 … … 59 52 title("Grid graph"). 60 53 copyright("(C) 2005 LEMON Project"). 61 coords( coord).54 coords(scaleMap(indexMap(graph), 10)). 62 55 enableParallel(). 63 nodeScale( .45).56 nodeScale(0.5). 64 57 drawArrows(). 65 edgeColors(co lor).58 edgeColors(composeMap(ColorSet(), path)). 66 59 run(); 67 60
Note: See TracChangeset
for help on using the changeset viewer.