Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

LAB2 / Unit1

.h
Скачиваний:
7
Добавлен:
01.02.2019
Размер:
2.85 Кб
Скачать
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>

typedef int COL;
typedef int ROW;

class Mat {
private:
	COL 			cols;
	ROW 			rows;
	double 			values[4][4];
public:
	Mat();
	Mat(ROW, COL);
	~Mat();
	const double& at(ROW, COL) const;
	double& at(ROW, COL);
	Mat operator *(const Mat) const;
};

class Point2D {
private:
	double x;
	double y;
public:
	Point2D();
	Point2D(double, double);
	int Tx();
	int Ty();
	double getX();
	double getY();
	void setX(double);
	void setY(double);
	void Draw();
};

class Vector3 {
public:
	double l;
	double m;
	double n;
	Vector3();
};

class Point3D {
private:
	double x;
	double y;
	double z;
public:
	Point3D();
	Point3D(double, double, double);
	Point2D T();
	double getX();
	double getY();
	double getZ();
	void setX(double);
	void setY(double);
	void setZ(double);
	void Rotate(Vector3, Point3D, double);
};

class Line {
public:
	Point3D a;
	Point3D b;
	Vector3 dirVector;
	Vector3 normVector;
	Line();
	void Draw();
	void FindNorm();
	void Set(Point3D, Point3D);
};

class Axis {
public:
	int size;
	Line axis;
	Mat mat;
	Axis();
	void Draw();
	void RotateX();
};

class Cube {
public:
	Point3D vertex[6];
	Line    lines[12];
	Cube();
	void Draw();
	void Rotate(unsigned int, double);
	void RotateL(Vector3, Point3D, double);
	void Update();;
};
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
	TPaintBox *PaintBox1;
	TTimer *Timer1;
	TEdit *Edit3;
	TButton *Button5;
	TEdit *Edit5;
	TEdit *Edit6;
	TEdit *Edit7;
	TButton *Button6;
	TEdit *Edit1;
	TEdit *Edit2;
	TEdit *Edit8;
	TLabel *Label1;
	TLabel *Label3;
	TLabel *Label4;
	TRadioGroup *RadioGroup1;
	void __fastcall PaintBox1Paint(TObject *Sender);
	void __fastcall Button3Click(TObject *Sender);
	void __fastcall Button4Click(TObject *Sender);
	void __fastcall Timer1Timer(TObject *Sender);
	void __fastcall Button5Click(TObject *Sender);
	void __fastcall Button6Click(TObject *Sender);
private:	// User declarations
public:		// User declarations
	__fastcall TForm1(TComponent* Owner);
	int round(double n);
	double fround(double n);
	Point2D center;
    double kof;
	Cube cube;
	double PI;
	bool rotate_vec;
    bool rotate_line;
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Соседние файлы в папке LAB2