home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
cad
/
atk1ibm.arj
/
GEDPS.PS
< prev
next >
Wrap
Text File
|
1991-03-24
|
6KB
|
237 lines
% This is a prologue for DFD files sent to the laser printer
% NOTE: A rotation is normally done for LANDSCAPE style printing.
% If this rotation is not desired, orientation is defined to PORTRAIT.
% THE ORIENTATION CAN BE CHANGED BY CHANGING THE DEFINITION OF ORIENTATION
% AND BY FIXING THE BoundingBox COMMENT (FOR EPS COMPATIBILITY)
% For LANDSCAPE, %%BoundingBox: 0 0 612 796, is proper
% For PORTRAIT, %%BoundingBox: 0 0 612 492, is proper.
orientation LANDSCAPE eq { % Set up based on orientation definition
90 rotate 36 -36 translate % landscape - origin in UL corner
10.0 72 mul 11000 div dup scale % scale to 11000 for 10 inches across page
20 setlinewidth % Same as 1 pixel on screen
}
{
36 440 translate % portrait - origin in UL corner of DFD
7.5 72 mul 11000 div dup scale % scale to 11000 for 7.5 inches across page
16 setlinewidth % Same as 1 pixel on screen
}
ifelse % Set up for LANDSCAPE or PORTRAIT
/myscale { 11000 80 div } def
/Helvetica findfont myscale scalefont setfont % 80 chars across page (now:x10)
% The x coordinate is the same as in DFDs, the Y coordinate is negative
/doProcess % Gets Pno Ptext Rad Xc Yc
{
/Yc exch def
/Xc exch def
/Rad exch def
/Ptext exch def
Xc Yc neg Rad add myscale sub placetext % Pno is still on the stack
Ptext Xc Yc neg placetext
Xc Yc neg Rad 0 360 arc stroke
} def
/doExternal % Gets: Etext Xc Yc Xdis Ydis
{
/Ydis exch def
/Xdis exch def
/Yc exch def
/Xc exch def
Xc Yc neg placetext % Etext is still on the stack
Xc Yc neg Xdis Ydis box
} def
/doFile % Gets: Ftext Xc Yc Xdis Ydis SingDoub
{
/SingDoub exch def
/Ydis exch def
/Xdis exch def
/Yc exch def
/Xc exch def
Xc Yc neg placetext % Ftext is already on the stack
Xc Yc neg Xdis Ydis
SingDoub 0 eq % Checks if Single line file
{ singlelinefile } % If single line
{ doublelinefile } % If double line
ifelse
} def
/doFlow % Gets: [[X1 Y1] ... [Xm Ym]] Xn Yn Name Arrows?
{
/Doub exch def % Single or double headed:
/Ftext exch def
/Yn exch def
/Xn exch def
/RouteArray exch def
RouteArray PolyLine % Draw the path, Sans arrowheads and Text
RouteArray 0 get aload pop /Ys exch def /Xs exch def
Doub 1 and 0 ne % Arrowhead at beginning!
{
RouteArray 1 get aload pop /Ytmp exch def /Xtmp exch def
Xs Ys neg moveto
Xs Xtmp sub Ys Ytmp sub atan arrowhead
gsave stroke grestore
newpath
}
if
Doub 2 and 0 ne % Arrowhead at end!
{
/tmpCount RouteArray length def
RouteArray tmpCount 1 sub get aload pop /Ye exch def /Xe exch def
RouteArray tmpCount 2 sub get aload pop /Ytmp exch def /Xtmp exch def
Xe Ye neg moveto
Xe Xtmp sub Ye Ytmp sub atan arrowhead
gsave stroke grestore
newpath
}
if
Xn Yn neg moveto
Ftext
dup BlankUnder
Xn Yn neg % Text still on stack
placetext
} def
/doDescription % Gets Dtext Xl Yl
{
neg moveto
gsave
dup stringwidth pop 2 div 0 rmoveto
dup BlankUnder
grestore
show
} def
%
%% Other functions
%
/placetext % stack: text xcenter ycenter
{
moveto % Absolute move to center of new text
dup stringwidth pop % puts x width on stack after copy of string
2 div neg % puts -1/2 x on stack
0 % puts 0 y-char height on stack
rmoveto % movck halfway
show % Only string was on stack now
newpath % Clear any current path from the moveto
} def
/box % items on stack: xcenter ycenter xdis ydis: For externals
{ /ydis exch def
/xdis exch def
/ycenter exch def
/xcenter exch def
newpath
xcenter xdis add ycenter ydis add moveto
0 ydis neg ydis neg add rlineto
xdis neg xdis neg add 0 rlineto
0 ydis ydis add rlineto
closepath stroke
} def
/singlelinefile % items on stack: same as for externals
{ /ydis exch def
/xdis exch def
/ycenter exch def
/xcenter exch def
newpath
xcenter xdis add ycenter ydis add moveto
xdis neg xdis neg add 0 rlineto
stroke
} def
/doublelinefile % items on stack: same as for externals
{ /ydis exch def
/xdis exch def
/ycenter exch def
/xcenter exch def
newpath
xcenter xdis add ycenter ydis add moveto
xdis neg xdis neg add 0 rlineto
stroke newpath
xcenter xdis add ycenter ydis neg add moveto
xdis neg xdis neg add 0 rlineto
stroke
} def
/average % Gets: Two numbers to average
{
add 2 div
} def
/arrowhead % Gets: angle as input
{
gsave % Save current origin & rotation
currentpoint % Get the current position
translate % Make it the origin
rotate % Use the angle argument
triangle % Draw the triangle
grestore % Restore origin and rotation
} def
/triangle % Draws a dull, black triangle at the origin
{
gsave % Preserve our dullness (gray scale)
0 setgray
0 0 moveto
50 100 lineto
-100 0 rlineto
closepath
fill
grestore % Restore our dullness
} def
/PolyLine % Array of 2-int arrays on stack
{
/Array exch def
Array 0 get aload pop /Ys exch def /Xs exch def
Xs Ys neg moveto
1 1 Array length 1 sub
{
Array exch get aload pop /Ye exch def /Xe exch def
Xe Ye neg lineto
/Xs Xe def
/Ys Ye def
}
for
gsave stroke grestore
newpath
} def
% Note: This is font specific. For Helvetica, the Font Box
% descends 22% below point size and extends above 94% point size
/BlankUnder % text-item
{
stringwidth pop % How wide is it
dup 0 gt
{ % If width is > 0
dup 2 div neg % Half of the string width wide
myscale rmoveto % Move to -1/2 stringwidth, myscale
dup 0 rlineto % Move to 1/2 stringwidth, myscale
0 myscale 1.25 mul neg rlineto % Move to 1/2 stringwidth, -.25 myscale
neg 0 rlineto % Move to -1/2 stringwidth, -.25 myscale
%myscale 1.2 mul rmoveto % And 1.2 char height high
%dup 0 rlineto 0 myscale 1.2 mul 1.2 mul neg rlineto
%neg 0 rlineto
closepath
gsave % Save current gray level
1 setgray fill
grestore newpath % Reset the gray level
}
{ % width is 0
pop % pop off extra stringwidth
}
ifelse
} def
%%EndProlog