-
Notifications
You must be signed in to change notification settings - Fork 0
/
basestation.tex
580 lines (499 loc) · 19.2 KB
/
basestation.tex
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
% chktex-file 1
% chktex-file 27
\makeatletter
% The keys that the user can provide are all the keys below.
% Keys for the Beam shape
\pgfkeys{
/pgf/.cd,
% The 4 following options control the proportion of shapewidth/shapeheight for
% the control points of the beam -> The must be greater than zero
control point 1 x/.initial=0.35,
control point 1 y/.initial=1.0,
control point 2 x/.initial=0.5,
control point 2 y/.initial=0.25,
}
% Keys for the UserTerminal shape
\pgfkeys{
/pgf/.cd,
button fill color/.initial=white,
screen fill color/.initial=white,
}
% Represents a "beam", which is constructed using two Bézier curves.
% The two control points can be controlled by passing the
% "control point 1 x/control point 1 y/control point 2 x/control point 2 y"
% parameters.
\pgfdeclareshape{Beam}{
% xxxxxxxxxx Define some saved macros xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\savedmacro\shapewidth{
\def\shapewidth{\pgfkeysvalueof{/pgf/minimum width}}
}
\savedmacro\shapeheight{
\def\shapeheight{\pgfkeysvalueof{/pgf/minimum height}}
}
\savedmacro\firstpointxprop{
\def\firstpointxprop{\pgfkeysvalueof{/pgf/control point 1 x}}
}
\savedmacro\firstpointyprop{
\def\firstpointyprop{\pgfkeysvalueof{/pgf/control point 1 y}}
}
\savedmacro\secondpointxprop{
\def\secondpointxprop{\pgfkeysvalueof{/pgf/control point 2 x}}
}
\savedmacro\secondpointyprop{
\def\secondpointyprop{\pgfkeysvalueof{/pgf/control point 2 y}}
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\savedanchor\startpoint{%
\pgfmathsetlength\pgf@x{-0.5*\shapewidth}
\pgfmathsetlength\pgf@y{0}
}
\savedanchor\endpoint{%
\pgfmathsetlength\pgf@x{0.5*\shapewidth}
\pgfmathsetlength\pgf@y{0}
}
% \savedanchor\centerpoint{%
% \pgf@x=0%
% \pgf@y=0%
% }
% Control point anchors
\savedanchor\firstcontrolpointtop{%
\pgfmathsetlength\pgf@x{\firstpointxprop*\shapewidth}
\pgfmathsetlength\pgf@y{\firstpointyprop*\shapeheight}
}
\savedanchor\secondcontrolpointtop{%
\pgfmathsetlength\pgf@x{\secondpointxprop*\shapewidth}
\pgfmathsetlength\pgf@y{\secondpointyprop*\shapeheight}
}
\savedanchor\firstcontrolpointbottom{%
\pgfmathsetlength\pgf@x{\firstpointxprop*\shapewidth}
\pgfmathsetlength\pgf@y{-\firstpointyprop*\shapeheight}
}
\savedanchor\secondcontrolpointbottom{%
\pgfmathsetlength\pgf@x{\secondpointxprop*\shapewidth}
\pgfmathsetlength\pgf@y{-\secondpointyprop*\shapeheight}
}
% xxxxxxxxxx Define regular anchors xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\anchor{center}{\startpoint}
\anchor{start}{\startpoint}
\anchor{end}{\endpoint}
\anchor{main region}{
\endpoint
\pgfmathsetlength\pgf@x{\[email protected]*\shapewidth}
}
\anchor{top control point 1}{\firstcontrolpointtop}
\anchor{top control point 2}{\secondcontrolpointtop}
\anchor{bottom control point 1}{\firstcontrolpointbottom}
\anchor{bottom control point 2}{\secondcontrolpointbottom}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\inheritanchorborder[from=rectangle]
% xxxxxxxxxx Draw the background path xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\backgroundpath{
\begin{pgfscope}
\pgfmoveto{\startpoint}
\pgfcurveto{\firstcontrolpointtop}{\secondcontrolpointtop}{\endpoint}
\pgfcurveto{\secondcontrolpointbottom}{\firstcontrolpointbottom}{\startpoint}
\pgfpathclose
\pgfusepath{stroke,fill}
\end{pgfscope}
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxx UserTerminal Shape xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\pgfdeclareshape{UserTerminal}{
% xxxxxxxxxx First we define some savedmacros xxxxxxxxxxxxxxxxxxxxxxxxxxx
% Macros and savedanchors common to UserTerminal and BaseStation Shapes
\savedanchor{\center}{
\pgf@x=0pt
\pgf@y=0pt
}
% Note that pgf provides the text macros \pgfshapeminwidth and
% pgfshapeminheight that store the minim width and minimum height,
% respectivelly. Note that They are "TEXT macros" and not
% "lengths". Calling them simple
% replaces for the text.
\savedanchor{\northeast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0.5\pgf@xa
\pgf@y=0.5\pgf@ya
% NOTE: We can't use 0.5\pgfshapeminwidth directly because the minimum
% width is stored in a "plain text macro". If minimum width is 2cm, for
% instance, and we write "\pgf@x=.5\pgfshapeminwidth" then \pgf@x would
% be set to 0.52cm, which is not what we want. See the explanation for
% \savedanchor in the pgfmanual (page 627).
}
\savedanchor{\southwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=-0.5\pgf@xa
\pgf@y=-0.5\pgf@ya
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% Savedanchors specific to the UserTerminal shape
\savedanchor{\screennortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0.45\pgf@xa
\pgf@y=0.45\pgf@ya
}
\savedanchor{\screensouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=-0.45\pgf@xa
\pgf@y=-0.35\pgf@ya
}
\savedanchor{\buttonsouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0pt
\pgf@y=-0.425\pgf@ya
\advance\pgf@x by -0.15\pgf@xa
\advance\pgf@y by -0.04\pgf@ya
}
\savedanchor{\buttonnortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0pt
\pgf@y=-0.425\pgf@ya
\advance\pgf@x by 0.15\pgf@xa
\advance\pgf@y by 0.04\pgf@ya
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Inherit anchor border from rectangle xxxxxxxxxxxxxxxxxxxxxxx
\inheritanchorborder[from=rectangle]
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Inherit normal anchors from rectangle xxxxxxxxxxxxxxxxxxxxxx
% We define the savedanchors "northeast" and "southwest". With these two
% defined we can inherit code for the regular anchors from the
% rectangle shape (even thought the northeast and southwest saved anchors
% in the rectangle shape are different from ours).
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{east}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{north east}
\inheritanchor[from=rectangle]{north west}
\inheritanchor[from=rectangle]{south west}
\inheritanchor[from=rectangle]{south east}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Now we define more regular anchors xxxxxxxxxxxxxxxxxxxxxxxxx
\anchor{text}
{
% This will get the center of the screen
\pgfpointlineattime{0.5}{\screensouthwest}{\screennortheast}
% Lets put the center of the text in the center of the screen
\advance\pgf@x by -0.5\wd\pgfnodeparttextbox
\advance\pgf@y by -0.5\ht\pgfnodeparttextbox
}
\anchor{button}{
\pgfpointlineattime{0.5}{\buttonsouthwest}{\buttonnortheast}
}
\anchor{screen}{
\pgfpointlineattime{0.5}{\screensouthwest}{\screennortheast}
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Draw the background xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\backgroundpath{
% Scope for Terminal Body
\begin{pgfscope}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
% '\pgfshapeminheight' cannot be used directly; or if you want to use it directly use the '*' for multiplication
\pgfsetcornersarced{\pgfpoint{0.03\pgf@ya}{0.03\pgf@ya}}
\pgfpathrectanglecorners
{\southwest}
{\northeast}
\pgfusepath{stroke,fill}
\end{pgfscope}
% Scope for the terminal Screen
\begin{pgfscope}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgfsetcornersarced{\pgfpoint{0.03\pgf@ya}{0.03\pgf@ya}}
\pgfsetfillcolor{\pgfkeysvalueof{/pgf/screen fill color}}
%\pgfsetfillcolor{white}
\pgfpathrectanglecorners
{\screensouthwest}
{\screennortheast}
\pgfusepath{stroke,fill}
\end{pgfscope}
% Scope for the button
\begin{pgfscope}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgfsetcornersarced{\pgfpoint{0.009\pgf@ya}{0.009\pgf@ya}}
\pgfsetfillcolor{\pgfkeysvalueof{/pgf/button fill color}}
%\pgfsetfillcolor{white}
\pgfpathrectanglecorners
{\buttonsouthwest}
{\buttonnortheast}
\pgfusepath{stroke,fill}
\end{pgfscope}
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxx END xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxx BaseStationSimple xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\pgfdeclareshape{BaseStationSimple}{
% xxxxxxxxxx Define savedanchors xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% Inherit all savedanchors from UserTerminal. We only need northeast and
% southwest, but we can't choose which ones to inherit.
\inheritsavedanchors[from=UserTerminal]
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxx Define savedanchors specific to the BaseStation shape xxxxxxxxxxx
\savedanchor{\BaseAsouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@y=-0.5\pgf@ya
\pgf@x=-0.12\pgf@xa
}
\savedanchor{\BaseAnortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@y=0.30\pgf@ya
\pgf@x=0.12\pgf@xa
}
% Maybe I don't need this savedanchor
\savedanchor{\MiddleAntennasouth}{
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0pt
\pgf@y=0.29\pgf@ya
}
\savedanchor{\AntennaConnectorsouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=-0.5\pgf@xa
\pgf@y=0.38\pgf@ya
}
\savedanchor{\AntennaConnectornortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0.5\pgf@xa
\pgf@y=0.42\pgf@ya
}
\savedanchor{\MiddleAntennasouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=-0.15\pgf@xa
\pgf@y=0.29\pgf@ya
}
\savedanchor{\MiddleAntennanortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0.15\pgf@xa
\pgf@y=0.5\pgf@ya
}
\savedanchor{\LeftAntennasouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=-0.5\pgf@xa
\pgf@y=0.29\pgf@ya
}
\savedanchor{\LeftAntennanortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=-0.25\pgf@xa
\pgf@y=0.5\pgf@ya
}
\savedanchor{\RightAntennasouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0.25\pgf@xa
\pgf@y=0.29\pgf@ya
}
\savedanchor{\RightAntennanortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@x=0.5\pgf@xa
\pgf@y=0.5\pgf@ya
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Inherit anchor border from UserTerminal xxxxxxxxxxxxxxxxxxxx
\inheritanchorborder[from=UserTerminal]
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Inherit normal anchors from UserTerminal xxxxxxxxxxxxxxxxxxx
% We define the savedanchors "northeast" and "southwest". With these two
% defined we can inherit code for the regular anchors from the
% UserTerminal shape (even thought the northeast and southwest saved anchors
% in the UserTerminal shape are different from ours).
\inheritanchor[from=UserTerminal]{center}
\inheritanchor[from=UserTerminal]{north}
\inheritanchor[from=UserTerminal]{east}
\inheritanchor[from=UserTerminal]{south}
\inheritanchor[from=UserTerminal]{west}
\inheritanchor[from=UserTerminal]{north east}
\inheritanchor[from=UserTerminal]{north west}
\inheritanchor[from=UserTerminal]{south west}
\inheritanchor[from=UserTerminal]{south east}
\inheritanchor[from=rectangle]{text}
\anchor{antenna right}{
\northeast
\pgfmathsetlength\pgf@y{0.8*\pgf@y}
}
\anchor{antenna left}{
\northeast
\pgfmathsetlength\pgf@y{0.8*\pgf@y}
\pgfmathsetlength\pgf@x{-\pgf@x}
}
\anchor{antenna center}{
\northeast
\pgfmathsetlength\pgf@y{0.8*\pgf@y}
\pgfmathsetlength\pgf@x{0}
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Draw the "behind background" xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% The base of the antenna will be in the behindbackgroundpath while the
% antennas will be in the backgroundpath.
\behindbackgroundpath{
% Scope for the Base
\begin{pgfscope}
% Draw the bottom base
\pgfpathrectanglecorners
{\BaseAsouthwest}
{\BaseAnortheast}
\pgfusepath{stroke,fill}
\end{pgfscope}
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Draw the background xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% The base of the antenna will be in the behindbackgroundpath while the
% antennas will be in the backgroundpath. The main reason for this
% separation is that this code here will be inherited in the
% "BaseStation" shape that we will define later.
\backgroundpath{
% Scope for the antenna connector
\begin{pgfscope}
% Draw Antenna connector
\pgfpathrectanglecorners
{\AntennaConnectorsouthwest}
{\AntennaConnectornortheast}
\pgfusepath{stroke,fill}
\end{pgfscope}
% Scope for the antennas
\begin{pgfscope}
% Draw the middle antenna
\pgfpathrectanglecorners
{\MiddleAntennasouthwest}
{\MiddleAntennanortheast}
% Draw the Left antenna
\pgfpathrectanglecorners
{\LeftAntennasouthwest}
{\LeftAntennanortheast}
% Draw the Right antenna
\pgfpathrectanglecorners
{\RightAntennasouthwest}
{\RightAntennanortheast}
\pgfusepath{stroke,fill}
\end{pgfscope}
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxx END xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxx BaseStation Shape xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\pgfdeclareshape{BaseStation}{
% xxxxxxxxxx Define savedanchors xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% Inherit all savedanchors from BaseStationSimple.
\inheritsavedanchors[from=BaseStationSimple]
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxx Define savedanchors specific to the BaseStation shape xxxxxxxxxxx
\savedanchor{\BaseAsouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@y=-0.5\pgf@ya
\pgf@x=-0.2\pgf@xa
}
\savedanchor{\BaseAnortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@y=-0.05\pgf@ya
\pgf@x=0.2\pgf@xa
}
\savedanchor{\BaseBsoutheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@y=-0.05\pgf@ya
\pgf@x=0.15\pgf@xa
}
\savedanchor{\BaseBnorthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@y=0.15\pgf@ya
\pgf@x=-0.15\pgf@xa
}
\savedanchor{\BaseCsouthwest}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@y=0.15\pgf@ya
\pgf@x=-0.1\pgf@xa
}
\savedanchor{\BaseCnortheast}{
\pgfmathsetlength\pgf@xa{\pgfshapeminwidth}
\pgfmathsetlength\pgf@ya{\pgfshapeminheight}
\pgf@y=0.30\pgf@ya
\pgf@x=0.1\pgf@xa
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Inherit anchor border from BaseStationSimple xxxxxxxxxxxxxxx
\inheritanchorborder[from=BaseStationSimple]
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Inherit normal anchors from BaseStationSimple xxxxxxxxxxxxxx
% We define the savedanchors "northeast" and "southwest". With these two
% defined we can inherit code for the regular anchors from the
% BaseStationSimple shape (even thought the northeast and southwest saved anchors
% in the BaseStationSimple shape are different from ours)..
\inheritanchor[from=BaseStationSimple]{center}
\inheritanchor[from=BaseStationSimple]{north}
\inheritanchor[from=BaseStationSimple]{east}
\inheritanchor[from=BaseStationSimple]{south}
\inheritanchor[from=BaseStationSimple]{west}
\inheritanchor[from=BaseStationSimple]{north east}
\inheritanchor[from=BaseStationSimple]{north west}
\inheritanchor[from=BaseStationSimple]{south west}
\inheritanchor[from=BaseStationSimple]{south east}
\inheritanchor[from=BaseStationSimple]{antenna right}
\inheritanchor[from=BaseStationSimple]{antenna left}
\inheritanchor[from=BaseStationSimple]{antenna center}
\inheritanchor[from=rectangle]{text}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxx Draw the "behind background" xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\behindbackgroundpath{
% Scope for the Base
\begin{pgfscope}
% Draw the bottom base
\pgfpathrectanglecorners
{\BaseAsouthwest}
{\BaseAnortheast}
% Draw the middle base
\pgfpathrectanglecorners
{\BaseBsoutheast}
{\BaseBnorthwest}
% Draw the bottom base
\pgfpathrectanglecorners
{\BaseCsouthwest}
{\BaseCnortheast}
\pgfusepath{stroke,fill}
\end{pgfscope}
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxx Inherit the background path from BaseStationSimple xxxxxxxxxxx
\inheritbackgroundpath[from=BaseStationSimple]
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxx END xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
% xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\makeatother
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "testbasestation.tex"
%%% TeX-PDF-mode: t
%%% End: