The Figure Classes:

Object-Oriented Simple Graphics for Introductory Programming


The figure classes were designed by Joe Turner and implemented at Clemson University as a means of providing object-oriented simple graphics for introductory programming students. The implementation uses the "CS1" graphics library by Eric Roberts of Stanford, which provides a simple C library of function calls for graphics operations in a popup window, and is implemented on Unix (X-windows), PC, and Mac platforms.

The figure classes are only implemented in C++ (so far), although some preliminary investigation and experimentation was done in Ada95 and it appears that the C++ design could be used for an Ada implementation. A Java implementation also appears to be quite straightforward (and some would argue unnecessary!), but of course a Java implementation would not need the CS1 C library for the graphics functions. Although the C++ implementation should theoretically work on all three platforms for which the underlying CS1 library has been implemented, only the Unix/X implementation has been tested.

The figure classes are described in the figure.h interface file. The distribution file is a Unix tar file containing some directories and a README file explaining the contents of the various directories. A straight untar (tar xf figure.tar) of the tar file will produce the README file and other files and directories. There are two versions of the tar file: a normal tar file that was generated by the Unix command tar cf figure.tar figure, and a gzipped tar file. (Note that the name of the gzipped file is "gz.figure.tar" rather than the usual "figure.tar.gz" to facilitate fetching the file with a web browser, because some browsers don't handle a .gz qualifier very well. You should be able to download either of these files by clicking on the appropriate link above.)

The figure classes and implementation(s) may be freely used, but not for a fee nor for any commercial purpose without permission. Efforts will be made to correct bugs that are reported, but no guarantee is made that any implementation is without fault or that reported bugs will be repaired. Regretfully, no assistance can be provided in installing or using the classes.

Comments and notification of problems and usage would be appreciated. Please email them to turner@cs.clemson.edu.

Linux Installation

Don Owens has provided Makefiles for installing the figure class on a Linux platform. There are 3 Makefiles -- the top-level Makefile and a Makefile for each of the figure and unixlib directories. The top-level Makefile will run make in each of the subdirectories. Compiling and installation only requires editing the top of the top-level Makefile to indicate which C and C++ compilers to use and where to install the library. The way the Makefiles are written in the distribution is to call the figure library libfigure.a instead of libg.a, because Linux already has a libg.a.

The Makefiles are figure/Makefile, figure/figure/Makefile, and figure/unixlib/Makefile. These are available in a tarfile and in a gzipped tarfile.