summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pgf-umlsd/pgf-umlsd-demo2.tex
blob: 7a419f232e78bed17f68c1d18cb2574bec5b697a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
% 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.

% The used style-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{soul} % hereby we are able to \hl == highlight some strings, or to \ul underline specials

%\usepackage[underline=true,rounded corners=false]{pgf-umlsd} % changed to following parameter-values:
\usepackage[underline=false,rounded corners=true]{pgf-umlsd}

\begin{document}

\begin{figure}
  \centering
  \begin{sequencediagram}
  \tikzstyle{inststyle}+=[rounded corners=3.2mm, bottom color=cyan] %% hier werden weitere Optionen angegeben
    \newthread{ss}{simulationServer}
    \newinst{ctr}{simControlNode}
    \newinst{ps}{physicsServer}
    \newinst[1]{sense}{senseServer}
    
    \begin{call}{ss}{Initialize()}{sense}{}
    \end{call}
    \begin{sdblock}{Run Loop}{}
      \begin{call}{ss}{StartCycle()}{ctr}{}
        \begin{call}{ctr}{ActAgent()}{sense}{}
        \end{call}
      \end{call}
      \begin{call}{ss}{Update()}{ps}{}
        \begin{call}{ps}{PrePhysicsUpdate()}{sense}{state}
        \end{call}
        \begin{callself}{ps}{PhysicsUpdate()}{}
        \end{callself}
        \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 part of pgf-umlsd-0.2.tar.gz
Get it at http://code.google.com/p/pgf-umlsd/}
\end{figure}

\begin{figure}
  \centering
  \begin{sequencediagram}
  \tikzstyle{inststyle}+=[rounded corners=0mm, bottom color=yellow] %% with rounded corners=0mm we get the standard behavior again
    \newthread{ss}{\ul{:SimulationServer}} 			    %% to show, that one is able, to underline special elements
    \newinst{ps}{:PhysicsServer}
    \newinst[2]{sense}{\ul{:SenseServer}} 			    %% to show, that one is able, to underline special elements
    \newthread[red]{ctr}{:SimControlNode}
    
    \begin{sdblock}[green!20]{Run Loop}{\small This is 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.The used style-file is part of pgf-umlsd-0.2.tar.gz --
get it at http://code.google.com/p/pgf-umlsd/}
\end{figure}

\end{document}

%%% Local Variables: 
%%% mode: Tex-PDF
%%% TeX-master: t
%%% End: