DPA 401/601

Spring 2013

Quadtree Editor

Homework Assignment 4

Due: Midnight, Thursday, February 28


This week you are to modify your quadtree program to add the capability to interactively delete entered points. The program should work as last week in response to the left mouse button, but if the right mouse button is clicked on a previously entered point, it should delete that point. A right mouse click that is not on a previously entered point should be ignored. Of course, the quadtree should be redisplayed to reflect its new configuration after each enter or delete. The program should not quit until either the 'q' or 'esc' key is pressed on the keyboard. I will demonstrate how the program should work in class.


Advanced Extension: Modify the left mouse button logic so that a left mouse click adds a point only if the click is not on a previously entered point. If the left button is pressed on a previously entered point, then the point should be dragged to the position of the mouse when the mouse button is release. Indicate that a point has been selected by changing its color while the mouse button is down, and restoring its color when the button is released. As a point is dragged, the display should be updated to reflect the quadtree status as the point moves across node boundaries.

Please submit your program using the standard submit procedure. You should include your program source code and a Makefile.