Please read the remarks about programming problems for this course.


This assignment is the first of three parts.

Cinder and Cairo provide the means for executing programs to draw pictures. They both use immediate mode graphics. The process is similar to drawing on a whiteboard—you can draw an image, but to move an image elsewhere on the board you must erase it and redraw it in its new location.

Another graphics paradigm uses structured graphics, which sometimes is referred to as the retained object model. This approach allows persistent objects to be moved, resized, duplicated, etc., without the applications developer manually erasing and redrawing images. Such structured graphics APIs allow developers to build applications that permit users to interact with software components through direct manipulation; for example, a user may be able to select a graphical object and move it within a window or make it bigger or smaller. All modern UIs permit such direct manipulation.

Your task is to develop such a direct manipulation 2D graphics API on top of Cinder and Cairo that provides a GraphicalObject abstract base class from which developers can derive concrete graphical objects for applications. GraphicalObject objects must support the following operations:

Provide a simple application that demonstrates the capabilities of your API. The application should allow the user to create several different kinds of graphical objects and manipulate them within a window. Examples include:

Your sample application does not need to be fancy or look polished or professional, but it does need to demonstrate sufficiently the capabilities of your graphical object API.

Important! The graphical objects in your example application must display some sort of interrelatedness; for example, moving a vertex in a graph should cause all edges connected to that vertex to move with it. In a graphical spreadsheet application, editing one of the values in a range should update the calculations for that range and redisplay the line graph that depends on that cell. This notion of changing things in the graphical presentation causing other things to change is an essential quality that Part 2 will address directly. Consider the Cinder Boost signals application we saw in class. Pressing the cursor keys causes the bar and dial to adjust accordingly. Note that in that example the dial object is a very crude graphical object (it can draw itself, but, for example, users cannot interactively move it). On the other hand, the progress bar is not a true graphical object at all— the progress bar is merely a visual artifact of the application's draw method.

When the assignment is due, be prepared to demonstrate your application in class and discuss the design of the API you developed to support your application. A slide or two illustrating your API's class hierarchy would be helpful.

After your presentation submit your source files to eclass.e.southern.edu.