------------------------------------------------------------------------------
MC logo
Shape Driver III
[^] Code Examples
------------------------------------------------------------------------------
<<Shape Driver II shapetest4.cc Shape Driver IV>>
/* Test of shape class using a compound shape. */
#include <iostream>
#include "canvas.h"
#include "shape.h"
#include "compound.h"
main()
{
        Canvas c(30,30);

        CompoundShape cs;
        cs.add(new Line(12, 2, 10, 20));
        cs.add(new Ellipse(5, 15, 20, 10));
        cs.add(new Rectangle(10, 10, 4, 6));
        cs.draw(c);
        cs.translate(3, -2);
        cs.draw(c);
        c.print(cout);
}
<<Shape Driver II Shape Driver IV>>