Debian Codegraph @

texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex

raw
1 % Copyright 2018 by Till Tantau
2 %
3 % This file may be distributed and/or modified
4 %
5 % 1. under the LaTeX Project Public License and/or
6 % 2. under the GNU Public License.
7 %
8 % See the file doc/generic/pgf/licenses/LICENSE for more details.
9
10 \ProvidesFileRCS{tikzlibrarypetri.code.tex}
11
12
13 % Styles for places:
14
15 \tikzset{every place/.style= {}}%
16 \tikzset{place/.style= {circle,draw,inner sep=0pt,
17 minimum size=5ex,
18 every place}}%
19
20
21 % Styles for transition:
22
23 \tikzset{every transition/.style= {}}%
24 \tikzset{transition/.style= {rectangle,draw,inner sep=0pt,
25 minimum size=4mm,
26 every transition}}%
27
28
29 % Styles for relationship types:
30
31 \tikzset{pre/.style= {<-,shorten <=1pt}}%
32 \tikzset{post/.style= {->,shorten >=1pt}}%
33 \tikzset{pre and post/.style= {<->,shorten >=1pt,shorten <=1pt}}%
34
35
36
37 % Styles for marks:
38
39 \tikzset{every token/.style= {}}%
40 \tikzset{token/.style= {fill=black,draw=none,circle,
41 inner sep=0.5pt,minimum size=1ex,
42 text=white,font=\pgfutil@font@tiny,every token}}%
43
44 \tikzoption{token distance}{\def\tikz@token@distance{#1}}%
45 \def\tikz@token@distance{1.5ex}%
46
47 \tikzset{children are tokens/.style= {growth function=\tikz@grow@tokens,edge from parent path=}}%
48
49 \tikzoption{tokens}{%
50 \ifnum#1>0\relax%
51 \tikzset{append after command={}
52 {[children are tokens]child foreach \tikz@dummy in {1,...,#1} {node[token]{}}}}%
53 \fi}%
54
55 \tikzoption{colored tokens}{%
56 \tikzset{append after command={}%
57 {[children are tokens]child foreach \tikz@child@color in {#1} {node[token,\tikz@child@color]{}}}}%
58 }%
59
60 \tikzoption{structured tokens}{%
61 \tikzset{append after command={}%
62 {[children are tokens]child foreach \tikzpetrichildname in {#1} {node[token]{\tikzpetrichildname}}}}%
63 }%
64
65
66 \def\tikz@grow@tokens{%
67 \pgfmathsetlength{\pgf@xa}{\tikz@token@distance}%
68 \pgfmathsetlength{\pgf@ya}{\tikz@token@distance}%
69 \pgf@xc=0pt%
70 \pgf@yc=0pt%
71 \csname tikz@grow@tokens@placer@\the\tikznumberofchildren @\the\tikznumberofcurrentchild\endcsname%
72 \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
73 }%
74
75 \def\tikz@def@grow@tokens#1#2#3#4{%
76 \expandafter\def\csname tikz@grow@tokens@placer@#1@#2\endcsname{%
77 \pgf@xc=#3\pgf@xa%
78 \pgf@yc=#4\pgf@ya}%
79 }%
80
81
82 % Single token
83 \tikz@def@grow@tokens{1}{1}{0}{0}%
84
85 % Two tokens
86 \tikz@def@grow@tokens{2}{1}{-.5}{0}%
87 \tikz@def@grow@tokens{2}{2}{.5}{0}%
88
89 % Three tokens
90 \tikz@def@grow@tokens{3}{1}{0} {0.57}%
91 \tikz@def@grow@tokens{3}{2}{-.5}{-.306025}%
92 \tikz@def@grow@tokens{3}{3}{.5} {-.306025}%
93
94 % Four tokens
95 \tikz@def@grow@tokens{4}{1}{-.5}{.5}%
96 \tikz@def@grow@tokens{4}{2}{.5}{.5}%
97 \tikz@def@grow@tokens{4}{3}{-.5}{-.5}%
98 \tikz@def@grow@tokens{4}{4}{.5}{-.5}%
99
100 % Five tokens
101 \tikz@def@grow@tokens{5}{1}{0}{.85}%
102 \tikz@def@grow@tokens{5}{2}{-0.808398}{0.26266}%
103 \tikz@def@grow@tokens{5}{3}{0.808398}{0.26266}%
104 \tikz@def@grow@tokens{5}{4}{-0.499617}{-0.687664}%
105 \tikz@def@grow@tokens{5}{5}{0.499617}{-0.687664}%
106
107 % Six tokens
108 \tikz@def@grow@tokens{6}{1}{-1}{.5}%
109 \tikz@def@grow@tokens{6}{2}{0}{.5}%
110 \tikz@def@grow@tokens{6}{3}{1}{.5}%
111 \tikz@def@grow@tokens{6}{4}{-1}{-.5}%
112 \tikz@def@grow@tokens{6}{5}{0}{-.5}%
113 \tikz@def@grow@tokens{6}{6}{1}{-.5}%
114
115 % Seven tokens
116 \tikz@def@grow@tokens{7}{1}{0}{1}%
117 \tikz@def@grow@tokens{7}{2}{-1}{.5}%
118 \tikz@def@grow@tokens{7}{3}{0}{0}%
119 \tikz@def@grow@tokens{7}{4}{1}{.5}%
120 \tikz@def@grow@tokens{7}{5}{-1}{-.5}%
121 \tikz@def@grow@tokens{7}{6}{0}{-1}%
122 \tikz@def@grow@tokens{7}{7}{1}{-.5}%
123
124 % Eight tokens
125 \tikz@def@grow@tokens{8}{1}{-.5}{1}%
126 \tikz@def@grow@tokens{8}{2}{.5}{1}%
127 \tikz@def@grow@tokens{8}{3}{-1}{0}%
128 \tikz@def@grow@tokens{8}{4}{0}{0}%
129 \tikz@def@grow@tokens{8}{5}{1}{0}%
130 \tikz@def@grow@tokens{8}{6}{-1}{-1}%
131 \tikz@def@grow@tokens{8}{7}{0}{-1}%
132 \tikz@def@grow@tokens{8}{8}{1}{-1}%
133
134 % Eight tokens
135 \tikz@def@grow@tokens{9}{1}{-1}{1}%
136 \tikz@def@grow@tokens{9}{2}{0}{1}%
137 \tikz@def@grow@tokens{9}{3}{1}{1}%
138 \tikz@def@grow@tokens{9}{4}{-1}{0}%
139 \tikz@def@grow@tokens{9}{5}{0}{0}%
140 \tikz@def@grow@tokens{9}{6}{1}{0}%
141 \tikz@def@grow@tokens{9}{7}{-1}{-1}%
142 \tikz@def@grow@tokens{9}{8}{0}{-1}%
143 \tikz@def@grow@tokens{9}{9}{1}{-1}%
144
145
146 \endinput