1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
class Shape
{
protected:
HDC hdc;
POINT pointA, pointB, pointC;
HRGN shapeRgn;
RECT shapeRect;
float b,h;
int idShape;
public:
Shape(HDC dc, POINT a, POINT b, POINT c, int i) :
hdc(dc), pointA(a), pointB(b), pointC(c), idShape(i)
{}
Shape(HDC dc, POINT a, POINT b, int i) :
hdc(dc), pointA(a), pointB(b), idShape(i)
{}
~Shape()
{}
int returnId() { return idShape; }
void Erase();
virtual float CalculateArea() = 0;
virtual void Draw() = 0;
virtual void SetShapeRgn() = 0;
void SetShapeRect();
bool TestSelect(POINT a);
};
| |