COIN-OR::LEMON - Graph Library

Changeset 133:d76e2ff9c70d in lemon-main


Ignore:
Timestamp:
04/13/08 09:20:43 (17 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Several doc improvements + new default parameter values

  • * *

Several minor improvements in graph_to_eps.h

  • * *

Several minor improvements in graph_to_eps.h

Location:
lemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/color.h

    r129 r133  
    112112
    113113    ///Constructor
     114    ///\param have_white indicates whether white is amongst the
     115    ///provided initial colors (\c true) or not (\c false). If it is true,
     116    ///white will be assigned to \c 0.
    114117    ///\param num the number of the allocated colors. If it is \c -1,
    115     ///the default color configuration is set up (26 color plus the
     118    ///the default color configuration is set up (26 color plus optionaly the
    116119    ///white).  If \c num is less then 26/27 then the default color
    117120    ///list is cut. Otherwise the color list is filled repeatedly with
    118121    ///the default color list.  (The colors can be changed later on.)
    119     ///\param have_white indicates whether white is amongst the
    120     ///provided color (\c true) or not (\c false). If it is true,
    121     ///white will be assigned to \c 0.
    122122    Palette(bool have_white=false,int num=-1)
    123123    {
     
    174174      colors[i%colors.size()]=c;
    175175    }
    176     ///\e
     176    ///Add a new color to the end of the color list.
    177177    void add(const Color &c)
    178178    {
     
    186186  };
    187187
    188   ///Returns a visible distinct \ref Color
     188  ///Returns a visibly distinct \ref Color
    189189
    190190  ///Returns a \ref Color which is as different from the given parameter
  • lemon/graph_to_eps.h

    r132 r133  
    4444///\ingroup eps_io
    4545///\file
    46 ///\brief Simple graph drawer
    47 ///
    48 ///\author Alpar Juttner
     46///\brief A well configurable tool for visualizing graphs
    4947
    5048namespace lemon {
     
    173171};
    174172
    175 ///Helper class to implement the named parameters of \ref graphToEps()
    176 
    177 ///Helper class to implement the named parameters of \ref graphToEps()
    178 ///\todo Is 'helper class' a good name for this?
    179 ///
    180 ///\todo Follow PostScript's DSC.
    181 /// Use own dictionary.
    182 ///\todo Useful new features.
    183 /// - Linestyles: dotted, dashed etc.
    184 /// - A second color and percent value for the lines.
     173///Auxiliary class to implement the named parameters of \ref graphToEps()
     174
     175///Auxiliary class to implement the named parameters of \ref graphToEps()
    185176template<class T> class GraphToEps : public T
    186177{
     
    370361
    371362  ///Sets the map of the node shapes.
    372   ///The availabe shape values
     363  ///The available shape values
    373364  ///can be found in \ref NodeShapes "enum NodeShapes".
    374365  ///\param x must be a node map with \c int (or convertible) values.
     
    412403  ///
    413404  ///\sa nodePsTextsPreamble()
    414   ///\todo Offer the choise not to move to the centre but pass the coordinates
    415   ///to the Postscript block inserted.
    416405  template<class X> GraphToEps<NodePsTextsTraits<X> > nodePsTexts(const X &x)
    417406  {
     
    522511  ///Negates the Y coordinates.
    523512  ///
    524   ///\todo More docs.
    525   ///
    526513  GraphToEps<T> &negateY(bool b=true) {
    527514    _negY=b;return *this;
    528515  }
    529516
    530   ///Turn on/off prescaling
     517  ///Turn on/off pre-scaling
    531518
    532519  ///By default graphToEps() rescales the whole image in order to avoid
     
    579566  ///Sets the width of the border around the picture
    580567  ///
    581   GraphToEps<T> &border(double b) {_xBorder=_yBorder=b;return *this;}
     568  GraphToEps<T> &border(double b=10) {_xBorder=_yBorder=b;return *this;}
    582569  ///Sets the width of the border around the picture
    583570
     
    596583  ///Sets the length of the arrowheads
    597584  ///
    598   GraphToEps<T> &arrowLength(double d) {_arrowLength*=d;return *this;}
     585  GraphToEps<T> &arrowLength(double d=1.0) {_arrowLength*=d;return *this;}
    599586  ///Sets the width of the arrowheads
    600587
    601588  ///Sets the width of the arrowheads
    602589  ///
    603   GraphToEps<T> &arrowWidth(double d) {_arrowWidth*=d;return *this;}
     590  GraphToEps<T> &arrowWidth(double d=.3) {_arrowWidth*=d;return *this;}
    604591 
    605592  ///Scales the drawing to fit to A4 page
     
    663650  ///Sets whether the the graph is undirected
    664651
    665   ///Sets whether the the graph is undirected
    666   ///
    667   GraphToEps<T> &undirected(bool b=true) {_undirected=b;return *this;}
     652  ///Sets whether the the graph is undirected.
     653  ///
     654  ///This setting is the default for undirected graphs.
     655  ///
     656  ///\sa directed()
     657   GraphToEps<T> &undirected(bool b=true) {_undirected=b;return *this;}
    668658
    669659  ///Sets whether the the graph is directed
     
    671661  ///Sets whether the the graph is directed.
    672662  ///Use it to show the edges as a pair of directed ones.
     663  ///
     664  ///This setting is the default for digraphs.
     665  ///
     666  ///\sa undirected()
    673667  GraphToEps<T> &directed(bool b=true) {_undirected=!b;return *this;}
    674 
     668 
    675669  ///Sets the title.
    676670
     
    684678  ///namely it inserts a <tt>%%Copyright:</tt> DSC field to the header of
    685679  ///the EPS file.
    686   ///\todo Multiline copyright notice could be supported.
    687680  GraphToEps<T> &copyright(const std::string &t) {_copyright=t;return *this;}
    688681
     
    710703  ///Like other functions using
    711704  ///\ref named-templ-func-param "named template parameters",
    712   ///this function calles the algorithm itself, i.e. in this case
     705  ///this function calls the algorithm itself, i.e. in this case
    713706  ///it draws the graph.
    714707  void run() {
    715     ///\todo better 'epsilon' would be nice here.
     708    //\todo better 'epsilon' would be nice here.
    716709    const double EPSILON=1e-9;
    717710    if(dontPrint) return;
     
    931924            dvec(mycoords[g.target(*i)]-mycoords[g.source(*i)]);
    932925          double l=std::sqrt(dvec.normSquare());
    933           ///\todo better 'epsilon' would be nice here.
     926          //\todo better 'epsilon' would be nice here.
    934927          dim2::Point<double> d(dvec/std::max(l,EPSILON));
    935928          dim2::Point<double> m;
Note: See TracChangeset for help on using the changeset viewer.