48 lines
853 B
C++
48 lines
853 B
C++
#ifndef BaseFigureH
|
|
#define BaseFigureH
|
|
|
|
#include <vcl.h>
|
|
|
|
const int SIDE_MIN = 20;
|
|
const int SIDE_MAX = 1000;
|
|
const int POS_MIN = -2000;
|
|
const int POS_MAX = 10000;
|
|
|
|
int InRange(int v, int a, int b);
|
|
|
|
class TFigure
|
|
{
|
|
protected:
|
|
int num;
|
|
int x, y;
|
|
int w, h;
|
|
TColor fillColor;
|
|
TColor lineColor;
|
|
|
|
void SetupCanvas(TCanvas *c);
|
|
void PaintNumber(TCanvas *c);
|
|
|
|
public:
|
|
TFigure(int aNum);
|
|
virtual ~TFigure();
|
|
|
|
virtual void Draw(TCanvas *c) = 0;
|
|
virtual bool Contains(int px, int py) = 0;
|
|
virtual String TypeName() = 0;
|
|
virtual String RusName() = 0;
|
|
|
|
int GetNum();
|
|
int GetX();
|
|
int GetY();
|
|
int GetW();
|
|
int GetH();
|
|
TColor GetFill();
|
|
TColor GetLine();
|
|
|
|
void SetBounds(int ax, int ay, int aw, int ah);
|
|
void MoveTo(int ax, int ay);
|
|
void SetFill(TColor c);
|
|
void SetLine(TColor c);
|
|
};
|
|
|
|
#endif
|