diff options
| author | Andrew Guschin <saintruler@gmail.com> | 2020-11-10 00:14:47 +0300 |
|---|---|---|
| committer | Andrew Guschin <saintruler@gmail.com> | 2020-11-10 00:14:47 +0300 |
| commit | df5b975bb2a2c4621f5f8fd93d711e21a75e7acf (patch) | |
| tree | 10c2c430a0e6e83ee89dee431c70a0745c1bed11 | |
| parent | 6ec61f84c354ed5c78a9782e678b425068fee846 (diff) | |
Почистил комментарии и исправил кодировки
25 files changed, 425 insertions, 490 deletions
diff --git a/task01/Guschin.sln b/task01/Guschin.sln index 28b263c..687f1a2 100644 --- a/task01/Guschin.sln +++ b/task01/Guschin.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29806.167 diff --git a/task01/Guschin/Guschin.vcxproj.filters b/task01/Guschin/Guschin.vcxproj.filters index c9ea7e5..67cf053 100644 --- a/task01/Guschin/Guschin.vcxproj.filters +++ b/task01/Guschin/Guschin.vcxproj.filters @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Исходные файлы"> diff --git a/task01/Guschin/Guschin.vcxproj.user b/task01/Guschin/Guschin.vcxproj.user index 88a5509..824d5a9 100644 --- a/task01/Guschin/Guschin.vcxproj.user +++ b/task01/Guschin/Guschin.vcxproj.user @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup /> </Project>
\ No newline at end of file diff --git a/task01/Guschin/MyForm.h b/task01/Guschin/MyForm.h index f1d2add..3d4a6f1 100644 --- a/task01/Guschin/MyForm.h +++ b/task01/Guschin/MyForm.h @@ -10,7 +10,7 @@ namespace Guschin { using namespace System::Drawing; /// <summary> - /// MyForm + /// Сводка для MyForm /// </summary> public ref class MyForm : public System::Windows::Forms::Form { @@ -19,13 +19,13 @@ namespace Guschin { { InitializeComponent(); // - //TODO: + //TODO: добавьте код конструктора // } protected: /// <summary> - /// . + /// Освободить все используемые ресурсы. /// </summary> ~MyForm() { @@ -46,14 +46,14 @@ namespace Guschin { private: /// <summary> - /// . + /// Обязательная переменная конструктора. /// </summary> System::ComponentModel::Container^ components; #pragma region Windows Form Designer generated code /// <summary> - /// - /// . + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. /// </summary> void InitializeComponent(void) { @@ -73,9 +73,9 @@ namespace Guschin { this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(442, 90); this->label1->TabIndex = 0; - this->label1->Text = L", . " - L" . , - " - L" . ."; + this->label1->Text = L"Привет, я молдавский вирус. Мой автор слишком беден и поэтому я не могу ничего сд" + L"елать твоему компьютеру. Пожалуйста, удали какой-нибудь файл и перечисли деньги " + L"по указанному счёту. Спасибо."; this->label1->Click += gcnew System::EventHandler(this, &MyForm::label1_Click); // // textBox1 @@ -96,7 +96,7 @@ namespace Guschin { this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(66, 20); this->label2->TabIndex = 2; - this->label2->Text = L": "; + this->label2->Text = L"Сумма: "; // // button1 // @@ -106,7 +106,7 @@ namespace Guschin { this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(103, 37); this->button1->TabIndex = 3; - this->button1->Text = L""; + this->button1->Text = L"Отправить"; this->button1->UseVisualStyleBackColor = true; // // currency @@ -118,7 +118,7 @@ namespace Guschin { this->currency->Name = L"currency"; this->currency->Size = System::Drawing::Size(55, 17); this->currency->TabIndex = 4; - this->currency->Text = L""; + this->currency->Text = L"рублей"; // // MyForm // @@ -132,7 +132,7 @@ namespace Guschin { this->Controls->Add(this->label1); this->DoubleBuffered = true; this->Name = L"MyForm"; - this->Text = L" "; + this->Text = L"Молдавский вирус"; this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &MyForm::MyForm_Paint); this->Resize += gcnew System::EventHandler(this, &MyForm::MyForm_Resize); this->ResumeLayout(false); @@ -155,7 +155,7 @@ namespace Guschin { SolidBrush^ drawBrush = gcnew SolidBrush(Color::Green); System::Drawing::Font^ drawFont = gcnew System::Drawing::Font("Comic Sans MS", 20); - g->DrawString(" ", drawFont, drawBrush, 40, 400); + g->DrawString("хаха надпись", drawFont, drawBrush, 40, 400); Pen^ sqarePen = gcnew Pen(Color::Green, 5); g->DrawLine(sqarePen, 0, ClientRectangle.Height / 3, ClientRectangle.Width / 3 * 2, 0); diff --git a/task02/Guschin.sln b/task02/Guschin.sln index 0a37280..1dc06a7 100644 --- a/task02/Guschin.sln +++ b/task02/Guschin.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29806.167 diff --git a/task02/Guschin/Guschin.vcxproj.filters b/task02/Guschin/Guschin.vcxproj.filters index 67a6242..3a1a5c8 100644 --- a/task02/Guschin/Guschin.vcxproj.filters +++ b/task02/Guschin/Guschin.vcxproj.filters @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Исходные файлы"> diff --git a/task02/Guschin/Guschin.vcxproj.user b/task02/Guschin/Guschin.vcxproj.user index 88a5509..824d5a9 100644 --- a/task02/Guschin/Guschin.vcxproj.user +++ b/task02/Guschin/Guschin.vcxproj.user @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup /> </Project>
\ No newline at end of file diff --git a/task02/Guschin/MyForm.h b/task02/Guschin/MyForm.h index f195cd7..d1a7c9b 100644 --- a/task02/Guschin/MyForm.h +++ b/task02/Guschin/MyForm.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once namespace Guschin { @@ -240,24 +240,15 @@ namespace Guschin { float rabbitVx = 8.5f; float rabbitVy = 8.5f; - /// <summary> - /// Ñâîäêà äëÿ MyForm - /// </summary> public ref class MyForm : public System::Windows::Forms::Form { public: MyForm(void) { InitializeComponent(); - // - //TODO: äîáàâüòå êîä êîíñòðóêòîðà - // } protected: - /// <summary> - /// Îñâîáîäèòü âñå èñïîëüçóåìûå ðåñóðñû. - /// </summary> ~MyForm() { if (components) @@ -267,16 +258,9 @@ namespace Guschin { } private: - /// <summary> - /// Îáÿçàòåëüíàÿ ïåðåìåííàÿ êîíñòðóêòîðà. - /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code - /// <summary> - /// Òðåáóåìûé ìåòîä äëÿ ïîääåðæêè êîíñòðóêòîðà — íå èçìåíÿéòå - /// ñîäåðæèìîå ýòîãî ìåòîäà ñ ïîìîùüþ ðåäàêòîðà êîäà. - /// </summary> void InitializeComponent(void) { this->SuspendLayout(); diff --git a/task02/Guschin/MyForm.resx b/task02/Guschin/MyForm.resx index 1af7de1..d58980a 100644 --- a/task02/Guschin/MyForm.resx +++ b/task02/Guschin/MyForm.resx @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema diff --git a/task03/Guschin.sln b/task03/Guschin.sln index 0a37280..1dc06a7 100644 --- a/task03/Guschin.sln +++ b/task03/Guschin.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29806.167 diff --git a/task03/Guschin/Guschin.vcxproj.filters b/task03/Guschin/Guschin.vcxproj.filters index c8d9b00..f21a2d5 100644 --- a/task03/Guschin/Guschin.vcxproj.filters +++ b/task03/Guschin/Guschin.vcxproj.filters @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Исходные файлы"> diff --git a/task03/Guschin/Guschin.vcxproj.user b/task03/Guschin/Guschin.vcxproj.user index 88a5509..824d5a9 100644 --- a/task03/Guschin/Guschin.vcxproj.user +++ b/task03/Guschin/Guschin.vcxproj.user @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup /> </Project>
\ No newline at end of file diff --git a/task03/Guschin/MyForm.h b/task03/Guschin/MyForm.h index bc09fd3..d84d287 100644 --- a/task03/Guschin/MyForm.h +++ b/task03/Guschin/MyForm.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once namespace Guschin { @@ -17,24 +17,15 @@ namespace Guschin { mat3 T; mat3 initT; - /// <summary> - /// Ñâîäêà äëÿ MyForm - /// </summary> public ref class MyForm : public System::Windows::Forms::Form { public: MyForm(void) { InitializeComponent(); - // - //TODO: äîáàâüòå êîä êîíñòðóêòîðà - // } protected: - /// <summary> - /// Îñâîáîäèòü âñå èñïîëüçóåìûå ðåñóðñû. - /// </summary> ~MyForm() { if (components) @@ -49,16 +40,9 @@ namespace Guschin { protected: private: - /// <summary> - /// Îáÿçàòåëüíàÿ ïåðåìåííàÿ êîíñòðóêòîðà. - /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code - /// <summary> - /// Òðåáóåìûé ìåòîä äëÿ ïîääåðæêè êîíñòðóêòîðà — íå èçìåíÿéòå - /// ñîäåðæèìîå ýòîãî ìåòîäà ñ ïîìîùüþ ðåäàêòîðà êîäà. - /// </summary> void InitializeComponent(void) { this->openFileDialog = (gcnew System::Windows::Forms::OpenFileDialog()); diff --git a/task03/Guschin/MyForm.resx b/task03/Guschin/MyForm.resx index 12048a9..f003e42 100644 --- a/task03/Guschin/MyForm.resx +++ b/task03/Guschin/MyForm.resx @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema diff --git a/task03/Hare_full.txt b/task03/Hare_full.txt index a214ad0..67f3d65 100644 --- a/task03/Hare_full.txt +++ b/task03/Hare_full.txt @@ -1,99 +1,99 @@ frame 8.5 8.5 -# -color 255 0 0 # -thickness 2 # 2 -path 23 # 23 (22 ) -0.5 3. # -1. 4.5 # -0.5 6. # -0.5 7.5 # -1. 8. # -1.5 8. # -2. 7.5 # -1.5 6. # -1.5 4.5 # -3. 4.5 # -3. 6. # -2.5 7.5 # -3. 8. # -3.5 8. # -4. 7.5 # -4. 6. # -3.5 4.5 # -4. 3. # -3.5 1.5 # -2.5 1. # -2. 1. # -1. 1.5 # +# голова +color 255 0 0 # цвет красный +thickness 2 # толщина 2 +path 23 # 23 точки (22 отрезка) +0.5 3. # от левой щеки вверх до уха +1. 4.5 # левое ухо слева снизу вверх +0.5 6. # левое ухо слева +0.5 7.5 # левое ухо верх слева +1. 8. # левое ухо верх середина +1.5 8. # левое ухо верх справа +2. 7.5 # левое ухо справа сверху вниз +1.5 6. # левое ухо справа до макушки +1.5 4.5 # макушка +3. 4.5 # правое ухо слева снизу вверх +3. 6. # правое ухо слева +2.5 7.5 # правое ухо верх слева +3. 8. # правое ухо верх середина +3.5 8. # правое ухо верх справа +4. 7.5 # правое ухо сверху вниз +4. 6. # правое ухо справа +3.5 4.5 # от правого уха вниз до щеки +4. 3. # правая скула +3.5 1.5 # подбородок справа +2.5 1. # подбородок снизу +2. 1. # подбородок слева +1. 1.5 # левая скула 0.5 3. -# -color 120 120 120 # -thickness 3 # 3 -path 22 # 22 (21 ) -4. 3. # -5.5 3.5 # -7. 3.5 # -7.5 2.5 # -8. 2.5 # -8. 2. # -7.5 2. # -7.5 0.5 # -6.5 0.5 # -6.5 1. # -6. 1. # -6. 0.5 # -5. 0.5 # -5. 1. # -4. 1. # -4. 0.5 # -3. 0.5 # -3. 1. # -2.5 1. # -2.5 0.5 # -1.5 0.5 # +# туловище +color 120 120 120 # цвет серый +thickness 3 # толщина 3 +path 22 # 22 точки (21 отрезок) +4. 3. # спина от головы вправо +5.5 3.5 # спина верх +7. 3.5 # спина сверху до хвоста +7.5 2.5 # хвост сверху +8. 2.5 # хвост справа +8. 2. # хвост низ справа налево +7.5 2. # задняя нога справа сверху вниз +7.5 0.5 # задняя нога низ +6.5 0.5 # задняя нога слева +6.5 1. # между задних ног +6. 1. # левая задняя нога справа +6. 0.5 # левая задняя нога низ +5. 0.5 # левая задняя нога слева +5. 1. # между задними и передними ногами +4. 1. # правая передняя нога справа +4. 0.5 # правая передняя нога низ +3. 0.5 # правая передняя нога слева +3. 1. # между передних ног +2.5 1. # передняя нога справа +2.5 0.5 # передняя нога низ +1.5 0.5 # передняя нога слева 1.5 1.25 -# -color 0 255 0 # -thickness 4 # 4 +# глаза +color 0 255 0 # цвет зеленый +thickness 4 # толщина 4 -# +# левый глаз path 5 -1.5 3.5 # -1.5 3. # -2. 3. # -2. 3.5 # +1.5 3.5 # левый глаз слева сверху вниз +1.5 3. # левый глаз низ +2. 3. # левый глаз справа +2. 3.5 # левый глаз верх 1.5 3.5 -# +# правый глаз path 5 -2.5 3.5 # -2.5 3. # -3. 3. # -3. 3.5 # +2.5 3.5 # правый глаз слева +2.5 3. # правый глаз снизу +3. 3. # правый глаз справа +3. 3.5 # правый глаз сверху 2.5 3.5 -# -color 0 0 0 # -thickness 2 # 2 +# ушные раковины +color 0 0 0 # цвет черный +thickness 2 # толщина 2 -# +# левая ушная раковина path 2 1. 5.5 1. 7. -# +# правая ушная раковина path 2 3.5 5.5 3.5 7. -# -color 0 0 255 # -thickness 3 # 3 +# нос +color 0 0 255 # цвет синий +thickness 3 # толщина 3 path 4 -2. 2.5 # -2.5 2.5 # -2.25 2. # +2. 2.5 # нос сверху +2.5 2.5 # нос справа +2.25 2. # нос слева 2. 2.5 diff --git a/task04/Guschin.sln b/task04/Guschin.sln index 0a37280..1dc06a7 100644 --- a/task04/Guschin.sln +++ b/task04/Guschin.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29806.167 diff --git a/task04/Guschin/Guschin.vcxproj.filters b/task04/Guschin/Guschin.vcxproj.filters index f93e64e..a2f1835 100644 --- a/task04/Guschin/Guschin.vcxproj.filters +++ b/task04/Guschin/Guschin.vcxproj.filters @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Исходные файлы"> diff --git a/task04/Guschin/Guschin.vcxproj.user b/task04/Guschin/Guschin.vcxproj.user index 88a5509..824d5a9 100644 --- a/task04/Guschin/Guschin.vcxproj.user +++ b/task04/Guschin/Guschin.vcxproj.user @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup /> </Project>
\ No newline at end of file diff --git a/task04/Guschin/MyForm.h b/task04/Guschin/MyForm.h index ee13fc6..b49d0a9 100644 --- a/task04/Guschin/MyForm.h +++ b/task04/Guschin/MyForm.h @@ -1,376 +1,343 @@ -#pragma once +#pragma once namespace Guschin { - using namespace System; - using namespace System::ComponentModel; - using namespace System::Collections; - using namespace System::Windows::Forms; - using namespace System::Data; - using namespace System::Drawing; - using namespace std; + using namespace System; + using namespace System::ComponentModel; + using namespace System::Collections; + using namespace System::Windows::Forms; + using namespace System::Data; + using namespace System::Drawing; + using namespace std; - float Vx; - float Vy; - float aspectFig; - vector<model> models; - mat3 T; - mat3 initT; + float Vx; + float Vy; + float aspectFig; + vector<model> models; + mat3 T; + mat3 initT; - /// <summary> - /// Ñâîäêà äëÿ MyForm - /// </summary> - public ref class MyForm : public System::Windows::Forms::Form - { - public: - MyForm(void) - { - InitializeComponent(); - // - //TODO: äîáàâüòå êîä êîíñòðóêòîðà - // - } + public ref class MyForm : public System::Windows::Forms::Form + { + public: + MyForm(void) + { + InitializeComponent(); + } - protected: - /// <summary> - /// Îñâîáîäèòü âñå èñïîëüçóåìûå ðåñóðñû. - /// </summary> - ~MyForm() - { - if (components) - { - delete components; - } - } - private: System::Windows::Forms::OpenFileDialog^ openFileDialog; - private: System::Windows::Forms::Button^ btnOpen; - protected: + protected: + ~MyForm() + { + if (components) + { + delete components; + } + } - protected: - - private: - /// <summary> - /// Îáÿçàòåëüíàÿ ïåðåìåííàÿ êîíñòðóêòîðà. - /// </summary> - System::ComponentModel::Container ^components; + private: + System::Windows::Forms::OpenFileDialog^ openFileDialog; + System::Windows::Forms::Button^ btnOpen; + System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code - /// <summary> - /// Òðåáóåìûé ìåòîä äëÿ ïîääåðæêè êîíñòðóêòîðà — íå èçìåíÿéòå - /// ñîäåðæèìîå ýòîãî ìåòîäà ñ ïîìîùüþ ðåäàêòîðà êîäà. - /// </summary> - void InitializeComponent(void) - { - this->openFileDialog = (gcnew System::Windows::Forms::OpenFileDialog()); - this->btnOpen = (gcnew System::Windows::Forms::Button()); - this->SuspendLayout(); - // - // openFileDialog - // - this->openFileDialog->DefaultExt = L"txt"; - this->openFileDialog->Filter = L"Текстовые файлы (*.txt)|*.txt|Все файлы (*.*)|*.*"; - this->openFileDialog->Title = L"Открыть файл"; - // - // btnOpen - // - this->btnOpen->Location = System::Drawing::Point(12, 12); - this->btnOpen->Name = L"btnOpen"; - this->btnOpen->Size = System::Drawing::Size(113, 39); - this->btnOpen->TabIndex = 0; - this->btnOpen->Text = L"Открыть"; - this->btnOpen->UseVisualStyleBackColor = true; - this->btnOpen->Click += gcnew System::EventHandler(this, &MyForm::btnOpen_Click); - // - // MyForm - // - this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); - this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; - this->ClientSize = System::Drawing::Size(553, 557); - this->Controls->Add(this->btnOpen); - this->KeyPreview = true; - this->Name = L"MyForm"; - this->Text = L"MyForm"; - this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load); - this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &MyForm::MyForm_Paint); - this->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &MyForm::MyForm_KeyDown); - this->Resize += gcnew System::EventHandler(this, &MyForm::MyForm_Resize); - this->ResumeLayout(false); + void InitializeComponent(void) + { + this->openFileDialog = (gcnew System::Windows::Forms::OpenFileDialog()); + this->btnOpen = (gcnew System::Windows::Forms::Button()); + this->SuspendLayout(); + // + // openFileDialog + // + this->openFileDialog->DefaultExt = L"txt"; + this->openFileDialog->Filter = L"Текстовые файлы (*.txt)|*.txt|Все файлы (*.*)|*.*"; + this->openFileDialog->Title = L"Открыть файл"; + // + // btnOpen + // + this->btnOpen->Location = System::Drawing::Point(12, 12); + this->btnOpen->Name = L"btnOpen"; + this->btnOpen->Size = System::Drawing::Size(113, 39); + this->btnOpen->TabIndex = 0; + this->btnOpen->Text = L"Открыть"; + this->btnOpen->UseVisualStyleBackColor = true; + this->btnOpen->Click += gcnew System::EventHandler(this, &MyForm::btnOpen_Click); + // + // MyForm + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->ClientSize = System::Drawing::Size(553, 557); + this->Controls->Add(this->btnOpen); + this->KeyPreview = true; + this->Name = L"MyForm"; + this->Text = L"MyForm"; + this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load); + this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &MyForm::MyForm_Paint); + this->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &MyForm::MyForm_KeyDown); + this->Resize += gcnew System::EventHandler(this, &MyForm::MyForm_Resize); + this->ResumeLayout(false); - } + } #pragma endregion - private: float left = 30, right = 100, top = 20, bottom = 50; // расстояния до границ окна - float minX = left, maxX; // диапазон изменения координат x - float minY = top, maxY; // диапазон изменения координат y - float Wcx = left, Wcy; // координаты левого нижнего угла прямоугольника - float Wx, Wy; // ширина и высота прямоугольника - - private: System::Void rectCalc() { - maxX = ClientRectangle.Width - right; // �������� ��������� ��������� x - maxY = ClientRectangle.Height - bottom; // �������� ��������� ��������� y - Wcy = maxY; // ���������� ������ ������� ���� �������������� - Wx = maxX - left; // ������ �������������� - Wy = maxY - top; // ������ � ������ �������������� - } - private: System::Void MyForm_Resize(System::Object^ sender, System::EventArgs^ e) { - rectCalc(); - Refresh(); - } - private: System::Void MyForm_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) { - Graphics^ g = e->Graphics; - g->Clear(Color::Aquamarine); + private: + float left = 30, right = 100, top = 20, bottom = 50; + float minX = left, maxX; + float minY = top, maxY; + float Wcx = left, Wcy; + float Wx, Wy; - Pen^ rectPen = gcnew Pen(Color::Black, 2); - g->DrawRectangle(rectPen, left, top, Wx, Wy); - for (int k = 0; k < models.size(); k++) { // ���� �� �������� - vector<path> figure = models[k].figure; // ������ ������� ���������� ������� - mat3 TM = T * models[k].modelM; // ������� ������ �������������� ������� - for (int i = 0; i < figure.size(); i++) { - path lines = figure[i]; // lines - ��������� ������� ����� - Pen^ pen = gcnew Pen(Color::FromArgb(lines.color.x, lines.color.y, lines.color.z)); - pen->Width = lines.thickness; + private: + System::Void rectCalc() { + maxX = ClientRectangle.Width - right; + maxY = ClientRectangle.Height - bottom; + Wcy = maxY; + Wx = maxX - left; + Wy = maxY - top; + } + private: + System::Void MyForm_Resize(System::Object^ sender, System::EventArgs^ e) { + rectCalc(); + Refresh(); + } + private: + System::Void MyForm_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) { + Graphics^ g = e->Graphics; + g->Clear(Color::Aquamarine); - vec2 start = normalize(TM * vec3(lines.vertices[0], 1.0)); // ��������� ����� ������� ������� - for (int j = 1; j < lines.vertices.size(); j++) { // ���� �� �������� ������ (�� �������) - vec2 end = normalize(TM * vec3(lines.vertices[j], 1.0)); // �������� ����� - vec2 tmpEnd = end; // �������������� ���������� ����� ��� �������� ������������� - if (clip(start, end, minX, minY, maxX, maxY)) { // ���� ������� ����� - // ����� ���������, start � end - ����� ������� ����� ������� - g->DrawLine(pen, start.x, start.y, end.x, end.y); // ��������� ������� ������ - } - start = tmpEnd; // �������� ����� ������������� ������� ���������� ��������� ������ ���������� - } - } - } + Pen^ rectPen = gcnew Pen(Color::Black, 2); + g->DrawRectangle(rectPen, left, top, Wx, Wy); + for (int k = 0; k < models.size(); k++) { + vector<path> figure = models[k].figure; + mat3 TM = T * models[k].modelM; + for (int i = 0; i < figure.size(); i++) { + path lines = figure[i]; + Pen^ pen = gcnew Pen(Color::FromArgb(lines.color.x, lines.color.y, lines.color.z)); + pen->Width = lines.thickness; - } - private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) { - rectCalc(); - } - private: System::Void MyForm_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) { - float Wcx = ClientRectangle.Width / 2.f; - float Wcy = ClientRectangle.Height / 2.f; + vec2 start = normalize(TM * vec3(lines.vertices[0], 1.0)); + for (int j = 1; j < lines.vertices.size(); j++) { + vec2 end = normalize(TM * vec3(lines.vertices[j], 1.0)); + vec2 tmpEnd = end; + if (clip(start, end, minX, minY, maxX, maxY)) { + g->DrawLine(pen, start.x, start.y, end.x, end.y); + } + start = tmpEnd; + } + } + } + } + private: + System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) { + rectCalc(); + } + private: + System::Void MyForm_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) { + float Wcx = ClientRectangle.Width / 2.f; + float Wcy = ClientRectangle.Height / 2.f; - switch (e->KeyCode) { - case Keys::Escape: - T = initT; - break; - case Keys::Q : - T = translate(-Wcx, -Wcy) * T; - T = rotate(0.01f) * T; - T = translate(Wcx, Wcy) * T; - break; - case Keys::E : - T = translate(-Wcx, -Wcy) * T; - T = rotate(-0.01f) * T; - T = translate(Wcx, Wcy) * T; - break; + switch (e->KeyCode) { + case Keys::Escape: + T = initT; + break; + case Keys::Q : + T = translate(-Wcx, -Wcy) * T; + T = rotate(0.01f) * T; + T = translate(Wcx, Wcy) * T; + break; + case Keys::E : + T = translate(-Wcx, -Wcy) * T; + T = rotate(-0.01f) * T; + T = translate(Wcx, Wcy) * T; + break; - case Keys::W : - T = translate(0.f, -1.f) * T; - break; - case Keys::S : - T = translate(0.f, 1.f) * T; - break; - case Keys::A : - T = translate(-1.f, 0.f) * T; - break; - case Keys::D : - T = translate(1.f, 0.f) * T; - break; + case Keys::W : + T = translate(0.f, -1.f) * T; + break; + case Keys::S : + T = translate(0.f, 1.f) * T; + break; + case Keys::A : + T = translate(-1.f, 0.f) * T; + break; + case Keys::D : + T = translate(1.f, 0.f) * T; + break; - case Keys::R: - T = translate(-Wcx, -Wcy) * T; - T = rotate(0.05f) * T; - T = translate(Wcx, Wcy) * T; - break; - case Keys::Y: - T = translate(-Wcx, -Wcy) * T; - T = rotate(-0.05f) * T; - T = translate(Wcx, Wcy) * T; - break; + case Keys::R: + T = translate(-Wcx, -Wcy) * T; + T = rotate(0.05f) * T; + T = translate(Wcx, Wcy) * T; + break; + case Keys::Y: + T = translate(-Wcx, -Wcy) * T; + T = rotate(-0.05f) * T; + T = translate(Wcx, Wcy) * T; + break; - case Keys::T: - T = translate(0.f, -10.f) * T; - break; - case Keys::G: - T = translate(0.f, 10.f) * T; - break; - case Keys::F: - T = translate(-10.f, 0.f) * T; - break; - case Keys::H: - T = translate(10.f, 0.f) * T; - break; + case Keys::T: + T = translate(0.f, -10.f) * T; + break; + case Keys::G: + T = translate(0.f, 10.f) * T; + break; + case Keys::F: + T = translate(-10.f, 0.f) * T; + break; + case Keys::H: + T = translate(10.f, 0.f) * T; + break; - case Keys::Z: - T = translate(-Wcx, -Wcy) * T; - T = scale(1.1f) * T; - T = translate(Wcx, Wcy) * T; - break; - case Keys::X: - T = translate(-Wcx, -Wcy) * T; - T = scale(1 / 1.1f) * T; - T = translate(Wcx, Wcy) * T; - break; + case Keys::Z: + T = translate(-Wcx, -Wcy) * T; + T = scale(1.1f) * T; + T = translate(Wcx, Wcy) * T; + break; + case Keys::X: + T = translate(-Wcx, -Wcy) * T; + T = scale(1 / 1.1f) * T; + T = translate(Wcx, Wcy) * T; + break; - case Keys::U: - T = translate(-Wcx, -Wcy) * T; - T = mirrorX() * T; - T = translate(Wcx, Wcy) * T; - break; - case Keys::J: - T = translate(-Wcx, -Wcy) * T; - T = mirrorY() * T; - T = translate(Wcx, Wcy) * T; - break; + case Keys::U: + T = translate(-Wcx, -Wcy) * T; + T = mirrorX() * T; + T = translate(Wcx, Wcy) * T; + break; + case Keys::J: + T = translate(-Wcx, -Wcy) * T; + T = mirrorY() * T; + T = translate(Wcx, Wcy) * T; + break; - case Keys::I: - T = translate(-Wcx, -Wcy) * T; - T = scale(1.1f, 1.f) * T; - T = translate(Wcx, Wcy) * T; - break; - case Keys::K: - T = translate(-Wcx, -Wcy) * T; - T = scale(1 / 1.1f, 1.f) * T; - T = translate(Wcx, Wcy) * T; - break; + case Keys::I: + T = translate(-Wcx, -Wcy) * T; + T = scale(1.1f, 1.f) * T; + T = translate(Wcx, Wcy) * T; + break; + case Keys::K: + T = translate(-Wcx, -Wcy) * T; + T = scale(1 / 1.1f, 1.f) * T; + T = translate(Wcx, Wcy) * T; + break; - case Keys::O: - T = translate(-Wcx, -Wcy) * T; - T = scale(1.f, 1.1f) * T; - T = translate(Wcx, Wcy) * T; - break; - case Keys::L: - T = translate(-Wcx, -Wcy) * T; - T = scale(1.f, 1 / 1.1f) * T; - T = translate(Wcx, Wcy) * T; - break; + case Keys::O: + T = translate(-Wcx, -Wcy) * T; + T = scale(1.f, 1.1f) * T; + T = translate(Wcx, Wcy) * T; + break; + case Keys::L: + T = translate(-Wcx, -Wcy) * T; + T = scale(1.f, 1 / 1.1f) * T; + T = translate(Wcx, Wcy) * T; + break; - default: - break; - } - Refresh(); - } - private: System::Void btnOpen_Click(System::Object^ sender, System::EventArgs^ e) { - if (openFileDialog->ShowDialog() == System::Windows::Forms::DialogResult::OK) { // � �������� ������� ������ ������ OK - // ���������� ����� ����� �� openFileDialog->FileName � fileName - wchar_t fileName[1024]; // ����������, � ������� ����������� �������� ��� ����� - for (int i = 0; i < openFileDialog->FileName->Length; i++) - fileName[i] = openFileDialog->FileName[i]; - fileName[openFileDialog->FileName->Length] = '\0'; + default: + break; + } + Refresh(); + } + private: + System::Void btnOpen_Click(System::Object^ sender, System::EventArgs^ e) { + if (openFileDialog->ShowDialog() == System::Windows::Forms::DialogResult::OK) { + wchar_t fileName[1024]; + for (int i = 0; i < openFileDialog->FileName->Length; i++) + fileName[i] = openFileDialog->FileName[i]; + fileName[openFileDialog->FileName->Length] = '\0'; - // ���������� � �������� ����� - ifstream in; - in.open(fileName); - if (in.is_open()) { - // ���� ������� ������ - models.clear(); // ������� ��������� ������ ������� - // ��������� ���������� ��� ������ �� ����� + ifstream in; + in.open(fileName); + if (in.is_open()) { + models.clear(); - mat3 M = mat3(1.f); // ������� ��� ��������� ��������� ������� - mat3 initM; // ������� ��� ���������� �������������� ������� ������� - vector<mat3> transforms; // ���� ������ �������������� - vector<path> figure; // ������ ������� ���������� ������� + mat3 M = mat3(1.f); + mat3 initM; + vector<mat3> transforms; + vector<path> figure; - float thickness = 2; // ������� �� ��������� �� ��������� 2 - float r, g, b; // ������������ ����� - r = g = b = 0; // �������� ������������ ����� �� ��������� (������) - string cmd; // ������ ��� ���������� ����� ������� - // ��������������� ������ � ������ - string str; // ������, � ������� ��������� ������ ����� - getline(in, str); // ��������� �� �������� ����� ������ ������ - while (in) { // ���� ��������� ������ ������� ������� - // ������������ ������ - if ((str.find_first_not_of(" \t\r\n") != string::npos) && (str[0] != '#')) { - // ����������� ������ �� ����� � �� ����������� - stringstream s(str); // ��������� ����� �� ������ str - s >> cmd; // ��������� ��� ������� - if (cmd == "frame") { // ������� ����������� - s >> Vx >> Vy; // ��������� ���������� �������� Vx � Vy - aspectFig = Vx / Vy; // ���������� ����������� ������ + float thickness = 2; + float r, g, b; + r = g = b = 0; + string cmd; + string str; + getline(in, str); + while (in) { + if ((str.find_first_not_of(" \t\r\n") != string::npos) && (str[0] != '#')) { + stringstream s(str); + s >> cmd; + if (cmd == "frame") { + s >> Vx >> Vy; + aspectFig = Vx / Vy; - float aspectRect = Wx / Wy; // ����������� ������ �������������� - // �������� ������ ������� � ������� ��������� - mat3 T1 = translate(-Vx / 2, -Vy / 2); - // ��������������� �������� �������, �������� ������ �������� - // ����������� ���������� ��� ���������� ��������� ����������� ������ - float S = aspectFig < aspectRect ? Wy / Vy : Wx / Vx; - mat3 S1 = scale(S, -S); - // ����� ����� �������� �� ������ ��������� � ������ ������� - mat3 T2 = translate(Wx / 2 + Wcx, Wcy - Wy / 2); - // � initT ��������� ��� ��� �������������� (������ ������) - initT = T2 * (S1 * T1); + float aspectRect = Wx / Wy; + mat3 T1 = translate(-Vx / 2, -Vy / 2); + float S = aspectFig < aspectRect ? Wy / Vy : Wx / Vx; + mat3 S1 = scale(S, -S); + mat3 T2 = translate(Wx / 2 + Wcx, Wcy - Wy / 2); + initT = T2 * (S1 * T1); - T = initT; - } - else if (cmd == "color") { // ���� ����� - s >> r >> g >> b; // ��������� ��� ������������ ����� - } - else if (cmd == "thickness") { // ������� ����� - s >> thickness; // ��������� �������� ������� - } - else if (cmd == "path") { // ����� ����� - vector<vec2> vertices; // ������ ����� ������� - int N; // ���������� ����� - s >> N; - string str1; // �������������� ������ ��� ������ �� ����� - while (N > 0) { // ���� �� ��� ����� ������� - getline(in, str1); // ��������� � str1 �� �������� ����� ��������� ������ - // ��� ��� ���� ����������, �� �� ����� ����� ��������� �� ����� - if ((str1.find_first_not_of(" \t\r\n") != string::npos) && (str1[0] != '#')) { - // ����������� ������ �� ����� � �� ����������� - // ������ � ��� ���� ��������� - float x, y; // ���������� ��� ���������� - stringstream s1(str1); // ��� ���� ��������� ����� �� ������ str1 - s1 >> x >> y; - vertices.push_back(vec2(x, y)); // ��������� ����� � ������ - N--; // ��������� ������� ����� ��������� ���������� ����� - } - } - // ��� ����� �������, ���������� ������� (path) � ������ �� � ������ figure - figure.push_back(path(vertices, vec3(r, g, b), thickness)); - } - else if (cmd == "model") { // ������ �������� ������ ������� - float mVcx, mVcy, mVx, mVy; // ��������� ������� model - s >> mVcx >> mVcy >> mVx >> mVy; // ��������� �������� ���������� - float S = mVx / mVy < 1 ? 2.f / mVy : 2.f / mVx; - // ����� ����� �������� �� ������ ��������� � ������ ������� - // ����� �������� �������� ��������������� - initM = scale(S) * translate(-mVcx, -mVcy); - figure.clear(); - } - else if (cmd == "figure") { // ������������ ����� ������ - models.push_back(model(figure, M * initM)); // ��������� ������� � ������ - } - else if (cmd == "translate") { // ������� - float Tx, Ty; // ��������� �������������� �������� - s >> Tx >> Ty; // ��������� ��������� - M = translate(Tx, Ty) * M; // ��������� ������� � ������ �������������� - } - else if (cmd == "scale") { // ��������������� - float S; // �������� ��������������� - s >> S; // ��������� �������� - M = scale(S) * M; // ��������� ��������������� � ������ �������������� - } - else if (cmd == "rotate") { // ������� - float theta; // ���� �������� � �������� - s >> theta; // ��������� �������� - M = rotate(-theta / 180.f * Math::PI) * M; // ��������� ������� � ������ �������������� - } - else if (cmd == "pushTransform") { // ���������� ������� � ���� - transforms.push_back(M); // ��������� ������� � ���� - } - else if (cmd == "popTransform") { // ����� � ������� �� ����� - M = transforms.back(); // �������� ������� ������� ����� - transforms.pop_back(); // ���������� ������� �� ���� - } - } - // ��������� ��������� ������ - getline(in, str); - } - Refresh(); - } - } - } -}; + T = initT; + } + else if (cmd == "color") { + s >> r >> g >> b; + } + else if (cmd == "thickness") { + s >> thickness; + } + else if (cmd == "path") { + vector<vec2> vertices; + int N; + s >> N; + string str1; + while (N > 0) { + getline(in, str1); + if ((str1.find_first_not_of(" \t\r\n") != string::npos) && (str1[0] != '#')) { + float x, y; + stringstream s1(str1); + s1 >> x >> y; + vertices.push_back(vec2(x, y)); + N--; + } + } + figure.push_back(path(vertices, vec3(r, g, b), thickness)); + } + else if (cmd == "model") { + float mVcx, mVcy, mVx, mVy; + s >> mVcx >> mVcy >> mVx >> mVy; + float S = mVx / mVy < 1 ? 2.f / mVy : 2.f / mVx; + initM = scale(S) * translate(-mVcx, -mVcy); + figure.clear(); + } + else if (cmd == "figure") { + models.push_back(model(figure, M * initM)); + } + else if (cmd == "translate") { + float Tx, Ty; + s >> Tx >> Ty; + M = translate(Tx, Ty) * M; + } + else if (cmd == "scale") { + float S; + s >> S; + M = scale(S) * M; + } + else if (cmd == "rotate") { + float theta; + s >> theta; + M = rotate(-theta / 180.f * Math::PI) * M; + } + else if (cmd == "pushTransform") { + transforms.push_back(M); + } + else if (cmd == "popTransform") { + M = transforms.back(); + transforms.pop_back(); + } + } + getline(in, str); + } + Refresh(); + } + } + } + }; } diff --git a/task04/Guschin/MyForm.resx b/task04/Guschin/MyForm.resx index 12048a9..f003e42 100644 --- a/task04/Guschin/MyForm.resx +++ b/task04/Guschin/MyForm.resx @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema diff --git a/task05/Guschin.sln b/task05/Guschin.sln index 0a37280..1dc06a7 100644 --- a/task05/Guschin.sln +++ b/task05/Guschin.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29806.167 diff --git a/task05/Guschin/Guschin.vcxproj.filters b/task05/Guschin/Guschin.vcxproj.filters index 3fd60b3..5497660 100644 --- a/task05/Guschin/Guschin.vcxproj.filters +++ b/task05/Guschin/Guschin.vcxproj.filters @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Исходные файлы"> diff --git a/task05/Guschin/Guschin.vcxproj.user b/task05/Guschin/Guschin.vcxproj.user index 88a5509..824d5a9 100644 --- a/task05/Guschin/Guschin.vcxproj.user +++ b/task05/Guschin/Guschin.vcxproj.user @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup /> </Project>
\ No newline at end of file diff --git a/task05/Guschin/MyForm.h b/task05/Guschin/MyForm.h index 09f0cd7..de6955a 100644 --- a/task05/Guschin/MyForm.h +++ b/task05/Guschin/MyForm.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once namespace Guschin { diff --git a/task05/Guschin/MyForm.resx b/task05/Guschin/MyForm.resx index 1af7de1..d58980a 100644 --- a/task05/Guschin/MyForm.resx +++ b/task05/Guschin/MyForm.resx @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema |