aboutsummaryrefslogtreecommitdiff
path: root/shapes.tex
blob: 0dbbba870fd0f4d3dceb088b877de15fe11847cf (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
\makeatletter

\pgfdeclareshape{stop}{%
  \savedanchor{\upperrightcorner}{
    \setlength{\pgf@xa}{\pgfshapeminwidth}
    \setlength{\pgf@ya}{\pgfshapeminheight}
    \pgf@x=0.5\pgf@xa
    \pgf@y=0.5\pgf@ya
  }
  \savedanchor{\lowerleftcorner}{
    \setlength{\pgf@xa}{\pgfshapeminwidth}
    \setlength{\pgf@ya}{\pgfshapeminheight}
    \pgf@x=-0.5\pgf@xa
    \pgf@y=-0.5\pgf@ya
  }

  \anchor{center}{\pgfpointorigin}
  % \anchor{center}{\centerpoint}
  \anchor{north east}{%
    \upperrightcorner%
  }
  \anchor{north}{%
    \upperrightcorner%
    \pgf@x=0pt
  }
  \anchor{south east}{%
    \upperrightcorner%
    \pgf@y=-\pgf@y
  }
  \anchor{south west}{%
    \lowerleftcorner%
  }
  \anchor{south}{%
    \lowerleftcorner%
    \pgf@x=0pt
  }
  \anchor{north west}{%
    \upperrightcorner%
    \pgf@x=-\pgf@x
  }
  \anchor{west}{%
    \lowerleftcorner%
    \pgf@y=0pt
  }
  \anchor{east}{%
    \upperrightcorner%
    \pgf@y=0pt
  }

  \savedanchor{\outerfirstcentersecond}{
    \setlength{\pgf@xa}{\pgfshapeminwidth}
    \setlength{\pgf@ya}{\pgfshapeminheight}
    % \divide\pgf@xa by 3
    % \divide\pgf@xa by 2
    \pgf@x=-.5\pgf@xa
    \advance\pgf@x by .5\pgf@ya
    \pgf@y=\pgf@ya
  }

  \anchor{one half}{
    \outerfirstcentersecond
    \pgf@y=0pt
  }
  \anchor{two half}{
    \outerfirstcentersecond
    \pgf@x=-\pgf@x
    \pgf@y=0pt
  }

  \anchor{north one half}{
    \outerfirstcentersecond
  }
  \anchor{north two half}{
    \outerfirstcentersecond
    \pgf@x=-\pgf@x
  }
  \anchor{south one half}{
    \outerfirstcentersecond
    \pgf@y=-\pgf@y
  }
  \anchor{south two half}{
    \outerfirstcentersecond
    \pgf@x=-\pgf@x
    \pgf@y=-\pgf@y
  }

  \savedanchor{\outerfirstquarter}{
    \setlength{\pgf@xa}{\pgfshapeminwidth}
    \setlength{\pgf@ya}{\pgfshapeminheight}
    \pgf@y=\pgf@ya
    \pgf@x=-.5\pgf@xa % We are at (shape.north west) now
    \advance\pgf@x by .5\pgf@ya % We are at (shape.north one half) now
    \advance\pgf@x by \pgf@ya
  }

  \anchor{two quarter}{
    \outerfirstquarter
    \pgf@y=0pt
  }
  \anchor{three quarter}{
    \outerfirstquarter
    \pgf@x=-\pgf@x
    \pgf@y=0pt
  }

  \anchor{north two quarter}{
    \outerfirstquarter
  }
  \anchor{south two quarter}{
    \outerfirstquarter
    \pgf@y=-\pgf@y
  }
  \anchor{north three quarter}{
    \outerfirstquarter
    \pgf@x=-\pgf@x
  }
  \anchor{south three quarter}{
    \outerfirstquarter
    \pgf@x=-\pgf@x
    \pgf@y=-\pgf@y
  }

  \savedanchor{\outerthirdsixth}{
    \setlength{\pgf@xa}{\pgfshapeminwidth}
    \setlength{\pgf@ya}{\pgfshapeminheight}
    \pgf@y=\pgf@ya
    \pgf@x=-.5\pgf@xa % We are at (shape.north west) now
    % \multiply\pgf@ya by 2
    \advance\pgf@x by 2.5\pgf@ya % We are at (shape.north one half) now
  }

  \anchor{three sixth}{
    \outerthirdsixth
    \pgf@y=0pt
  }

  \anchor{four sixth}{
    \outerthirdsixth
    \pgf@x=-\pgf@x
    \pgf@y=0pt
  }

  \anchor{north three sixth}{
    \outerthirdsixth
  }

  \anchor{south three sixth}{
    \outerthirdsixth
    \pgf@y=-\pgf@y
  }

  \anchor{north four sixth}{
    \outerthirdsixth
    \pgf@x=-\pgf@x
  }

  \anchor{south four sixth}{
    \ 
    \pgf@x=-\pgf@x
    \pgf@y=-\pgf@y
  }

  % Added only the minimal eighth anchor
  \savedanchor{\outerfourtheighth}{
    \setlength{\pgf@xa}{\pgfshapeminwidth}
    \setlength{\pgf@ya}{\pgfshapeminheight}
    \pgf@y=\pgf@ya
    \pgf@x=-.5\pgf@xa % We are at (shape.north west) now
    \advance\pgf@x by .5\pgf@ya % We are at (shape.north one half) now
    \advance\pgf@x by 3\pgf@ya
  }

  \anchor{four eighth}{
    \outerfourtheighth
    \pgf@y=0pt
  }
  \anchor{five eighth}{
    \outerfourtheighth
    \pgf@x=-\pgf@x
    \pgf@y=0pt
  }  

  % Added only the minimal tenth anchor
  \savedanchor{\outerfifthtenth}{
    \setlength{\pgf@xa}{\pgfshapeminwidth}
    \setlength{\pgf@ya}{\pgfshapeminheight}
    \pgf@y=\pgf@ya
    \pgf@x=-.5\pgf@xa % We are at (shape.north west) now
    \advance\pgf@x by .5\pgf@ya % We are at (shape.north one half) now
    \advance\pgf@x by 4\pgf@ya
  }

  \anchor{five tenth}{
    \outerfifthtenth
    \pgf@y=0pt
  }
  \anchor{six tenth}{
    \outerfifthtenth
    \pgf@x=-\pgf@x
    \pgf@y=0pt
  }

  \savedanchor{\outertop}{
    \setlength{\pgf@ya}{\pgfshapeminheight}
    \pgf@x=0pt
    \pgf@y=1\pgf@ya
  }

  \anchor{north center}{
    \outertop
  }

  \anchor{south center}{
    \outertop
    \pgf@y=-\pgf@y
  }

  \backgroundpath{
    \pgfpathrectanglecorners{\lowerleftcorner}{\upperrightcorner}
  }
}

\makeatother

\tikzset{
  stop/.style={
    shape=stop,
    color=black!30,
    draw,
    fill=yellow!30,
    rounded corners=1cm,
    minimum height=2cm,
  },
  stop1/.style={
    stop,
    minimum width=2cm,
  },
  stop2/.style={
    stop,
    minimum width=4cm,
  },
  stop3/.style={
    stop,
    minimum width=6cm,
  },
  stop4/.style={
    stop,
    minimum width=8cm,
  },
  stop5/.style={
    stop,
    minimum width=10cm,
  },
  stop6/.style={
    stop,
    minimum width=12cm,
  },
  stop7/.style={
    stop,
    minimum width=14cm,
  },
  stop8/.style={
    stop,
    minimum width=16cm,
  },
  stop9/.style={
    stop,
    minimum width=18cm,
  }, 
  stop10/.style={
    stop,
    minimum width=20cm,
  },  
}