Comp 272 Program 3 Dordal Due: Mar 26 (end of week 11) For your third program you are to take the shapes files, available on my web page, and do the following: * rewrite the Shape, CircleShape, and RectShape classes to use the Point class, as discussed in Friday's lecture. Specifically, you should provide ctors that use Point instead of double x, double y, and you should change the private data to use Point where appropriate. You are *not* required to eliminate the existing x,y ctors, although you may eliminate them if you wish. If you retain them, they will probably need modification; if you do not retain them, you will have to change the places in main() where these shapes are used. Note that the Point class is *not* a Shape, for reasons (basically of simplicity) discussed in class. This is the only part of the program that involves modifications outside of main.cpp, to shape.h, circlesh.h, and rectsh.h. * Create a general (ie not necessarily regular) Polygon shape, to be called PolyShape2. This turns out to be straightforward using the RegPolyShape class as a framwork, as long as you initialize the private vectors called point_X and point_Y in the regular polygon class definition, the (irregular) polygon will draw correctly. I recommend a ctor that takes a vector; an alternative is a ctor that takes an integer numsides (leaving the vertices unspecified), and then a function setvertex(int i, Point p). I have placed an outline of the new class, called PolyShape2, into main.cpp. * Complete the implementation of the Group shape. I've provided you with a start, again in main.cpp. You need to implement the move() and get/setColor operations. You should also fix Group::addShape() so that the added shape takes on the correct color (as returned by Shape::getColor()) Note that Groups, in keeping with the Shape interface, are monochromatic. * Define a new class of your choice derived from Shape. Provide a ctor. Your shape should be something more complex than a single Polygon. Here are a few possibilities: Tree (circle top, rectangle trunk) wagon (rectangle body, two circular wheels) car (polygonal body, wheels) bird (two polygons, or else one polygon with a circular eye) house (compound polygon) All these are easily implemented as (monochromatic) Groups. Or you can implement slightly differently to allow multi-colored shapes; eg houses can have walls of any color but the roof is always black and the windows are always yellow. This would represent a mild departure from the existing Shape interface, where the Shape color now represented the "primary" color of the Shape. * Draw a simple picture using your shape, and replicate it all around the screen (using move). Your drawing should include "several" colors (though not necessarily in the same shape). Here is a list of the source files you will need. Note that those marked with * should NOT be modified. You can add your new shape in either its own .h file, or just put your class definitions in main.cpp. main.cpp starting point *ezdraw.h windows-based necessary system file for drawing *graphlib.h another read-only system file shape.h Shape base class, plus color info circlesh.h for circles rectsh.h for rectangles *regpolysh.h for REGULAR polygons; the starter definitions for irregular polygons are in main.cpp You will also need these: Ezd32m.lib EZDraw lib file; include in your project EzDraw32.dll EZDraw dll; just put in your project directory I've zipped all these together along with the basic "project" files (*.sln, etc). Note that, even though your program draws in a graphics window, you can also write diagnosic/debugging messages to cout. The project should compile under gnu g++, though it will take some work to get it to compile under unix-like systems due to the windows-specific graphics library. (Some tweaking of the #ifdefs in ezdraw.h also remains to be done.) Turn in main.cpp and the *.h files you've modified.