-



- - . 60


window->xmin = x1;

C++ . . .

( ) ; . Item, Shape Item Box Circle Shape:

class Item

{

public:

virtual void cut ();

virtual void move (Length deltax, Length deltay) = 0;

virtual Boolean pick (Length px, Length py) = 0;

virtual void ungroup () = 0;

};

class Shape: public Item

{

protected:

Length x;

Length y;

public:

void cut ();

void draw () {write (COLOR_FOREGROUND);};

void erase (); {write (COLOR_BACKGROUND);};

void move (Length deltax, Length deltay);

Boolean pick (Length px, Length py) = 0;

void ungroup () { };

virtual void write (Color color) = 0;

};

class Box: public Shape

{

protected:

Length width;

Length height;

public:

Box (Length x0, Length y0, Length width0, Length height0);

Boolean pick (Length px, Length py);

void write (Color color);

};

class Circle: public Shape

{

protected:

Length radius;

public:

Circle (Length x0, Length y0, Length radius0);

Boolean pick (Length px, Length py);