COIN-OR::LEMON - Graph Library

Changeset 1107:d972653c89d5 in lemon-0.x


Ignore:
Timestamp:
01/29/05 16:09:41 (15 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1506
Message:
  • Node shapes are shown in the doc.
  • The generated PS file is closer to be DSC conform.
Files:
7 added
2 edited

Legend:

Unmodified
Added
Removed
  • doc/Doxyfile

    r1064 r1107  
    518518# the \image command).
    519519
    520 IMAGE_PATH             =
     520IMAGE_PATH             = images
    521521
    522522# The INPUT_FILTER tag can be used to specify a program that doxygen should
  • src/lemon/graph_to_eps.h

    r1103 r1107  
    153153///
    154154///\todo Follow PostScript's DSC.
    155 ///\todo Use own dictionary.
     155/// Use own dictionary.
     156///\todo Provide a way to set %%Title: and %%Copyright:. Set %%CreationDate:
     157///\todo Useful new features.
     158/// - Linestyles: dotted, dashed etc.
     159/// - A second color and percent value for the lines.
    156160template<class T> class GraphToEps : public T
    157161{
     
    168172  bool dontPrint;
    169173
    170   enum NodeShapes { CIRCLE=0, SQUARE=1, DIAMOND=2 };
    171                    
     174public:
     175  ///Node shapes
     176
     177  ///Node shapes
     178  ///
     179  enum NodeShapes {
     180    /// = 0
     181    ///\image html nodeshape_0.png
     182    ///\image latex nodeshape_0.eps "CIRCLE shape (0)" width=2cm
     183    CIRCLE=0,
     184    /// = 1
     185    ///\image html nodeshape_1.png
     186    ///\image latex nodeshape_1.eps "SQUARE shape (1)" width=2cm
     187    ///
     188    SQUARE=1,
     189    /// = 2
     190    ///\image html nodeshape_2.png
     191    ///\image latex nodeshape_2.eps "DIAMOND shape (2)" width=2cm
     192    ///
     193    DIAMOND=2
     194  };
     195
     196private:
    172197  class edgeLess {
    173198    const Graph &g;
     
    236261  ///Sets the map of the node shapes
    237262
    238   ///Sets the map of the node shapes
     263  ///Sets the map of the node shapes.
     264  ///The availabe shape values
     265  ///can be found in \ref NodeShapes "enum NodeShapes".
    239266  ///\param x must be a node map with \c int (or convertible) values.
    240   ///\todo Incomplete doc.
     267  ///\sa NodeShapes
    241268  template<class X> GraphToEps<NodeShapesTraits<X> > nodeShapes(const X &x)
    242269  {
     
    450477   
    451478    os << "%!PS-Adobe-2.0 EPSF-2.0\n";
    452     //\todo: Chech whether the graph is empty.
     479    os << "%%Title: LEMON GraphToEps figure\n" ///\todo setTitle() is needed
     480//        << "%%Copyright: XXXX\n"
     481       << "%%Creator: LEMON GraphToEps function\n"
     482//        << "%%CreationDate: XXXXXXX\n"
     483      ;
     484    ///\todo: Chech whether the graph is empty.
    453485    BoundingBox<double> bb;
    454486    for(NodeIt n(g);n!=INVALID;++n) {
     
    463495                      << bb.right()* _scale+_xBorder << ' '
    464496                      << bb.top()*   _scale+_yBorder << '\n';
     497
     498    os << "%%EndComments\n";
     499   
    465500    //x1 y1 x2 y2 x3 y3 cr cg cb w
    466501    os << "/lb { setlinewidth setrgbcolor newpath moveto\n"
     
    740775template<class G>
    741776GraphToEps<DefaultGraphToEpsTraits<G> >
    742 graphToEps(G &g,char *file_name)
     777graphToEps(G &g,const char *file_name)
    743778{
    744779  return GraphToEps<DefaultGraphToEpsTraits<G> >
Note: See TracChangeset for help on using the changeset viewer.