Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::To_Graphviz< GT, Node_Attr, Arc_Attr, SN, SA > Struct Template Reference

Functor class for generating Graphviz DOT specifications. More...

#include <generate_graph.H>

Public Member Functions

void operator() (const GT &g, std::ostream &out, const Node_Attr &node_attr=Node_Attr(), const Arc_Attr &arc_attr=Arc_Attr(), const std::string &rankdir="LR")
 Generate DOT specification for a graph.
 
void digraph (const GT &g, std::ostream &out, const Node_Attr &node_attr=Node_Attr(), const Arc_Attr &arc_attr=Arc_Attr(), const std::string &rankdir="LR")
 
void ranks (const GT &g, std::ostream &out, const Node_Attr &node_attr=Node_Attr(), const Arc_Attr &arc_attr=Arc_Attr(), const std::string &rankdir="LR")
 

Detailed Description

template<class GT, class Node_Attr = Dft_Node_Attr<GT>, class Arc_Attr = Dft_Arc_Attr<GT>, class SN = Dft_Show_Node<GT>, class SA = Dft_Show_Arc<GT>>
struct Aleph::To_Graphviz< GT, Node_Attr, Arc_Attr, SN, SA >

Functor class for generating Graphviz DOT specifications.

A high-level class that traverses a graph and generates a DOT specification for the Graphviz visualization system. The class handles the topological structure while delegating content generation to customizable attribute classes.

Template Parameters

  • GT: Graph type (derived from List_Graph)
  • Node_Attr: Functor for node attributes. Invoked as: cpp Node_Attr()(g, node, out); // writes to out stream
  • Arc_Attr: Functor for arc attributes. Invoked as: cpp Arc_Attr()(g, arc, out); // writes to out stream
  • SN: Node filter - only filtered nodes are included
  • SA: Arc filter - only filtered arcs are included

Generated Output

For each node:

For each arc:

Usage Example

std::ofstream out("graph.dot");
DynList< T > maps(const C &c, Op op)
Classic map operation.
Functor class for generating Graphviz DOT specifications.
See also
Filter_Iterator For node/arc filtering
Dft_Node_Attr Default node attribute generator
Dft_Arc_Attr Default arc attribute generator

Definition at line 672 of file generate_graph.H.

Member Function Documentation

◆ digraph()

template<class GT , class Node_Attr = Dft_Node_Attr<GT>, class Arc_Attr = Dft_Arc_Attr<GT>, class SN = Dft_Show_Node<GT>, class SA = Dft_Show_Arc<GT>>
void Aleph::To_Graphviz< GT, Node_Attr, Arc_Attr, SN, SA >::digraph ( const GT g,
std::ostream &  out,
const Node_Attr node_attr = Node_Attr(),
const Arc_Attr arc_attr = Arc_Attr(),
const std::string &  rankdir = "LR" 
)
inline

Definition at line 691 of file generate_graph.H.

References Aleph::maps().

◆ operator()()

template<class GT , class Node_Attr = Dft_Node_Attr<GT>, class Arc_Attr = Dft_Arc_Attr<GT>, class SN = Dft_Show_Node<GT>, class SA = Dft_Show_Arc<GT>>
void Aleph::To_Graphviz< GT, Node_Attr, Arc_Attr, SN, SA >::operator() ( const GT g,
std::ostream &  out,
const Node_Attr node_attr = Node_Attr(),
const Arc_Attr arc_attr = Arc_Attr(),
const std::string &  rankdir = "LR" 
)
inline

Generate DOT specification for a graph.

@param g The graph to visualize
@param out Output stream for DOT specification
@param node_attr Node attribute generator functor
@param arc_attr Arc attribute generator functor
@param rankdir Layout direction ("TB", "BT", "LR", "RL")

Definition at line 682 of file generate_graph.H.

References Aleph::maps().

◆ ranks()

template<class GT , class Node_Attr = Dft_Node_Attr<GT>, class Arc_Attr = Dft_Arc_Attr<GT>, class SN = Dft_Show_Node<GT>, class SA = Dft_Show_Arc<GT>>
void Aleph::To_Graphviz< GT, Node_Attr, Arc_Attr, SN, SA >::ranks ( const GT g,
std::ostream &  out,
const Node_Attr node_attr = Node_Attr(),
const Arc_Attr arc_attr = Arc_Attr(),
const std::string &  rankdir = "LR" 
)
inline

Definition at line 700 of file generate_graph.H.

References Aleph::maps().


The documentation for this struct was generated from the following file: