ruby-graphviz_c 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gemrc +0 -0
- data/.gitignore +9 -0
- data/.travis.yml +7 -0
- data/AUTHORS.rdoc +33 -0
- data/CHANGELOG.rdoc +287 -0
- data/COPYING.rdoc +133 -0
- data/Gemfile +4 -0
- data/README.rdoc +206 -0
- data/Rakefile +71 -0
- data/bin/dot2ruby +91 -0
- data/bin/gem2gv +165 -0
- data/bin/git2gv +167 -0
- data/bin/ruby2gv +234 -0
- data/bin/xml2gv +96 -0
- data/examples/dot/JSP.dot +52 -0
- data/examples/dot/balanced.dot +36 -0
- data/examples/dot/cluster.dot +30 -0
- data/examples/dot/dotgraph.dot +28 -0
- data/examples/dot/fsm.dot +20 -0
- data/examples/dot/genetic.dot +118 -0
- data/examples/dot/hello.dot +1 -0
- data/examples/dot/hello_test.rb +33 -0
- data/examples/dot/lion_share.dot +103 -0
- data/examples/dot/prof.dot +150 -0
- data/examples/dot/psg.dot +28 -0
- data/examples/dot/rank.dot +6 -0
- data/examples/dot/sdh.dot +284 -0
- data/examples/dot/siblings.dot +492 -0
- data/examples/dot/so-sample001.gv +30 -0
- data/examples/dot/so-sample002.gv +33 -0
- data/examples/dot/so-sample003.gv +45 -0
- data/examples/dot/test.dot +17 -0
- data/examples/dot/test_parse.rb +13 -0
- data/examples/dot/this_crach_with_dot_2.20.dot +24 -0
- data/examples/dot/unix.dot +104 -0
- data/examples/graphml/attributes.ext.graphml +12 -0
- data/examples/graphml/attributes.graphml +40 -0
- data/examples/graphml/cluster.graphml +75 -0
- data/examples/graphml/failed_graph.graphml +461 -0
- data/examples/graphml/hyper.graphml +29 -0
- data/examples/graphml/nested.graphml +54 -0
- data/examples/graphml/port.graphml +32 -0
- data/examples/graphml/simple.graphml +30 -0
- data/examples/hello.png +0 -0
- data/examples/rgv/rgv.ps +125 -0
- data/examples/rgv/test_rgv.rb +12 -0
- data/examples/sample01.rb +32 -0
- data/examples/sample02.rb +42 -0
- data/examples/sample03.rb +31 -0
- data/examples/sample04.rb +22 -0
- data/examples/sample05.rb +32 -0
- data/examples/sample06.rb +46 -0
- data/examples/sample07.rb +23 -0
- data/examples/sample08.rb +34 -0
- data/examples/sample09.rb +50 -0
- data/examples/sample10.rb +50 -0
- data/examples/sample11.rb +42 -0
- data/examples/sample12.rb +55 -0
- data/examples/sample13.rb +48 -0
- data/examples/sample14.rb +44 -0
- data/examples/sample15.rb +25 -0
- data/examples/sample16.rb +8 -0
- data/examples/sample17.rb +92 -0
- data/examples/sample18.rb +24 -0
- data/examples/sample19.rb +59 -0
- data/examples/sample20.rb +47 -0
- data/examples/sample21.rb +12 -0
- data/examples/sample22.rb +10 -0
- data/examples/sample23.rb +11 -0
- data/examples/sample24.rb +11 -0
- data/examples/sample25.rb +11 -0
- data/examples/sample26.rb +8 -0
- data/examples/sample27.rb +8 -0
- data/examples/sample28.rb +12 -0
- data/examples/sample29.rb +8 -0
- data/examples/sample30.rb +12 -0
- data/examples/sample31.rb +10 -0
- data/examples/sample32.rb +14 -0
- data/examples/sample33.rb +43 -0
- data/examples/sample34.rb +29 -0
- data/examples/sample35.rb +43 -0
- data/examples/sample36.rb +35 -0
- data/examples/sample37.rb +87 -0
- data/examples/sample38.rb +12 -0
- data/examples/sample39.rb +11 -0
- data/examples/sample40.rb +17 -0
- data/examples/sample41.rb +8 -0
- data/examples/sample42.rb +35 -0
- data/examples/sample43.rb +26 -0
- data/examples/sample44.rb +97 -0
- data/examples/sample45.rb +24 -0
- data/examples/sample46.rb +43 -0
- data/examples/sample47.rb +7 -0
- data/examples/sample48.rb +62 -0
- data/examples/sample49.rb +10 -0
- data/examples/sample50.rb +215 -0
- data/examples/sample51.rb +37 -0
- data/examples/sample52.rb +62 -0
- data/examples/sample53.rb +26 -0
- data/examples/sample54.rb +26 -0
- data/examples/sample55.rb +9 -0
- data/examples/sample56.rb +10 -0
- data/examples/sample57.rb +8 -0
- data/examples/sample58.rb +33 -0
- data/examples/sample59.rb +14 -0
- data/examples/sample60.rb +12 -0
- data/examples/sample61.rb +12 -0
- data/examples/sample62.rb +24 -0
- data/examples/sample63.rb +32 -0
- data/examples/sample64.rb +31 -0
- data/examples/sample65.rb +9 -0
- data/examples/sample66.rb +4 -0
- data/examples/sample67.rb +10 -0
- data/examples/sample68.rb +27 -0
- data/examples/sample69.rb +23 -0
- data/examples/sample70.rb +9 -0
- data/examples/sample99.rb +70 -0
- data/examples/sdlshapes/README +2 -0
- data/examples/sdlshapes/sdl.ps +655 -0
- data/examples/sdlshapes/sdlshapes.dot +78 -0
- data/examples/test.xml +26 -0
- data/examples/theory/pert.rb +47 -0
- data/examples/theory/tests.rb +87 -0
- data/lib/ext/gvpr/dot2ruby.g +185 -0
- data/lib/graphviz/attrs.rb +73 -0
- data/lib/graphviz/constants.rb +294 -0
- data/lib/graphviz/core_ext.rb +64 -0
- data/lib/graphviz/dot2ruby.rb +59 -0
- data/lib/graphviz/dot_script.rb +109 -0
- data/lib/graphviz/dsl.rb +67 -0
- data/lib/graphviz/edge.rb +197 -0
- data/lib/graphviz/elements.rb +39 -0
- data/lib/graphviz/ext.rb +17 -0
- data/lib/graphviz/family_tree/couple.rb +63 -0
- data/lib/graphviz/family_tree/generation.rb +39 -0
- data/lib/graphviz/family_tree/person.rb +120 -0
- data/lib/graphviz/family_tree/sibling.rb +13 -0
- data/lib/graphviz/family_tree.rb +118 -0
- data/lib/graphviz/graphml.rb +268 -0
- data/lib/graphviz/math/matrix.rb +221 -0
- data/lib/graphviz/node.rb +160 -0
- data/lib/graphviz/nothugly/nothugly.xsl +321 -0
- data/lib/graphviz/nothugly.rb +63 -0
- data/lib/graphviz/theory.rb +321 -0
- data/lib/graphviz/types/arrow_type.rb +32 -0
- data/lib/graphviz/types/color.rb +58 -0
- data/lib/graphviz/types/color_list.rb +24 -0
- data/lib/graphviz/types/esc_string.rb +20 -0
- data/lib/graphviz/types/gv_bool.rb +49 -0
- data/lib/graphviz/types/gv_double.rb +32 -0
- data/lib/graphviz/types/html_string.rb +18 -0
- data/lib/graphviz/types/lbl_string.rb +22 -0
- data/lib/graphviz/types/rect.rb +35 -0
- data/lib/graphviz/types/spline_type.rb +77 -0
- data/lib/graphviz/types.rb +22 -0
- data/lib/graphviz/utils/colors.rb +1018 -0
- data/lib/graphviz/utils.rb +70 -0
- data/lib/graphviz/xml.rb +119 -0
- data/lib/graphviz.rb +967 -0
- data/lib/ruby-graphviz.rb +1 -0
- data/man/dot2ruby.1 +66 -0
- data/man/dot2ruby.1.ronn +55 -0
- data/man/gem2gv.1 +60 -0
- data/man/gem2gv.1.ronn +47 -0
- data/man/git2gv.1 +48 -0
- data/man/git2gv.1.ronn +40 -0
- data/man/ruby2gv.1 +60 -0
- data/man/ruby2gv.1.ronn +47 -0
- data/man/xml2gv.1 +48 -0
- data/man/xml2gv.1.ronn +39 -0
- data/ruby-graphviz.gemspec +47 -0
- data/setup.rb +1585 -0
- data/test/helper.rb +13 -0
- data/test/support.rb +95 -0
- data/test/test_dot_script.rb +47 -0
- data/test/test_examples.rb +151 -0
- data/test/test_graph.rb +115 -0
- data/test/test_search.rb +29 -0
- data/test/test_subgraph.rb +27 -0
- data/test/test_theory.rb +98 -0
- data/test/test_types.rb +65 -0
- data/test/test_utils_colors.rb +52 -0
- metadata +301 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
$:.unshift( "../lib" )
|
2
|
+
require 'graphviz'
|
3
|
+
|
4
|
+
puts GraphViz.graph( :G ) { |g|
|
5
|
+
g[:label] = "<<b>This</b> is <i>a</i> <b>test</b>>"
|
6
|
+
n1 = g.add_nodes( "N1", :label => '<<b>node 1</b>>')
|
7
|
+
n2 = g.add_nodes( "N2", :label => '<<b>node 2</b>>')
|
8
|
+
g.add_edges( n1, n2, :label => '<<u>edge</u>>')
|
9
|
+
}.output( :svg => "#{$0}.svg", :none => String )
|
@@ -0,0 +1,70 @@
|
|
1
|
+
$:.unshift( "../lib" );
|
2
|
+
require 'graphviz/family_tree'
|
3
|
+
|
4
|
+
tree = GraphViz::FamilyTree.new do
|
5
|
+
generation do
|
6
|
+
chantale.is_a_woman( "Chantale" )
|
7
|
+
jacques.is_a_man( "Jacques" )
|
8
|
+
|
9
|
+
jacques.is_dead
|
10
|
+
jacques.is_maried_with chantale
|
11
|
+
|
12
|
+
rose.is_a_woman( "Rose Marie" )
|
13
|
+
andre.is_a_man( "Andre" )
|
14
|
+
|
15
|
+
andre.is_maried_with rose
|
16
|
+
andre.is_dead
|
17
|
+
end
|
18
|
+
|
19
|
+
generation do
|
20
|
+
benoist.is_a_man( "Benoist" )
|
21
|
+
nathalie.is_a_woman( "Nathalie" )
|
22
|
+
|
23
|
+
benoist.is_maried_with nathalie
|
24
|
+
|
25
|
+
michel.is_a_man( "Michel" )
|
26
|
+
brigitte.is_a_woman( "Brigitte" )
|
27
|
+
|
28
|
+
michel.is_maried_with brigitte
|
29
|
+
end
|
30
|
+
|
31
|
+
couple( chantale, jacques ).kids( nathalie )
|
32
|
+
couple( rose, andre ).kids( benoist )
|
33
|
+
|
34
|
+
generation do
|
35
|
+
charlotte.is_a_woman( "Charlotte" )
|
36
|
+
amelie.is_a_woman( "Amelie" )
|
37
|
+
clement.is_a_man( "Clement" )
|
38
|
+
gregoire.is_a_man( "Gregoire" )
|
39
|
+
|
40
|
+
muriel.is_a_woman( "Muriel" )
|
41
|
+
gilles.is_a_man( "Gilles" )
|
42
|
+
|
43
|
+
morgane.is_a_woman( "Morgane" )
|
44
|
+
gregoire.is_divorced_with morgane
|
45
|
+
|
46
|
+
pascal.is_a_man( "Pascal" )
|
47
|
+
muriel.is_divorced_with pascal
|
48
|
+
|
49
|
+
gregoire.is_maried_with muriel
|
50
|
+
end
|
51
|
+
|
52
|
+
couple( michel, brigitte ).kids( muriel, gilles )
|
53
|
+
couple( benoist, nathalie ).kids( charlotte, amelie, clement, gregoire )
|
54
|
+
|
55
|
+
generation do
|
56
|
+
arthur.is_a_boy( "Arthur" )
|
57
|
+
colyne.is_a_girl( "Colyne" )
|
58
|
+
benedict.is_a_boy( "Benedict" )
|
59
|
+
maia.is_a_girl( "Maia" )
|
60
|
+
enaitz.is_a_boy( "Enaitz" )
|
61
|
+
milo.is_a_boy( "Milo" )
|
62
|
+
end
|
63
|
+
|
64
|
+
couple( gregoire, morgane ).kids( arthur, colyne, benedict )
|
65
|
+
couple( gregoire, muriel ).kids( maia )
|
66
|
+
couple( muriel, pascal ).kids( milo )
|
67
|
+
muriel.kids( enaitz )
|
68
|
+
end
|
69
|
+
|
70
|
+
tree.graph.save( :png => "#{$0}.png" )
|
@@ -0,0 +1,655 @@
|
|
1
|
+
%! SDL shapes for Graphviz/dot in PostScript output mode
|
2
|
+
|
3
|
+
% FILE
|
4
|
+
% sdl.ps - SDL shapes for Graphviz/dot in PostScript output mode
|
5
|
+
%
|
6
|
+
% USE
|
7
|
+
% All procedures expect to be passed a rectangular bounding box in the
|
8
|
+
% order [upper right, lower right, lower left, upper left, upper right].
|
9
|
+
% All procedures expect to be used with "peripheries = 0".
|
10
|
+
%
|
11
|
+
% BUGS
|
12
|
+
% The following shapes are currently not implemented:
|
13
|
+
% - frame/system/block/process/procedure/service/procedure, and types thereof
|
14
|
+
% - macro inlet/outlet/call
|
15
|
+
% - exception handler/handle/raise
|
16
|
+
% - decision (suggest use diamond)
|
17
|
+
% - alternative (suggest use triangle)
|
18
|
+
% - internal input/output (suggest stop using historical relics!)
|
19
|
+
%
|
20
|
+
% COPYRIGHT AND PERMISSION NOTICE
|
21
|
+
% Copyright (C) 2005 Cambridge Silicon Radio Ltd.; all rights reserved.
|
22
|
+
%
|
23
|
+
% Permission is hereby granted, free of charge, to any person obtaining
|
24
|
+
% a copy of this software and associated documentation files (the
|
25
|
+
% "Software"), to deal in the Software without restriction, including
|
26
|
+
% without limitation the rights to use, copy, modify, merge, publish,
|
27
|
+
% distribute, sublicense, and/or sell copies of the Software, and to
|
28
|
+
% permit persons to whom the Software is furnished to do so, subject to
|
29
|
+
% the following conditions:
|
30
|
+
%
|
31
|
+
% The above copyright notice and this permission notice shall be
|
32
|
+
% included in all copies or substantial portions of the Software.
|
33
|
+
%
|
34
|
+
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
35
|
+
% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
36
|
+
% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
37
|
+
% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
38
|
+
% LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
39
|
+
% OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
40
|
+
% WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
41
|
+
%
|
42
|
+
% Except as contained in this notice, the name of a copyright holder
|
43
|
+
% shall not be used in advertising or otherwise to promote the sale, use
|
44
|
+
% or other dealings in the Software without prior written authorization
|
45
|
+
% of the copyright holder.
|
46
|
+
%
|
47
|
+
% REVISION
|
48
|
+
% #4
|
49
|
+
|
50
|
+
/xdef {exch def} bind def
|
51
|
+
|
52
|
+
% SDL task
|
53
|
+
|
54
|
+
/sdl_task {
|
55
|
+
3 1 roll % put filled flag at end
|
56
|
+
4 ne { stop } if % sanity-check number of sides
|
57
|
+
aload pop
|
58
|
+
newpath
|
59
|
+
moveto
|
60
|
+
lineto
|
61
|
+
lineto
|
62
|
+
lineto
|
63
|
+
pop pop
|
64
|
+
closepath
|
65
|
+
{ fill } { stroke } ifelse
|
66
|
+
} bind def
|
67
|
+
|
68
|
+
% SDL input from right
|
69
|
+
% The indent has lines at 45 degrees
|
70
|
+
% There should be a few spaces at the end of this shape's label
|
71
|
+
|
72
|
+
/sdl_input_from_right {
|
73
|
+
9 dict begin
|
74
|
+
3 1 roll % put filled flag at end
|
75
|
+
4 ne { stop } if % sanity-check number of sides
|
76
|
+
aload pop
|
77
|
+
/ury xdef /urx xdef
|
78
|
+
/lry xdef /lrx xdef
|
79
|
+
/lly xdef /llx xdef
|
80
|
+
/uly xdef /ulx xdef
|
81
|
+
/h2 ury lry sub 2 div def
|
82
|
+
newpath
|
83
|
+
moveto
|
84
|
+
urx h2 sub ury h2 sub lineto
|
85
|
+
lrx lry lineto
|
86
|
+
llx lly lineto
|
87
|
+
ulx uly lineto
|
88
|
+
closepath
|
89
|
+
{ fill } { stroke } ifelse
|
90
|
+
end
|
91
|
+
} bind def
|
92
|
+
|
93
|
+
% SDL input from left
|
94
|
+
% Similar to SDL input from right
|
95
|
+
% There should be a few spaces at the start of this shape's label
|
96
|
+
|
97
|
+
/sdl_input_from_left {
|
98
|
+
9 dict begin
|
99
|
+
3 1 roll % put filled flag at end
|
100
|
+
4 ne { stop } if % sanity-check number of sides
|
101
|
+
aload pop
|
102
|
+
/ury xdef /urx xdef
|
103
|
+
/lry xdef /lrx xdef
|
104
|
+
/lly xdef /llx xdef
|
105
|
+
/uly xdef /ulx xdef
|
106
|
+
/h2 uly lly sub 2 div def
|
107
|
+
newpath
|
108
|
+
moveto
|
109
|
+
lrx lry lineto
|
110
|
+
llx lly lineto
|
111
|
+
ulx h2 add ury h2 sub lineto
|
112
|
+
ulx uly lineto
|
113
|
+
closepath
|
114
|
+
{ fill } { stroke } ifelse
|
115
|
+
end
|
116
|
+
} bind def
|
117
|
+
|
118
|
+
% SDL priority input from right
|
119
|
+
% Similar to SDL input from right
|
120
|
+
% The chevrons are displaced by an eighth of the shape height
|
121
|
+
% The filled version is indistinguishable from a non-priority SDL input
|
122
|
+
|
123
|
+
/sdl_priority_input_from_right {
|
124
|
+
9 dict begin
|
125
|
+
3 1 roll % put filled flag at end
|
126
|
+
4 ne { stop } if % sanity-check number of sides
|
127
|
+
aload pop
|
128
|
+
/ury xdef /urx xdef
|
129
|
+
/lry xdef /lrx xdef
|
130
|
+
/lly xdef /llx xdef
|
131
|
+
/uly xdef /ulx xdef
|
132
|
+
/h2 ury lry sub 2 div def
|
133
|
+
newpath
|
134
|
+
moveto
|
135
|
+
urx h2 sub ury h2 sub lineto
|
136
|
+
lrx lry lineto
|
137
|
+
llx lly lineto
|
138
|
+
ulx uly lineto
|
139
|
+
closepath
|
140
|
+
{ fill } { stroke
|
141
|
+
urx h2 4 div sub ury moveto
|
142
|
+
urx h2 sub h2 4 div sub ury h2 sub lineto
|
143
|
+
lrx h2 4 div sub lry lineto
|
144
|
+
stroke } ifelse
|
145
|
+
end
|
146
|
+
} bind def
|
147
|
+
|
148
|
+
% SDL priority input from left
|
149
|
+
% Similar to SDL priority input from right
|
150
|
+
|
151
|
+
/sdl_priority_input_from_left {
|
152
|
+
9 dict begin
|
153
|
+
3 1 roll % put filled flag at end
|
154
|
+
4 ne { stop } if % sanity-check number of sides
|
155
|
+
aload pop
|
156
|
+
/ury xdef /urx xdef
|
157
|
+
/lry xdef /lrx xdef
|
158
|
+
/lly xdef /llx xdef
|
159
|
+
/uly xdef /ulx xdef
|
160
|
+
/h2 uly lly sub 2 div def
|
161
|
+
newpath
|
162
|
+
moveto
|
163
|
+
lrx lry lineto
|
164
|
+
llx lly lineto
|
165
|
+
ulx h2 add uly h2 sub lineto
|
166
|
+
ulx uly lineto
|
167
|
+
closepath
|
168
|
+
{ fill } { stroke
|
169
|
+
llx h2 4 div add lly moveto
|
170
|
+
ulx h2 add h2 4 div add uly h2 sub lineto
|
171
|
+
ulx h2 4 div add uly lineto
|
172
|
+
stroke } ifelse
|
173
|
+
end
|
174
|
+
} bind def
|
175
|
+
|
176
|
+
% SDL start
|
177
|
+
% The left and right sides are semicircles
|
178
|
+
% This should be used with "label = " ""
|
179
|
+
|
180
|
+
/sdl_start {
|
181
|
+
9 dict begin
|
182
|
+
3 1 roll % put filled flag at end
|
183
|
+
4 ne { stop } if % sanity-check number of sides
|
184
|
+
aload pop
|
185
|
+
/ury xdef /urx xdef
|
186
|
+
/lry xdef /lrx xdef
|
187
|
+
/lly xdef /llx xdef
|
188
|
+
/uly xdef /ulx xdef
|
189
|
+
pop pop
|
190
|
+
/r ury lry sub 2 div def
|
191
|
+
newpath
|
192
|
+
urx r sub ury r sub r 90 -90 arcn
|
193
|
+
ulx r add uly r sub r -90 90 arcn
|
194
|
+
closepath
|
195
|
+
{ fill } { stroke } ifelse
|
196
|
+
end
|
197
|
+
} bind def
|
198
|
+
|
199
|
+
% SDL procedure start
|
200
|
+
% Similar to SDL start
|
201
|
+
% The filled version is indistinguishable from an SDL start
|
202
|
+
% This should be used with "label = " ""
|
203
|
+
|
204
|
+
/sdl_procedure_start {
|
205
|
+
9 dict begin
|
206
|
+
3 1 roll % put filled flag at end
|
207
|
+
4 ne { stop } if % sanity-check number of sides
|
208
|
+
aload pop
|
209
|
+
/ury xdef /urx xdef
|
210
|
+
/lry xdef /lrx xdef
|
211
|
+
/lly xdef /llx xdef
|
212
|
+
/uly xdef /ulx xdef
|
213
|
+
pop pop
|
214
|
+
/r ury lry sub 2 div def
|
215
|
+
newpath
|
216
|
+
urx r sub ury r sub r 90 -90 arcn
|
217
|
+
ulx r add uly r sub r -90 90 arcn
|
218
|
+
closepath
|
219
|
+
{ fill } { stroke
|
220
|
+
lrx r sub lry moveto
|
221
|
+
0 r 2 mul rlineto
|
222
|
+
llx r add lly moveto
|
223
|
+
0 r 2 mul rlineto
|
224
|
+
stroke } ifelse
|
225
|
+
end
|
226
|
+
} bind def
|
227
|
+
|
228
|
+
% SDL state/nextstate
|
229
|
+
% The left and right sides are arcs
|
230
|
+
|
231
|
+
/sdl_state {
|
232
|
+
12 dict begin
|
233
|
+
3 1 roll % put filled flag at end
|
234
|
+
4 ne { stop } if % sanity-check number of sides
|
235
|
+
aload pop
|
236
|
+
/ury xdef /urx xdef
|
237
|
+
/lry xdef /lrx xdef
|
238
|
+
/lly xdef /llx xdef
|
239
|
+
/uly xdef /ulx xdef
|
240
|
+
pop pop
|
241
|
+
/h2 ury lry sub 2 div def
|
242
|
+
/w2 h2 1.5 mul def % was urx ulx sub 2 div def but this made curvature width-dependent
|
243
|
+
/r w2 def
|
244
|
+
/th h2 r dup mul h2 dup mul sub sqrt atan def
|
245
|
+
newpath
|
246
|
+
urx w2 sub ury h2 sub r th th neg arcn
|
247
|
+
ulx w2 add uly h2 sub r -180 th add -180 th sub arcn
|
248
|
+
closepath
|
249
|
+
{ fill } { stroke } ifelse
|
250
|
+
end
|
251
|
+
} bind def
|
252
|
+
|
253
|
+
% SDL output to right
|
254
|
+
% The outdent has lines at 45 degrees
|
255
|
+
% There should be a few spaces at the end of this shape's label
|
256
|
+
|
257
|
+
/sdl_output_to_right {
|
258
|
+
9 dict begin
|
259
|
+
3 1 roll % put filled flag at end
|
260
|
+
4 ne { stop } if % sanity-check number of sides
|
261
|
+
aload pop
|
262
|
+
/ury xdef /urx xdef
|
263
|
+
/lry xdef /lrx xdef
|
264
|
+
/lly xdef /llx xdef
|
265
|
+
/uly xdef /ulx xdef
|
266
|
+
/h2 ury lry sub 2 div def
|
267
|
+
newpath
|
268
|
+
exch h2 sub exch moveto
|
269
|
+
urx ury h2 sub lineto
|
270
|
+
lrx h2 sub lry lineto
|
271
|
+
llx lly lineto
|
272
|
+
ulx uly lineto
|
273
|
+
closepath
|
274
|
+
{ fill } { stroke } ifelse
|
275
|
+
end
|
276
|
+
} bind def
|
277
|
+
|
278
|
+
% SDL output to left
|
279
|
+
% Similar to SDL output to right
|
280
|
+
% There should be a few spaces at the start of this shape's label
|
281
|
+
|
282
|
+
/sdl_output_to_left {
|
283
|
+
9 dict begin
|
284
|
+
3 1 roll % put filled flag at end
|
285
|
+
4 ne { stop } if % sanity-check number of sides
|
286
|
+
aload pop
|
287
|
+
/ury xdef /urx xdef
|
288
|
+
/lry xdef /lrx xdef
|
289
|
+
/lly xdef /llx xdef
|
290
|
+
/uly xdef /ulx xdef
|
291
|
+
/h2 ury lry sub 2 div def
|
292
|
+
newpath
|
293
|
+
moveto
|
294
|
+
lrx lry lineto
|
295
|
+
llx h2 add lly lineto
|
296
|
+
ulx ury h2 sub lineto
|
297
|
+
ulx h2 add uly lineto
|
298
|
+
closepath
|
299
|
+
{ fill } { stroke } ifelse
|
300
|
+
end
|
301
|
+
} bind def
|
302
|
+
|
303
|
+
% SDL continuous signal/enabling condition
|
304
|
+
% The chevrons have lines at 45 degrees
|
305
|
+
% There should be a few spaces at the start and end of this shape's label
|
306
|
+
|
307
|
+
/sdl_condition {
|
308
|
+
9 dict begin
|
309
|
+
3 1 roll % put filled flag at end
|
310
|
+
4 ne { stop } if % sanity-check number of sides
|
311
|
+
aload pop
|
312
|
+
/ury xdef /urx xdef
|
313
|
+
/lry xdef /lrx xdef
|
314
|
+
/lly xdef /llx xdef
|
315
|
+
/uly xdef /ulx xdef
|
316
|
+
/h2 ury lry sub 2 div def
|
317
|
+
newpath
|
318
|
+
exch h2 sub exch moveto
|
319
|
+
urx ury h2 sub lineto
|
320
|
+
lrx h2 sub lry lineto
|
321
|
+
dup llx h2 add lly 3 -1 roll { lineto } { moveto } ifelse
|
322
|
+
ulx uly h2 sub lineto
|
323
|
+
ulx h2 add uly lineto
|
324
|
+
{ fill } { stroke } ifelse
|
325
|
+
end
|
326
|
+
} bind def
|
327
|
+
|
328
|
+
% SDL save
|
329
|
+
% The left and right edges are at about 60 degrees
|
330
|
+
% There should be a few spaces at the start and end of this shape's label
|
331
|
+
|
332
|
+
/sdl_save {
|
333
|
+
9 dict begin
|
334
|
+
3 1 roll % put filled flag at end
|
335
|
+
4 ne { stop } if % sanity-check number of sides
|
336
|
+
aload pop
|
337
|
+
/ury xdef /urx xdef
|
338
|
+
/lry xdef /lrx xdef
|
339
|
+
/lly xdef /llx xdef
|
340
|
+
/uly xdef /ulx xdef
|
341
|
+
/h3 ury lry sub 3 div def
|
342
|
+
newpath
|
343
|
+
moveto
|
344
|
+
lrx h3 sub lry lineto
|
345
|
+
llx lly lineto
|
346
|
+
ulx h3 add uly lineto
|
347
|
+
closepath
|
348
|
+
{ fill } { stroke } ifelse
|
349
|
+
end
|
350
|
+
} bind def
|
351
|
+
|
352
|
+
% SDL stop
|
353
|
+
% The width of the bounding box is ignored; the lines are set at 45 degrees
|
354
|
+
% This shape cannot be filled
|
355
|
+
% This should be used with "label = """ and "arrowhead = none, headclip = false"
|
356
|
+
|
357
|
+
/sdl_stop {
|
358
|
+
7 dict begin
|
359
|
+
{ stop } if % make sure not asked to fill this
|
360
|
+
4 ne { stop } if % sanity-check number of sides
|
361
|
+
aload pop
|
362
|
+
pop pop
|
363
|
+
/lry xdef /lrx xdef
|
364
|
+
/lly xdef /llx xdef
|
365
|
+
/uly xdef pop
|
366
|
+
/h2 uly lly sub 2 div def
|
367
|
+
/mx llx lrx add 2 div def
|
368
|
+
newpath
|
369
|
+
mx h2 add exch moveto pop
|
370
|
+
mx h2 sub lly lineto
|
371
|
+
mx h2 sub uly moveto
|
372
|
+
mx h2 add lry lineto
|
373
|
+
closepath
|
374
|
+
stroke
|
375
|
+
end
|
376
|
+
} bind def
|
377
|
+
|
378
|
+
% SDL return
|
379
|
+
% The width of the bounding box is ignored; the lines are set at 45 degrees
|
380
|
+
% The filled version is indistinguishable from an SDL connection
|
381
|
+
|
382
|
+
/sdl_return {
|
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 pop
|
388
|
+
/lry xdef /lrx xdef
|
389
|
+
/lly xdef /llx xdef
|
390
|
+
/uly xdef pop
|
391
|
+
pop pop
|
392
|
+
/h2 uly lly sub 2 div 2 sqrt div def
|
393
|
+
/mx llx lrx add 2 div def
|
394
|
+
/my lry ury add 2 div def
|
395
|
+
newpath
|
396
|
+
mx my uly lly sub 2 div 0 360 arc
|
397
|
+
{ fill } { stroke
|
398
|
+
mx h2 add my h2 add moveto
|
399
|
+
mx h2 sub my h2 sub lineto
|
400
|
+
mx h2 sub my h2 add moveto
|
401
|
+
mx h2 add my h2 sub lineto
|
402
|
+
stroke } ifelse
|
403
|
+
end
|
404
|
+
} bind def
|
405
|
+
|
406
|
+
% SDL create
|
407
|
+
% The extra lines are displaced by an eighth of the shape height
|
408
|
+
% The filled version is indistinguishable from an SDL task
|
409
|
+
|
410
|
+
/sdl_create {
|
411
|
+
9 dict begin
|
412
|
+
3 1 roll % put filled flag at end
|
413
|
+
4 ne { stop } if % sanity-check number of sides
|
414
|
+
aload pop
|
415
|
+
/ury xdef /urx xdef
|
416
|
+
/lry xdef /lrx xdef
|
417
|
+
/lly xdef /llx xdef
|
418
|
+
/uly xdef /ulx xdef
|
419
|
+
/h8 ury lry sub 8 div def
|
420
|
+
newpath
|
421
|
+
moveto
|
422
|
+
lrx lry lineto
|
423
|
+
llx lly lineto
|
424
|
+
ulx uly lineto
|
425
|
+
closepath
|
426
|
+
{ fill } { stroke
|
427
|
+
ulx uly h8 sub moveto
|
428
|
+
urx ury h8 sub lineto
|
429
|
+
llx lly h8 add moveto
|
430
|
+
lrx lry h8 add lineto
|
431
|
+
stroke } ifelse
|
432
|
+
end
|
433
|
+
} bind def
|
434
|
+
|
435
|
+
% SDL call
|
436
|
+
% The extra lines are displaced by an eighth of the shape height
|
437
|
+
% The filled version is indistinguishable from an SDL task
|
438
|
+
% There should be a few spaces at the start and end of this shape's label
|
439
|
+
|
440
|
+
/sdl_call {
|
441
|
+
9 dict begin
|
442
|
+
3 1 roll % put filled flag at end
|
443
|
+
4 ne { stop } if % sanity-check number of sides
|
444
|
+
aload pop
|
445
|
+
/ury xdef /urx xdef
|
446
|
+
/lry xdef /lrx xdef
|
447
|
+
/lly xdef /llx xdef
|
448
|
+
/uly xdef /ulx xdef
|
449
|
+
/h8 ury lry sub 8 div def
|
450
|
+
newpath
|
451
|
+
moveto
|
452
|
+
lrx lry lineto
|
453
|
+
llx lly lineto
|
454
|
+
ulx uly lineto
|
455
|
+
closepath
|
456
|
+
{ fill } { stroke
|
457
|
+
urx h8 sub ury moveto
|
458
|
+
lrx h8 sub lry lineto
|
459
|
+
llx h8 add lly moveto
|
460
|
+
ulx h8 add uly lineto
|
461
|
+
stroke } ifelse
|
462
|
+
end
|
463
|
+
} bind def
|
464
|
+
|
465
|
+
% SDL text symbol
|
466
|
+
% The corner has a size of twice the H height
|
467
|
+
|
468
|
+
/sdl_text {
|
469
|
+
10 dict begin
|
470
|
+
3 1 roll % put filled flag at end
|
471
|
+
4 ne { stop } if % sanity-check number of sides
|
472
|
+
aload pop
|
473
|
+
/ury xdef /urx xdef
|
474
|
+
/lry xdef /lrx xdef
|
475
|
+
/lly xdef /llx xdef
|
476
|
+
/uly xdef /ulx xdef
|
477
|
+
/h8 ury lry sub 8 div def
|
478
|
+
newpath
|
479
|
+
moveto
|
480
|
+
/d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop 2 mul def
|
481
|
+
newpath
|
482
|
+
urx ury d sub moveto
|
483
|
+
lrx lry lineto
|
484
|
+
llx lly lineto
|
485
|
+
ulx uly lineto
|
486
|
+
urx d sub ury lineto
|
487
|
+
closepath
|
488
|
+
{ fill } { stroke } ifelse
|
489
|
+
urx ury d sub moveto
|
490
|
+
d neg 0 rlineto
|
491
|
+
0 d rlineto
|
492
|
+
stroke
|
493
|
+
end
|
494
|
+
} bind def
|
495
|
+
|
496
|
+
% SDL text extension from left
|
497
|
+
% This should be used with "rank = same"
|
498
|
+
|
499
|
+
/sdl_text_extension_from_left {
|
500
|
+
3 1 roll % put filled flag at end
|
501
|
+
4 ne { stop } if % sanity-check number of sides
|
502
|
+
aload pop
|
503
|
+
pop pop
|
504
|
+
moveto
|
505
|
+
lineto
|
506
|
+
lineto
|
507
|
+
lineto
|
508
|
+
{ fill } { stroke } ifelse
|
509
|
+
} bind def
|
510
|
+
|
511
|
+
% SDL text extension from right
|
512
|
+
% This should be used with "rank = same"
|
513
|
+
|
514
|
+
/sdl_text_extension_from_right {
|
515
|
+
3 1 roll % put filled flag at end
|
516
|
+
4 ne { stop } if % sanity-check number of sides
|
517
|
+
aload pop
|
518
|
+
pop pop
|
519
|
+
8 4 roll
|
520
|
+
moveto
|
521
|
+
lineto
|
522
|
+
lineto
|
523
|
+
lineto
|
524
|
+
{ fill } { stroke } ifelse
|
525
|
+
} bind def
|
526
|
+
|
527
|
+
% SDL comment from left
|
528
|
+
% This should be used with "style = dashed" and "rank = same"
|
529
|
+
|
530
|
+
/sdl_comment_from_left { sdl_text_extension_from_left } bind def
|
531
|
+
|
532
|
+
% SDL comment from right
|
533
|
+
% This should be used with "style = dashed" and "rank = same"
|
534
|
+
|
535
|
+
/sdl_comment_from_right { sdl_text_extension_from_right } bind def
|
536
|
+
|
537
|
+
% SDL connector
|
538
|
+
% The width of the bounding box is ignored
|
539
|
+
|
540
|
+
/sdl_connector {
|
541
|
+
7 dict begin
|
542
|
+
3 1 roll % put filled flag at end
|
543
|
+
4 ne { stop } if % sanity-check number of sides
|
544
|
+
aload pop
|
545
|
+
pop pop
|
546
|
+
/lry xdef /lrx xdef
|
547
|
+
/lly xdef /llx xdef
|
548
|
+
/uly xdef pop
|
549
|
+
pop pop
|
550
|
+
/h2 uly lly sub 2 div def
|
551
|
+
/mx llx lrx add 2 div def
|
552
|
+
newpath
|
553
|
+
mx uly h2 sub h2 0 360 arc
|
554
|
+
{ fill } { stroke } ifelse
|
555
|
+
end
|
556
|
+
} bind def
|
557
|
+
|
558
|
+
% SDL set (extension)
|
559
|
+
% The hourglass has a size of twice the H height
|
560
|
+
% There should be a few spaces at the start of this shape's label
|
561
|
+
|
562
|
+
/sdl_set {
|
563
|
+
10 dict begin
|
564
|
+
3 1 roll % put filled flag at end
|
565
|
+
4 ne { stop } if % sanity-check number of sides
|
566
|
+
aload pop
|
567
|
+
/ury xdef /urx xdef
|
568
|
+
/lry xdef /lrx xdef
|
569
|
+
/lly xdef /llx xdef
|
570
|
+
/uly xdef /ulx xdef
|
571
|
+
/my uly lly add 2 div def
|
572
|
+
newpath
|
573
|
+
moveto
|
574
|
+
/d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def
|
575
|
+
newpath
|
576
|
+
llx d add my d add moveto
|
577
|
+
ulx d add uly lineto
|
578
|
+
urx ury lineto
|
579
|
+
lrx lry lineto
|
580
|
+
llx d add lly lineto
|
581
|
+
llx d add my d sub lineto
|
582
|
+
dup { closepath fill } { stroke } ifelse
|
583
|
+
llx my d sub moveto
|
584
|
+
d 2 mul dup rlineto
|
585
|
+
d 2 mul neg 0 rlineto
|
586
|
+
d 2 mul dup neg rlineto
|
587
|
+
closepath
|
588
|
+
{ fill } { stroke } ifelse
|
589
|
+
end
|
590
|
+
} bind def
|
591
|
+
|
592
|
+
% SDL reset (extension)
|
593
|
+
% The cross has a size of twice the H height
|
594
|
+
% There should be a few spaces at the start of this shape's label
|
595
|
+
|
596
|
+
/sdl_reset {
|
597
|
+
10 dict begin
|
598
|
+
3 1 roll % put filled flag at end
|
599
|
+
4 ne { stop } if % sanity-check number of sides
|
600
|
+
aload pop
|
601
|
+
/ury xdef /urx xdef
|
602
|
+
/lry xdef /lrx xdef
|
603
|
+
/lly xdef /llx xdef
|
604
|
+
/uly xdef /ulx xdef
|
605
|
+
/my uly lly add 2 div def
|
606
|
+
newpath
|
607
|
+
moveto
|
608
|
+
/d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def
|
609
|
+
newpath
|
610
|
+
urx ury moveto
|
611
|
+
lrx lry lineto
|
612
|
+
llx d add lly lineto
|
613
|
+
ulx d add uly lineto
|
614
|
+
closepath
|
615
|
+
{ fill } { stroke } ifelse
|
616
|
+
llx my d sub moveto
|
617
|
+
d 2 mul dup rlineto
|
618
|
+
llx d 2 mul add my d sub moveto
|
619
|
+
d 2 mul dup neg exch rlineto
|
620
|
+
stroke
|
621
|
+
end
|
622
|
+
} bind def
|
623
|
+
|
624
|
+
% SDL export (extension)
|
625
|
+
% The store has a width of twice the H height
|
626
|
+
% There should be a few spaces at the start of this shape's label
|
627
|
+
|
628
|
+
/sdl_export {
|
629
|
+
10 dict begin
|
630
|
+
3 1 roll % put filled flag at end
|
631
|
+
4 ne { stop } if % sanity-check number of sides
|
632
|
+
aload pop
|
633
|
+
/ury xdef /urx xdef
|
634
|
+
/lry xdef /lrx xdef
|
635
|
+
/lly xdef /llx xdef
|
636
|
+
/uly xdef /ulx xdef
|
637
|
+
/my uly lly add 2 div def
|
638
|
+
newpath
|
639
|
+
moveto
|
640
|
+
/d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def
|
641
|
+
newpath
|
642
|
+
llx d add my d 2 div add moveto
|
643
|
+
ulx d add uly lineto
|
644
|
+
urx ury lineto
|
645
|
+
lrx lry lineto
|
646
|
+
llx d add lly lineto
|
647
|
+
llx d add my d 2 div sub lineto
|
648
|
+
{ closepath fill } { stroke } ifelse
|
649
|
+
llx my d 2 div sub moveto
|
650
|
+
d 2 mul 0 rlineto
|
651
|
+
llx my d 2 div add moveto
|
652
|
+
d 2 mul 0 rlineto
|
653
|
+
stroke
|
654
|
+
end
|
655
|
+
} bind def
|