Comp 2673, Spring2002
Programming Project 2
Assigned Friday, May 3, 2002
Due Wednesday, May 29, 2002
The problem
This assignment is to write a graphics editor. The editor will run on the
CS Sun machines, opening a window on the main monitor. The editor
lets the user input lines, rectangles, circles, and polygons, using the mouse
to indicate locations. It also allows the user to delete any of the shapes
they've created, again using the mouse to point to the object. It also allows
the user to start a fresh drawing (delete all shapes). After any
delete operation, the program should of course update the screen.
You may design the interface to your program, but it should be simple to
use. You should give information about how to use the program to the user.
(You may display it using cout if you like).
Storing the objects
Store your shapes in an STL list (#include <list>).
Make a base class for all shapes, and define derived classes for each of
the shape types.
Graphics Package
You are being provided with a simple graphics package called cs3g. (This
package is based on SRGP, Simple Raster Graphics Package.) In order to use
this, you'll have to put some things into your makefile.
First, add /u/home/ftl/include to the include path (-I option to g++). Also,
you'll have to add /u/home/ftl/lib to the library search path
(-L option to g++) and you'll have to link several libraries, including
libcs3g.a and libsrgp.a and libX11.a (use the -l option to g++).
The graphics package is a low-level interface to the display device and input
devices. There are routines for drawing graphics primitives (lines, ellipses,
etc), and routines for getting information from the input devices (mouse and
keyboard).
For details on the graphics package, see cs3g info
Submission guidelines
You may work alone, or may choose to work with a partner who is also
taking Comp2673 this quarter.
All code must be written individually and independently
by the two in your group. If you choose to work with another
person, you must choose someone whose programming skills are at approximately
the same level as you. You are responsible for dividing the work in an
equitable way, and each of you is responsible for understanding every
part of the program. Group work loses its effectiveness if work is not
distributed in a fair manner. If you cannot say that you contributed
nearly 50% of the work, then you and your partner are both engaging in
academically dishonest behavior.
As usual,
at the top of each file, put comments with your name(s), the date, course
number, and assignment number. Write the program with a
well organized structure, format it consistently, and document your
program by naming functions and variables in a useful way, and by writing
comments that would help someone understand how the code works so they
could modify, enhance, or debug it. Functions should perform a specific
and well-defined task that is described in comment lines above the
function header. Classes should be designed with a simple interface to
manage their data members. The logical flow of your program
should be simple and easy to follow.
Turn in a hard copy
of the header files and source code at the beginning of class on the
due date. Also turn in a hard copy of a separate document which
explains your program - this should be one or two pages, and should include
an explanation of the input and output of your program,
and the overall structure of your program, including classes and functions.
You will also submit your program electronically before class on the
due date. As before, email a zip file containing a directory with your
source code, header files, and makefile. Send it to comp2673@cs.du.edu.