diff -r 0a7d604a9763 -r d972653c89d5 src/lemon/graph_to_eps.h --- a/src/lemon/graph_to_eps.h Fri Jan 28 15:37:08 2005 +0000 +++ b/src/lemon/graph_to_eps.h Sat Jan 29 15:09:41 2005 +0000 @@ -152,7 +152,11 @@ ///\todo Is 'helper class' a good name for this? /// ///\todo Follow PostScript's DSC. -///\todo Use own dictionary. +/// Use own dictionary. +///\todo Provide a way to set %%Title: and %%Copyright:. Set %%CreationDate: +///\todo Useful new features. +/// - Linestyles: dotted, dashed etc. +/// - A second color and percent value for the lines. template class GraphToEps : public T { typedef typename T::Graph Graph; @@ -167,8 +171,29 @@ bool dontPrint; - enum NodeShapes { CIRCLE=0, SQUARE=1, DIAMOND=2 }; - +public: + ///Node shapes + + ///Node shapes + /// + enum NodeShapes { + /// = 0 + ///\image html nodeshape_0.png + ///\image latex nodeshape_0.eps "CIRCLE shape (0)" width=2cm + CIRCLE=0, + /// = 1 + ///\image html nodeshape_1.png + ///\image latex nodeshape_1.eps "SQUARE shape (1)" width=2cm + /// + SQUARE=1, + /// = 2 + ///\image html nodeshape_2.png + ///\image latex nodeshape_2.eps "DIAMOND shape (2)" width=2cm + /// + DIAMOND=2 + }; + +private: class edgeLess { const Graph &g; public: @@ -235,9 +260,11 @@ }; ///Sets the map of the node shapes - ///Sets the map of the node shapes + ///Sets the map of the node shapes. + ///The availabe shape values + ///can be found in \ref NodeShapes "enum NodeShapes". ///\param x must be a node map with \c int (or convertible) values. - ///\todo Incomplete doc. + ///\sa NodeShapes template GraphToEps > nodeShapes(const X &x) { dontPrint=true; @@ -449,7 +476,12 @@ if(dontPrint) return; os << "%!PS-Adobe-2.0 EPSF-2.0\n"; - //\todo: Chech whether the graph is empty. + os << "%%Title: LEMON GraphToEps figure\n" ///\todo setTitle() is needed +// << "%%Copyright: XXXX\n" + << "%%Creator: LEMON GraphToEps function\n" +// << "%%CreationDate: XXXXXXX\n" + ; + ///\todo: Chech whether the graph is empty. BoundingBox bb; for(NodeIt n(g);n!=INVALID;++n) { double ns=_nodeSizes[n]*_nodeScale; @@ -462,6 +494,9 @@ << bb.bottom()*_scale-_yBorder << ' ' << bb.right()* _scale+_xBorder << ' ' << bb.top()* _scale+_yBorder << '\n'; + + os << "%%EndComments\n"; + //x1 y1 x2 y2 x3 y3 cr cg cb w os << "/lb { setlinewidth setrgbcolor newpath moveto\n" << " 4 2 roll 1 index 1 index curveto stroke } bind def\n"; @@ -739,7 +774,7 @@ ///\sa graphToEps(G &g, std::ostream& os) template GraphToEps > -graphToEps(G &g,char *file_name) +graphToEps(G &g,const char *file_name) { return GraphToEps > (DefaultGraphToEpsTraits(g,*new std::ofstream(file_name),true));