% -*-LaTeX-*-
% Converted automatically from troff to LaTeX by tr2tex on Sun Mar 15 15:42:37 1992
% tr2tex was written by Kamal Al-Yahya at Stanford University
% (Kamal%Hanauma@SU-SCORE.ARPA)


\documentstyle[troffman]{article}
\begin{document}
%
% input file: fig.1
%
\phead{FIG}{1}{28\ March\ 1988}

\shead{NAME}
fig -- Facility for Interactive Generation of figures
\shead{SYNOPSIS}
{\bf fig}
%
\bf [ -r ] \rm%
 
%
\bf [ \rm%
 %
\it file \rm%
 %
\bf ] \rm%

\shead{DESCRIPTION}
{\it Fig} 
is a menu-driven tool that allows the user to draw and manipulate objects
interactively on the screen of a Sun Workstation. 
It can only be run within the SunWindows environment and requires a 
three-button mouse.
{\it File} 
specifies the name of a file to be edited. The description of objects in
the file will be read at the start of %
\it fig\rm%
. 
\par
The output from %
\it fig \rm%
 can be printed by first using 
{\it f2p}
(%
\it fig \rm%
 to %
\it pic\rm%
(1) translator, also known by its previous
name %
\it ftop\rm%
(1L)) to translate it into 
{\it pic}{\rm (1)}
language.
The %
\it pic\rm%
(1) file can be saved and edited like ordinary text file.
To print the file one should issue the command:
\nwl
pic file $|$ troff \rm%

\nwl
adding any required options to the invocation of %
\it troff\rm%
(1).
The file may be used in conjunction with any other %
\it troff\rm%
(1) preprocessors.
\par
Another way to produce a hrad copy is to use %
\it f2ps \rm%
 (the fig to postscript
translator) to produce a postscript file from %
\it fig \rm%
 file.
The postscript file can be sent directly to a postscript printer
via
{\it lpr}{\rm (1).}
\shead{OPTIONS}
\begin{TPlist}{{\bf --r}}
\item[{{\bf --r}}]
Change the position of the panel window to the right of the canvas window
(default: left).
\end{TPlist}
\shead{GRAPHICAL OBJECTS}
The objects in %
\it fig \rm%
 are divided into %
\bf primitive objects \rm%
 and
%
\bf compound object\rm%
. The primitive objects are: %
\it ARC\rm%
, %
\it CIRCLE\rm%
,
%
\it CLOSED SPLINE\rm%
, %
\it ELLIPSE\rm%
, %
\it POLYLINE\rm%
, %
\it POLYGON\rm%
,
%
\it SPLINE\rm%
, and %
\it TEXT\rm%
.  A primitive can be moved, rotated,
flipped, copied or erased.
A compound object is composed of primitive objects. The primitive objects
that constitute a compound can not be individually modified, but they can
be manipulated as an entity; a compound can be moved, rotated, flipped,
copied or erased.  An extra function that can be applied to a compound
object is %
\bf scaling\rm%
, which is not available for primitive objects.
\shead{DISPLAY WINDOWS}
Three windows comprise the display area of %
\it fig\rm%
: the 
panel window the message window, and the canvas window. 
The message window always appears below the others;
it is the area in which messages are sent and received. from the
The menu window can be placed to the left or right of the
the canvas window (default: left).
\shead{POP-UP MENU}
The pop-up menu appears when the right mouse button is pressed with the
cursor positioned within the canvas window.
Positioning the cursor over the desired menu entry and releasing the
button selects a menu entry.
\par
There are a number of file accessing functions in the pop-up menu.
Most of the time when one of these functions is selected, the user
will be asked for a file name.  If the specified file can be located
and the access permission are granted, %
\it fig \rm%
 will carry out
the function.  However in case things go wrong, %
\it fig \rm%
 will
