------------------------------------------------------------------------------
MC logo
Shape Driver I
[^] Code Examples
------------------------------------------------------------------------------
<<Compound Shape Implementation shapetest2.cc Shape Driver II>>
/* Test of drawable classes. */
#include <iostream>
#include "canvas.h"

/* Fred draws a big + sign. */
void fred(Drawable &c)
{
        c.line(20-10, 20, 20+10, 20);
        c.line(20, 20-10, 20, 20+10);
}

main()
{
        Canvas c(30,40);

        fred(c);

        OffsetDrawable r(c, 3, 3);
        fred(r);

        r.translate(-5, 10);
        fred(r);

        r.print(cout);
}
<<Compound Shape Implementation Shape Driver II>>