Correct bad arrow enpoint when parallel edges are enabled.
2 * src/lemon/graph_to_eps.h - Part of LEMON, a generic C++ optimization library
4 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Combinatorial Optimization Research Group, EGRES).
7 * Permission to use, modify and distribute this software is granted
8 * provided that this copyright notice appears in all copies. For
9 * precise terms see the accompanying LICENSE file.
11 * This software is provided "AS IS" with no warranty of any kind,
12 * express or implied, and with no claim as to its suitability for any
17 #ifndef LEMON_GRAPH_TO_EPS_H
18 #define LEMON_GRAPH_TO_EPS_H
27 #include<lemon/maps.h>
28 #include<lemon/bezier.h>
32 ///\brief Simple graph drawer
34 ///\author Alpar Juttner
38 ///Data structure representing RGB colors.
40 ///Data structure representing RGB colors.
46 ///Default constructor
49 Color(double r,double g,double b) :_r(r),_g(g),_b(b) {};
50 ///Returns the red component
51 double getR() {return _r;}
52 ///Returns the green component
53 double getG() {return _g;}
54 ///Returns the blue component
55 double getB() {return _b;}
56 ///Set the color components
57 void set(double r,double g,double b) { _r=r;_g=g;_b=b; };
60 ///Default traits class of \ref GraphToEps
62 ///Default traits class of \ref GraphToEps
64 ///\c G is the type of the underlying graph.
66 struct DefaultGraphToEpsTraits
69 typedef typename Graph::Node Node;
70 typedef typename Graph::NodeIt NodeIt;
71 typedef typename Graph::Edge Edge;
72 typedef typename Graph::EdgeIt EdgeIt;
73 typedef typename Graph::InEdgeIt InEdgeIt;
74 typedef typename Graph::OutEdgeIt OutEdgeIt;
81 ConstMap<typename Graph::Node,xy<double> > _coords;
82 ConstMap<typename Graph::Node,double > _nodeSizes;
83 ConstMap<typename Graph::Node,int > _nodeShapes;
85 ConstMap<typename Graph::Node,Color > _nodeColors;
86 ConstMap<typename Graph::Edge,Color > _edgeColors;
88 ConstMap<typename Graph::Edge,double > _edgeWidths;
90 double _edgeWidthScale;
93 double _xBorder, _yBorder;
95 double _nodeBorderQuotient;
98 double _arrowLength, _arrowWidth;
100 bool _showNodes, _showEdges;
102 bool _enableParallel;
106 ConstMap<typename Graph::Node,bool > _nodeTexts;
107 double _nodeTextSize;
109 bool _showNodePsText;
110 ConstMap<typename Graph::Node,bool > _nodePsTexts;
111 char *_nodePsTextsPreamble;
114 bool _pleaseRemoveOsStream;
118 ///\param _g is a reference to the graph to be printed
119 ///\param _os is a reference to the output stream.
120 ///\param _os is a reference to the output stream.
121 ///\param _pros If it is \c true, then the \c ostream referenced by \c _os
122 ///will be explicitly deallocated by the destructor.
123 ///By default it is <tt>std::cout</tt>
124 DefaultGraphToEpsTraits(const G &_g,std::ostream& _os=std::cout,
127 _coords(xy<double>(1,1)), _nodeSizes(1.0), _nodeShapes(0),
128 _nodeColors(Color(1,1,1)), _edgeColors(Color(0,0,0)),
129 _edgeWidths(1), _edgeWidthScale(0.3),
130 _nodeScale(1.0), _xBorder(10), _yBorder(10), _scale(1.0),
131 _nodeBorderQuotient(.1),
132 _drawArrows(false), _arrowLength(1), _arrowWidth(0.3),
133 _showNodes(true), _showEdges(true),
134 _enableParallel(false), _parEdgeDist(1),
135 _showNodeText(false), _nodeTexts(false), _nodeTextSize(1),
136 _showNodePsText(false), _nodePsTexts(false), _nodePsTextsPreamble(0),
138 _pleaseRemoveOsStream(_pros) {}
141 ///Helper class to implement the named parameters of \ref graphToEps()
143 ///Helper class to implement the named parameters of \ref graphToEps()
144 ///\todo Is 'helper class' a good name for this?
146 template<class T> class GraphToEps : public T
148 typedef typename T::Graph Graph;
149 typedef typename Graph::Node Node;
150 typedef typename Graph::NodeIt NodeIt;
151 typedef typename Graph::Edge Edge;
152 typedef typename Graph::EdgeIt EdgeIt;
153 typedef typename Graph::InEdgeIt InEdgeIt;
154 typedef typename Graph::OutEdgeIt OutEdgeIt;
156 static const int INTERPOL_PREC=20;
160 enum NodeShapes { CIRCLE=0, SQUARE=1 };
165 edgeLess(const Graph &_g) : g(_g) {}
166 bool operator()(Edge a,Edge b) const
168 Node ai=min(g.source(a),g.target(a));
169 Node aa=max(g.source(a),g.target(a));
170 Node bi=min(g.source(b),g.target(b));
171 Node ba=max(g.source(b),g.target(b));
173 (ai==bi && (aa < ba ||
174 (aa==ba && ai==g.source(a) && bi==g.target(b))));
177 bool isParallel(Edge e,Edge f) const
179 return (g.source(e)==g.source(f)&&g.target(e)==g.target(f))||
180 (g.source(e)==g.target(f)&&g.target(e)==g.source(f));
182 static xy<double> rot(xy<double> v)
184 return xy<double>(v.y,-v.x);
187 static std::string psOut(const xy &p)
189 std::ostringstream os;
190 os << p.x << ' ' << p.y;
195 GraphToEps(const T &t) : T(t), dontPrint(false) {};
197 template<class X> struct CoordsTraits : public T {
199 CoordsTraits(const T &t,const X &x) : T(t), _coords(x) {}
201 ///Sets the map of the node coordinates
203 ///Sets the map of the node coordinates.
204 ///\param x must be a node map with xy<double> or xy<int> values.
205 template<class X> GraphToEps<CoordsTraits<X> > coords(const X &x) {
207 return GraphToEps<CoordsTraits<X> >(CoordsTraits<X>(*this,x));
209 template<class X> struct NodeSizesTraits : public T {
211 NodeSizesTraits(const T &t,const X &x) : T(t), _nodeSizes(x) {}
213 ///Sets the map of the node sizes
215 ///Sets the map of the node sizes
216 ///\param x must be a node map with \c double (or convertible) values.
217 template<class X> GraphToEps<NodeSizesTraits<X> > nodeSizes(const X &x)
220 return GraphToEps<NodeSizesTraits<X> >(NodeSizesTraits<X>(*this,x));
222 template<class X> struct NodeShapesTraits : public T {
223 const X &_nodeShapes;
224 NodeShapesTraits(const T &t,const X &x) : T(t), _nodeShapes(x) {}
226 ///Sets the map of the node shapes
228 ///Sets the map of the node shapes
229 ///\param x must be a node map with \c int (or convertible) values.
230 ///\todo Incomplete doc.
231 template<class X> GraphToEps<NodeShapesTraits<X> > nodeShapes(const X &x)
234 return GraphToEps<NodeShapesTraits<X> >(NodeShapesTraits<X>(*this,x));
236 template<class X> struct NodeTextsTraits : public T {
238 NodeTextsTraits(const T &t,const X &x) : T(t), _nodeTexts(x) {}
240 ///Sets the text printed on the nodes
242 ///Sets the text printed on the nodes
243 ///\param x must be a node map with type that can be pushed to a standard
245 template<class X> GraphToEps<NodeTextsTraits<X> > nodeTexts(const X &x)
249 return GraphToEps<NodeTextsTraits<X> >(NodeTextsTraits<X>(*this,x));
251 template<class X> struct NodePsTextsTraits : public T {
252 const X &_nodePsTexts;
253 NodePsTextsTraits(const T &t,const X &x) : T(t), _nodePsTexts(x) {}
255 ///Inserts a PostScript block to the nodes
257 ///With this command it is possible to insert a verbatim PostScript
258 ///block to the nodes.
259 ///The PS current point will be moved to the centre of the node before
260 ///the PostScript block inserted.
262 ///Before and after the block a newline character is inserted to you
263 ///don't have to bother with the separators.
265 ///\param x must be a node map with type that can be pushed to a standard
268 ///\sa nodePsTextsPreamble()
269 ///\todo Offer the choise not to move to the centre but pass the coordinates
270 ///to the Postscript block inserted.
271 template<class X> GraphToEps<NodePsTextsTraits<X> > nodePsTexts(const X &x)
274 _showNodePsText=true;
275 return GraphToEps<NodePsTextsTraits<X> >(NodePsTextsTraits<X>(*this,x));
277 template<class X> struct EdgeWidthsTraits : public T {
278 const X &_edgeWidths;
279 EdgeWidthsTraits(const T &t,const X &x) : T(t), _edgeWidths(x) {}
281 ///Sets the map of the edge widths
283 ///Sets the map of the edge widths
284 ///\param x must be a edge map with \c double (or convertible) values.
285 template<class X> GraphToEps<EdgeWidthsTraits<X> > edgeWidths(const X &x)
288 return GraphToEps<EdgeWidthsTraits<X> >(EdgeWidthsTraits<X>(*this,x));
291 template<class X> struct NodeColorsTraits : public T {
292 const X &_nodeColors;
293 NodeColorsTraits(const T &t,const X &x) : T(t), _nodeColors(x) {}
295 ///Sets the map of the node colors
297 ///Sets the map of the node colors
298 ///\param x must be a node map with \ref Color values.
299 template<class X> GraphToEps<NodeColorsTraits<X> >
300 nodeColors(const X &x)
303 return GraphToEps<NodeColorsTraits<X> >(NodeColorsTraits<X>(*this,x));
305 template<class X> struct EdgeColorsTraits : public T {
306 const X &_edgeColors;
307 EdgeColorsTraits(const T &t,const X &x) : T(t), _edgeColors(x) {}
309 ///Sets the map of the edge colors
311 ///Sets the map of the edge colors
312 ///\param x must be a edge map with \ref Color values.
313 template<class X> GraphToEps<EdgeColorsTraits<X> >
314 edgeColors(const X &x)
317 return GraphToEps<EdgeColorsTraits<X> >(EdgeColorsTraits<X>(*this,x));
319 ///Sets a global scale factor for node sizes
321 ///Sets a global scale factor for node sizes
323 GraphToEps<T> &nodeScale(double d) {_nodeScale=d;return *this;}
324 ///Sets a global scale factor for edge widths
326 ///Sets a global scale factor for edge widths
328 GraphToEps<T> &edgeWidthScale(double d) {_edgeWidthScale=d;return *this;}
329 ///Sets a global scale factor for the whole picture
331 ///Sets a global scale factor for the whole picture
333 GraphToEps<T> &scale(double d) {_scale=d;return *this;}
334 ///Sets the width of the border around the picture
336 ///Sets the width of the border around the picture
338 GraphToEps<T> &border(double b) {_xBorder=_yBorder=b;return *this;}
339 ///Sets the width of the border around the picture
341 ///Sets the width of the border around the picture
343 GraphToEps<T> &border(double x, double y) {
344 _xBorder=x;_yBorder=y;return *this;
346 ///Sets whether to draw arrows
348 ///Sets whether to draw arrows
350 GraphToEps<T> &drawArrows(bool b=true) {_drawArrows=b;return *this;}
351 ///Sets the length of the arrowheads
353 ///Sets the length of the arrowheads
355 GraphToEps<T> &arrowLength(double d) {_arrowLength*=d;return *this;}
356 ///Sets the width of the arrowheads
358 ///Sets the width of the arrowheads
360 GraphToEps<T> &arrowWidth(double d) {_arrowWidth*=d;return *this;}
362 ///Enables parallel edges
364 ///Enables parallel edges
365 ///\todo Partially implemented
366 GraphToEps<T> &enableParallel(bool b=true) {_enableParallel=b;return *this;}
372 GraphToEps<T> &parEdgeDist(double d) {_parEdgeDist*=d;return *this;}
378 GraphToEps<T> &hideEdges(bool b=true) {_showEdges=!b;return *this;}
383 GraphToEps<T> &hideNodes(bool b=true) {_showNodes=!b;return *this;}
385 ///Sets the size of the node texts
387 ///Sets the size of the node texts
389 GraphToEps<T> &nodeTextSize(double d) {_nodeTextSize=d;return *this;}
390 ///Gives a preamble block for node Postscript block.
392 ///Gives a preamble block for node Postscript block.
395 GraphToEps<T> & nodePsTextsPreamble(const char *str) {
396 _nodePsTextsPreamble=s ;return *this;
398 ///Sets whether the the graph is undirected
400 ///Sets whether the the graph is undirected
402 GraphToEps<T> &undir(bool b=true) {_undir=b;return *this;}
403 ///Sets whether the the graph is directed
405 ///Sets whether the the graph is directed.
406 ///Use it to show the undirected edges as a pair of directed ones.
407 GraphToEps<T> &bidir(bool b=true) {_undir=!b;return *this;}
410 bool isInsideNode(xy<double> p, double r,int t)
414 return p.normSquare()<=r*r;
416 return p.x<=r&&p.x>=-r&&p.y<=r&&p.y>=-r;
424 if(dontPrint) return;
426 os << "%!PS-Adobe-2.0 EPSF-2.0\n";
427 //\todo: Chech whether the graph is empty.
428 BoundingBox<double> bb;
429 for(NodeIt n(g);n!=INVALID;++n) {
430 double ns=_nodeSizes[n]*_nodeScale;
435 os << "%%BoundingBox: "
436 << bb.left()* _scale-_xBorder << ' '
437 << bb.bottom()*_scale-_yBorder << ' '
438 << bb.right()* _scale+_xBorder << ' '
439 << bb.top()* _scale+_yBorder << '\n';
440 //x1 y1 x2 y2 x3 y3 cr cg cb w
441 os << "/lb { setlinewidth setrgbcolor newpath moveto\n"
442 << " 4 2 roll 1 index 1 index curveto stroke } bind def\n";
443 os << "/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def\n";
445 os << "/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def\n";
447 os << "/sq { newpath 2 index 1 index add 2 index 2 index add moveto\n"
448 << " 2 index 1 index sub 2 index 2 index add lineto\n"
449 << " 2 index 1 index sub 2 index 2 index sub lineto\n"
450 << " 2 index 1 index add 2 index 2 index sub lineto\n"
451 << " closepath pop pop pop} bind def\n";
453 os << "/nc { setrgbcolor 2 index 2 index 2 index c fill\n"
454 << " 0 0 0 setrgbcolor dup "
455 << _nodeBorderQuotient << " mul setlinewidth "
456 << 1+_nodeBorderQuotient/2 << " div c stroke\n"
458 os << "/nsq { setrgbcolor 2 index 2 index 2 index sq fill\n"
459 << " 0 0 0 setrgbcolor dup "
460 << _nodeBorderQuotient << " mul setlinewidth "
461 << 1+_nodeBorderQuotient/2 << " div sq stroke\n"
463 os << "/arrl " << _arrowLength << " def\n";
464 os << "/arrw " << _arrowWidth << " def\n";
466 os << "/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def\n";
467 //len w dx_norm dy_norm x1 y1 cr cg cb
468 os << "/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def\n"
469 << " /w exch def /len exch def\n"
470 // << " 0.1 setlinewidth x1 y1 moveto dx len mul dy len mul rlineto stroke"
471 << " newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto\n"
472 << " len w sub arrl sub dx dy lrl\n"
473 << " arrw dy dx neg lrl\n"
474 << " dx arrl w add mul dy w 2 div arrw add mul sub\n"
475 << " dy arrl w add mul dx w 2 div arrw add mul add rlineto\n"
476 << " dx arrl w add mul neg dy w 2 div arrw add mul sub\n"
477 << " dy arrl w add mul neg dx w 2 div arrw add mul add rlineto\n"
478 << " arrw dy dx neg lrl\n"
479 << " len w sub arrl sub neg dx dy lrl\n"
480 << " closepath fill } bind def\n";
481 os << "/cshow { 2 index 2 index moveto dup stringwidth pop\n"
482 << " neg 2 div fosi .35 mul neg rmoveto show pop pop} def\n";
485 if(_scale!=1.0) os << _scale << " dup scale\n";
488 os << "%Edges:\ngsave\n";
489 if(_enableParallel) {
490 std::vector<Edge> el;
491 for(EdgeIt e(g);e!=INVALID;++e)
492 if(!_undir||g.source(e)<g.target(e)) el.push_back(e);
493 sort(el.begin(),el.end(),edgeLess(g));
495 typename std::vector<Edge>::iterator j;
496 for(typename std::vector<Edge>::iterator i=el.begin();i!=el.end();i=j) {
497 for(j=i+1;j!=el.end()&&isParallel(*i,*j);++j) ;
500 for(typename std::vector<Edge>::iterator e=i;e!=j;++e)
501 sw+=_edgeWidths[*e]*_edgeWidthScale+_parEdgeDist;
504 xy<double> dvec(_coords[g.target(*i)]-_coords[g.source(*i)]);
505 double l=sqrt(dvec.normSquare());
506 xy<double> d(dvec/l);
508 // m=xy<double>(_coords[g.target(*i)]+_coords[g.source(*i)])/2.0;
510 // m=xy<double>(_coords[g.source(*i)])+
511 // dvec*(double(_nodeSizes[g.source(*i)])/
512 // (_nodeSizes[g.source(*i)]+_nodeSizes[g.target(*i)]));
514 m=xy<double>(_coords[g.source(*i)])+
515 d*(l+_nodeSizes[g.source(*i)]-_nodeSizes[g.target(*i)])/2.0;
517 for(typename std::vector<Edge>::iterator e=i;e!=j;++e) {
518 sw+=_edgeWidths[*e]*_edgeWidthScale/2.0;
519 xy<double> mm=m+rot(d)*sw/.75;
522 xy<double> s=_coords[g.source(*e)];
523 xy<double> t=_coords[g.target(*e)];
524 double rn=_nodeSizes[g.target(*e)]*_nodeScale;
525 node_shape=_nodeShapes[g.target(*e)];
526 Bezier3 bez(s,mm,mm,t);
528 for(int i=0;i<INTERPOL_PREC;++i)
529 if(isInsideNode(bez((t1+t2)/2)-t,rn,node_shape)) t2=(t1+t2)/2;
531 xy<double> apoint=bez((t1+t2)/2);
532 rn = _arrowLength+_edgeWidths[*e]*_edgeWidthScale;
535 for(int i=0;i<INTERPOL_PREC;++i)
536 if((bez((t1+t2)/2)-apoint).normSquare()>rn) t1=(t1+t2)/2;
538 xy<double> linend=bez((t1+t2)/2);
539 bez=bez.before((t1+t2)/2);
540 // rn=_nodeSizes[g.source(*e)]*_nodeScale;
541 // node_shape=_nodeShapes[g.source(*e)];
543 // for(int i=0;i<INTERPOL_PREC;++i)
544 // if(isInsideNode(bez((t1+t2)/2)-t,rn,node_shape)) t1=(t1+t2)/2;
545 // else t2=(t1+t2)/2;
546 // bez=bez.after((t1+t2)/2);
547 os << _edgeWidths[*e]*_edgeWidthScale << " setlinewidth "
548 << _edgeColors[*e].getR() << ' '
549 << _edgeColors[*e].getG() << ' '
550 << _edgeColors[*e].getB() << " setrgbcolor newpath\n"
551 << bez.p1.x << ' ' << bez.p1.y << " moveto\n"
552 << bez.p2.x << ' ' << bez.p2.y << ' '
553 << bez.p3.x << ' ' << bez.p3.y << ' '
554 << bez.p4.x << ' ' << bez.p4.y << " curveto stroke\n";
555 xy<double> dd(rot(linend-apoint));
556 dd*=(_edgeWidths[*e]*_edgeWidthScale+_arrowWidth)/
557 sqrt(dd.normSquare());
558 os << "newpath " << psOut(apoint) << " moveto "
559 << psOut(linend+dd) << " lineto "
560 << psOut(linend-dd) << " lineto closepath fill\n";
563 os << _coords[g.source(*e)].x << ' '
564 << _coords[g.source(*e)].y << ' '
565 << mm.x << ' ' << mm.y << ' '
566 << _coords[g.target(*e)].x << ' '
567 << _coords[g.target(*e)].y << ' '
568 << _edgeColors[*e].getR() << ' '
569 << _edgeColors[*e].getG() << ' '
570 << _edgeColors[*e].getB() << ' '
571 << _edgeWidths[*e]*_edgeWidthScale << " lb\n";
573 sw+=_edgeWidths[*e]*_edgeWidthScale/2.0+_parEdgeDist;
577 else for(EdgeIt e(g);e!=INVALID;++e)
578 if(!_undir||g.source(e)<g.target(e))
580 xy<double> d(_coords[g.target(e)]-_coords[g.source(e)]);
581 double rn=_nodeSizes[g.target(e)]*_nodeScale;
582 int node_shape=_nodeShapes[g.target(e)];
584 for(int i=0;i<INTERPOL_PREC;++i)
585 if(isInsideNode((-(t1+t2)/2)*d,rn,node_shape)) t1=(t1+t2)/2;
587 double l=sqrt(d.normSquare());
590 os << l*(1-(t1+t2)/2) << ' '
591 << _edgeWidths[e]*_edgeWidthScale << ' '
592 << d.x << ' ' << d.y << ' '
593 << _coords[g.source(e)].x << ' '
594 << _coords[g.source(e)].y << ' '
595 << _edgeColors[e].getR() << ' '
596 << _edgeColors[e].getG() << ' '
597 << _edgeColors[e].getB() << " arr\n";
599 else os << _coords[g.source(e)].x << ' '
600 << _coords[g.source(e)].y << ' '
601 << _coords[g.target(e)].x << ' '
602 << _coords[g.target(e)].y << ' '
603 << _edgeColors[e].getR() << ' '
604 << _edgeColors[e].getG() << ' '
605 << _edgeColors[e].getB() << ' '
606 << _edgeWidths[e]*_edgeWidthScale << " l\n";
610 os << "%Nodes:\ngsave\n";
611 for(NodeIt n(g);n!=INVALID;++n) {
612 os << _coords[n].x << ' ' << _coords[n].y << ' '
613 << _nodeSizes[n]*_nodeScale << ' '
614 << _nodeColors[n].getR() << ' '
615 << _nodeColors[n].getG() << ' '
616 << _nodeColors[n].getB() << ' ';
617 switch(_nodeShapes[n]) {
628 os << "%Node texts:\ngsave\n";
629 os << "/fosi " << _nodeTextSize << " def\n";
630 os << "(Helvetica) findfont fosi scalefont setfont\n";
631 os << "0 0 0 setrgbcolor\n";
632 for(NodeIt n(g);n!=INVALID;++n)
633 os << _coords[n].x << ' ' << _coords[n].y
634 << " (" << _nodeTexts[n] << ") cshow\n";
637 if(_showNodePsText) {
638 os << "%Node PS blocks:\ngsave\n";
639 for(NodeIt n(g);n!=INVALID;++n)
640 os << _coords[n].x << ' ' << _coords[n].y
641 << " moveto\n" << _nodePsTexts[n] << "\n";
648 if(_pleaseRemoveOsStream) {delete &os;}
653 ///Generates an EPS file from a graph
656 ///Generates an EPS file from a graph.
657 ///\param g is a reference to the graph to be printed
658 ///\param os is a reference to the output stream.
659 ///By default it is <tt>std::cout</tt>
661 ///This function also has a lot of \ref named-templ-param "named parameters",
662 ///they are declared as the members of class \ref GraphToEps. The following
663 ///example shows how to use these parameters.
665 /// graphToEps(g).scale(10).coords(coords)
666 /// .nodeScale(2).nodeSizes(sizes)
667 /// .edgeWidthScale(.4);
670 ///\sa graphToEps(G &g, char *file_name)
672 GraphToEps<DefaultGraphToEpsTraits<G> >
673 graphToEps(G &g, std::ostream& os=std::cout)
676 GraphToEps<DefaultGraphToEpsTraits<G> >(DefaultGraphToEpsTraits<G>(g,os));
679 ///Generates an EPS file from a graph
682 ///This function does the same as
683 ///\ref graphToEps(G &g,std::ostream& os)
684 ///but it writes its output into the file \c file_name
685 ///instead of a stream.
686 ///\sa graphToEps(G &g, std::ostream& os)
688 GraphToEps<DefaultGraphToEpsTraits<G> >
689 graphToEps(G &g,char *file_name)
691 return GraphToEps<DefaultGraphToEpsTraits<G> >
692 (DefaultGraphToEpsTraits<G>(g,*new std::ofstream(file_name),true));
695 } //END OF NAMESPACE LEMON
697 #endif // LEMON_GRAPH_TO_EPS_H