diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pgf-umlsd/pgf-umlsd-demo.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pgf-umlsd/pgf-umlsd-demo.tex | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pgf-umlsd/pgf-umlsd-demo.tex b/Master/texmf-dist/doc/latex/pgf-umlsd/pgf-umlsd-demo.tex new file mode 100644 index 00000000000..6c807d65e40 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-umlsd/pgf-umlsd-demo.tex @@ -0,0 +1,101 @@ +% Demonstration of pgf-umlsd.sty, a convenient set of macros for drawing +% UML sequence diagrams. Written by Xu Yuan <xuyuan.cn@gmail.com> from +% Southeast University, China. +% This file is part of pgf-umlsd +% you may get it at +% http://code.google.com/p/pgf-umlsd/ + +\documentclass{article} + +\usepackage{tikz} +\usetikzlibrary{arrows,shadows} % for pgf-umlsd +\usepackage[underline=true,rounded corners=false]{pgf-umlsd} + +\begin{document} + +\begin{figure} + \centering + \begin{sequencediagram} + \newthread{ss}{:SimulationServer} + \newinst{ctr}{:SimControlNode} + \newinst{ps}{:PhysicsServer} + \newinst[1]{sense}{:SenseServer} + + \begin{call}{ss}{Initialize()}{sense}{} + \end{call} + \begin{sdblock}{Run Loop}{The main loop} + \begin{call}{ss}{StartCycle()}{ctr}{} + \begin{call}{ctr}{ActAgent()}{sense}{} + \end{call} + \end{call} + \begin{call}{ss}{Update()}{ps}{} + \begin{messcall}{ps}{PrePhysicsUpdate()}{sense}{state} + \end{messcall} + \begin{sdblock}{Physics Loop}{} + \begin{callself}{ps}{PhysicsUpdate()}{} + \end{callself} + \end{sdblock} + \begin{call}{ps}{PostPhysicsUpdate()}{sense}{} + \end{call} + \end{call} + \begin{call}{ss}{EndCycle()}{ctr}{} + \begin{call}{ctr}{SenseAgent()}{sense}{} + \end{call} + \end{call} + \end{sdblock} + \end{sequencediagram} + \caption{UML sequence diagram demo. The used style-file is + \texttt{pgf-umlsd.sty}, you may get it at + http://code.google.com/p/pgf-umlsd/} +\end{figure} + +\begin{figure} + \centering + \begin{sequencediagram} + \tikzstyle{inststyle}+=[bottom color=yellow] % custom the style + \newthread[blue]{ss}{:SimulationServer} + \newinst{ps}{:PhysicsServer} + \newinst[2]{sense}{:SenseServer} + \newthread[red]{ctr}{:SimControlNode} + + \begin{sdblock}[green!20]{Run Loop}{The main loop} + \mess{ctr}{StartCycle}{ss} + \begin{call}{ss}{Update()}{ps}{} + \prelevel + \begin{callself}{ctr}{SenseAgent()}{} + \begin{call}[3]{ctr}{Read}{sense}{} + \end{call} + \end{callself} + \prelevel\prelevel\prelevel\prelevel + \setthreadbias{west} + \begin{call}{ps}{PrePhysicsUpdate()}{sense}{} + \end{call} + \setthreadbias{center} + \begin{callself}{ps}{Update()}{} + \begin{callself}{ps}{\small CollisionDetection()}{} + \end{callself} + \begin{callself}{ps}{Dynamics()}{} + \end{callself} + \end{callself} + \begin{call}{ps}{PostPhysicsUpdate()}{sense}{} + \end{call} + \end{call} + \mess{ss}{EndCycle}{ctr} + \begin{callself}{ctr}{ActAgent()}{} + \begin{call}{ctr}{Write}{sense}{} + \end{call} + \end{callself} + \end{sdblock} + + \end{sequencediagram} + \caption{Example of a sequence with parallel activities and the + customed style. The used style-file is \texttt{pgf-umlsd.sty}, you + may get it at http://code.google.com/p/pgf-umlsd/} +\end{figure} + +\end{document} + +%%% Local Variables: +%%% mode: Tex-PDF +%%% TeX-master: t +%%% End: |