Добавил:
farel
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:LAB1_B3 / Unit1
.h//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
class point {
public:
double rx, ry;
int x, y;
TColor color;
point();
void Draw();
void Set(double rx_, double ry_);
void Transformation(double dX, double dY, double sX, double sY, double angle);
};
class line {
struct vector {
double x, y;
vector() {}
};
public:
point a, b;
vector norm;
line() {}
void Draw();
void FindNorm();
void Set(point a_, point b_);
};
class triangle {
public:
point vertex[3];
line side[3];
triangle();
void Draw();
void Transformation(double dX, double dY, double sX, double sY, double angle);
};
class matrix {
public:
int rows, cols;
double values[3][3];
matrix(int rows_, int cols_);
matrix operator *(matrix m);
};
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TImage *Image1;
TButton *Button1;
TTimer *Timer1;
TCheckBox *cRotate;
TCheckBox *cScale;
TCheckBox *cOffset;
TEdit *EAngle;
TEdit *EsX;
TEdit *EsY;
TEdit *EdX;
TLabel *Label1;
TLabel *Label2;
TLabel *Label3;
TEdit *EdY;
TLabel *Label5;
TLabel *Label6;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Timer1Timer(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
void Refresh();
void DrawGrid();
void DrawAxes();
void CheckPoints();
void DrawPoints();
void InitPoints();
bool pnpoly(point p[3], double x, double y);
point mid;
point points[40];
triangle trigon;
int round(double n);
int iter;
double gAngle, gsX, gsY, gdX, gdY;
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif