Changeset 606:c5fd2d996909 in lemon for lemon/graph_to_eps.h
- Timestamp:
- 03/29/09 23:08:20 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/graph_to_eps.h
r562 r606 65 65 ///Default traits class of \ref GraphToEps. 66 66 /// 67 ///\ c Gis the type of the underlying graph.68 template<class G >67 ///\param GR is the type of the underlying graph. 68 template<class GR> 69 69 struct DefaultGraphToEpsTraits 70 70 { 71 typedef G Graph;71 typedef GR Graph; 72 72 typedef typename Graph::Node Node; 73 73 typedef typename Graph::NodeIt NodeIt; … … 140 140 141 141 ///Constructor 142 ///\param _g Reference to the graph to be printed. 143 ///\param _os Reference to the output stream. 144 ///\param _os Reference to the output stream. 142 ///\param gr Reference to the graph to be printed. 143 ///\param ost Reference to the output stream. 145 144 ///By default it is <tt>std::cout</tt>. 146 ///\param _pros If it is \c true, then the \c ostream referenced by \c _os145 ///\param pros If it is \c true, then the \c ostream referenced by \c os 147 146 ///will be explicitly deallocated by the destructor. 148 DefaultGraphToEpsTraits(const G &_g,std::ostream& _os=std::cout,149 bool _pros=false) :150 g( _g), os(_os),147 DefaultGraphToEpsTraits(const GR &gr, std::ostream& ost = std::cout, 148 bool pros = false) : 149 g(gr), os(ost), 151 150 _coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0), 152 151 _nodeColors(WHITE), _arcColors(BLACK), … … 159 158 _showNodeText(false), _nodeTexts(false), _nodeTextSize(1), 160 159 _showNodePsText(false), _nodePsTexts(false), _nodePsTextsPreamble(0), 161 _undirected(lemon::UndirectedTagIndicator<G >::value),162 _pleaseRemoveOsStream( _pros), _scaleToA4(false),160 _undirected(lemon::UndirectedTagIndicator<GR>::value), 161 _pleaseRemoveOsStream(pros), _scaleToA4(false), 163 162 _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK), 164 163 _autoNodeScale(false), … … 1135 1134 ///to the end of the parameter list. 1136 1135 ///\sa GraphToEps 1137 ///\sa graphToEps(G &g, const char *file_name)1138 template<class G >1139 GraphToEps<DefaultGraphToEpsTraits<G > >1140 graphToEps(G &g, std::ostream& os=std::cout)1136 ///\sa graphToEps(GR &g, const char *file_name) 1137 template<class GR> 1138 GraphToEps<DefaultGraphToEpsTraits<GR> > 1139 graphToEps(GR &g, std::ostream& os=std::cout) 1141 1140 { 1142 1141 return 1143 GraphToEps<DefaultGraphToEpsTraits<G > >(DefaultGraphToEpsTraits<G>(g,os));1142 GraphToEps<DefaultGraphToEpsTraits<GR> >(DefaultGraphToEpsTraits<GR>(g,os)); 1144 1143 } 1145 1144 … … 1148 1147 ///\ingroup eps_io 1149 1148 ///This function does the same as 1150 ///\ref graphToEps(G &g,std::ostream& os)1149 ///\ref graphToEps(GR &g,std::ostream& os) 1151 1150 ///but it writes its output into the file \c file_name 1152 1151 ///instead of a stream. 1153 ///\sa graphToEps(G &g, std::ostream& os)1154 template<class G >1155 GraphToEps<DefaultGraphToEpsTraits<G > >1156 graphToEps(G &g,const char *file_name)1152 ///\sa graphToEps(GR &g, std::ostream& os) 1153 template<class GR> 1154 GraphToEps<DefaultGraphToEpsTraits<GR> > 1155 graphToEps(GR &g,const char *file_name) 1157 1156 { 1158 1157 std::ostream* os = new std::ofstream(file_name); … … 1161 1160 throw IoError("Cannot write file", file_name); 1162 1161 } 1163 return GraphToEps<DefaultGraphToEpsTraits<G > >1164 (DefaultGraphToEpsTraits<G >(g,*os,true));1162 return GraphToEps<DefaultGraphToEpsTraits<GR> > 1163 (DefaultGraphToEpsTraits<GR>(g,*os,true)); 1165 1164 } 1166 1165 … … 1169 1168 ///\ingroup eps_io 1170 1169 ///This function does the same as 1171 ///\ref graphToEps(G &g,std::ostream& os)1170 ///\ref graphToEps(GR &g,std::ostream& os) 1172 1171 ///but it writes its output into the file \c file_name 1173 1172 ///instead of a stream. 1174 ///\sa graphToEps(G &g, std::ostream& os)1175 template<class G >1176 GraphToEps<DefaultGraphToEpsTraits<G > >1177 graphToEps(G &g,const std::string& file_name)1173 ///\sa graphToEps(GR &g, std::ostream& os) 1174 template<class GR> 1175 GraphToEps<DefaultGraphToEpsTraits<GR> > 1176 graphToEps(GR &g,const std::string& file_name) 1178 1177 { 1179 1178 std::ostream* os = new std::ofstream(file_name.c_str()); … … 1182 1181 throw IoError("Cannot write file", file_name); 1183 1182 } 1184 return GraphToEps<DefaultGraphToEpsTraits<G > >1185 (DefaultGraphToEpsTraits<G >(g,*os,true));1183 return GraphToEps<DefaultGraphToEpsTraits<GR> > 1184 (DefaultGraphToEpsTraits<GR>(g,*os,true)); 1186 1185 } 1187 1186
Note: See TracChangeset
for help on using the changeset viewer.