Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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?

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

Todo:
Useful new features.

Definition at line 165 of file graph_to_eps.h.

Public Types

enum  NodeShapes { CIRCLE = 0, SQUARE = 1, DIAMOND = 2 }
 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< 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 > & edgeWidthScale (double d)
 Sets a global scale factor for edge widths.
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 > & nodePsTextsPreamble (const char *str)
 Gives a preamble block for node Postscript block.
GraphToEps< T > & undir (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

Enumeration values:
CIRCLE  = 0
nodeshape_0.png
SQUARE  = 1
nodeshape_1.png
DIAMOND  = 2
nodeshape_2.png

Definition at line 184 of file graph_to_eps.h.


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.

Definition at line 245 of file graph_to_eps.h.

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.

Definition at line 257 of file graph_to_eps.h.

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

Definition at line 273 of file graph_to_eps.h.

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.

Definition at line 287 of file graph_to_eps.h.

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 to 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.

Definition at line 313 of file graph_to_eps.h.

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.

Definition at line 327 of file graph_to_eps.h.

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.

Definition at line 342 of file graph_to_eps.h.

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.

Definition at line 356 of file graph_to_eps.h.

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

Sets a global scale factor for node sizes

Definition at line 365 of file graph_to_eps.h.

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

Sets a global scale factor for edge widths

Definition at line 370 of file graph_to_eps.h.

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

Sets a global scale factor for the whole picture

Definition at line 375 of file graph_to_eps.h.

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

Sets the width of the border around the picture

Definition at line 380 of file graph_to_eps.h.

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

Sets the width of the border around the picture

Definition at line 385 of file graph_to_eps.h.

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

Sets whether to draw arrows

Definition at line 392 of file graph_to_eps.h.

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

Sets the length of the arrowheads

Definition at line 397 of file graph_to_eps.h.

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

Sets the width of the arrowheads

Definition at line 402 of file graph_to_eps.h.

GraphToEps<T>& scaleToA4  )  [inline]
 

Scales the drawing to fit to A4 page

Definition at line 408 of file graph_to_eps.h.

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

Enables parallel edges

Todo:
Partially implemented

Definition at line 414 of file graph_to_eps.h.

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

Sets the distance

Definition at line 420 of file graph_to_eps.h.

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

Hides the edges

Definition at line 426 of file graph_to_eps.h.

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

Hides the nodes

Definition at line 431 of file graph_to_eps.h.

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

Sets the size of the node texts

Definition at line 437 of file graph_to_eps.h.

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

Gives a preamble block for node Postscript block.

See also:
nodePsTexts()

Definition at line 443 of file graph_to_eps.h.

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

Sets whether the the graph is undirected

Definition at line 450 of file graph_to_eps.h.

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.

Definition at line 455 of file graph_to_eps.h.

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.

Definition at line 462 of file graph_to_eps.h.

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.

Definition at line 469 of file graph_to_eps.h.

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:
: Chech whether the graph is empty.

Definition at line 494 of file graph_to_eps.h.

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Mon Feb 21 15:02:32 2005 for LEMON by  doxygen 1.4.1