1.1 --- a/lemon/color.h Mon Apr 14 11:23:56 2008 +0100
1.2 +++ b/lemon/color.h Sun Apr 13 08:20:43 2008 +0100
1.3 @@ -111,14 +111,14 @@
1.4 ///Constructor
1.5
1.6 ///Constructor
1.7 + ///\param have_white indicates whether white is amongst the
1.8 + ///provided initial colors (\c true) or not (\c false). If it is true,
1.9 + ///white will be assigned to \c 0.
1.10 ///\param num the number of the allocated colors. If it is \c -1,
1.11 - ///the default color configuration is set up (26 color plus the
1.12 + ///the default color configuration is set up (26 color plus optionaly the
1.13 ///white). If \c num is less then 26/27 then the default color
1.14 ///list is cut. Otherwise the color list is filled repeatedly with
1.15 ///the default color list. (The colors can be changed later on.)
1.16 - ///\param have_white indicates whether white is amongst the
1.17 - ///provided color (\c true) or not (\c false). If it is true,
1.18 - ///white will be assigned to \c 0.
1.19 Palette(bool have_white=false,int num=-1)
1.20 {
1.21 if (num==0) return;
1.22 @@ -173,7 +173,7 @@
1.23 {
1.24 colors[i%colors.size()]=c;
1.25 }
1.26 - ///\e
1.27 + ///Add a new color to the end of the color list.
1.28 void add(const Color &c)
1.29 {
1.30 colors.push_back(c);
1.31 @@ -185,7 +185,7 @@
1.32 int size() const { return int(colors.size());}
1.33 };
1.34
1.35 - ///Returns a visible distinct \ref Color
1.36 + ///Returns a visibly distinct \ref Color
1.37
1.38 ///Returns a \ref Color which is as different from the given parameter
1.39 ///as it is possible.
2.1 --- a/lemon/graph_to_eps.h Mon Apr 14 11:23:56 2008 +0100
2.2 +++ b/lemon/graph_to_eps.h Sun Apr 13 08:20:43 2008 +0100
2.3 @@ -43,9 +43,7 @@
2.4
2.5 ///\ingroup eps_io
2.6 ///\file
2.7 -///\brief Simple graph drawer
2.8 -///
2.9 -///\author Alpar Juttner
2.10 +///\brief A well configurable tool for visualizing graphs
2.11
2.12 namespace lemon {
2.13
2.14 @@ -172,16 +170,9 @@
2.15 {}
2.16 };
2.17
2.18 -///Helper class to implement the named parameters of \ref graphToEps()
2.19 +///Auxiliary class to implement the named parameters of \ref graphToEps()
2.20
2.21 -///Helper class to implement the named parameters of \ref graphToEps()
2.22 -///\todo Is 'helper class' a good name for this?
2.23 -///
2.24 -///\todo Follow PostScript's DSC.
2.25 -/// Use own dictionary.
2.26 -///\todo Useful new features.
2.27 -/// - Linestyles: dotted, dashed etc.
2.28 -/// - A second color and percent value for the lines.
2.29 +///Auxiliary class to implement the named parameters of \ref graphToEps()
2.30 template<class T> class GraphToEps : public T
2.31 {
2.32 // Can't believe it is required by the C++ standard
2.33 @@ -369,7 +360,7 @@
2.34 ///Sets the map of the node shapes
2.35
2.36 ///Sets the map of the node shapes.
2.37 - ///The availabe shape values
2.38 + ///The available shape values
2.39 ///can be found in \ref NodeShapes "enum NodeShapes".
2.40 ///\param x must be a node map with \c int (or convertible) values.
2.41 ///\sa NodeShapes
2.42 @@ -411,8 +402,6 @@
2.43 ///ostream.
2.44 ///
2.45 ///\sa nodePsTextsPreamble()
2.46 - ///\todo Offer the choise not to move to the centre but pass the coordinates
2.47 - ///to the Postscript block inserted.
2.48 template<class X> GraphToEps<NodePsTextsTraits<X> > nodePsTexts(const X &x)
2.49 {
2.50 dontPrint=true;
2.51 @@ -521,13 +510,11 @@
2.52
2.53 ///Negates the Y coordinates.
2.54 ///
2.55 - ///\todo More docs.
2.56 - ///
2.57 GraphToEps<T> &negateY(bool b=true) {
2.58 _negY=b;return *this;
2.59 }
2.60
2.61 - ///Turn on/off prescaling
2.62 + ///Turn on/off pre-scaling
2.63
2.64 ///By default graphToEps() rescales the whole image in order to avoid
2.65 ///very big or very small bounding boxes.
2.66 @@ -578,7 +565,7 @@
2.67
2.68 ///Sets the width of the border around the picture
2.69 ///
2.70 - GraphToEps<T> &border(double b) {_xBorder=_yBorder=b;return *this;}
2.71 + GraphToEps<T> &border(double b=10) {_xBorder=_yBorder=b;return *this;}
2.72 ///Sets the width of the border around the picture
2.73
2.74 ///Sets the width of the border around the picture
2.75 @@ -595,12 +582,12 @@
2.76
2.77 ///Sets the length of the arrowheads
2.78 ///
2.79 - GraphToEps<T> &arrowLength(double d) {_arrowLength*=d;return *this;}
2.80 + GraphToEps<T> &arrowLength(double d=1.0) {_arrowLength*=d;return *this;}
2.81 ///Sets the width of the arrowheads
2.82
2.83 ///Sets the width of the arrowheads
2.84 ///
2.85 - GraphToEps<T> &arrowWidth(double d) {_arrowWidth*=d;return *this;}
2.86 + GraphToEps<T> &arrowWidth(double d=.3) {_arrowWidth*=d;return *this;}
2.87
2.88 ///Scales the drawing to fit to A4 page
2.89
2.90 @@ -662,16 +649,23 @@
2.91 }
2.92 ///Sets whether the the graph is undirected
2.93
2.94 - ///Sets whether the the graph is undirected
2.95 + ///Sets whether the the graph is undirected.
2.96 ///
2.97 - GraphToEps<T> &undirected(bool b=true) {_undirected=b;return *this;}
2.98 + ///This setting is the default for undirected graphs.
2.99 + ///
2.100 + ///\sa directed()
2.101 + GraphToEps<T> &undirected(bool b=true) {_undirected=b;return *this;}
2.102
2.103 ///Sets whether the the graph is directed
2.104
2.105 ///Sets whether the the graph is directed.
2.106 ///Use it to show the edges as a pair of directed ones.
2.107 + ///
2.108 + ///This setting is the default for digraphs.
2.109 + ///
2.110 + ///\sa undirected()
2.111 GraphToEps<T> &directed(bool b=true) {_undirected=!b;return *this;}
2.112 -
2.113 +
2.114 ///Sets the title.
2.115
2.116 ///Sets the title of the generated image,
2.117 @@ -683,7 +677,6 @@
2.118 ///Sets the copyright statement of the generated image,
2.119 ///namely it inserts a <tt>%%Copyright:</tt> DSC field to the header of
2.120 ///the EPS file.
2.121 - ///\todo Multiline copyright notice could be supported.
2.122 GraphToEps<T> ©right(const std::string &t) {_copyright=t;return *this;}
2.123
2.124 protected:
2.125 @@ -709,10 +702,10 @@
2.126
2.127 ///Like other functions using
2.128 ///\ref named-templ-func-param "named template parameters",
2.129 - ///this function calles the algorithm itself, i.e. in this case
2.130 + ///this function calls the algorithm itself, i.e. in this case
2.131 ///it draws the graph.
2.132 void run() {
2.133 - ///\todo better 'epsilon' would be nice here.
2.134 + //\todo better 'epsilon' would be nice here.
2.135 const double EPSILON=1e-9;
2.136 if(dontPrint) return;
2.137
2.138 @@ -930,7 +923,7 @@
2.139 dim2::Point<double>
2.140 dvec(mycoords[g.target(*i)]-mycoords[g.source(*i)]);
2.141 double l=std::sqrt(dvec.normSquare());
2.142 - ///\todo better 'epsilon' would be nice here.
2.143 + //\todo better 'epsilon' would be nice here.
2.144 dim2::Point<double> d(dvec/std::max(l,EPSILON));
2.145 dim2::Point<double> m;
2.146 // m=dim2::Point<double>(mycoords[g.target(*i)]+mycoords[g.source(*i)])/2.0;