#include <nodeprint.h>
Inheritance diagram for LayoutVisitor:


Public Types | |
| typedef LayoutVisitor< _TContent, _TIter > | _Self |
| typedef NodeVisitor< typename _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > > | _Base |
Public Methods | |
| virtual _Self * | construct () const |
| virtual _Self * | clone () const |
| virtual | ~LayoutVisitor () |
| virtual void | operator() (_TIter &iter) |
| Start the layout process. | |
| virtual void | visitNormalNode (const NormalNode< _TContent > *node) |
| Take a NormalNode and put it in the list. | |
| virtual void | visitRootNode (const RootNode< _TContent > *node) |
| Take a RootNode and put its subtree in the list. | |
| virtual std::map< const Node< _TContent > *, Position > | getMap () const |
Protected Methods | |
| void | addNode (const Node< _TContent > *node, Position pos) |
| Take a Node and put it in the list. | |
| Position | calculatePosition (const Node< _TContent > *node) |
| Calculate node position using the described algorithm. | |
Protected Attributes | |
| std::map< const Node< _TContent > *, Position > | m_map |
It uses a simple algorithm that positions the nodes on a discrete array with distance 1 so that all leaves are equal distant from their neugbours. The positions are stored in a map thet is provided by 'getMap()'.
Yes, that is not the best layout algorithm... If anyone needs a better one, you might convince me to backport the better one I have ;-)
Definition at line 57 of file nodeprint.h.
|
|
Reimplemented from NodeVisitor< _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > >. Definition at line 65 of file nodeprint.h. |
|
|
Reimplemented from NodeVisitor< _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > >. Definition at line 62 of file nodeprint.h. Referenced by LayoutVisitor::clone(), and LayoutVisitor::construct(). |
|
|
Definition at line 69 of file nodeprint.h. |
|
||||||||||||
|
Take a Node and put it in the list.
Definition at line 171 of file nodeprint.h. References LayoutVisitor::m_map. Referenced by LayoutVisitor::visitNormalNode(), and LayoutVisitor::visitRootNode(). |
|
|
Calculate node position using the described algorithm.
Definition at line 181 of file nodeprint.h. References Node::beginAll(), Node::endAll(), Node::getChildren(), Node::getParent(), LayoutVisitor::m_map, Position::x, and Position::y. Referenced by LayoutVisitor::visitNormalNode(), and LayoutVisitor::visitRootNode(). |
|
|
Definition at line 68 of file nodeprint.h. References LayoutVisitor::_Self. |
|
|
Definition at line 67 of file nodeprint.h. References LayoutVisitor::_Self. |
|
|
Definition at line 75 of file nodeprint.h. References LayoutVisitor::m_map. |
|
|
Start the layout process.
Definition at line 139 of file nodeprint.h. References NodeVisitor< _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > >::init(), NodeVisitor< _TIter::const_iterator, const Node< _TContent >, const NormalNode< _TContent >, const RootNode< _TContent > >::iterate(), and LayoutVisitor::m_map. |
|
|
Take a NormalNode and put it in the list.
Definition at line 151 of file nodeprint.h. References LayoutVisitor::addNode(), and LayoutVisitor::calculatePosition(). |
|
|
Take a RootNode and put its subtree in the list.
Definition at line 161 of file nodeprint.h. References LayoutVisitor::addNode(), and LayoutVisitor::calculatePosition(). |
|
|
Definition at line 81 of file nodeprint.h. Referenced by LayoutVisitor::addNode(), LayoutVisitor::calculatePosition(), LayoutVisitor::getMap(), and LayoutVisitor::operator()(). |
1.2.17