summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytikzautomata.code.tex
blob: d30f8abb767ae4cfe125161638aa2b4ec87073c6 (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
% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarytikzautomata.code.tex,v 1.3 2006/10/11 15:22:26 tantau Exp $


% Styles for states:

\tikzstyle{every state}=           []

\tikzstyle{state without output}=  [circle,draw,minimum size=2.5em,every state]
\tikzstyle{state with output}=     [circle split,draw,minimum size=2.5em,every state]

\tikzstyle{accepting by arrow}=    [after node path=
{
  {
    [to path=
    {
      [->,double=none,every accepting by arrow]
      --
      ([shift=(\tikz@accepting@angle:\tikz@accepting@distance)]\tikztostart.\tikz@accepting@angle)
          node [shape=rectangle,anchor=\tikz@accepting@anchor] {\tikz@accepting@text}
      }]
    edge ()
  }
}]
\tikzstyle{every accepting by arrow}=[]
\tikzstyle{accepting by double}= [double,outer sep=.5\pgflinewidth+.3pt] % .3pt is half double width distance

\tikzstyle{initial by arrow}=   [after node path=
{
  {
    [to path=
    {
      [->,double=none,every initial by arrow]
      ([shift=(\tikz@initial@angle:\tikz@initial@distance)]\tikztostart.\tikz@initial@angle)
          node [shape=rectangle,anchor=\tikz@initial@anchor] {\tikz@initial@text}
        -- (\tikztostart)}]
    edge ()
  }
}]
\tikzstyle{every initial by arrow}=[]


\tikzoption{initial text}{\tikzaddafternodepathoption{\def\tikz@initial@text{#1}}}
\tikzoption{accepting text}{\tikzaddafternodepathoption{\def\tikz@accepting@text{#1}}}

\tikzoption{initial where}{\tikzaddafternodepathoption{\csname tikz@initial@compute@#1\endcsname}}
\tikzoption{accepting where}{\tikzaddafternodepathoption{\csname tikz@accepting@compute@#1\endcsname}}

\tikzoption{initial distance}{\tikzaddafternodepathoption{\def\tikz@initial@distance{#1}}}
\tikzoption{accepting distance}{\tikzaddafternodepathoption{\def\tikz@initial@distance{#1}}}

\def\tikz@initial@text{start}
\def\tikz@accepting@text{}

\def\tikz@initial@distance{3ex}
\def\tikz@accepting@distance{3ex}

\def\tikz@initial@compute@above{\def\tikz@initial@angle{90}\def\tikz@initial@anchor{south}}
\def\tikz@initial@compute@below{\def\tikz@initial@angle{270}\def\tikz@initial@anchor{north}}
\def\tikz@initial@compute@left{\def\tikz@initial@angle{180}\def\tikz@initial@anchor{east}}
\def\tikz@initial@compute@right{\def\tikz@initial@angle{0}\def\tikz@initial@anchor{west}}

\def\tikz@initial@angle{180}
\def\tikz@initial@anchor{east}

\def\tikz@accepting@compute@above{\def\tikz@accepting@angle{90}\def\tikz@accepting@anchor{south}}
\def\tikz@accepting@compute@below{\def\tikz@accepting@angle{270}\def\tikz@accepting@anchor{north}}
\def\tikz@accepting@compute@left{\def\tikz@accepting@angle{180}\def\tikz@accepting@anchor{east}}
\def\tikz@accepting@compute@right{\def\tikz@accepting@angle{0}\def\tikz@accepting@anchor{west}}

\def\tikz@accepting@angle{0}
\def\tikz@accepting@anchor{west}


\tikzstyle{initial above}=        [initial by arrow,initial where=above]
\tikzstyle{initial below}=        [initial by arrow,initial where=below]
\tikzstyle{initial left}=         [initial by arrow,initial where=left]
\tikzstyle{initial right}=        [initial by arrow,initial where=right]

\tikzstyle{accepting above}=      [accepting by arrow,accepting where=above]
\tikzstyle{accepting below}=      [accepting by arrow,accepting where=below]
\tikzstyle{accepting left}=       [accepting by arrow,accepting where=left]
\tikzstyle{accepting right}=      [accepting by arrow,accepting where=right]


% Defaults:

\tikzstyle{state}=                [state without output]
\tikzstyle{accepting}=            [accepting by double]
\tikzstyle{initial}=              [initial by arrow]



\endinput