Each class above should inherit from the Drawable base class. Multiple inheritance is supported in C++ if you want a richer class hierarchy, but this is not required.
Each class must have a void setColor(GLfloat red, GLfloat green, GLfloat blue) to change the color of the object. For lines, this color should be used as a line color. For other objects, the color indicates the fill color.
Each class must have a void move(GLfloat dx, GLfloat dy) method that translates the object by an amount dx in the horizontal direction and dy in the vertical direction. In OpenGL, the origin is in the lower left corner.
Each class must have a copy constructor that can create a copy or clone of a given object. The cloned copy should initially have the same geometry and color, but can later be moved independently of the original object. Triangles can only clone other Triangles. It does not make sense to have a copy constructor for Triangles that accept Circles.
Additional geometries (points, polygons, ellipses) may be added, or you can add additional features (line thickness, outline color, etc) if you would like.
If you program dynamically allocates memory (it probably should) using new, be sure to free the memory by calling delete in the appropriate place.
If a class dynamically allocates memory, be sure to write an appropriate destructor.
If all is working well, you should be able to test your code using
cumin[labs]$ ls 01/ CMakeLists.txt cumin[labs]$ mkdir build cumin[labs]$ cd build/ cumin[build]$ cmake .. cumin[build]$ make cumin[build]$ cd 01 cumin[01]$ ./test_geometry
x=xc+r*cos(t) y=yc+r*sin(t)For (axis-aligned) ellipses, instead of one radius, there are two semi-major axes lengths denoted a and b in the horizontal and vertical directions. It is often convenient to specify an ellipse by opposite corners of the rectangle bounding the ellipse. Computing the semi-major axes and the parametric form of an ellipse are left as an optional exercise.