COIN-OR::LEMON - Graph Library

Changeset 1573:b76a0af36f44 in lemon-0.x


Ignore:
Timestamp:
07/20/05 10:06:32 (14 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2072
Message:
  • graph_to_eps_demo.cc is rightly documented
  • Fix/improve documentation of graphToEps()
  • Missing const added to ColorSet::size();
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • demo/graph_to_eps_demo.cc

    r1435 r1573  
    1515 */
    1616
    17 #include<lemon/graph_to_eps.h>
    18 #include<lemon/maps.h>
    19 #include<lemon/list_graph.h>
    20 #include<lemon/graph_utils.h>
     17/// \ingroup demos
     18/// \file
     19/// \brief Demo of the graph grawing function \ref graphToEps()
     20///
     21/// This demo program shows examples how to  use the function \ref
     22/// graphToEps(). It takes no input but simply creates  six
     23/// <tt>.eps</tt> files demonstrating how to draw directed/undirected
     24/// graphs, how to handle parallel egdes, how to change the properties
     25/// (like color, shape, size, title etc.) of nodes and edges
     26/// individually using appropriate \ref maps-page "graphmaps".
    2127
    2228#include <cmath>
    2329
     30#include<lemon/graph_to_eps.h>
     31#include<lemon/list_graph.h>
    2432
    2533using namespace std;
     
    6775  IdMap<ListGraph,Node> id(g);
    6876
     77  cout << "Create 'graph_to_eps_demo_out.eps'" << endl;
    6978  graphToEps(g,"graph_to_eps_demo_out.eps").scale(10).coords(coords).
    7079    title("Sample .eps figure").
     
    7887    run();
    7988
     89
     90  cout << "Create 'graph_to_eps_demo_out_arr.eps'" << endl;
    8091  graphToEps(g,"graph_to_eps_demo_out_arr.eps").scale(10).
    8192    title("Sample .eps figure (with arrowheads)").
     
    102113  e=g.addEdge(n1,n2); ecolors[e]=7; widths[e]=1;
    103114
     115  cout << "Create 'graph_to_eps_demo_out_par.eps'" << endl;
    104116  graphToEps(g,"graph_to_eps_demo_out_par.eps").scale(10).
    105117    title("Sample .eps figure (parallel edges)").
     
    115127    run();
    116128 
     129  cout << "Create 'graph_to_eps_demo_out_par_arr.eps'" << endl;
    117130  graphToEps(g,"graph_to_eps_demo_out_par_arr.eps").scale(10).
    118131    title("Sample .eps figure (parallel edges and arrowheads)").
     
    129142    run();
    130143
     144  cout << "Create 'graph_to_eps_demo_out_a4.eps'" << endl;
    131145  graphToEps(g,"graph_to_eps_demo_out_a4.eps").scaleToA4().
    132146    title("Sample .eps figure (fits to A4)").
     
    154168  }
    155169 
     170  cout << "Create 'graph_to_eps_demo_out_colors.eps'" << endl;
    156171  graphToEps(h,"graph_to_eps_demo_out_colors.eps").scale(60).
    157     title("Sample .eps figure (parallel edges and arrowheads)").
     172    title("Sample .eps figure (ColorSet demo)").
    158173    copyright("(C) 2005 LEMON Project").
    159174    coords(hcoords).
  • lemon/graph_to_eps.h

    r1539 r1573  
    6969///Maps <tt>int</tt>s to different \ref Color "Color"s
    7070
    71 ///This map assing one of the predefined \ref Color "Color"s
     71///This map assigns one of the predefined \ref Color "Color"s
    7272///to each <tt>int</tt>. It is possible to change the colors as well as their
    7373///number. The integer range is cyclically mapped to the provided set of colors.
     
    146146  void resize(int s) { colors.resize(s);}
    147147  ///Returns the munber of the existing colors.
    148   std::size_t size() { return colors.size();}
     148  std::size_t size() const { return colors.size();}
    149149};
    150150
     
    467467  ///the PostScript block inserted.
    468468  ///
    469   ///Before and after the block a newline character is inserted to you
     469  ///Before and after the block a newline character is inserted so you
    470470  ///don't have to bother with the separators.
    471471  ///
     
    503503
    504504  ///Sets the map of the node colors
    505   ///\param x must be a node map with \ref Color values.
     505  ///\param x must be a node map with \ref Color values.
     506  ///
     507  ///\sa ColorSet
    506508  template<class X> GraphToEps<NodeColorsTraits<X> >
    507509  nodeColors(const X &x)
     
    518520  ///Sets the map of the node text colors
    519521  ///\param x must be a node map with \ref Color values.
     522  ///
     523  ///\sa ColorSet
    520524  template<class X> GraphToEps<NodeTextColorsTraits<X> >
    521525  nodeTextColors(const X &x)
     
    534538  ///Sets the map of the edge colors
    535539  ///\param x must be a edge map with \ref Color values.
     540  ///
     541  ///\sa ColorSet
    536542  template<class X> GraphToEps<EdgeColorsTraits<X> >
    537543  edgeColors(const X &x)
     
    622628  ///Sets the color of the node texts to be as different from the node color
    623629  ///as it is possible
    624     ///
     630  ///
    625631  GraphToEps<T> &distantColorNodeTexts()
    626632  {_nodeTextColorType=DIST_COL;return *this;}
     
    10091015///to the end of the parameter list.
    10101016///\sa GraphToEps
    1011 ///\sa graphToEps(G &g, char *file_name)
     1017///\sa graphToEps(G &g, const char *file_name)
    10121018template<class G>
    10131019GraphToEps<DefaultGraphToEpsTraits<G> >
     
    10201026///Generates an EPS file from a graph
    10211027
    1022 ///\ingroup misc
     1028///\ingroup io_group
    10231029///This function does the same as
    10241030///\ref graphToEps(G &g,std::ostream& os)
Note: See TracChangeset for help on using the changeset viewer.