|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: R T
Length: 29800 (0x7468)
Types: TextFile
Names: »README.NROFFED«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec1/utep/README.NROFFED«
AN INTERACTIVE DRAWING BOARD PACKAGE
David H. Williams and Inaam Bakir
The University of Texas at El Paso
El Paso, Texas 79968
(915) 747-5470
ihnp4!ut-sally!utep-vaxa!williams
Page 1
I. INSTALLATION
cd to directory where software will be installed.
mkdir utep (make utep directory)
tar vx0 * (extract all of the files)
cd utep (enter the working directory)
To run the interactive program:
make (compile and link the routines)
drawit.out > /dev/aed (execute the program,
redirecting the output to an AED display.
Commands for executing the program will be
issued on the user terminal, and the output
will be displayed on the AED.)
To run the demo program:
make -f demo.makefile (compile and link the routines)
demo.out >/dev/aed (execute the program,
redirecting the output to an AED display.
Commands for executing the program will be
issued on the user terminal, and the output
will be displayed on the AED. The demo
output consists of a series of images dep-
icting a scene from sunrise to nightime.)
GOOD LUCK!
II. SUMMARY OF WORK
An interactive drawing board software package has been
designed for any user who has no knowledge of computers but
is able to interact with the computer through the use of the
keyboard. This package is menu driven and has a segmented
display file where entites like circles, squares, lines,
etc. can be created by inputting corresponding commands.
They then can be changed in many ways to assemble the re-
quired design. Images can be saved and recalled on the
display device for editing. The package is structured to be
device independent. It have the ability to drive different
devices with slight modification for each new device. It is
also structured to be machine independent by implementing
the package in FORTRAN 77. (One C language routine is also
required.)
Page 2
III. REQUIRED HARDWARE AND SOFTWARE
The required hardware and sofware is:
(a) A computer with UNIX. (The output program requires about
120k bytes of memory on a VAX 11/780.)
(b) FORTRAN 77 and C compilers.
(b) AED 512 Graphics/Imaging Terminal (Output Device).
(c) Micro-Term or other Terminal (Input Device). The alpha-
numeric keyboard is used to enter commands and parame-
ter values.
IV. PROGRAM DESIGN
This package has been designed to enable the user to
develop an image, modify it and store it easily. The gen-
eration of an image on the display devices screen consists
of the following steps:
(1) initialize the variables.
(2) enter the graphics mode.
(3) set window,screen and viewports limits.
(4) identify item by inputting its type, position,
color and measurements.
(5) clip item to window edges (if necessary).
(6) perform world-to-screen transformation.
(7) display item.
(8) edit image.
(9) exit graphics mode.
The following table lists all of the routines:
axes- draw x and y axes along page sides.
blnkrow- blank row and column that corresponds to
segments number in overlapping table.
block data- assign default values to common variables.
boxit- build boxes four corners out of boxes (blc) and
(trc).
boxitm- box current item by returning its boxes four
corners coordinates.
boxlin- compare two boxes for overlapping- at least
one box must represent a horizontal or a vertical
line.
boxout- check if item box lies outside page boundary.
boxsitm- box current standard item (square,rectangle,
triangle,circle and line).
buldcod- build a background segment or a (ucp) segments
Page 3
code.
cat- perform concatenation transformation.
change- display a question on the screen regarding
making changes to current item.
check- check if one point coordinates lie inside
a boxed item.
checkit- check if one point coordinates lie outside
page boundary.
cir- draw a 360 line segment unit circle in world
coordinates.
ckchang- check issued change on current item for validity.
ckovlap- check if current item overlaps other segments;
if so, set the appropriate entries in
overlapping table.
clean- insert a character in display file.
clip- clip line to window bounds using Conley's
Algorithm.
clr- (re) initialize transformation matrix.
clrbkgd- change background color.
compare- compare two boxes for overlapping.
cpnums- change polygon number after deletion of an item.
csif- close and save image files.
dcl- use an AED 512 built in command to draw
a filled circle.
dcode- transform one point device coordinates into
a three byte xy20 code (AED 512 code).
delitm- delete item from image.
delucp- delete a (ucp) from image.
dfplyln- set deletion flags of current (ucp)s lines
OFF.
dfr- use an AED 512 built in command to draw
a filled rectangle.
dlbkgd- delete segment background from image.
dlentry- delete one entry from list of overlapping
segments.
dmove- define command m (move and fill).
drawp- output display file contents on AED 512 screen
driver- transform one point screen coordinates into
device coordinates.
dsimage- display recalled image.
dspage- draw saved image's segments according to
their priorities.
edit- edit current image.
eight- draw digit 8.
eraitm- erase item from image.
eraucp- erase a (ucp) from image.
entaxes- enter segment axes in auxiliary table.
enterbp- enter a background segment or a (ucp) segment
information in segments table.
entpage- enter segment page in auxiliary table.
error- display an error message on I/P devices screen.
fclose- close image files.
Page 4
findsg- find if one segment number exists in list.
five- draw digit 5.
fopen- open image files.
four- draw digit 4.
gcmenu- display image editing menu.
hmarker- draw a horizontal unit marker.
howmpg- inquire about how many saved images exist.
ifl- use an AED 512 built in command to interior
fill closed polygons.
init- initialize variables and set encoding scheme
intrprt- interpret code on the output devices screen.
isblin- inquire if current box represents a horizontal
or vertical line.
isboxpg- check if current box represents page bounds.
ispdone- inquire if user is done with current (ucp).
issovlp- build a list of items numbers that overlaps
item in question.
itmmsin- check new measurements of item for validity.
itmptin- check new position of item for validity.
lcmenu- display item editing menu.
line- draw line if visible (within window bounds).
lsitems- list segments table content on I/P devices
screen.
makmove- make a move to a point on output devices screen.
matmlt- perform multiplication between two matrices.
mfoptns- display command (m) options on the screen.
move- check if point coordinates are within bounds
before making a move.
movepr- move to a certain point on screen.
movitm- move item to a new position.
mvwhere- read and process issued command.
newpage- reinitialize variables and supply user with a
blank page.
nine- draw digit 9.
oif- open image files.
one- draw digit 1.
openfl- open image files,save image,close files.
osegp- find out if current segment overlaps segment
page.
pgdone- exit output devices graphic mode and return
to alpha mode.
pickitm- pick one item by inputting its number.
pobound- check if one point coordinates actually lie
on page boundary.
procitm- specify,display and edit current item.
rdcomnd- read & process issued command on picked item.
rdinf- read image information back into program.
rdjpg- read display file content back into program.
readat- read auxiliary table .
readol- read overlapping table.
readst- read segment table.
readup- read (ucp)s common block.
Page 5
recall- recall an image on the output devices screen.
redmitm- draw moved item into its new position.
replac- replace one of the previously stored pages
with current page.
resave- resave current image.
respfy- respecify current item according to issued
command.
rstable- (re) initialize segments table.
rstotbl- (re) initialize overlapping table.
rstplst- (re) initialize (ucp)s list.
sat- establish the auxiliary table.
savat- save auxiliary table.
savinf- write image information into storage files.
savjpg- write display file content into storage files.
savpag- save current page for later use.
savol- save overlapping table.
savst- save segments table.
savup- save (ucp)s common block.
sbpovlp- set a background segment or a (ucp) segment
overlapping.
scl- build scaling matrix.
screen- (re) specify screen boundaries.
sct- call an AED 512 built in command to create
a color table.
sctable- (re) initialize color table.
search- search for one segment entry in list of
overlapping segments.
sec- call an AED 512 built in command to set
drawing color.
sendcod- send one segment code to be interpreted on
output devices screen.
sendsgs- send a number of segments to be displayed on
output devices screen.
setovlp- set two overlapped items entries in overlapping
table.
seven- draw digit 7.
showbg- show a background segment on output devices
screen.
showbp- show a user constructed polygon (ucp) on
output devices screen.
six- draw digit 6.
sndscd- establish type of segment and send its code to
be interpreted.
snpage- save current page as a new page.
sortlst- sort list of overlapping segments.
splyflg- set (ucp) flag ON (meaning that (ucp) under
construction).
sqr- draw a unit square in world coordinates.
srchlst- return one (ucp)s entry in list of (ucp)s.
srchtbl- search segments table for background color.
star- draw a star in world coordinates.
stovlap- process two segments for overlapping.
Page 6
swap- swap two points.
tempinf- temporarily transfer information from segments
table into items (twb).
term- terminate graphics mode by returning to alpha
mode.
three- draw digit 3.
tlt- build translation matrix.
triang- draw a unit triangle in world coordinates.
two- draw digit 2.
uftabl- store units numbers and files names in a table.
updf- update display file after deletion of an item.
upentry- update segments table after deletion of an item.
upinfo- update items (twb) after changing that item.
upolyln- mark current line to be a component of a (ucp).
upotble- update overlapping table after deletion of an
item.
uppoly- update (ucp)s common block after deleting one (ucp).
uptable- update segments table after changing an item.
usrpoly- construct current (ucp).
vmarker- draw a vertical unit marker.
vwport- (re) specify viewport boundaries.
wdscrn- transform one point world coordinates into
screen coordinates.
whichf- inquire about saved image files.
whichp- inquire about recalled image number.
whichu- inquire about saved image units.
windo- (re) specify window boundaries.
wtitems- write items (twb) into (pwb).
zero- draw digit 0.
zeroone- check if an array contains zeros or ones.
for output device.
V. DESCRIPTION OF SOFTWARE MODELS
The modular design of this package exhibits a clear
division of tasks among its modules. Basically, there are
four sections to be considered in some detail:
(1) Create an item.
(2) Edit an item.
(3) Edit an image.
(4) Save an image and/or Recall a saved image.
CREATE AN ITEM
A. Main Routine
Subroutine PROCITM will access the items specification,
which is stored in the items temporary working block (twb),
to construct an item and display it on the output device
Page 7
screen. The information, which is in the temporary working
block will then be stored in the permanent working block
(pwb).
B. Called Routines
1. SPFYITM (specify item)
Calls upon four interactive routines to read and store
users input concerning the item's position, measure-
ment, color and type of interior (outlined or solid ob-
ject).
2. DSPLYIT (display item on output devices screen)
Basically, subroutine SHOWITM is called to use the
items specifications stored in its (twb) to construct
the item as follows:
CIRCLE- uses center coordinates, radius value and
color value; calls DCL routine to use an AED
512 built in command (dcl) to draw a filled
circle or call CIR which is a routine to
draw a 360 line segments circle.
SQUARE
OR
RECTANGLE- uses bottom left corner coordinates (blc),
top right corner coordinates (trc) and color
value to call routine DFR which uses an AED
512 built in command (dfr) to draw a filled
square or rectangle or call routine SQR to
draw an outlined square or use four lines
segments to draw an outlined rectangle.
TRIANGLE- uses (blc) coordinates, side length value
and color value to draw an outlined trian-
gle. If solid triangle is specified, fill
triangle interior with specified color.
LINE- uses (blc) coordinates, (trc) coordinates
and color value to draw a line by calling
subroutine LINE.
Now that the item has been constructed according to the
specification, the next step is to show the item on the out-
put device screen by calling subroutine SENDCOD which will
send that segment code to be interpreted and the result to
Page 8
be displayed on the output device.
3. WTITEMS (write items (twb) into (pwb))
This routine copies items (twb) information into the
next available slot in the segments table which is also
called the permanent working block (pwb).
EXAMPLE:
General Case:
Items are square, rectangle, triangle, circle and line.
To draw a square at position (1.0,1.0) with a side length of
2.5 units and fill with light brown color,the user must:
1. input real x-value blank real y-value
followed by carriage return.
(ex): 1.0 1.0 <CR>
2. input real side length value followed by
carriage return.
(ex): 2.5 <CR>
3. input integer color value followed by
carriage return.
(ex): 10 <CR>
4. answer yes to a type of interior question
followed by carriage return.
(ex): y <CR>
RESULT:
A solid, light brown square positioned at (1.0,1.0) with
(2.5) units side length.
Special Case:
Item is a user constructed polygon (ucp) or background seg-
ment.
The user needs to pick the m-command (for move and
fill) from the items menu. There are two options available
within this command to handle those two special cases, (u-
(ucp) and b- background). To draw a (ucp) that has three
lines with the following begining and ending points,
(1.0,1.0) , (4.0,3.0)
(4.0,3.0) , (6.0,1.0)
(6.0,1.0) , (1.0,1.0)
and is filled with red color, the user must:
1. input the following for the 1st line
1.0 1.0 <CR>
Page 9
4.0 3.0 <CR>
7 <CR> (lines will be
drawn with white color)
2. input the following for 2nd line
4.0 3.0 <CR>
6.0 1.0 <CR>
7 <CR>
3. input the following for 3rd line
6.0 1.0 <CR>
1.0 1.0 <CR>
7 <CR>
4. input 1 <CR> to color (ucp) with red.
5. input 4.0 2.0 <CR> which is the interior
fill point for (ucp).
RESULT:
A red filled (ucp) positioned at (1.0,1.0) which has
three lines as specified.
The user needs to be aware of several things when
creating a (ucp). A user constructed polygons building com-
ponents should be lines ONLY. It also must be a closed po-
lygon and have an interior fill point that lies clearly in-
side the polygon. The user has the responsibility to see to
it that it is inputted correctly on the first trial , (i.e)
there is no room for error.
EDIT ITEM
A. Main Routine
Subroutine PROCITM converses with the user interactiv-
ly. It inquires about a need to issue changes on the current
item. If so, the item will be erased from the image followed
by a redrawing of that part of the image which has over-
lapped with the item. This routine will ask the user to
respecify the item.
B. Called Routines
1. subroutine ISSOVLP will build a list of all segments
that overlap the item in question.
2. subroutine SENDSGS will send those segments to the out-
put devices screen in the order in which they were
created.
3. subroutine RESPFY will inquire about the type of change
(position, color or measurement). It will check the is-
sued change for validation. Subroutine CKCHANG (check
change) will return an answer to this question and in-
form the user about the reason if the issued change
Page 10
could not be approved. The condition for validation of
the requested change is that the changed item falls
within the page bounds.
EXAMPLE:
General Case:
Items are square, rectangle, triangle, circle and line. To
edit a square by moving it from position (1.0,1.0) to
(2.0,3.5),the user must:
1. pick command p (position) from
items editing menu,
p <CR>
2. input new position,
2.0 3.5 <CR>
RESULT:
The same solid, light brown square positioned at (2.0,3.5)
instead of (1.0,1.0).
Special Case:
Items are (ucp) and background segments. This program has
not been designed to include these special cases in items
editing session.
CREATE AND EDIT IMAGE
_▶08◀C_▶08◀r_▶08◀e_▶08◀a_▶08◀t_▶08◀e _▶08◀A_▶08◀n _▶08◀I_▶08◀m_▶08◀a_▶08◀g_▶08◀e
In one drawing session, the user is allowed to create
up to five images. On each image he/she can draw up to five
(ucp)s, one background segment and any number of regular
items for a total of up to 20 items on each page.
_▶08◀E_▶08◀d_▶08◀i_▶08◀t _▶08◀i_▶08◀m_▶08◀a_▶08◀g_▶08◀e
A. Main Routine
Subroutine EDIT converses with the user interactively
to inquire about a user's need to issue changes on the
current image. If so, the user must identify the item by in-
putting its number and the change command. The changed item
and updated image will then be displayed on the screen.
B. Called Routines
LSITEMS- list image items on the input devices screen.
PICKITM- ask user to identify item by inputting its
number.
Page 11
GCMENU- display image editing commands as follows:
m- move item
e- erase item
a- add item
RDCOMND- read command character and call corresponding
routines as follows:
subroutine MOVITM- erase item from image, redraw only
that part of image that has over-
lapped with item, redraw item in
new position and redraw that part
of image that has overlapped with
moved item.
subroutine DELITM- erase item from image, redraw only
part of image that has overlapped
with deleted item, update display
file by erasing segments code, up-
date segments records where needed.
EXAMPLE:
To Edit an image, a menu of commands will be displayed as
follows:
m- move item
e- erase item
a- add item
Each item will be handled one at a time by specifying its
number and the needed command. The user should be aware of
the following special cases in image editing :
1. cannot move a (ucp) or a background segment.
2. cannot move a line that belongs to a (ucp).
3. cannot erase a line that belongs to a (ucp)
without erasing that (ucp) first.
If these special cases are tried by the user, error
messages or warning messages will be displayed on the screen
to inform the user about these situations.
SAVE IMAGE AND/OR RECALL SAVED IMAGE
_▶08◀S_▶08◀a_▶08◀v_▶08◀e _▶08◀I_▶08◀m_▶08◀a_▶08◀g_▶08◀e
A. Main Routine
Subroutine SAVPAG converses interactively with the user
to find out if the created image is to be saved. If it is,
the image must be checked to see if it is a recalled image
that has undergone some changes. If so , the image is
Page 12
resaved. If not, nothing is done because the image will be
saved automatically, since an image file is designed to be
saved after execution. If it is a new image that has just
been created, it will be saved as a new page.
B. Called Routines
SNPAGE- save new page
RESAVE- resave image
PGDONE- exit graphics mode
NEWPAGE- reinitialize variables and supply a blank page.
_▶08◀R_▶08◀e_▶08◀c_▶08◀a_▶08◀l_▶08◀l _▶08◀S_▶08◀a_▶08◀v_▶08◀e_▶08◀d _▶08◀I_▶08◀m_▶08◀a_▶08◀g_▶08◀e
A. Main Routine
Subroutine RECALL converses interactively with the user
to find out if the user wants to call a previously saved im-
age on the screen. If so, it will display the image on the
screen, edit the image if needed and resave the image again
B. Called Routines
HOWMPG- return the number of saved images
WHICHP- which page need to be recalled
DSIMAGE- display and edit image
FOPEN- open image files
FCLOSE- close image files