DPA 401/601

Spring 2013

Polygon Editor

Homework Assignment 8

Due: Midnight, Tuesday April 14


Assignment:

This week you are to extend the interactive polygon builder that you did for Homework 6 to make it a full polygon editor. When the program starts up, it is in vertex entry mode, and operates exactly like your program for Homework 6. However, after the polygon is closed, the program should enter editing mode.

In this mode, the user can still move vertices around using the left mouse button, however there should now be two additional options: deleting and inserting vertices. The user deletes a vertex by clicking on it with the right mouse button. The user inserts a new vertex by pressing the left mouse button on an edge. The new vertex is placed at the mouse position, on the edge. As long as the left-button is held down, the vertex can be dragged. When the button is released, the vertex is frozen.

The polygon outline should be continuously updated on screen as vertices are entered, deleted, or dragged. The program should not quit until either the 'q' or 'esc' key is pressed on the keyboard.


Advanced Extension: There is no advanced extension for this assignment.

Please submit your program using the standard submit procedure. You should include your all of your source code .cpp and .h files, and a Makefile.