COIN-OR::LEMON - Graph Library

Changeset 909:2c35bef44dd1 in lemon


Ignore:
Timestamp:
02/21/10 18:55:30 (9 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Parents:
905:c841ae1aca29 (diff), 906: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
Message:

Merge bugfix #336

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_to_eps.h

    r833 r909  
    685685#else
    686686      os << bits::getWinFormattedDate();
     687      os << std::endl;
    687688#endif
    688689    }
    689     os << std::endl;
    690690
    691691    if (_autoArcWidthScale) {
  • lemon/graph_to_eps.h

    r906 r909  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2009
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    6565///Default traits class of \ref GraphToEps.
    6666///
    67 ///\c G is the type of the underlying graph.
    68 template<class G>
     67///\param GR is the type of the underlying graph.
     68template<class GR>
    6969struct DefaultGraphToEpsTraits
    7070{
    71   typedef G Graph;
     71  typedef GR Graph;
     72  typedef GR Digraph;
    7273  typedef typename Graph::Node Node;
    7374  typedef typename Graph::NodeIt NodeIt;
     
    140141
    141142  ///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
    147147  ///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),
    151151    _coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0),
    152152    _nodeColors(WHITE), _arcColors(BLACK),
     
    159159    _showNodeText(false), _nodeTexts(false), _nodeTextSize(1),
    160160    _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),
    163163    _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK),
    164164    _autoNodeScale(false),
     
    243243
    244244  typedef typename T::Graph Graph;
     245  typedef typename T::Digraph Digraph;
    245246  typedef typename Graph::Node Node;
    246247  typedef typename Graph::NodeIt NodeIt;
     
    270271    ///\image html nodeshape_1.png
    271272    ///\image latex nodeshape_1.eps "SQUARE shape (1)" width=2cm
    272     ///
    273273    SQUARE=1,
    274274    /// = 2
    275275    ///\image html nodeshape_2.png
    276276    ///\image latex nodeshape_2.eps "DIAMOND shape (2)" width=2cm
    277     ///
    278277    DIAMOND=2,
    279278    /// = 3
    280279    ///\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
    283281    MALE=3,
    284282    /// = 4
    285283    ///\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
    288285    FEMALE=4
    289286  };
     
    516513  ///Turn on/off pre-scaling
    517514
    518   ///By default graphToEps() rescales the whole image in order to avoid
     515  ///By default, graphToEps() rescales the whole image in order to avoid
    519516  ///very big or very small bounding boxes.
    520517  ///
     
    11181115///\param g Reference to the graph to be printed.
    11191116///\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>.
    11211118///
    11221119///This function also has a lot of
     
    11301127///\endcode
    11311128///
    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.
    11331130///
    11341131///\warning Don't forget to put the \ref GraphToEps::run() "run()"
    11351132///to the end of the parameter list.
    11361133///\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)
     1135template<class GR>
     1136GraphToEps<DefaultGraphToEpsTraits<GR> >
     1137graphToEps(GR &g, std::ostream& os=std::cout)
    11411138{
    11421139  return
    1143     GraphToEps<DefaultGraphToEpsTraits<G> >(DefaultGraphToEpsTraits<G>(g,os));
     1140    GraphToEps<DefaultGraphToEpsTraits<GR> >(DefaultGraphToEpsTraits<GR>(g,os));
    11441141}
    11451142
     
    11481145///\ingroup eps_io
    11491146///This function does the same as
    1150 ///\ref graphToEps(G &g,std::ostream& os)
     1147///\ref graphToEps(GR &g,std::ostream& os)
    11511148///but it writes its output into the file \c file_name
    11521149///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)
     1151template<class GR>
     1152GraphToEps<DefaultGraphToEpsTraits<GR> >
     1153graphToEps(GR &g,const char *file_name)
    11571154{
    11581155  std::ostream* os = new std::ofstream(file_name);
     
    11611158    throw IoError("Cannot write file", file_name);
    11621159  }
    1163   return GraphToEps<DefaultGraphToEpsTraits<G> >
    1164     (DefaultGraphToEpsTraits<G>(g,*os,true));
     1160  return GraphToEps<DefaultGraphToEpsTraits<GR> >
     1161    (DefaultGraphToEpsTraits<GR>(g,*os,true));
    11651162}
    11661163
     
    11691166///\ingroup eps_io
    11701167///This function does the same as
    1171 ///\ref graphToEps(G &g,std::ostream& os)
     1168///\ref graphToEps(GR &g,std::ostream& os)
    11721169///but it writes its output into the file \c file_name
    11731170///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)
     1172template<class GR>
     1173GraphToEps<DefaultGraphToEpsTraits<GR> >
     1174graphToEps(GR &g,const std::string& file_name)
    11781175{
    11791176  std::ostream* os = new std::ofstream(file_name.c_str());
     
    11821179    throw IoError("Cannot write file", file_name);
    11831180  }
    1184   return GraphToEps<DefaultGraphToEpsTraits<G> >
    1185     (DefaultGraphToEpsTraits<G>(g,*os,true));
     1181  return GraphToEps<DefaultGraphToEpsTraits<GR> >
     1182    (DefaultGraphToEpsTraits<GR>(g,*os,true));
    11861183}
    11871184
Note: See TracChangeset for help on using the changeset viewer.