ruby-graphviz 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/.gemrc +0 -0
  2. data/.gitignore +6 -0
  3. data/AUTHORS +3 -0
  4. data/Gemfile +4 -0
  5. data/README.rdoc +25 -45
  6. data/Rakefile +59 -0
  7. data/bin/dot2ruby +0 -0
  8. data/bin/gem2gv +0 -0
  9. data/bin/git2gv +0 -0
  10. data/bin/ruby2gv +0 -0
  11. data/bin/xml2gv +0 -0
  12. data/examples/sample48.rb +2 -2
  13. data/examples/sample62.rb +24 -0
  14. data/examples/sample63.rb +32 -0
  15. data/examples/sample64.rb +31 -0
  16. data/examples/sample65.rb +9 -0
  17. data/lib/graphviz.rb +55 -25
  18. data/lib/graphviz/constants.rb +103 -100
  19. data/lib/graphviz/core_ext.rb +57 -34
  20. data/lib/graphviz/dot2ruby.rb +9 -0
  21. data/lib/graphviz/dsl.rb +59 -0
  22. data/lib/graphviz/node.rb +2 -1
  23. data/lib/graphviz/types.rb +0 -4
  24. data/lib/graphviz/types/arrow_type.rb +32 -0
  25. data/lib/graphviz/types/color.rb +56 -0
  26. data/lib/graphviz/types/color_list.rb +22 -0
  27. data/lib/graphviz/types/esc_string.rb +5 -14
  28. data/lib/graphviz/types/gv_bool.rb +49 -0
  29. data/lib/graphviz/types/gv_double.rb +12 -2
  30. data/lib/graphviz/types/html_string.rb +3 -1
  31. data/lib/graphviz/types/lbl_string.rb +2 -1
  32. data/lib/graphviz/types/rect.rb +34 -0
  33. data/lib/graphviz/types/spline_type.rb +75 -0
  34. data/lib/graphviz/utils.rb +2 -2
  35. data/lib/graphviz/utils/colors.rb +1019 -0
  36. data/ruby-graphviz.gemspec +57 -0
  37. data/test/test_examples.rb +4 -0
  38. data/test/{test_init.rb → test_graph.rb} +1 -1
  39. data/test/test_types.rb +65 -0
  40. data/test/test_utils_colors.rb +57 -0
  41. metadata +100 -112
  42. data/examples/rgv/rgv.ps +0 -125
  43. data/examples/rgv/test_rgv.rb +0 -12
  44. data/examples/rgv/test_rgv.rb.ps +0 -393
  45. data/examples/simpsons.gv +0 -69
  46. data/test/output/sample01.rb.png +0 -0
  47. data/test/output/sample02.rb.png +0 -0
  48. data/test/output/sample03.rb.png +0 -0
  49. data/test/output/sample04.rb.png +0 -0
  50. data/test/output/sample05.rb.png +0 -0
  51. data/test/output/sample06.rb.png +0 -0
  52. data/test/output/sample07.rb.png +0 -0
  53. data/test/output/sample08.rb.png +0 -0
  54. data/test/output/sample09.rb.png +0 -0
  55. data/test/output/sample10.rb.png +0 -0
  56. data/test/output/sample11.rb.png +0 -0
  57. data/test/output/sample12.rb.png +0 -0
  58. data/test/output/sample13.rb.png +0 -0
  59. data/test/output/sample14.rb.png +0 -0
  60. data/test/output/sample15.rb.png +0 -0
  61. data/test/output/sample16.rb.png +0 -0
  62. data/test/output/sample17.rb.png +0 -0
  63. data/test/output/sample18.rb.png +0 -0
  64. data/test/output/sample19.rb.png +0 -0
  65. data/test/output/sample20.rb.png +0 -0
  66. data/test/output/sample21.rb.html +0 -3
  67. data/test/output/sample21.rb.png +0 -0
  68. data/test/output/sample22.rb.html +0 -5
  69. data/test/output/sample22.rb.png +0 -0
  70. data/test/output/sample23.rb.png +0 -0
  71. data/test/output/sample24.rb.png +0 -0
  72. data/test/output/sample25.rb.png +0 -0
  73. data/test/output/sample26.rb.png +0 -0
  74. data/test/output/sample28.rb.png +0 -0
  75. data/test/output/sample29.rb.svg +0 -21
  76. data/test/output/sample30.rb.ps +0 -923
  77. data/test/output/sample31.rb.png +0 -0
  78. data/test/output/sample32.rb.png +0 -0
  79. data/test/output/sample35.rb.gv +0 -24
  80. data/test/output/sample35.rb.png +0 -0
  81. data/test/output/sample37.rb.dot +0 -50
  82. data/test/output/sample37.rb.png +0 -0
  83. data/test/output/sample38.rb.png +0 -0
  84. data/test/output/sample39.rb.png +0 -0
  85. data/test/output/sample40.rb.png +0 -0
  86. data/test/output/sample41.rb.svg +0 -8
  87. data/test/output/sample42.rb.png +0 -0
  88. data/test/output/sample43.rb.png +0 -0
  89. data/test/output/sample44.rb.png +0 -0
  90. data/test/output/sample45.rb.png +0 -0
  91. data/test/output/sample46.rb.png +0 -0
  92. data/test/output/sample47.rb.png +0 -0
  93. data/test/output/sample48.rb.png +0 -0
  94. data/test/output/sample49.rb.png +0 -0
  95. data/test/output/sample50.rb.png +0 -0
  96. data/test/output/sample51.rb.png +0 -0
  97. data/test/output/sample52.rb.png +0 -0
  98. data/test/output/sample53.rb.png +0 -0
  99. data/test/output/sample54.rb.png +0 -0
  100. data/test/output/sample55.rb.png +0 -0
  101. data/test/output/sample56.rb.svg +0 -28
  102. data/test/output/sample58.rb.png +0 -0
  103. data/test/output/sample59.rb.png +0 -0
  104. data/test/output/sample60.rb.png +0 -0
  105. data/test/output/sample61.rb.png +0 -0
  106. data/test/output/sample99.rb.png +0 -0