abort the function and printed the causes on the message window.
\begin{TPlist}{{\it Undo}}
\item[{{\it Undo}}]
Undo the last object creation or modification.
\item[{{\it Redisplay}}]
Redraw the canvas.
\item[{{\it Remove} all}]
Remove all objects on the canvas window (can be undone).
\item[{{\it Edit} file ...}]
The current contents of the canvas are cleared and objects
are read from the specified file.
The user will be asked for a file name.
This file will become the current file.
\item[{{\it Save}}]
Save the current contents of the canvas in the current file.
If no file is being edited, the user will be asked for a file
name as in the "Save in ..." function.
\item[{{\it Read} file ...}]
Read objects from the specified file and merge them with objects already
shown on the canvas.
(The user will be asked for a file name.)
\item[{{\it Save} as ...}]
Save objects on the screen into a file specified by the user.
(The user will be asked for a file name.)
\item[{{\it Status}}]
Show the name of the current file and directory.
\item[{{\it Change} Directory}]
Change the working directory.  Any file name without a full path name
will employ the current working directory.
\item[{{\it Save} \& Exit}]
Save the objects in the current file and exit from %
\it fig\rm%
.
If there is no current file, the user will be asked for a file name.
No confirmation will be asked.
\item[{{\it Quit}}]
Exit from %
\it fig\rm%
, discarding all objects. The user will be asked to 
confirm the action, by clicking the left button.
\item[{{\it Save} as BITMAP ...}]
Create a bitmap picture of the drawings for use with other tools (for example,
for use as an icon).  The smallest rectangular area of pixels
that encompasses the figure is written to the named file 
(the user will be asked for a file name) from
top row to bottom and left to right (in Sun raster format).
Only %
\it TEXT \rm%
 objects that are parts of compound objects will be
treated as parts of the picture; other texts are saved as objects in
%
\it fig \rm%
 format following the bitmap data.
The coordinates of these text objects can be used
to identify locations on the bitmap.
\end{TPlist}
\shead{MENU WINDOW MANIPULATION FUNCTIONS}
Icons in the menu window represent object manipulation functions,
modes and other drawing or modification aids.
Manipulation functions are selected by positioning the cursor over it and
clicking the left mouse button.  The selected icon is highlighted, and
a message describing its function appears in the message window.
\par
The left and middle buttons are used to creat and modify objects in the canvas
window.  Most actions start with clicking of the left button
and end with clicking of the right button.
There is no need to hold down a button while positioning
the cursor.
\shead{MENU WINDOW COMMAND DESCRIPTIONS}
Entries in the panel window can be classified into two categories:
object creation/modification/removal commands (only one of which may be active
at any one time), and drawing aids (which act as toggle switches).
There are two ways for drawing circles, two for ellipses, two for splines
and two for closed splines.
There are two basic splines.  One is the interpolated spline
in which the spline pass thorough the entered points (knots).
The other is the normal spline in which on control points are
passed by the spline (except for the two end points in the open spline).
\shead{OBJECT CREATION/MODIFICATION/REMOVAL}
Multiple commands are grouped thematically in the following
descriptions (which is listed alphabetically).
\begin{TPlist}{{\it ADD/DELETE} ARROWS}
\item[{{\it ADD/DELETE} ARROWS}]
Add or delete arrow heads for %
\it POLYLINE\rm%
, %
\it POLYGON\rm%
, %
\it SPLINE \rm%

or %
\it CLOSED SPLINE \rm%
 objects (points of a %
\it BOX \rm%
 can not be added or
deleted).
\item[{{\it ADD/DELETE} POINTS}]
Add or delete points for %
\it POLYLINE\rm%
, %
\it POLYGON\rm%
, %
\it SPLINE \rm%

or %
\it CLOSED SPLINE \rm%
 objects (points of a %
\it BOX \rm%
 can not be added
or deleted).
\item[{{\it ARC}}]
Create an arc.  Specify three points using the left button.
\item[{{\it BOX}}]
Create rectangular boxes.  Start with the left button and terminate with
the right button.
\item[{{\it BREAK} COMPOUND}]
Break  a compound object to allow manipulation of its component parts.
Click the left button on the bounding box of
the compound object.
\item[{{\it CIRCLE} }]
Create circles by specifying their radii or diameters.
Click the left button on the canvas window, move the cursor until the
desired radius or diameter is reached, then click the middle button to
terminate. The circle will be drawn after the pressing of the middle button.
\item[{{\it CLOSED} INTERPOLATED SPLINE}]
Create closed or periodic splines.  The function is similar
to %
\it POLYGON \rm%
 except that a closed interpolated spline is drawn.
