1.1 --- a/lemon/graph_to_eps.h Thu Mar 05 10:13:20 2009 +0000
1.2 +++ b/lemon/graph_to_eps.h Sun Mar 29 23:08:20 2009 +0200
1.3 @@ -64,11 +64,11 @@
1.4
1.5 ///Default traits class of \ref GraphToEps.
1.6 ///
1.7 -///\c G is the type of the underlying graph.
1.8 -template<class G>
1.9 +///\param GR is the type of the underlying graph.
1.10 +template<class GR>
1.11 struct DefaultGraphToEpsTraits
1.12 {
1.13 - typedef G Graph;
1.14 + typedef GR Graph;
1.15 typedef typename Graph::Node Node;
1.16 typedef typename Graph::NodeIt NodeIt;
1.17 typedef typename Graph::Arc Arc;
1.18 @@ -139,15 +139,14 @@
1.19 ///Constructor
1.20
1.21 ///Constructor
1.22 - ///\param _g Reference to the graph to be printed.
1.23 - ///\param _os Reference to the output stream.
1.24 - ///\param _os Reference to the output stream.
1.25 + ///\param gr Reference to the graph to be printed.
1.26 + ///\param ost Reference to the output stream.
1.27 ///By default it is <tt>std::cout</tt>.
1.28 - ///\param _pros If it is \c true, then the \c ostream referenced by \c _os
1.29 + ///\param pros If it is \c true, then the \c ostream referenced by \c os
1.30 ///will be explicitly deallocated by the destructor.
1.31 - DefaultGraphToEpsTraits(const G &_g,std::ostream& _os=std::cout,
1.32 - bool _pros=false) :
1.33 - g(_g), os(_os),
1.34 + DefaultGraphToEpsTraits(const GR &gr, std::ostream& ost = std::cout,
1.35 + bool pros = false) :
1.36 + g(gr), os(ost),
1.37 _coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0),
1.38 _nodeColors(WHITE), _arcColors(BLACK),
1.39 _arcWidths(1.0), _arcWidthScale(0.003),
1.40 @@ -158,8 +157,8 @@
1.41 _enableParallel(false), _parArcDist(1),
1.42 _showNodeText(false), _nodeTexts(false), _nodeTextSize(1),
1.43 _showNodePsText(false), _nodePsTexts(false), _nodePsTextsPreamble(0),
1.44 - _undirected(lemon::UndirectedTagIndicator<G>::value),
1.45 - _pleaseRemoveOsStream(_pros), _scaleToA4(false),
1.46 + _undirected(lemon::UndirectedTagIndicator<GR>::value),
1.47 + _pleaseRemoveOsStream(pros), _scaleToA4(false),
1.48 _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK),
1.49 _autoNodeScale(false),
1.50 _autoArcWidthScale(false),
1.51 @@ -1134,55 +1133,55 @@
1.52 ///\warning Don't forget to put the \ref GraphToEps::run() "run()"
1.53 ///to the end of the parameter list.
1.54 ///\sa GraphToEps
1.55 -///\sa graphToEps(G &g, const char *file_name)
1.56 -template<class G>
1.57 -GraphToEps<DefaultGraphToEpsTraits<G> >
1.58 -graphToEps(G &g, std::ostream& os=std::cout)
1.59 +///\sa graphToEps(GR &g, const char *file_name)
1.60 +template<class GR>
1.61 +GraphToEps<DefaultGraphToEpsTraits<GR> >
1.62 +graphToEps(GR &g, std::ostream& os=std::cout)
1.63 {
1.64 return
1.65 - GraphToEps<DefaultGraphToEpsTraits<G> >(DefaultGraphToEpsTraits<G>(g,os));
1.66 + GraphToEps<DefaultGraphToEpsTraits<GR> >(DefaultGraphToEpsTraits<GR>(g,os));
1.67 }
1.68
1.69 ///Generates an EPS file from a graph
1.70
1.71 ///\ingroup eps_io
1.72 ///This function does the same as
1.73 -///\ref graphToEps(G &g,std::ostream& os)
1.74 +///\ref graphToEps(GR &g,std::ostream& os)
1.75 ///but it writes its output into the file \c file_name
1.76 ///instead of a stream.
1.77 -///\sa graphToEps(G &g, std::ostream& os)
1.78 -template<class G>
1.79 -GraphToEps<DefaultGraphToEpsTraits<G> >
1.80 -graphToEps(G &g,const char *file_name)
1.81 +///\sa graphToEps(GR &g, std::ostream& os)
1.82 +template<class GR>
1.83 +GraphToEps<DefaultGraphToEpsTraits<GR> >
1.84 +graphToEps(GR &g,const char *file_name)
1.85 {
1.86 std::ostream* os = new std::ofstream(file_name);
1.87 if (!(*os)) {
1.88 delete os;
1.89 throw IoError("Cannot write file", file_name);
1.90 }
1.91 - return GraphToEps<DefaultGraphToEpsTraits<G> >
1.92 - (DefaultGraphToEpsTraits<G>(g,*os,true));
1.93 + return GraphToEps<DefaultGraphToEpsTraits<GR> >
1.94 + (DefaultGraphToEpsTraits<GR>(g,*os,true));
1.95 }
1.96
1.97 ///Generates an EPS file from a graph
1.98
1.99 ///\ingroup eps_io
1.100 ///This function does the same as
1.101 -///\ref graphToEps(G &g,std::ostream& os)
1.102 +///\ref graphToEps(GR &g,std::ostream& os)
1.103 ///but it writes its output into the file \c file_name
1.104 ///instead of a stream.
1.105 -///\sa graphToEps(G &g, std::ostream& os)
1.106 -template<class G>
1.107 -GraphToEps<DefaultGraphToEpsTraits<G> >
1.108 -graphToEps(G &g,const std::string& file_name)
1.109 +///\sa graphToEps(GR &g, std::ostream& os)
1.110 +template<class GR>
1.111 +GraphToEps<DefaultGraphToEpsTraits<GR> >
1.112 +graphToEps(GR &g,const std::string& file_name)
1.113 {
1.114 std::ostream* os = new std::ofstream(file_name.c_str());
1.115 if (!(*os)) {
1.116 delete os;
1.117 throw IoError("Cannot write file", file_name);
1.118 }
1.119 - return GraphToEps<DefaultGraphToEpsTraits<G> >
1.120 - (DefaultGraphToEpsTraits<G>(g,*os,true));
1.121 + return GraphToEps<DefaultGraphToEpsTraits<GR> >
1.122 + (DefaultGraphToEpsTraits<GR>(g,*os,true));
1.123 }
1.124
1.125 } //END OF NAMESPACE LEMON