GraphToEps Class Template Reference

#include <lemon/graph_to_eps.h>

List of all members.


Detailed Description

template<class T>
class lemon::GraphToEps< T >

Helper class to implement the named parameters of graphToEps()
Todo:
Is 'helper class' a good name for this?

Useful new features.

Todo:
Follow PostScript's DSC. Use own dictionary.


Public Types

enum  NodeShapes {
  CIRCLE = 0, SQUARE = 1, DIAMOND = 2, MALE = 3,
  FEMALE = 4
}
 Node shapes. More...

Public Member Functions

template<class X>
GraphToEps< CoordsTraits<
X > > 
coords (const X &x)
 Sets the map of the node coordinates.
template<class X>
GraphToEps< NodeSizesTraits<
X > > 
nodeSizes (const X &x)
 Sets the map of the node sizes.
template<class X>
GraphToEps< NodeShapesTraits<
X > > 
nodeShapes (const X &x)
 Sets the map of the node shapes.
template<class X>
GraphToEps< NodeTextsTraits<
X > > 
nodeTexts (const X &x)
 Sets the text printed on the nodes.
template<class X>
GraphToEps< NodePsTextsTraits<
X > > 
nodePsTexts (const X &x)
 Inserts a PostScript block to the nodes.
template<class X>
GraphToEps< EdgeWidthsTraits<
X > > 
edgeWidths (const X &x)
 Sets the map of the edge widths.
template<class X>
GraphToEps< NodeColorsTraits<
X > > 
nodeColors (const X &x)
 Sets the map of the node colors.
template<class X>
GraphToEps< NodeTextColorsTraits<
X > > 
nodeTextColors (const X &x)
 Sets the map of the node text colors.
template<class X>
GraphToEps< EdgeColorsTraits<
X > > 
edgeColors (const X &x)
 Sets the map of the edge colors.
GraphToEps< T > & nodeScale (double d)
 Sets a global scale factor for node sizes.
GraphToEps< T > & autoNodeScale (bool b=true)
 Turns on/off the automatic node width scaling.
GraphToEps< T > & negateY (bool b=true)
 Negates the Y coordinates.
GraphToEps< T > & edgeWidthScale (double d)
 Sets a global scale factor for edge widths.
GraphToEps< T > & autoEdgeWidthScale (bool b=true)
 Turns on/off the automatic edge width scaling.
GraphToEps< T > & scale (double d)
 Sets a global scale factor for the whole picture.
GraphToEps< T > & border (double b)
 Sets the width of the border around the picture.
GraphToEps< T > & border (double x, double y)
 Sets the width of the border around the picture.
GraphToEps< T > & drawArrows (bool b=true)
 Sets whether to draw arrows.
GraphToEps< T > & arrowLength (double d)
 Sets the length of the arrowheads.
GraphToEps< T > & arrowWidth (double d)
 Sets the width of the arrowheads.
GraphToEps< T > & scaleToA4 ()
 Scales the drawing to fit to A4 page.
GraphToEps< T > & enableParallel (bool b=true)
 Enables parallel edges.
GraphToEps< T > & parEdgeDist (double d)
 Sets the distance.
GraphToEps< T > & hideEdges (bool b=true)
 Hides the edges.
GraphToEps< T > & hideNodes (bool b=true)
 Hides the nodes.
GraphToEps< T > & nodeTextSize (double d)
 Sets the size of the node texts.
GraphToEps< T > & distantColorNodeTexts ()
 Sets the color of the node texts to be different from the node color.
GraphToEps< T > & distantBWNodeTexts ()
 Sets the color of the node texts to be black or white and always visible.
GraphToEps< T > & nodePsTextsPreamble (const char *str)
 Gives a preamble block for node Postscript block.
GraphToEps< T > & undirected (bool b=true)
 Sets whether the the graph is undirected.
GraphToEps< T > & bidir (bool b=true)
 Sets whether the the graph is directed.
GraphToEps< T > & title (const std::string &t)
 Sets the title.
GraphToEps< T > & copyright (const std::string &t)
 Sets the copyright statement.
void run ()
 Draws the graph.


Member Enumeration Documentation

enum NodeShapes
 

Node shapes

Enumerator:
CIRCLE  = 0
nodeshape_0.png
SQUARE  = 1
nodeshape_1.png
DIAMOND  = 2
nodeshape_2.png
MALE  = 3
nodeshape_3.png
FEMALE  = 4
nodeshape_4.png


Member Function Documentation

GraphToEps<CoordsTraits<X> > coords const X &  x  )  [inline]
 

Sets the map of the node coordinates.

Parameters:
x must be a node map with xy<double> or xy<int> values.

GraphToEps<NodeSizesTraits<X> > nodeSizes const X &  x  )  [inline]
 

Sets the map of the node sizes

Parameters:
x must be a node map with double (or convertible) values.

GraphToEps<NodeShapesTraits<X> > nodeShapes const X &  x  )  [inline]
 

Sets the map of the node shapes. The availabe shape values can be found in enum NodeShapes.

Parameters:
x must be a node map with int (or convertible) values.
See also:
NodeShapes

GraphToEps<NodeTextsTraits<X> > nodeTexts const X &  x  )  [inline]
 

Sets the text printed on the nodes

Parameters:
x must be a node map with type that can be pushed to a standard ostream.