The spline will pass through the points (knots).
\item[{{\it CLOSED} SPLINE}]
Create closed or periodic spline objects.
The function is similar to %
\it POLYGON \rm%

except that a closed spline will be drawn instead of polygon.
The entered points are just control points; i.e., the spline will
not pass any of these points.
\item[{{\it COPY}}]
Copy object.  Click the left button over part of the object to be
copied (for %
\it CIRCLE \rm%
 and %
\it ELLIPSE \rm%

objects, position on their circumferences).  Drag the object to the desired
position and click the middle button.
This function as well as the following three functions 
(%
\it MOVE\rm%
, %
\it MOVE POINT\rm%
, %
\it REMOVE\rm%
)
will cause point markers (manipulation aids) to be shown on the canvas window.
There are no markers for %
\it CIRCLE \rm%
 or %
\it ELLIPSE \rm%
 objects.
\item[{{\it ELLIPSE}}]
Create ellipses using the same procedure as for the drawing of circles.
\item[{{\it GLUE}}]
Glue the primitive objects within a bounding box into a compound object
(the bounding box itself is not part of the figure; 
it is a visual aid for manipulating the compound). 
\item[{{\it INTERPOLATED} SPLINE}]
Create (cubic spline) spline objects.
Enter control vectors in the same way as for creation of a
%
\it POLYLINE \rm%
 object.
At least three points (two control vectors) must be entered.
The spline will pass through the entered points.
\item[{{\it MOVE}}]
Move objects in the same way as in %
\it COPY\rm%
.
\item[{{\it MOVE} POINT}]
Modify the position of points of %
\it POLYLINE, %
\it BOX\rm%
, %
\it POLYGON\rm%
,
%
\it ELLIPSE\rm%
, %
\it ARC \rm%
 and %
\it SPLINE \rm%

objects.  Click the left button over the desired point, reposition the point,
and click the middle button.  Note that %
\it BOX \rm%
 and %
\it POLYGON \rm%
 
objects are internally stored as %
\it POLYLINE \rm%

objects, and therefore moving certain points may open these objects.
\item[{{\it POLYGON}}]
Same as %
\it POLYLINE \rm%

except that a line segment is drawn connecting the first and last
points entered.
\item[{{\it POLYLINE}}]
Create polylines (line segments connecting a sequence of points).
Enter points by clicking the left button at the desired positions on the
canvas window.  Click the middle button to terminate.
\item[{{\it REMOVE}}]
Remove (or delete) objects.
\item[{{\it SCALE} COMPOUND}]
Only compound objects can be scaled.  Click the left button
on a corner of the bounding box, stretch the
bounding box to the desired size, and click the middle button.
\item[{{\it SPLINE}}]
Create (quadratic spline) spline objects.
Enter control vectors in the same way as for creation of a
%
\it POLYLINE \rm%
 object.
At least three points (two control vectors) must be entered.
The spline will pass only the two end points.
\item[{{\it TEXT}}]
Create text strings. Click the left button at the desired position on
the canvas window, then enter text from the keyboard.
Terminate by clicking the middle button or typing the return key.
\item[{{\it TURN}}]
Turn %
\it POLYGON \rm%
 into a %
\it CLOSED INTERPOLATED SPLINE \rm%
 object, or
turn %
\it POLYLINE \rm%
 into a %
\it INTERPOLATED SPLINE \rm%
 object.
\end{TPlist}
\shead{DRAWING AIDS}
Drawing aids act as toggle switches. More than one can be selected at a time
(except for %
\it GRID \rm%
 and the line drawing modes).
\begin{TPlist}{{\it AUTO} FORWARD/BACKWARD ARROW}
\item[{{\it AUTO} FORWARD/BACKWARD ARROW}]
Automatically add forward/backward arrow heads to %
\it POLYLINE\rm%
, %
\it SPLINE \rm%

