@@ -73,20 +73,20 @@ Sequence Diagrams.]
7373% From https://tex.stackexchange.com/questions/155776/check-if-counter-exists
7474% Tests if a counter has already been defined.
7575% Usage:
76- % \ifcounter{counter name}{action if exists}{action else}
77- \newcommand *\ifcounter [1]{%
76+ % \pgf@umlsd@ ifcounter{counter name}{action if exists}{action else}
77+ \newcommand *\pgf@umlsd@ ifcounter [1]{%
7878 \ifcsname c@#1\endcsname
79- \expandafter\@firstoftwo
79+ \expandafter\@firstoftwo
8080 \else
81- \expandafter\@secondoftwo
81+ \expandafter\@secondoftwo
8282 \fi
8383}
8484
8585% new an instance
8686% Example:
8787% \newinst[edge distance]{var}{name:class}
8888\newcommand {\newinst }[3][0.2]{
89- \ifcounter {callselflevel#2}
89+ \pgf@umlsd@ ifcounter {callselflevel#2}
9090 {\setcounter {callselflevel#2}{0}}
9191 {\newcounter {callselflevel#2}}
9292 \stepcounter {instnum}
@@ -140,7 +140,7 @@ Sequence Diagrams.]
140140}
141141}
142142{
143- \ifthenelse {\equal {\f\ thecallevel }{\t\ thecallevel }}
143+ \ifthenelse {\equal {\pgf@umlsd@f@ thecallevel }{\pgf@umlsd@t@ thecallevel }}
144144{
145145 \end {callself}
146146}
@@ -160,17 +160,17 @@ Sequence Diagrams.]
160160
161161 \draw [->,>=triangle 60] ({cf\thecallevel }) -- (ct\thecallevel )
162162 node[midway, above] {#3};
163- \def\l\ thecallevel {#1}
164- \def\f\ thecallevel {#2}
165- \def\t\ thecallevel {#4}
163+ \def\pgf@umlsd@l@ thecallevel {#1}
164+ \def\pgf@umlsd@f@ thecallevel {#2}
165+ \def\pgf@umlsd@t@ thecallevel {#4}
166166 \def\returnvalue {#5}
167167 \tikzstyle {threadstyle}+=[instcolor#2]
168168}
169169{
170- \addtocounter {seqlevel}{\l\ thecallevel }
170+ \addtocounter {seqlevel}{\pgf@umlsd@l@ thecallevel }
171171 \path
172- (\f\ thecallevel )+(0,-\theseqlevel *\unitfactor -0.7*\unitfactor ) node (rf\thecallevel ) {}
173- (\t\ thecallevel .\threadbias )+(0,-\theseqlevel *\unitfactor -0.7*\unitfactor ) node (rt\thecallevel ) {};
172+ (\pgf@umlsd@f@ thecallevel )+(0,-\theseqlevel *\unitfactor -0.7*\unitfactor ) node (rf\thecallevel ) {}
173+ (\pgf@umlsd@t@ thecallevel .\threadbias )+(0,-\theseqlevel *\unitfactor -0.7*\unitfactor ) node (rt\thecallevel ) {};
174174 \draw [dashed,->,>=angle 60] ({rt\thecallevel }) -- (rf\thecallevel )
175175 node[midway, above]{\returnvalue };
176176 \drawthread {ct\thecallevel }{rt\thecallevel }
@@ -185,13 +185,13 @@ Sequence Diagrams.]
185185\newenvironment *{callself}[4][1]{
186186 \stepcounter {seqlevel}
187187 \stepcounter {callevel} % push
188- \def\l\ thecallevel {#1}
189- \def\f\ thecallevel {#2}
190- \def\t\ thecallevel {#2}
191- \stepcounter {callselflevel\f\ thecallevel }
188+ \def\pgf@umlsd@l@ thecallevel {#1}
189+ \def\pgf@umlsd@f@ thecallevel {#2}
190+ \def\pgf@umlsd@t@ thecallevel {#2}
191+ \stepcounter {callselflevel\pgf@umlsd@f@ thecallevel }
192192
193193 \path
194- (#2)+(\arabic {callselflevel\f\ thecallevel }*0.1-0.1,-\theseqlevel *\unitfactor -0.7*\unitfactor ) node (sc\thecallevel ) {}
194+ (#2)+(\arabic {callselflevel\pgf@umlsd@f@ thecallevel }*0.1-0.1,-\theseqlevel *\unitfactor -0.7*\unitfactor ) node (sc\thecallevel ) {}
195195 ({sc\thecallevel }.east)+(0,-0.33*\unitfactor ) node (scb\thecallevel ) {};
196196
197197 \draw [->,>=triangle 60] ({sc\thecallevel }.east) -- ++(0.8,0)
@@ -200,15 +200,15 @@ Sequence Diagrams.]
200200 \def\returnvalue {#4}
201201 \tikzstyle {threadstyle}+=[instcolor#2]
202202}{
203- \addtocounter {seqlevel}{\l\ thecallevel }
204- \path (\f\ thecallevel )+(\arabic {callselflevel\f\ thecallevel }*0.1-0.1,-\theseqlevel *\unitfactor -0.33*\unitfactor ) node
203+ \addtocounter {seqlevel}{\pgf@umlsd@l@ thecallevel }
204+ \path (\pgf@umlsd@f@ thecallevel )+(\arabic {callselflevel\pgf@umlsd@f@ thecallevel }*0.1-0.1,-\theseqlevel *\unitfactor -0.33*\unitfactor ) node
205205 (sct\thecallevel ) {};
206206
207207 \draw [dashed,->,>=angle 60] ({sct\thecallevel }.east) node
208208 (sce\thecallevel ) {} -- ++(0.8,0) -- node[midway, right]{\returnvalue } ++(0,-0.33*\unitfactor ) -- ++(-0.8,0);
209209 \drawthread {scb\thecallevel }{sce\thecallevel }
210210 \addtocounter {callevel}{-1} % pop
211- \addtocounter {callselflevel\f\ thecallevel }{-1}
211+ \addtocounter {callselflevel\pgf@umlsd@f@ thecallevel }{-1}
212212}
213213
214214% message between threads
@@ -238,20 +238,20 @@ Sequence Diagrams.]
238238\newcommand *{\messself }[3][1]{
239239 \stepcounter {seqlevel}
240240 \stepcounter {callevel} % push
241- \def\l\ thecallevel {#1}
242- \def\f\ thecallevel {#2}
243- \stepcounter {callselflevel\f\ thecallevel }
241+ \def\pgf@umlsd@l@ thecallevel {#1}
242+ \def\pgf@umlsd@f@ thecallevel {#2}
243+ \stepcounter {callselflevel\pgf@umlsd@f@ thecallevel }
244244 \path
245- (\f\ thecallevel )+(\arabic {callselflevel\f\ thecallevel }*0.1-0.1,-\theseqlevel *\unitfactor -0.33*\unitfactor )
245+ (\pgf@umlsd@f@ thecallevel )+(\arabic {callselflevel\pgf@umlsd@f@ thecallevel }*0.1-0.1,-\theseqlevel *\unitfactor -0.33*\unitfactor )
246246node
247247 (sct\thecallevel ) {};
248- \addtocounter {seqlevel}{\l\ thecallevel }
248+ \addtocounter {seqlevel}{\pgf@umlsd@l@ thecallevel }
249249 \draw [->,>=angle 60] ({sct\thecallevel }.east) node
250250 (sce\thecallevel ) {} -- ++(0.8,0) -- node[midway, right]{#3}
251- ++(0,-\l\ thecallevel *\unitfactor ) -- ++(-0.8,0);
251+ ++(0,-\pgf@umlsd@l@ thecallevel *\unitfactor ) -- ++(-0.8,0);
252252
253253 \addtocounter {callevel}{-1} % pop
254- \addtocounter {callselflevel\f\ thecallevel }{-1}
254+ \addtocounter {callselflevel\pgf@umlsd@f@ thecallevel }{-1}
255255}
256256
257257% message between threads
@@ -279,16 +279,16 @@ node
279279
280280 \draw [->,>=angle 60] ({cf\thecallevel }) -- (ct\thecallevel )
281281 node[midway, above] {#3};
282- \def\l\ thecallevel {#1}
283- \def\f\ thecallevel {#2}
284- \def\t\ thecallevel {#4}
282+ \def\pgf@umlsd@l@ thecallevel {#1}
283+ \def\pgf@umlsd@f@ thecallevel {#2}
284+ \def\pgf@umlsd@t@ thecallevel {#4}
285285 \tikzstyle {threadstyle}+=[instcolor#2]
286286}
287287{
288- \addtocounter {seqlevel}{\l\ thecallevel }
288+ \addtocounter {seqlevel}{\pgf@umlsd@l@ thecallevel }
289289 \path
290- (\f\ thecallevel )+(0,-\theseqlevel *\unitfactor -0.7*\unitfactor ) node (rf\thecallevel ) {}
291- (\t\ thecallevel .\threadbias )+(0,-\theseqlevel *\unitfactor -0.3*\unitfactor ) node (rt\thecallevel ) {};
290+ (\pgf@umlsd@f@ thecallevel )+(0,-\theseqlevel *\unitfactor -0.7*\unitfactor ) node (rf\thecallevel ) {}
291+ (\pgf@umlsd@t@ thecallevel .\threadbias )+(0,-\theseqlevel *\unitfactor -0.3*\unitfactor ) node (rt\thecallevel ) {};
292292 \drawthread {ct\thecallevel }{rt\thecallevel }
293293 \addtocounter {callevel}{-1} % pop
294294}
0 commit comments