GraphToEps<NodePsTextsTraits<X> > nodePsTexts const X &  x  )  [inline]
 

With this command it is possible to insert a verbatim PostScript block to the nodes. The PS current point will be moved to the centre of the node before the PostScript block inserted.

Before and after the block a newline character is inserted so you don't have to bother with the separators.

Parameters:
x must be a node map with type that can be pushed to a standard ostream.
See also:
nodePsTextsPreamble()
Todo:
Offer the choise not to move to the centre but pass the coordinates to the Postscript block inserted.

GraphToEps<EdgeWidthsTraits<X> > edgeWidths const X &  x  )  [inline]
 

Sets the map of the edge widths

Parameters:
x must be a edge map with double (or convertible) values.

GraphToEps<NodeColorsTraits<X> > nodeColors const X &  x  )  [inline]
 

Sets the map of the node colors

Parameters:
x must be a node map with Color values.
See also:
ColorSet

GraphToEps<NodeTextColorsTraits<X> > nodeTextColors const X &  x  )  [inline]
 

Sets the map of the node text colors

Parameters:
x must be a node map with Color values.
See also:
ColorSet

GraphToEps<EdgeColorsTraits<X> > edgeColors const X &  x  )  [inline]
 

Sets the map of the edge colors

Parameters:
x must be a edge map with Color values.
See also:
ColorSet

GraphToEps<T>& nodeScale double  d  )  [inline]
 

Sets a global scale factor for node sizes.

If nodeSizes() is not given, this function simply sets the node sizes to d. If nodeSizes() is given, but autoNodeScale() is not, then the node size given by nodeSizes() will be multiplied by the value d. If both nodeSizes() and autoNodeScale() are used, then the node sizes will be scaled in such a way that the greatest size will be equal to d.

GraphToEps<T>& autoNodeScale bool  b = true  )  [inline]
 

Turns on/off the automatic node width scaling.

See also:
nodeScale()

GraphToEps<T>& negateY bool  b = true  )  [inline]
 

Negates the Y coordinates.

Todo:
More docs.

GraphToEps<T>& edgeWidthScale double  d  )  [inline]
 

Sets a global scale factor for edge widths.

If edgeWidths() is not given, this function simply sets the edge widths to d. If edgeWidths() is given, but autoEdgeWidthScale() is not, then the edge withs given by edgeWidths() will be multiplied by the value d. If both edgeWidths() and autoEdgeWidthScale() are used, then the edge withs will be scaled in such a way that the greatest width will be equal to d.

GraphToEps<T>& autoEdgeWidthScale bool  b = true  )  [inline]
 

Turns on/off the automatic edge width scaling.

See also:
edgeWidthScale()

GraphToEps<T>& scale double  d  )  [inline]
 

Sets a global scale factor for the whole picture

GraphToEps<T>& border double  b  )  [inline]
 

Sets the width of the border around the picture

GraphToEps<T>& border double  x,
double  y
[inline]
 

Sets the width of the border around the picture

GraphToEps<T>& drawArrows bool  b = true  )  [inline]
 

Sets whether to draw arrows

GraphToEps<T>& arrowLength double  d  )  [inline]
 

Sets the length of the arrowheads

GraphToEps<T>& arrowWidth double  d  )  [inline]
 

Sets the width of the arrowheads

GraphToEps<T>& scaleToA4  )  [inline]
 

Scales the drawing to fit to A4 page

GraphToEps<T>& parEdgeDist double  d  )  [inline]
 

Sets the distance

GraphToEps<T>& hideEdges bool  b = true  )  [inline]
 

Hides the edges

GraphToEps<T>& hideNodes bool  b = true  )  [inline]
 

Hides the nodes

GraphToEps<T>& nodeTextSize double  d  )  [inline]
 

Sets the size of the node texts

GraphToEps<T>& distantColorNodeTexts  )  [inline]
 

Sets the color of the node texts to be as different from the node color as it is possible

GraphToEps<T>& distantBWNodeTexts  )  [inline]
 

Sets the color of the node texts to be black or white according to which is more different from the node color

GraphToEps<T>& nodePsTextsPreamble const char *  str  )  [inline]
 

Gives a preamble block for node Postscript block.

See also:
nodePsTexts()

GraphToEps<T>& undirected bool  b = true  )  [inline]
 

Sets whether the the graph is undirected

GraphToEps<T>& bidir bool  b = true  )  [inline]
 

Sets whether the the graph is directed. Use it to show the undirected edges as a pair of directed ones.

GraphToEps<T>& title const std::string &  t  )  [inline]
 

Sets the title of the generated image, namely it inserts a %Title: DSC field to the header of the EPS file.

GraphToEps<T>& copyright const std::string &  t  )  [inline]
 

Sets the copyright statement of the generated image, namely it inserts a %Copyright: DSC field to the header of the EPS file.

Todo:
Multiline copyright notice could be supported.

void run  )  [inline]
 

Like other functions using named template parameters, this function calles the algorithm itself, i.e. in this case it draws the graph.

Todo:
better 'epsilon' would be nice here.
Todo:
better 'epsilon' would be nice here.
Bug:
: Chech whether the graph is empty.
Todo:
better 'epsilon' would be nice here.


The documentation for this class was generated from the following file:
Generated on Fri Feb 3 18:41:36 2006 for LEMON by  doxygen 1.4.6