Basic framework: http://www.texample.net/tikz/examples/filesystem-tree/
Have a look to 21. Making trees grow in PGF Manual.
The solution is my first try with it, so its not perfect.
You can create nodes
and childs
. The distance between the levels can defined with level distance=<length>
.
Connection between node and child it set with edge from parent path={[->] ([xshift=.5em]\tikzparentnode.south west) |- (\tikzchildnode.west)}]
. (The xshift
is optional). You can also add dashed
.
The child position is set with grow via three points={...}
have a look to chapter 72.1 Growth Functions in PGF Manual.
For space/ blank childs you can add child [missing] {}
.
Optional you can set the nodes also to dashed
and not solid
or something else.
MWE:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\tikzstyle{every node}=[draw=black,thick,anchor=west]
\begin{tikzpicture}[%
parent anchor=south west,
level distance=40mm,
grow via three points={one child at (0.1,-1) and
two children at (0.1,-1) and (0.1,-2)},
%edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}]
edge from parent path={[->] ([xshift=.5em]\tikzparentnode.south west) |- (\tikzchildnode.west)}]
\node { \_start}
child { node {main}
child[%
grow via three points={one child at (0.1,-1) and
two children at (0.1,-1) and (0.1,-2)},
edge from parent path={[->] ([xshift=.5em]\tikzparentnode.south west) |- (\tikzchildnode.west)}] { node {\_\_function}
child[%
grow via three points={one child at (-0.5,-1) and
two children at (-0.5,-1) and (-1.2,-1)},
edge from parent path={[->] ([xshift=.5em]\tikzparentnode.south west) |- (\tikzchildnode.west)}] { node {\_\_mt\_MasterFunction\_}
child[%
grow=right, edge from parent path={[->,dashed] (\tikzparentnode.east) |- (\tikzchildnode.west)}] { node {\_thread\_start}
child[%
grow via three points={one child at (-0.5,-1) and
two children at (-0.5,-1) and (-0.5,-2)},
edge from parent path={[->,solid] ([xshift=.5em]\tikzparentnode.south west) |- (\tikzchildnode.west)}] { node[solid] {\_\_mt\_SlaveFunction}
child { node {\_\_mt\_WaitForWork}}
child { node {\_\_mt\_run\_my\_job}
child { node {\_\_mt\_runLoop\_int\_}
child { node {loop body function}}
}
}
child [missing] {}
child [missing] {}
child { node {\_\_mt\_EndOfTaskBarrier\_}}
}
}
child { node {\_\_mt\_run\_my\_job\_}
child { node {\_\_mt\_runloop\_int\_}
child { node {loop body function}}
}
}
}
child [missing] {}
child [missing] {}
child [missing] {}
child { node {\_\_mt\_EndOfTaskBarrier\_}}
}
};
\end{tikzpicture}
\end{document}