or %
\it ARC \rm%
 objects.
\item[{{\it FLIP}}]
Invert the object (middle button) or produce a mirror-image copy of an
object (left button). Point to part of the object ("the handle"), click
the appropriate button.
\item[{{\it GRID}}]
Display either the quarter- or half-inch grids (left button).
\item[{{\it MAGNET}}]
Round points to the nearest 1/16 of an inch.
This affects every function, and is provided as an alignment aid.
\item[{{\it UNRESTRICTED}}]
Allow lines to be drawn with any slope.
\item[{{\it MANHATTAN}}]
Enforce drawing of lines in the horizontal and vertical direction only.
Both %
\it MANHATTAN \rm%
 and %
\it MOUNTAIN \rm%
 can be turned on simultaneously. The
creations of %
\it POLYGON\rm%
, %
\it POLYLINE \rm%
 and %
\it SPLINE \rm%
 objects are
affected by these two modes.
\item[{{\it MOUNTAIN}}]
Enforce drawing of only diagonal lines.  Both %
\it MANHATTAN \rm%

and %
\it MOUNTAIN \rm%
 can be turned on simultaneously. The creations
of %
\it POLYGON\rm%
, %
\it POLYLINE \rm%
 and %
\it SPLINE \rm%
 objects are affected
by these two modes.
\item[{{\it MANHATTAN} MOUNTAIN}]
Allow lines to be drawn at any slope allowed when in
MOUNTIAIN or MANHATTAN modes.
\item[{{\it LATEX} LINE}]
Allow lines to be drawn only at slopes which can be handled by LaTeX picture
environment lines: slope = x/y, where x,y are integers in the range [-6,6].
\item[{{\it LATEX} VECTOR}]
Allow lines to be drawn only at slopes which can be handled by LaTeX picture
environment vectors: slope = x/y, where x,y are integers in the range [-4,4].
\item[{{\it ROTATE}}]
Rotate the object (middle button) or copy (left button) +90 degrees.
\item[{{\it SOLID/DASHED} LINE STYLE}]
Toggle between solid and dashed line styles. The dash length
is fixed at 0.05 inch.
\end{TPlist}
\shead{BUGS}
Text strings will appear differently on hard copy, because the display
fonts are fixed-width fonts while the fonts used by %
\it pic\rm%
(1) are
variable-width fonts.
\par
A double quote in a text string should be preceded by a back slash if the
it is to be printed through 
{\it pic}{\rm (1).}
\par
Objects that extend beyond the canvas window may cause image shrinkage in
hard copy printed by
{\it pic}{\rm (1),}
since it will try to fit every object onto a single 8.5" x 11" page.
\par
Ellipses which are too narrow may cause %
\it fig \rm%
 to loop forever.
\par
Objects which are created while one of the 
{\it grids}
is on may appear ragged. This can be corrected by selecting %
\it Redisplay \rm%

from the pop-up menu.
\par
The X11 cursors are not the original ones but chosen from
X11's cursor font.
\par
Righthand panel is not supported. It should be possible to do
that but Ken was too lazy.
\shead{SEE ALSO}
Brian W. Kernighan
{\it PIC\ -\ A\ Graphics\ Language\ for\ Typesetting\ User\ Manual}
\nwl
col(1) ditroff(1), eqn(1), f2p(1), f2ps(1), man(7), me(7), ms(7),
pic(1), tbl(1), troff(1),
\shead{ACKNOWLEDGEMENT}
Many thanks goes to Professor Donald E. Fussell who inspired the
creation of this tool.
\shead{AUTHOR}
Supoj Sutanthavibul
\nwl
University of Texas at Austin 
\nwl
(supoj@sally.UTEXAS.EDU) 
\nwl
Manual page modified by R. P. C. Rodgers, UCSF School of Pharmacy,
San Francisco, CA 94118 
\nwl
Frank Schmuck of Cornell contributed the LaTeX line drawing modes.
\end{document}
