------------------------------------------------------------------------------
MC logo
Shape Driver IV
[^] Code Examples
------------------------------------------------------------------------------
<<Shape Driver III shapetest5.cc Linked List Node Classes>>
/* Test of shape classes will all sorts of stuff. */
#include <iostream>
#include "canvas.h"
#include "shape.h"
#include "compound.h"
main()
{
        Canvas c(37, 50);

        Line line(3, 12, 3, 19);
        line.translate(2, 2);
        line.draw(c);
        line.translate(25, 0);
        line.draw(c);

        Square sq(11, 10, 13);
        sq.draw(c);

        CompoundShape cs;
        cs.add(new Ellipse(0, 0, 6, 12));
        cs.add(new Ellipse(25, 0, 6, 12));
        cs.add(new Line(6, 6, 25, 6));
        cs.translate(2, 2);
        cs.draw(c);
        cs.translate(0, 20);
        cs.draw(c);

        c.print(cout);
}
<<Shape Driver III Linked List Node Classes>>