QUADTREE PROJECT DRAWING ROUTINES
=================================

The drawing routines that you'll be using for part 3 and part 4 of the
quadtree project are contained in drawing.tar.gz.  To use them, your project
will basically generate rendering commands in a custom language that the
drawing routines use.  Programs that are part of the rendering package can
then use that output to draw your quadtree.

First, your project will generate a listing of rendering commands, with the
help of the functions listed in drawing_c.h.  These (text) rendering commands
will be produced as the output from some project commands such as DISPLAY.
See the drawing_c.h header file for detailed documentation about each drawing
function available to you.  Each drawing function prints a command in the
custom rendering language that is particular to this drawing package.  Note
that this is the only real integration that must be done for your project; you
don't need to actually draw all the lines, pixels, etc.  You simply have to
call the appropriate functions from drawing_c.h.

The actual rendering is handled by the second component of the drawing
routines, which consists of two programs, called showquad and printquad.
These programs take the text output (in the custom rendering language) and
create a picture of your quadtree.  Showquad draws a picture on-screen, while
printquad draws your quadtree as a PostScript file sent to standard output.

Both programs are capable of finding these drawing commands anywhere in your
project output, so testing your DISPLAY routine is very simple - you can send
the output from your project directly to either program with no modification.
For example, assuming your test input file is called test.in and it contains a
DISPLAY() command, you could do the following to render your quadtree:
   ./<project file> < test.in > my.out
   ./showquad my.out

Or, if you are not a fan of temporary files, you could use this:
   ./<project file> < test.in | showquad

To generate a PostScript file containing your output, use printquad:
   ./<project file> < test.in | printquad > output.ps

Note that all you need to integrate into your project are the drawing.c and
drawing_c.h files.  You should add statements to your Makefile to compile the
code in drawing.c into your project.  However, you don't have to worry about
compiling printquad and showquad.

I've tested the drawing routines on linux.grace.umd.edu, and they compile and
run nicely there.  Also note that if you are using showquad to draw your
quadtree on-screen, you need to set up X forwarding in your SSH client, so
that the drawing window can be created.


----

Contact the TA if you have any questions.

