Changeset 838:2c35bef44dd1 in lemon-main for lemon/graph_to_eps.h
- Timestamp:
- 02/21/10 18:55:30 (15 years ago)
- Branch:
- default
- Parents:
- 836:c841ae1aca29 (diff), 837:f58e01094738 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/graph_to_eps.h
r786 r838 685 685 #else 686 686 os << bits::getWinFormattedDate(); 687 os << std::endl; 687 688 #endif 688 689 } 689 os << std::endl;690 690 691 691 if (_autoArcWidthScale) { -
lemon/graph_to_eps.h
r837 r838 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-200 85 * Copyright (C) 2003-2009 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 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 typedef GR Digraph; 72 73 typedef typename Graph::Node Node; 73 74 typedef typename Graph::NodeIt NodeIt; … … 140 141 141 142 ///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. 145 ///By default it is <tt>std::cout</tt>. 146 ///\param _pros If it is \c true, then the \c ostream referenced by \c _os 143 ///\param gr Reference to the graph to be printed. 144 ///\param ost Reference to the output stream. 145 ///By default, it is <tt>std::cout</tt>. 146 ///\param pros If it is \c true, then the \c ostream referenced by \c os 147 147 ///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),148 DefaultGraphToEpsTraits(const GR &gr, std::ostream& ost = std::cout, 149 bool pros = false) : 150 g(gr), os(ost), 151 151 _coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0), 152 152 _nodeColors(WHITE), _arcColors(BLACK), … … 159 159 _showNodeText(false), _nodeTexts(false), _nodeTextSize(1), 160 160 _showNodePsText(false), _nodePsTexts(false), _nodePsTextsPreamble(0), 161 _undirected(lemon::UndirectedTagIndicator<G >::value),162 _pleaseRemoveOsStream( _pros), _scaleToA4(false),161 _undirected(lemon::UndirectedTagIndicator<GR>::value), 162 _pleaseRemoveOsStream(pros), _scaleToA4(false), 163 163 _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK), 164 164 _autoNodeScale(false), … … 243 243 244 244 typedef typename T::Graph Graph; 245 typedef typename T::Digraph Digraph; 245 246 typedef typename Graph::Node Node; 246 247 typedef typename Graph::NodeIt NodeIt; … … 270 271 ///\image html nodeshape_1.png 271 272 ///\image latex nodeshape_1.eps "SQUARE shape (1)" width=2cm 272 ///273 273 SQUARE=1, 274 274 /// = 2 275 275 ///\image html nodeshape_2.png 276 276 ///\image latex nodeshape_2.eps "DIAMOND shape (2)" width=2cm 277 ///278 277 DIAMOND=2, 279 278 /// = 3 280 279 ///\image html nodeshape_3.png 281 ///\image latex nodeshape_2.eps "MALE shape (4)" width=2cm 282 /// 280 ///\image latex nodeshape_3.eps "MALE shape (3)" width=2cm 283 281 MALE=3, 284 282 /// = 4 285 283 ///\image html nodeshape_4.png 286 ///\image latex nodeshape_2.eps "FEMALE shape (4)" width=2cm 287 /// 284 ///\image latex nodeshape_4.eps "FEMALE shape (4)" width=2cm 288 285 FEMALE=4 289 286 }; … … 516 513 ///Turn on/off pre-scaling 517 514 518 ///By default graphToEps() rescales the whole image in order to avoid515 ///By default, graphToEps() rescales the whole image in order to avoid 519 516 ///very big or very small bounding boxes. 520 517 /// … … 1118 1115 ///\param g Reference to the graph to be printed. 1119 1116 ///\param os Reference to the output stream. 1120 ///By default it is <tt>std::cout</tt>.1117 ///By default, it is <tt>std::cout</tt>. 1121 1118 /// 1122 1119 ///This function also has a lot of … … 1130 1127 ///\endcode 1131 1128 /// 1132 ///For more detailed examples see the \ref graph_to_eps_demo.cc demo file.1129 ///For more detailed examples, see the \ref graph_to_eps_demo.cc demo file. 1133 1130 /// 1134 1131 ///\warning Don't forget to put the \ref GraphToEps::run() "run()" 1135 1132 ///to the end of the parameter list. 1136 1133 ///\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)1134 ///\sa graphToEps(GR &g, const char *file_name) 1135 template<class GR> 1136 GraphToEps<DefaultGraphToEpsTraits<GR> > 1137 graphToEps(GR &g, std::ostream& os=std::cout) 1141 1138 { 1142 1139 return 1143 GraphToEps<DefaultGraphToEpsTraits<G > >(DefaultGraphToEpsTraits<G>(g,os));1140 GraphToEps<DefaultGraphToEpsTraits<GR> >(DefaultGraphToEpsTraits<GR>(g,os)); 1144 1141 } 1145 1142 … … 1148 1145 ///\ingroup eps_io 1149 1146 ///This function does the same as 1150 ///\ref graphToEps(G &g,std::ostream& os)1147 ///\ref graphToEps(GR &g,std::ostream& os) 1151 1148 ///but it writes its output into the file \c file_name 1152 1149 ///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)1150 ///\sa graphToEps(GR &g, std::ostream& os) 1151 template<class GR> 1152 GraphToEps<DefaultGraphToEpsTraits<GR> > 1153 graphToEps(GR &g,const char *file_name) 1157 1154 { 1158 1155 std::ostream* os = new std::ofstream(file_name); … … 1161 1158 throw IoError("Cannot write file", file_name); 1162 1159 } 1163 return GraphToEps<DefaultGraphToEpsTraits<G > >1164 (DefaultGraphToEpsTraits<G >(g,*os,true));1160 return GraphToEps<DefaultGraphToEpsTraits<GR> > 1161 (DefaultGraphToEpsTraits<GR>(g,*os,true)); 1165 1162 } 1166 1163 … … 1169 1166 ///\ingroup eps_io 1170 1167 ///This function does the same as 1171 ///\ref graphToEps(G &g,std::ostream& os)1168 ///\ref graphToEps(GR &g,std::ostream& os) 1172 1169 ///but it writes its output into the file \c file_name 1173 1170 ///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)1171 ///\sa graphToEps(GR &g, std::ostream& os) 1172 template<class GR> 1173 GraphToEps<DefaultGraphToEpsTraits<GR> > 1174 graphToEps(GR &g,const std::string& file_name) 1178 1175 { 1179 1176 std::ostream* os = new std::ofstream(file_name.c_str()); … … 1182 1179 throw IoError("Cannot write file", file_name); 1183 1180 } 1184 return GraphToEps<DefaultGraphToEpsTraits<G > >1185 (DefaultGraphToEpsTraits<G >(g,*os,true));1181 return GraphToEps<DefaultGraphToEpsTraits<GR> > 1182 (DefaultGraphToEpsTraits<GR>(g,*os,true)); 1186 1183 } 1187 1184
Note: See TracChangeset
for help on using the changeset viewer.