Exemple #1
0
/*
 * Primordial root object creation and initialization function.  A pointer
 * to this function is passed to the object manager constructor.
 */
void GraphicsInitialize (RefList* root) {
    Picture* pict = new Picture;
    FullGraphic dfault;
	    
    InitPPaint();
    root->Append(new RefList(pict));

    dfault.FillBg(true);
    dfault.SetColors(pblack, pwhite);
    dfault.SetPattern(psolid);
    dfault.SetBrush(psingle);
    dfault.SetFont(pstdfont);

    Line* line = new Line (0, 0, 75, 75, &dfault);
    MultiLine* multiline = new MultiLine (x, y, 6, &dfault);
    BSpline* spline = new BSpline (x, y, 6, &dfault);
    Rect* rect = new Rect (0, 0, 100, 100, &dfault);
    FillRect* frect = new FillRect (0, 0, 100, 100, &dfault);
    Circle* circle = new Circle (0, 0, 50, &dfault);
    FillCircle* fcircle = new FillCircle (0, 0, 50, &dfault);
    Polygon* poly = new Polygon (x, y, 6, &dfault);
    FillPolygon* fpoly = new FillPolygon (x, y, 6, &dfault);
    ClosedBSpline* cspline = new ClosedBSpline (x, y, 6, &dfault);
    FillBSpline* fspline = new FillBSpline (x, y, 6, &dfault);
    Label* label = new Label ("Type 'q' to quit this program.", &dfault);
    Stencil* stencil = new Stencil(new Bitmap(iv_bits, iv_width, iv_height));
    RasterRect* raster = new RasterRect(CreateRaster());

    line->Translate(0, 300);
    multiline->Translate(100, 300);
    spline->Translate(250, 300);
    rect->Translate(100, 150);
    frect->Translate(100, 0);
    circle->Scale(1.0, 0.6);
    circle->Translate(0, 150);
    fcircle->Scale(1.0, 0.6);
    poly->Translate(250, 150);
    fpoly->Translate(250, 0);
    cspline->Translate(400, 150);
    fspline->Translate(400, 0);
    label->Translate(350, 175);
    stencil->Translate(400, 300);
    raster->Scale(5, 5);
    raster->Translate(350, 350);

    pict->Append(line, multiline, spline, rect);
    pict->Append(frect, circle, fcircle, poly);
    pict->Append(fpoly, cspline, fspline, label);
    pict->Append(stencil, raster);
}