@@ -1,69 +0,0 @@
1
- digraph FamilyTree {
2
- subgraph Generation0 {
3
- rank = "same";
4
- abraham [label = "Abraham", shape = "box", color = "blue"];
5
- mona [label = "Mona", shape = "box", color = "pink"];
6
- abrahamAndmona [shape = "point"];
7
- abraham -> abrahamAndmona [dir = "none"]
8
- abrahamAndmona -> mona [dir = "none"]
9
- clancy [label = "Clancy", shape = "box", color = "blue"];
10
- jackeline [label = "Jackeline", shape = "box", color = "pink"];
11
- clancyAndjackeline [shape = "point"];
12
- clancy -> clancyAndjackeline [dir = "none"]
13
- clancyAndjackeline -> jackeline [dir = "none"]
14
- }
15
- subgraph Generation1 {
16
- rank = "same";
17
- herb [label = "Herb", shape = "box", color = "blue"];
18
- homer [label = "Homer", shape = "box", color = "blue"];
19
- homerAndmarge [shape = "point"];
20
- marge [label = "Marge", shape = "box", color = "pink"];
21
- patty [label = "Patty", shape = "box", color = "pink"];
22
- selma [label = "Selma", shape = "box", color = "pink"];
23
- homer -> homerAndmarge [dir = "none"]
24
- homerAndmarge -> marge [dir = "none"]
25
- }
26
- subgraph abrahamAndmonaKids {
27
- rank = "same";
28
- herbKid [label = "herbKid", shape = "point"];
29
- abrahamAndmonaKids [label = "abrahamAndmonaKids", shape = "point"];
30
- herbKid -> abrahamAndmonaKids [dir = "none"]
31
- homerKid [label = "homerKid", shape = "point"];
32
- abrahamAndmonaKids -> homerKid [dir = "none"]
33
- }
34
- herbKid -> herb [dir = "none"]
35
- abrahamAndmona -> abrahamAndmonaKids [dir = "none"]
36
- homerKid -> homer [dir = "none"]
37
- subgraph clancyAndjackelineKids {
38
- rank = "same";
39
- margeKid [label = "margeKid", shape = "point"];
40
- pattyKid [label = "pattyKid", shape = "point"];
41
- margeKid -> pattyKid [dir = "none"]
42
- selmaKid [label = "selmaKid", shape = "point"];
43
- pattyKid -> selmaKid [dir = "none"]
44
- }
45
- margeKid -> marge [dir = "none"]
46
- pattyKid -> patty [dir = "none"]
47
- clancyAndjackeline -> pattyKid [dir = "none"]
48
- selmaKid -> selma [dir = "none"]
49
- subgraph Generation2 {
50
- rank = "same";
51
- bart [label = "Bart", shape = "box", color = "blue"];
52
- lisa [label = "Lisa", shape = "box", color = "pink"];
53
- maggie [label = "Maggie", shape = "box", color = "pink"];
54
- ling [label = "Ling", shape = "box", color = "blue"];
55
- }
56
- subgraph homerAndmargeKids {
57
- rank = "same";
58
- bartKid [label = "bartKid", shape = "point"];
59
- lisaKid [label = "lisaKid", shape = "point"];
60
- bartKid -> lisaKid [dir = "none"]
61
- maggieKid [label = "maggieKid", shape = "point"];
62
- lisaKid -> maggieKid [dir = "none"]
63
- }
64
- bartKid -> bart [dir = "none"]
65
- lisaKid -> lisa [dir = "none"]
66
- homerAndmarge -> lisaKid [dir = "none"]
67
- maggieKid -> maggie [dir = "none"]
68
- ling -> selma [dir = "none"]
69
- }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,3 +0,0 @@
1
- base referer
2
- poly http://www.research.att.com/base.html 133,29 130,22 121,15 107,10 89,7 69,5 50,7 32,10 17,15 8,22 5,29 8,37 17,43 32,49 50,52 69,53 89,52 107,49 121,43 130,37
3
- poly colors.html 114,125 112,118 106,111 96,106 83,103 69,101 55,103 43,106 33,111 26,118 24,125 26,133 33,139 43,145 55,148 69,149 83,148 96,145 106,139 112,133
Binary file
@@ -1,5 +0,0 @@
1
- <map id="mainmap" name="mainmap">
2
- <area shape="poly" id="node1" href="http://www.research.att.com/command.html" title="command" alt="" coords="133,29 130,22 121,15 107,10 89,7 69,5 50,7 32,10 17,15 8,22 5,29 8,37 17,43 32,49 50,52 69,53 89,52 107,49 121,43 130,37"/>
3
- <area shape="poly" id="edge2" href="colors.html" alt="" coords="72,54 72,87 67,87 67,54"/>
4
- <area shape="rect" id="graph1" href="http://www.research.att.com/base.html" alt="" coords="0,0,139,155"/>
5
- </map>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
3
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
- <!-- Generated by graphviz version 2.27.20101125.0545 (20101125.0545)
5
- -->
6
- <!-- Title: G Pages: 1 -->
7
- <svg width="150pt" height="62pt"
8
- viewBox="0.00 0.00 150.00 62.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9
- <g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 58)">
10
- <title>G</title>
11
- <polygon fill="white" stroke="white" points="-4,5 -4,-58 147,-58 147,5 -4,5"/>
12
- <!-- &quot;Hello\.&quot;\nHow are you ? -->
13
- <g id="node1" class="node"><title>&quot;Hello\.&quot;\nHow are you ?</title>
14
- <a xlink:href="http://www.website.com" xlink:title="&quot;Hello.&quot;\nHow are you ?">
15
- <ellipse fill="none" stroke="#ff0000" cx="71" cy="-27" rx="70.9184" ry="26.8701"/>
16
- <text text-anchor="middle" x="71" y="-29.4" font-family="Times,serif" font-size="14.00">&quot;Hello.&quot;</text>
17
- <text text-anchor="middle" x="71" y="-14.4" font-family="Times,serif" font-size="14.00">How are you ?</text>
18
- </a>
19
- </g>
20
- </g>
21
- </svg>
@@ -1,923 +0,0 @@
1
- %!PS-Adobe-3.0
2
- %%Creator: graphviz version 2.27.20101125.0545 (20101125.0545)
3
- %%Title: g
4
- %%Pages: (atend)
5
- %%BoundingBox: (atend)
6
- %%EndComments
7
- save
8
- %%BeginProlog
9
- /DotDict 200 dict def
10
- DotDict begin
11
-
12
- /setupLatin1 {
13
- mark
14
- /EncodingVector 256 array def
15
- EncodingVector 0
16
-
17
- ISOLatin1Encoding 0 255 getinterval putinterval
18
- EncodingVector 45 /hyphen put
19
-
20
- % Set up ISO Latin 1 character encoding
21
- /starnetISO {
22
- dup dup findfont dup length dict begin
23
- { 1 index /FID ne { def }{ pop pop } ifelse
24
- } forall
25
- /Encoding EncodingVector def
26
- currentdict end definefont
27
- } def
28
- /Times-Roman starnetISO def
29
- /Times-Italic starnetISO def
30
- /Times-Bold starnetISO def
31
- /Times-BoldItalic starnetISO def
32
- /Helvetica starnetISO def
33
- /Helvetica-Oblique starnetISO def
34
- /Helvetica-Bold starnetISO def
35
- /Helvetica-BoldOblique starnetISO def
36
- /Courier starnetISO def
37
- /Courier-Oblique starnetISO def
38
- /Courier-Bold starnetISO def
39
- /Courier-BoldOblique starnetISO def
40
- cleartomark
41
- } bind def
42
-
43
- %%BeginResource: procset graphviz 0 0
44
- /coord-font-family /Times-Roman def
45
- /default-font-family /Times-Roman def
46
- /coordfont coord-font-family findfont 8 scalefont def
47
-
48
- /InvScaleFactor 1.0 def
49
- /set_scale {
50
- dup 1 exch div /InvScaleFactor exch def
51
- scale
52
- } bind def
53
-
54
- % styles
55
- /solid { [] 0 setdash } bind def
56
- /dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def
57
- /dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def
58
- /invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def
59
- /bold { 2 setlinewidth } bind def
60
- /filled { } bind def
61
- /unfilled { } bind def
62
- /rounded { } bind def
63
- /diagonals { } bind def
64
-
65
- % hooks for setting color
66
- /nodecolor { sethsbcolor } bind def
67
- /edgecolor { sethsbcolor } bind def
68
- /graphcolor { sethsbcolor } bind def
69
- /nopcolor {pop pop pop} bind def
70
-
71
- /beginpage { % i j npages
72
- /npages exch def
73
- /j exch def
74
- /i exch def
75
- /str 10 string def
76
- npages 1 gt {
77
- gsave
78
- coordfont setfont
79
- 0 0 moveto
80
- (\() show i str cvs show (,) show j str cvs show (\)) show
81
- grestore
82
- } if
83
- } bind def
84
-
85
- /set_font {
86
- findfont exch
87
- scalefont setfont
88
- } def
89
-
90
- % draw text fitted to its expected width
91
- /alignedtext { % width text
92
- /text exch def
93
- /width exch def
94
- gsave
95
- width 0 gt {
96
- [] 0 setdash
97
- text stringwidth pop width exch sub text length div 0 text ashow
98
- } if
99
- grestore
100
- } def
101
-
102
- /boxprim { % xcorner ycorner xsize ysize
103
- 4 2 roll
104
- moveto
105
- 2 copy
106
- exch 0 rlineto
107
- 0 exch rlineto
108
- pop neg 0 rlineto
109
- closepath
110
- } bind def
111
-
112
- /ellipse_path {
113
- /ry exch def
114
- /rx exch def
115
- /y exch def
116
- /x exch def
117
- matrix currentmatrix
118
- newpath
119
- x y translate
120
- rx ry scale
121
- 0 0 1 0 360 arc
122
- setmatrix
123
- } bind def
124
-
125
- /endpage { showpage } bind def
126
- /showpage { } def
127
-
128
- /layercolorseq
129
- [ % layer color sequence - darkest to lightest
130
- [0 0 0]
131
- [.2 .8 .8]
132
- [.4 .8 .8]
133
- [.6 .8 .8]
134
- [.8 .8 .8]
135
- ]
136
- def
137
-
138
- /layerlen layercolorseq length def
139
-
140
- /setlayer {/maxlayer exch def /curlayer exch def
141
- layercolorseq curlayer 1 sub layerlen mod get
142
- aload pop sethsbcolor
143
- /nodecolor {nopcolor} def
144
- /edgecolor {nopcolor} def
145
- /graphcolor {nopcolor} def
146
- } bind def
147
-
148
- /onlayer { curlayer ne {invis} if } def
149
-
150
- /onlayers {
151
- /myupper exch def
152
- /mylower exch def
153
- curlayer mylower lt
154
- curlayer myupper gt
155
- or
156
- {invis} if
157
- } def
158
-
159
- /curlayer 0 def
160
-
161
- %%EndResource
162
- %%EndProlog
163
- %%BeginSetup
164
- 14 default-font-family set_font
165
- 1 setmiterlimit
166
- % /arrowlength 10 def
167
- % /arrowwidth 5 def
168
-
169
- % make sure pdfmark is harmless for PS-interpreters other than Distiller
170
- /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse
171
- % make '<<' and '>>' safe on PS Level 1 devices
172
- /languagelevel where {pop languagelevel}{1} ifelse
173
- 2 lt {
174
- userdict (<<) cvn ([) cvn load put
175
- userdict (>>) cvn ([) cvn load put
176
- } if
177
-
178
- %%EndSetup
179
- %! SDL shapes for Graphviz/dot in PostScript output mode
180
-
181
- % FILE
182
- % sdl.ps - SDL shapes for Graphviz/dot in PostScript output mode
183
- %
184
- % USE
185
- % All procedures expect to be passed a rectangular bounding box in the
186
- % order [upper right, lower right, lower left, upper left, upper right].
187
- % All procedures expect to be used with "peripheries = 0".
188
- %
189
- % BUGS
190
- % The following shapes are currently not implemented:
191
- % - frame/system/block/process/procedure/service/procedure, and types thereof
192
- % - macro inlet/outlet/call
193
- % - exception handler/handle/raise
194
- % - decision (suggest use diamond)
195
- % - alternative (suggest use triangle)
196
- % - internal input/output (suggest stop using historical relics!)
197
- %
198
- % COPYRIGHT AND PERMISSION NOTICE
199
- % Copyright (C) 2005 Cambridge Silicon Radio Ltd.; all rights reserved.
200
- %
201
- % Permission is hereby granted, free of charge, to any person obtaining
202
- % a copy of this software and associated documentation files (the
203
- % "Software"), to deal in the Software without restriction, including
204
- % without limitation the rights to use, copy, modify, merge, publish,
205
- % distribute, sublicense, and/or sell copies of the Software, and to
206
- % permit persons to whom the Software is furnished to do so, subject to
207
- % the following conditions:
208
- %
209
- % The above copyright notice and this permission notice shall be
210
- % included in all copies or substantial portions of the Software.
211
- %
212
- % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
213
- % EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
214
- % MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
215
- % NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
216
- % LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
217
- % OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
218
- % WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
219
- %
220
- % Except as contained in this notice, the name of a copyright holder
221
- % shall not be used in advertising or otherwise to promote the sale, use
222
- % or other dealings in the Software without prior written authorization
223
- % of the copyright holder.
224
- %
225
- % REVISION
226
- % #4
227
-
228
- /xdef {exch def} bind def
229
-
230
- % SDL task
231
-
232
- /sdl_task {
233
- 3 1 roll % put filled flag at end
234
- 4 ne { stop } if % sanity-check number of sides
235
- aload pop
236
- newpath
237
- moveto
238
- lineto
239
- lineto
240
- lineto
241
- pop pop
242
- closepath
243
- { fill } { stroke } ifelse
244
- } bind def
245
-
246
- % SDL input from right
247
- % The indent has lines at 45 degrees
248
- % There should be a few spaces at the end of this shape's label
249
-
250
- /sdl_input_from_right {
251
- 9 dict begin
252
- 3 1 roll % put filled flag at end
253
- 4 ne { stop } if % sanity-check number of sides
254
- aload pop
255
- /ury xdef /urx xdef
256
- /lry xdef /lrx xdef
257
- /lly xdef /llx xdef
258
- /uly xdef /ulx xdef
259
- /h2 ury lry sub 2 div def
260
- newpath
261
- moveto
262
- urx h2 sub ury h2 sub lineto
263
- lrx lry lineto
264
- llx lly lineto
265
- ulx uly lineto
266
- closepath
267
- { fill } { stroke } ifelse
268
- end
269
- } bind def
270
-
271
- % SDL input from left
272
- % Similar to SDL input from right
273
- % There should be a few spaces at the start of this shape's label
274
-
275
- /sdl_input_from_left {
276
- 9 dict begin
277
- 3 1 roll % put filled flag at end
278
- 4 ne { stop } if % sanity-check number of sides
279
- aload pop
280
- /ury xdef /urx xdef
281
- /lry xdef /lrx xdef
282
- /lly xdef /llx xdef
283
- /uly xdef /ulx xdef
284
- /h2 uly lly sub 2 div def
285
- newpath
286
- moveto
287
- lrx lry lineto
288
- llx lly lineto
289
- ulx h2 add ury h2 sub lineto
290
- ulx uly lineto
291
- closepath
292
- { fill } { stroke } ifelse
293
- end
294
- } bind def
295
-
296
- % SDL priority input from right
297
- % Similar to SDL input from right
298
- % The chevrons are displaced by an eighth of the shape height
299
- % The filled version is indistinguishable from a non-priority SDL input
300
-
301
- /sdl_priority_input_from_right {
302
- 9 dict begin
303
- 3 1 roll % put filled flag at end
304
- 4 ne { stop } if % sanity-check number of sides
305
- aload pop
306
- /ury xdef /urx xdef
307
- /lry xdef /lrx xdef
308
- /lly xdef /llx xdef
309
- /uly xdef /ulx xdef
310
- /h2 ury lry sub 2 div def
311
- newpath
312
- moveto
313
- urx h2 sub ury h2 sub lineto
314
- lrx lry lineto
315
- llx lly lineto
316
- ulx uly lineto
317
- closepath
318
- { fill } { stroke
319
- urx h2 4 div sub ury moveto
320
- urx h2 sub h2 4 div sub ury h2 sub lineto
321
- lrx h2 4 div sub lry lineto
322
- stroke } ifelse
323
- end
324
- } bind def
325
-
326
- % SDL priority input from left
327
- % Similar to SDL priority input from right
328
-
329
- /sdl_priority_input_from_left {
330
- 9 dict begin
331
- 3 1 roll % put filled flag at end
332
- 4 ne { stop } if % sanity-check number of sides
333
- aload pop
334
- /ury xdef /urx xdef
335
- /lry xdef /lrx xdef
336
- /lly xdef /llx xdef
337
- /uly xdef /ulx xdef
338
- /h2 uly lly sub 2 div def
339
- newpath
340
- moveto
341
- lrx lry lineto
342
- llx lly lineto
343
- ulx h2 add uly h2 sub lineto
344
- ulx uly lineto
345
- closepath
346
- { fill } { stroke
347
- llx h2 4 div add lly moveto
348
- ulx h2 add h2 4 div add uly h2 sub lineto
349
- ulx h2 4 div add uly lineto
350
- stroke } ifelse
351
- end
352
- } bind def
353
-
354
- % SDL start
355
- % The left and right sides are semicircles
356
- % This should be used with "label = " ""
357
-
358
- /sdl_start {
359
- 9 dict begin
360
- 3 1 roll % put filled flag at end
361
- 4 ne { stop } if % sanity-check number of sides
362
- aload pop
363
- /ury xdef /urx xdef
364
- /lry xdef /lrx xdef
365
- /lly xdef /llx xdef
366
- /uly xdef /ulx xdef
367
- pop pop
368
- /r ury lry sub 2 div def
369
- newpath
370
- urx r sub ury r sub r 90 -90 arcn
371
- ulx r add uly r sub r -90 90 arcn
372
- closepath
373
- { fill } { stroke } ifelse
374
- end
375
- } bind def
376
-
377
- % SDL procedure start
378
- % Similar to SDL start
379
- % The filled version is indistinguishable from an SDL start
380
- % This should be used with "label = " ""
381
-
382
- /sdl_procedure_start {
383
- 9 dict begin
384
- 3 1 roll % put filled flag at end
385
- 4 ne { stop } if % sanity-check number of sides
386
- aload pop
387
- /ury xdef /urx xdef
388
- /lry xdef /lrx xdef
389
- /lly xdef /llx xdef
390
- /uly xdef /ulx xdef
391
- pop pop
392
- /r ury lry sub 2 div def
393
- newpath
394
- urx r sub ury r sub r 90 -90 arcn
395
- ulx r add uly r sub r -90 90 arcn
396
- closepath
397
- { fill } { stroke
398
- lrx r sub lry moveto
399
- 0 r 2 mul rlineto
400
- llx r add lly moveto
401
- 0 r 2 mul rlineto
402
- stroke } ifelse
403
- end
404
- } bind def
405
-
406
- % SDL state/nextstate
407
- % The left and right sides are arcs
408
-
409
- /sdl_state {
410
- 12 dict begin
411
- 3 1 roll % put filled flag at end
412
- 4 ne { stop } if % sanity-check number of sides
413
- aload pop
414
- /ury xdef /urx xdef
415
- /lry xdef /lrx xdef
416
- /lly xdef /llx xdef
417
- /uly xdef /ulx xdef
418
- pop pop
419
- /h2 ury lry sub 2 div def
420
- /w2 h2 1.5 mul def % was urx ulx sub 2 div def but this made curvature width-dependent
421
- /r w2 def
422
- /th h2 r dup mul h2 dup mul sub sqrt atan def
423
- newpath
424
- urx w2 sub ury h2 sub r th th neg arcn
425
- ulx w2 add uly h2 sub r -180 th add -180 th sub arcn
426
- closepath
427
- { fill } { stroke } ifelse
428
- end
429
- } bind def
430
-
431
- % SDL output to right
432
- % The outdent has lines at 45 degrees
433
- % There should be a few spaces at the end of this shape's label
434
-
435
- /sdl_output_to_right {
436
- 9 dict begin
437
- 3 1 roll % put filled flag at end
438
- 4 ne { stop } if % sanity-check number of sides
439
- aload pop
440
- /ury xdef /urx xdef
441
- /lry xdef /lrx xdef
442
- /lly xdef /llx xdef
443
- /uly xdef /ulx xdef
444
- /h2 ury lry sub 2 div def
445
- newpath
446
- exch h2 sub exch moveto
447
- urx ury h2 sub lineto
448
- lrx h2 sub lry lineto
449
- llx lly lineto
450
- ulx uly lineto
451
- closepath
452
- { fill } { stroke } ifelse
453
- end
454
- } bind def
455
-
456
- % SDL output to left
457
- % Similar to SDL output to right
458
- % There should be a few spaces at the start of this shape's label
459
-
460
- /sdl_output_to_left {
461
- 9 dict begin
462
- 3 1 roll % put filled flag at end
463
- 4 ne { stop } if % sanity-check number of sides
464
- aload pop
465
- /ury xdef /urx xdef
466
- /lry xdef /lrx xdef
467
- /lly xdef /llx xdef
468
- /uly xdef /ulx xdef
469
- /h2 ury lry sub 2 div def
470
- newpath
471
- moveto
472
- lrx lry lineto
473
- llx h2 add lly lineto
474
- ulx ury h2 sub lineto
475
- ulx h2 add uly lineto
476
- closepath
477
- { fill } { stroke } ifelse
478
- end
479
- } bind def
480
-
481
- % SDL continuous signal/enabling condition
482
- % The chevrons have lines at 45 degrees
483
- % There should be a few spaces at the start and end of this shape's label
484
-
485
- /sdl_condition {
486
- 9 dict begin
487
- 3 1 roll % put filled flag at end
488
- 4 ne { stop } if % sanity-check number of sides
489
- aload pop
490
- /ury xdef /urx xdef
491
- /lry xdef /lrx xdef
492
- /lly xdef /llx xdef
493
- /uly xdef /ulx xdef
494
- /h2 ury lry sub 2 div def
495
- newpath
496
- exch h2 sub exch moveto
497
- urx ury h2 sub lineto
498
- lrx h2 sub lry lineto
499
- dup llx h2 add lly 3 -1 roll { lineto } { moveto } ifelse
500
- ulx uly h2 sub lineto
501
- ulx h2 add uly lineto
502
- { fill } { stroke } ifelse
503
- end
504
- } bind def
505
-
506
- % SDL save
507
- % The left and right edges are at about 60 degrees
508
- % There should be a few spaces at the start and end of this shape's label
509
-
510
- /sdl_save {
511
- 9 dict begin
512
- 3 1 roll % put filled flag at end
513
- 4 ne { stop } if % sanity-check number of sides
514
- aload pop
515
- /ury xdef /urx xdef
516
- /lry xdef /lrx xdef
517
- /lly xdef /llx xdef
518
- /uly xdef /ulx xdef
519
- /h3 ury lry sub 3 div def
520
- newpath
521
- moveto
522
- lrx h3 sub lry lineto
523
- llx lly lineto
524
- ulx h3 add uly lineto
525
- closepath
526
- { fill } { stroke } ifelse
527
- end
528
- } bind def
529
-
530
- % SDL stop
531
- % The width of the bounding box is ignored; the lines are set at 45 degrees
532
- % This shape cannot be filled
533
- % This should be used with "label = """ and "arrowhead = none, headclip = false"
534
-
535
- /sdl_stop {
536
- 7 dict begin
537
- { stop } if % make sure not asked to fill this
538
- 4 ne { stop } if % sanity-check number of sides
539
- aload pop
540
- pop pop
541
- /lry xdef /lrx xdef
542
- /lly xdef /llx xdef
543
- /uly xdef pop
544
- /h2 uly lly sub 2 div def
545
- /mx llx lrx add 2 div def
546
- newpath
547
- mx h2 add exch moveto pop
548
- mx h2 sub lly lineto
549
- mx h2 sub uly moveto
550
- mx h2 add lry lineto
551
- closepath
552
- stroke
553
- end
554
- } bind def
555
-
556
- % SDL return
557
- % The width of the bounding box is ignored; the lines are set at 45 degrees
558
- % The filled version is indistinguishable from an SDL connection
559
-
560
- /sdl_return {
561
- 9 dict begin
562
- 3 1 roll % put filled flag at end
563
- 4 ne { stop } if % sanity-check number of sides
564
- aload pop
565
- /ury xdef pop
566
- /lry xdef /lrx xdef
567
- /lly xdef /llx xdef
568
- /uly xdef pop
569
- pop pop
570
- /h2 uly lly sub 2 div 2 sqrt div def
571
- /mx llx lrx add 2 div def
572
- /my lry ury add 2 div def
573
- newpath
574
- mx my uly lly sub 2 div 0 360 arc
575
- { fill } { stroke
576
- mx h2 add my h2 add moveto
577
- mx h2 sub my h2 sub lineto
578
- mx h2 sub my h2 add moveto
579
- mx h2 add my h2 sub lineto
580
- stroke } ifelse
581
- end
582
- } bind def
583
-
584
- % SDL create
585
- % The extra lines are displaced by an eighth of the shape height
586
- % The filled version is indistinguishable from an SDL task
587
-
588
- /sdl_create {
589
- 9 dict begin
590
- 3 1 roll % put filled flag at end
591
- 4 ne { stop } if % sanity-check number of sides
592
- aload pop
593
- /ury xdef /urx xdef
594
- /lry xdef /lrx xdef
595
- /lly xdef /llx xdef
596
- /uly xdef /ulx xdef
597
- /h8 ury lry sub 8 div def
598
- newpath
599
- moveto
600
- lrx lry lineto
601
- llx lly lineto
602
- ulx uly lineto
603
- closepath
604
- { fill } { stroke
605
- ulx uly h8 sub moveto
606
- urx ury h8 sub lineto
607
- llx lly h8 add moveto
608
- lrx lry h8 add lineto
609
- stroke } ifelse
610
- end
611
- } bind def
612
-
613
- % SDL call
614
- % The extra lines are displaced by an eighth of the shape height
615
- % The filled version is indistinguishable from an SDL task
616
- % There should be a few spaces at the start and end of this shape's label
617
-
618
- /sdl_call {
619
- 9 dict begin
620
- 3 1 roll % put filled flag at end
621
- 4 ne { stop } if % sanity-check number of sides
622
- aload pop
623
- /ury xdef /urx xdef
624
- /lry xdef /lrx xdef
625
- /lly xdef /llx xdef
626
- /uly xdef /ulx xdef
627
- /h8 ury lry sub 8 div def
628
- newpath
629
- moveto
630
- lrx lry lineto
631
- llx lly lineto
632
- ulx uly lineto
633
- closepath
634
- { fill } { stroke
635
- urx h8 sub ury moveto
636
- lrx h8 sub lry lineto
637
- llx h8 add lly moveto
638
- ulx h8 add uly lineto
639
- stroke } ifelse
640
- end
641
- } bind def
642
-
643
- % SDL text symbol
644
- % The corner has a size of twice the H height
645
-
646
- /sdl_text {
647
- 10 dict begin
648
- 3 1 roll % put filled flag at end
649
- 4 ne { stop } if % sanity-check number of sides
650
- aload pop
651
- /ury xdef /urx xdef
652
- /lry xdef /lrx xdef
653
- /lly xdef /llx xdef
654
- /uly xdef /ulx xdef
655
- /h8 ury lry sub 8 div def
656
- newpath
657
- moveto
658
- /d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop 2 mul def
659
- newpath
660
- urx ury d sub moveto
661
- lrx lry lineto
662
- llx lly lineto
663
- ulx uly lineto
664
- urx d sub ury lineto
665
- closepath
666
- { fill } { stroke } ifelse
667
- urx ury d sub moveto
668
- d neg 0 rlineto
669
- 0 d rlineto
670
- stroke
671
- end
672
- } bind def
673
-
674
- % SDL text extension from left
675
- % This should be used with "rank = same"
676
-
677
- /sdl_text_extension_from_left {
678
- 3 1 roll % put filled flag at end
679
- 4 ne { stop } if % sanity-check number of sides
680
- aload pop
681
- pop pop
682
- moveto
683
- lineto
684
- lineto
685
- lineto
686
- { fill } { stroke } ifelse
687
- } bind def
688
-
689
- % SDL text extension from right
690
- % This should be used with "rank = same"
691
-
692
- /sdl_text_extension_from_right {
693
- 3 1 roll % put filled flag at end
694
- 4 ne { stop } if % sanity-check number of sides
695
- aload pop
696
- pop pop
697
- 8 4 roll
698
- moveto
699
- lineto
700
- lineto
701
- lineto
702
- { fill } { stroke } ifelse
703
- } bind def
704
-
705
- % SDL comment from left
706
- % This should be used with "style = dashed" and "rank = same"
707
-
708
- /sdl_comment_from_left { sdl_text_extension_from_left } bind def
709
-
710
- % SDL comment from right
711
- % This should be used with "style = dashed" and "rank = same"
712
-
713
- /sdl_comment_from_right { sdl_text_extension_from_right } bind def
714
-
715
- % SDL connector
716
- % The width of the bounding box is ignored
717
-
718
- /sdl_connector {
719
- 7 dict begin
720
- 3 1 roll % put filled flag at end
721
- 4 ne { stop } if % sanity-check number of sides
722
- aload pop
723
- pop pop
724
- /lry xdef /lrx xdef
725
- /lly xdef /llx xdef
726
- /uly xdef pop
727
- pop pop
728
- /h2 uly lly sub 2 div def
729
- /mx llx lrx add 2 div def
730
- newpath
731
- mx uly h2 sub h2 0 360 arc
732
- { fill } { stroke } ifelse
733
- end
734
- } bind def
735
-
736
- % SDL set (extension)
737
- % The hourglass has a size of twice the H height
738
- % There should be a few spaces at the start of this shape's label
739
-
740
- /sdl_set {
741
- 10 dict begin
742
- 3 1 roll % put filled flag at end
743
- 4 ne { stop } if % sanity-check number of sides
744
- aload pop
745
- /ury xdef /urx xdef
746
- /lry xdef /lrx xdef
747
- /lly xdef /llx xdef
748
- /uly xdef /ulx xdef
749
- /my uly lly add 2 div def
750
- newpath
751
- moveto
752
- /d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def
753
- newpath
754
- llx d add my d add moveto
755
- ulx d add uly lineto
756
- urx ury lineto
757
- lrx lry lineto
758
- llx d add lly lineto
759
- llx d add my d sub lineto
760
- dup { closepath fill } { stroke } ifelse
761
- llx my d sub moveto
762
- d 2 mul dup rlineto
763
- d 2 mul neg 0 rlineto
764
- d 2 mul dup neg rlineto
765
- closepath
766
- { fill } { stroke } ifelse
767
- end
768
- } bind def
769
-
770
- % SDL reset (extension)
771
- % The cross has a size of twice the H height
772
- % There should be a few spaces at the start of this shape's label
773
-
774
- /sdl_reset {
775
- 10 dict begin
776
- 3 1 roll % put filled flag at end
777
- 4 ne { stop } if % sanity-check number of sides
778
- aload pop
779
- /ury xdef /urx xdef
780
- /lry xdef /lrx xdef
781
- /lly xdef /llx xdef
782
- /uly xdef /ulx xdef
783
- /my uly lly add 2 div def
784
- newpath
785
- moveto
786
- /d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def
787
- newpath
788
- urx ury moveto
789
- lrx lry lineto
790
- llx d add lly lineto
791
- ulx d add uly lineto
792
- closepath
793
- { fill } { stroke } ifelse
794
- llx my d sub moveto
795
- d 2 mul dup rlineto
796
- llx d 2 mul add my d sub moveto
797
- d 2 mul dup neg exch rlineto
798
- stroke
799
- end
800
- } bind def
801
-
802
- % SDL export (extension)
803
- % The store has a width of twice the H height
804
- % There should be a few spaces at the start of this shape's label
805
-
806
- /sdl_export {
807
- 10 dict begin
808
- 3 1 roll % put filled flag at end
809
- 4 ne { stop } if % sanity-check number of sides
810
- aload pop
811
- /ury xdef /urx xdef
812
- /lry xdef /lrx xdef
813
- /lly xdef /llx xdef
814
- /uly xdef /ulx xdef
815
- /my uly lly add 2 div def
816
- newpath
817
- moveto
818
- /d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def
819
- newpath
820
- llx d add my d 2 div add moveto
821
- ulx d add uly lineto
822
- urx ury lineto
823
- lrx lry lineto
824
- llx d add lly lineto
825
- llx d add my d 2 div sub lineto
826
- { closepath fill } { stroke } ifelse
827
- llx my d 2 div sub moveto
828
- d 2 mul 0 rlineto
829
- llx my d 2 div add moveto
830
- d 2 mul 0 rlineto
831
- stroke
832
- end
833
- } bind def
834
- setupLatin1
835
- %%Page: 1 1
836
- %%PageBoundingBox: 275 302 337 490
837
- %%PageOrientation: Portrait
838
- 0 0 1 beginpage
839
- gsave
840
- 275 302 62 188 boxprim clip newpath
841
- 1 1 set_scale 0 rotate 279 307 translate
842
- % A
843
- gsave
844
- 1 setlinewidth
845
- 0 0 0 nodecolor
846
- [ 54 180 0 180 0 144 54 144 54 180 ] 4 false sdl_procedure_start
847
- 0 0 0 nodecolor
848
- 14 /Times-Roman set_font
849
- 21.5 156.9 moveto 11 (A) alignedtext
850
- grestore
851
- % B
852
- gsave
853
- 1 setlinewidth
854
- 0 0 0 nodecolor
855
- [ 54 108 0 108 0 72 54 72 54 108 ] 4 false sdl_save
856
- 0 0 0 nodecolor
857
- 14 /Times-Roman set_font
858
- 22 84.9 moveto 10 (B) alignedtext
859
- grestore
860
- % A->B
861
- gsave
862
- 1 setlinewidth
863
- 0 0 0 edgecolor
864
- newpath 27 143.83 moveto
865
- 27 136.13 27 126.97 27 118.42 curveto
866
- stroke
867
- 0 0 0 edgecolor
868
- newpath 30.5 118.41 moveto
869
- 27 108.41 lineto
870
- 23.5 118.41 lineto
871
- closepath fill
872
- 1 setlinewidth
873
- solid
874
- 0 0 0 edgecolor
875
- newpath 30.5 118.41 moveto
876
- 27 108.41 lineto
877
- 23.5 118.41 lineto
878
- closepath stroke
879
- grestore
880
- % n
881
- gsave
882
- 1 setlinewidth
883
- 0 0 0 nodecolor
884
- newpath 54 36 moveto
885
- 0 36 lineto
886
- 0 0 lineto
887
- 54 0 lineto
888
- closepath stroke
889
- 0 0 0 nodecolor
890
- 14 /Times-Roman set_font
891
- 25 12.9 moveto 21 (g::n) alignedtext
892
- grestore
893
- % B->n
894
- gsave
895
- 1 setlinewidth
896
- 0 0 0 edgecolor
897
- newpath 27 71.83 moveto
898
- 27 64.13 27 54.97 27 46.42 curveto
899
- stroke
900
- 0 0 0 edgecolor
901
- newpath 30.5 46.41 moveto
902
- 27 36.41 lineto
903
- 23.5 46.41 lineto
904
- closepath fill
905
- 1 setlinewidth
906
- solid
907
- 0 0 0 edgecolor
908
- newpath 30.5 46.41 moveto
909
- 27 36.41 lineto
910
- 23.5 46.41 lineto
911
- closepath stroke
912
- grestore
913
- endpage
914
- showpage
915
- grestore
916
- %%PageTrailer
917
- %%EndPage: 1
918
- %%Trailer
919
- %%Pages: 1
920
- %%BoundingBox: 275 302 337 490
921
- end
922
- restore
923
- %%EOF