summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Guschin <saintruler@gmail.com>2020-11-09 23:28:49 +0300
committerAndrew Guschin <saintruler@gmail.com>2020-11-09 23:28:49 +0300
commit0408d33694635cdc28db23c9c6388bd916626bde (patch)
tree843f2e61b8f5652ff3b2f19779820c223403ca7d
Добавил первые 4 задания
-rw-r--r--.gitignore3
-rw-r--r--task01/Guschin.sln31
-rw-r--r--task01/Guschin/Guschin.vcxproj133
-rw-r--r--task01/Guschin/Guschin.vcxproj.filters27
-rw-r--r--task01/Guschin/Guschin.vcxproj.user4
-rw-r--r--task01/Guschin/MyForm.cpp13
-rw-r--r--task01/Guschin/MyForm.h171
-rw-r--r--task02/Guschin.sln31
-rw-r--r--task02/Guschin/Guschin.vcxproj140
-rw-r--r--task02/Guschin/Guschin.vcxproj.filters32
-rw-r--r--task02/Guschin/Guschin.vcxproj.user4
-rw-r--r--task02/Guschin/MyForm.cpp12
-rw-r--r--task02/Guschin/MyForm.h366
-rw-r--r--task02/Guschin/MyForm.resx120
-rw-r--r--task03/Guschin.sln31
-rw-r--r--task03/Guschin/Figure.h18
-rw-r--r--task03/Guschin/Guschin.vcxproj143
-rw-r--r--task03/Guschin/Guschin.vcxproj.filters41
-rw-r--r--task03/Guschin/Guschin.vcxproj.user4
-rw-r--r--task03/Guschin/Matrix.h98
-rw-r--r--task03/Guschin/MyForm.cpp19
-rw-r--r--task03/Guschin/MyForm.h298
-rw-r--r--task03/Guschin/MyForm.resx123
-rw-r--r--task03/Guschin/Transform.h45
-rw-r--r--task03/Hare_full.txt99
-rw-r--r--task03/clown.txt251
-rw-r--r--task04/Geometric.txt38
-rw-r--r--task04/Guschin.sln31
-rw-r--r--task04/Guschin/Clip.h54
-rw-r--r--task04/Guschin/Figure.h27
-rw-r--r--task04/Guschin/Guschin.vcxproj144
-rw-r--r--task04/Guschin/Guschin.vcxproj.filters44
-rw-r--r--task04/Guschin/Guschin.vcxproj.user4
-rw-r--r--task04/Guschin/Matrix.h98
-rw-r--r--task04/Guschin/MyForm.cpp20
-rw-r--r--task04/Guschin/MyForm.h376
-rw-r--r--task04/Guschin/MyForm.resx123
-rw-r--r--task04/Guschin/Transform.h45
-rw-r--r--task04/result.txt474
39 files changed, 3735 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8fe75cc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+x64
+.vs
+*.aps \ No newline at end of file
diff --git a/task01/Guschin.sln b/task01/Guschin.sln
new file mode 100644
index 0000000..28b263c
--- /dev/null
+++ b/task01/Guschin.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29806.167
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Guschin", "Guschin\Guschin.vcxproj", "{A9D89F35-1B7B-4ABC-890F-1862B89672E1}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Debug|x64.ActiveCfg = Debug|x64
+ {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Debug|x64.Build.0 = Debug|x64
+ {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Debug|x86.ActiveCfg = Debug|Win32
+ {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Debug|x86.Build.0 = Debug|Win32
+ {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Release|x64.ActiveCfg = Release|x64
+ {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Release|x64.Build.0 = Release|x64
+ {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Release|x86.ActiveCfg = Release|Win32
+ {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {D94F9F0A-82EE-4062-A0A2-7CF63E6A06BC}
+ EndGlobalSection
+EndGlobal
diff --git a/task01/Guschin/Guschin.vcxproj b/task01/Guschin/Guschin.vcxproj
new file mode 100644
index 0000000..904927c
--- /dev/null
+++ b/task01/Guschin/Guschin.vcxproj
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MyForm.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="MyForm.h">
+ <FileType>CppForm</FileType>
+ </ClInclude>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>16.0</VCProjectVersion>
+ <ProjectGuid>{A9D89F35-1B7B-4ABC-890F-1862B89672E1}</ProjectGuid>
+ <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+ <Keyword>ManagedCProj</Keyword>
+ <RootNamespace>Guschin</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>Main</EntryPointSymbol>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/task01/Guschin/Guschin.vcxproj.filters b/task01/Guschin/Guschin.vcxproj.filters
new file mode 100644
index 0000000..c9ea7e5
--- /dev/null
+++ b/task01/Guschin/Guschin.vcxproj.filters
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Исходные файлы">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Файлы заголовков">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
+ </Filter>
+ <Filter Include="Файлы ресурсов">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MyForm.cpp">
+ <Filter>Файлы заголовков</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="MyForm.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/task01/Guschin/Guschin.vcxproj.user b/task01/Guschin/Guschin.vcxproj.user
new file mode 100644
index 0000000..88a5509
--- /dev/null
+++ b/task01/Guschin/Guschin.vcxproj.user
@@ -0,0 +1,4 @@
+<?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.cpp b/task01/Guschin/MyForm.cpp
new file mode 100644
index 0000000..c45f0fc
--- /dev/null
+++ b/task01/Guschin/MyForm.cpp
@@ -0,0 +1,13 @@
+#include "MyForm.h"
+
+using namespace System;
+using namespace System::Windows::Forms;
+
+[STAThreadAttribute]
+void Main(array<String^>^ args)
+{
+ Application::EnableVisualStyles();
+ Application::SetCompatibleTextRenderingDefault(false);
+ Guschin::MyForm form;
+ Application::Run(% form);
+}
diff --git a/task01/Guschin/MyForm.h b/task01/Guschin/MyForm.h
new file mode 100644
index 0000000..f1d2add
--- /dev/null
+++ b/task01/Guschin/MyForm.h
@@ -0,0 +1,171 @@
+#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;
+
+ /// <summary>
+ /// MyForm
+ /// </summary>
+ public ref class MyForm : public System::Windows::Forms::Form
+ {
+ public:
+ MyForm(void)
+ {
+ InitializeComponent();
+ //
+ //TODO:
+ //
+ }
+
+ protected:
+ /// <summary>
+ /// .
+ /// </summary>
+ ~MyForm()
+ {
+ if (components)
+ {
+ delete components;
+ }
+ }
+ private: System::Windows::Forms::Label^ label1;
+ private: System::Windows::Forms::TextBox^ textBox1;
+ private: System::Windows::Forms::Label^ label2;
+ private: System::Windows::Forms::Button^ button1;
+ private: System::Windows::Forms::Label^ currency;
+
+ protected:
+
+ protected:
+
+ private:
+ /// <summary>
+ /// .
+ /// </summary>
+ System::ComponentModel::Container^ components;
+
+#pragma region Windows Form Designer generated code
+ /// <summary>
+ ///
+ /// .
+ /// </summary>
+ void InitializeComponent(void)
+ {
+ this->label1 = (gcnew System::Windows::Forms::Label());
+ this->textBox1 = (gcnew System::Windows::Forms::TextBox());
+ this->label2 = (gcnew System::Windows::Forms::Label());
+ this->button1 = (gcnew System::Windows::Forms::Button());
+ this->currency = (gcnew System::Windows::Forms::Label());
+ this->SuspendLayout();
+ //
+ // label1
+ //
+ this->label1->BackColor = System::Drawing::SystemColors::Control;
+ this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->label1->Location = System::Drawing::Point(29, 33);
+ 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->Click += gcnew System::EventHandler(this, &MyForm::label1_Click);
+ //
+ // textBox1
+ //
+ this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 13, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->textBox1->Location = System::Drawing::Point(102, 252);
+ this->textBox1->Name = L"textBox1";
+ this->textBox1->Size = System::Drawing::Size(189, 27);
+ this->textBox1->TabIndex = 1;
+ //
+ // label2
+ //
+ this->label2->AutoSize = true;
+ this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->label2->Location = System::Drawing::Point(30, 255);
+ this->label2->Name = L"label2";
+ this->label2->Size = System::Drawing::Size(66, 20);
+ this->label2->TabIndex = 2;
+ this->label2->Text = L": ";
+ //
+ // button1
+ //
+ this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->button1->Location = System::Drawing::Point(358, 248);
+ this->button1->Name = L"button1";
+ this->button1->Size = System::Drawing::Size(103, 37);
+ this->button1->TabIndex = 3;
+ this->button1->Text = L"";
+ this->button1->UseVisualStyleBackColor = true;
+ //
+ // currency
+ //
+ this->currency->AutoSize = true;
+ this->currency->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->currency->Location = System::Drawing::Point(297, 258);
+ this->currency->Name = L"currency";
+ this->currency->Size = System::Drawing::Size(55, 17);
+ this->currency->TabIndex = 4;
+ this->currency->Text = L"";
+ //
+ // MyForm
+ //
+ this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
+ this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
+ this->ClientSize = System::Drawing::Size(500, 500);
+ this->Controls->Add(this->currency);
+ this->Controls->Add(this->button1);
+ this->Controls->Add(this->label2);
+ this->Controls->Add(this->textBox1);
+ this->Controls->Add(this->label1);
+ this->DoubleBuffered = true;
+ this->Name = L"MyForm";
+ 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);
+ this->PerformLayout();
+
+ }
+#pragma endregion
+ private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {
+ }
+ private: System::Void MyForm_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
+ Graphics^ g = e->Graphics;
+ g->Clear(Color::Pink);
+
+ Pen^ redPen = gcnew Pen(Color::Red);
+ redPen->Width = 6;
+ g->DrawLine(redPen, 0, 0, this->ClientRectangle.Width, this->ClientRectangle.Height);
+
+ Pen^ bluePen = gcnew Pen(Color::Blue, 10);
+ g->DrawLine(bluePen, 90, 50, ClientRectangle.Width, 80);
+
+ SolidBrush^ drawBrush = gcnew SolidBrush(Color::Green);
+ System::Drawing::Font^ drawFont = gcnew System::Drawing::Font("Comic Sans MS", 20);
+ 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);
+ g->DrawLine(sqarePen, ClientRectangle.Width / 3 * 2, 0, ClientRectangle.Width, ClientRectangle.Height / 3 * 2);
+ g->DrawLine(sqarePen, ClientRectangle.Width, ClientRectangle.Height / 3 * 2, ClientRectangle.Width / 3, ClientRectangle.Height);
+ g->DrawLine(sqarePen, ClientRectangle.Width / 3, ClientRectangle.Height, 0, ClientRectangle.Height / 3);
+
+ }
+ private: System::Void MyForm_Resize(System::Object^ sender, System::EventArgs^ e) {
+ this->Refresh();
+ }
+ };
+}
diff --git a/task02/Guschin.sln b/task02/Guschin.sln
new file mode 100644
index 0000000..0a37280
--- /dev/null
+++ b/task02/Guschin.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29806.167
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Guschin", "Guschin\Guschin.vcxproj", "{7FD831C6-82A0-4285-8C15-41D557E54312}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x64.ActiveCfg = Debug|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x64.Build.0 = Debug|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x86.ActiveCfg = Debug|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x86.Build.0 = Debug|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x64.ActiveCfg = Release|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x64.Build.0 = Release|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x86.ActiveCfg = Release|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {44500E7D-60B5-4F8A-8A21-14C0785E2BF7}
+ EndGlobalSection
+EndGlobal
diff --git a/task02/Guschin/Guschin.vcxproj b/task02/Guschin/Guschin.vcxproj
new file mode 100644
index 0000000..20e327c
--- /dev/null
+++ b/task02/Guschin/Guschin.vcxproj
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>16.0</VCProjectVersion>
+ <ProjectGuid>{7FD831C6-82A0-4285-8C15-41D557E54312}</ProjectGuid>
+ <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+ <Keyword>ManagedCProj</Keyword>
+ <RootNamespace>Guschin</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>Main</EntryPointSymbol>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>Main</EntryPointSymbol>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="MyForm.h">
+ <FileType>CppForm</FileType>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MyForm.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="MyForm.resx">
+ <DependentUpon>MyForm.h</DependentUpon>
+ </EmbeddedResource>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/task02/Guschin/Guschin.vcxproj.filters b/task02/Guschin/Guschin.vcxproj.filters
new file mode 100644
index 0000000..67a6242
--- /dev/null
+++ b/task02/Guschin/Guschin.vcxproj.filters
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Исходные файлы">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Файлы заголовков">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
+ </Filter>
+ <Filter Include="Файлы ресурсов">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="MyForm.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MyForm.cpp">
+ <Filter>Исходные файлы</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="MyForm.resx">
+ <Filter>Файлы ресурсов</Filter>
+ </EmbeddedResource>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/task02/Guschin/Guschin.vcxproj.user b/task02/Guschin/Guschin.vcxproj.user
new file mode 100644
index 0000000..88a5509
--- /dev/null
+++ b/task02/Guschin/Guschin.vcxproj.user
@@ -0,0 +1,4 @@
+<?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.cpp b/task02/Guschin/MyForm.cpp
new file mode 100644
index 0000000..3ddb603
--- /dev/null
+++ b/task02/Guschin/MyForm.cpp
@@ -0,0 +1,12 @@
+#include "MyForm.h"
+
+using namespace System;
+using namespace System::Windows::Forms;
+
+[STAThreadAttribute]
+void Main(array<String^> ^ args) {
+ Application::EnableVisualStyles();
+ Application::SetCompatibleTextRenderingDefault(false);
+ Guschin::MyForm form;
+ Application::Run(% form);
+} \ No newline at end of file
diff --git a/task02/Guschin/MyForm.h b/task02/Guschin/MyForm.h
new file mode 100644
index 0000000..f195cd7
--- /dev/null
+++ b/task02/Guschin/MyForm.h
@@ -0,0 +1,366 @@
+#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;
+
+ // 20 x 30
+
+ float clown[] = {
+ //
+ 8.f, 29.f, 12.f, 29.f,
+ 12.f, 29.f, 13.f, 28.f,
+ 13.f, 28.f, 14.f, 26.f,
+ 14.f, 26.f, 13.f, 24.f,
+ 13.f, 24.f, 15.f, 23.f,
+ 15.f, 23.f, 15.f, 22.f,
+ 15.f, 22.f, 14.f, 21.f,
+ 14.f, 21.f, 12.f, 22.f,
+ 12.f, 22.f, 8.f, 22.f,
+ 8.f, 22.f, 6.f, 21.f,
+ 6.f, 21.f, 5.f, 22.f,
+ 5.f, 22.f, 5.f, 23.f,
+ 5.f, 23.f, 7.f, 24.f,
+ 7.f, 24.f, 6.f, 26.f,
+ 6.f, 26.f, 7.f, 28.f,
+ 7.f, 28.f, 8.f, 29.f,
+
+ 14.f, 26.f, 15.f, 26.f,
+ 15.f, 26.f, 16.f, 27.f,
+ 16.f, 27.f, 16.f, 26.f,
+ 16.f, 26.f, 17.f, 25.f,
+ 17.f, 25.f, 16.f, 25.f,
+ 16.f, 25.f, 15.f, 24.f,
+ 15.f, 24.f, 15.f, 25.f,
+ 15.f, 25.f, 14.f, 26.f,
+
+ 15.f, 25.f, 15.f, 26.f,
+ 15.f, 26.f, 16.f, 26.f,
+ 16.f, 26.f, 16.f, 25.f,
+ 16.f, 25.f, 15.f, 25.f,
+ 15.f, 25.f, 12.f, 23.f,
+
+ //
+ 15.f, 22.f, 19.f, 17.f,
+ 19.f, 17.f, 19.f, 15.f,
+ 19.f, 15.f, 18.f, 16.f,
+ 18.f, 16.f, 19.f, 14.f,
+ 19.f, 14.f, 18.f, 13.f,
+ 18.f, 13.f, 17.f, 15.f,
+ 17.f, 15.f, 18.f, 12.f,
+ 18.f, 12.f, 16.f, 10.f,
+ 16.f, 10.f, 15.f, 8.f,
+ 15.f, 8.f, 11.f, 6.f,
+ 11.f, 6.f, 9.f, 6.f,
+ 9.f, 6.f, 5.f, 8.f,
+ 5.f, 8.f, 4.f, 10.f,
+ 4.f, 10.f, 2.f, 12.f,
+ 2.f, 12.f, 3.f, 15.f,
+ 3.f, 15.f, 2.f, 13.f,
+ 2.f, 13.f, 1.f, 14.f,
+ 1.f, 14.f, 2.f, 16.f,
+ 2.f, 16.f, 1.f, 15.f,
+ 1.f, 15.f, 1.f, 17.f,
+ 1.f, 17.f, 5.f, 22.f,
+
+ //
+ 7.f, 16.f, 5.f, 17.f,
+ 5.f, 17.f, 5.f, 19.f,
+ 5.f, 19.f, 7.f, 21.f,
+ 7.f, 21.f, 9.f, 21.f,
+ 9.f, 21.f, 10.f, 18.5f,
+ 10.f, 18.5f, 9.f, 16.f,
+ 9.f, 16.f, 7.f, 16.f,
+ 7.f, 16.f, 6.f, 17.f,
+ 6.f, 17.f, 7.f, 19.f,
+ 7.f, 19.f, 8.f, 19.f,
+ 8.f, 19.f, 9.f, 17.f,
+ 9.f, 17.f, 8.f, 16.f,
+ 8.f, 16.f, 8.f, 17.f,
+ 8.f, 17.f, 7.f, 17.f,
+ 7.f, 17.f, 7.f, 16.f,
+
+ 13.f, 16.f, 15.f, 17.f,
+ 15.f, 17.f, 15.f, 19.f,
+ 15.f, 19.f, 13.f, 21.f,
+ 13.f, 21.f, 11.f, 21.f,
+ 11.f, 21.f, 10.f, 18.5f,
+ 10.f, 18.5f, 11.f, 16.f,
+ 11.f, 16.f, 13.f, 16.f,
+ 13.f, 16.f, 14.f, 17.f,
+ 14.f, 17.f, 13.f, 19.f,
+ 13.f, 19.f, 12.f, 19.f,
+ 12.f, 19.f, 11.f, 17.f,
+ 11.f, 17.f, 12.f, 16.f,
+ 12.f, 16.f, 12.f, 17.f,
+ 12.f, 17.f, 13.f, 17.f,
+ 13.f, 17.f, 13.f, 16.f,
+
+ //
+ 9.f, 16.f, 11.f, 16.f,
+ 11.f, 16.f, 13.f, 15.f,
+ 13.f, 15.f, 14.f, 13.f,
+ 14.f, 13.f, 13.f, 12.f,
+ 13.f, 12.f, 10.f, 11.f,
+ 9.f, 16.f, 7.f, 15.f,
+ 7.f, 15.f, 6.f, 13.f,
+ 6.f, 13.f, 7.f, 12.f,
+ 7.f, 12.f, 10.f, 11.f,
+
+ //
+ 14.f, 13.f, 15.f, 13.f,
+ 15.f, 13.f, 16.f, 12.f,
+ 16.f, 12.f, 16.f, 11.f,
+ 16.f, 11.f, 13.f, 9.f,
+ 13.f, 9.f, 10.f, 8.f,
+ 6.f, 13.f, 5.f, 13.f,
+ 5.f, 13.f, 4.f, 12.f,
+ 4.f, 12.f, 4.f, 11.f,
+ 4.f, 11.f, 7.f, 9.f,
+ 7.f, 9.f, 10.f, 8.f,
+
+ //
+ 14.f, 12.f, 15.f, 11.f,
+ 14.f, 11.f, 13.f, 10.f,
+ 13.f, 10.f, 10.f, 9.f,
+ 6.f, 12.f, 5.f, 11.f,
+ 6.f, 11.f, 7.f, 10.f,
+ 7.f, 10.f, 10.f, 9.f,
+
+ //
+ 15.f, 17.f, 16.f, 15.f,
+ 16.f, 15.f, 16.f, 10.f,
+ 5.f, 17.f, 4.f, 15.f,
+ 4.f, 15.f, 4.f, 10.f,
+
+ //
+ 10.f, 5.f, 14.f, 1.f,
+ 14.f, 1.f, 14.f, 7.f,
+ 14.f, 7.f, 10.f, 3.f,
+
+ 12.f, 5.f, 13.f, 5.f,
+ 13.f, 5.f, 13.f, 4.f,
+ 13.f, 4.f, 12.f, 4.f,
+ 12.f, 4.f, 12.f, 5.f,
+
+ 13.f, 6.f, 14.f, 5.f,
+
+ 14.f, 4.f, 13.f, 3.f,
+ 13.f, 3.f, 14.f, 2.f,
+
+ //
+ 10.f, 3.f, 6.f, 7.f,
+ 6.f, 7.f, 6.f, 1.f,
+ 6.f, 1.f, 10.f, 5.f,
+
+ 8.f, 3.f, 7.f, 3.f,
+ 7.f, 3.f, 7.f, 4.f,
+ 7.f, 4.f, 8.f, 4.f,
+ 8.f, 4.f, 8.f, 3.f,
+
+ 7.f, 2.f, 6.f, 3.f,
+
+ 6.f, 4.f, 7.f, 5.f,
+ 7.f, 5.f, 6.f, 6.f,
+ };
+ unsigned int clownSize = sizeof(clown) / sizeof(float);
+ float clownVx = 20.f;
+ float clownVy = 30.f;
+
+ float rabbit[] = {
+ // голова
+ 0.5f,3.f,1.f,4.5f, // от левой щеки вверх до уха
+ 1.f,4.5f,0.5f,6.f, // левое ухо слева снизу вверх
+ 0.5f,6.f,0.5f, 7.5f,// левое ухо слева
+ 0.5f, 7.5f,1.f,8.f,// левое ухо верх слева
+ 1.f,8.f,1.5f,8.f,// левое ухо верх середина
+ 1.5f,8.f,2.f,7.5f,// левое ухо верх справа
+ 2.f,7.5f,1.5f, 6.f,// левое ухо справа сверху вниз
+ 1.5f, 6.f,1.5f,4.5f,// левое ухо справа до макушки
+ 1.5f,4.5f,3.f,4.5f,// макушка
+ 3.f,4.5f,3.f,6.f,// правое ухо слева снизу вверх
+ 3.f,6.f,2.5f,7.5f,// правое ухо слева
+ 2.5f,7.5f,3.f,8.f,// правое ухо верх слева
+ 3.f,8.f,3.5f,8.f,// правое ухо верх середина
+ 3.5f,8.f,4.f,7.5f,// правое ухо верх справа
+ 4.f,7.5f,4.f,6.f,// правое ухо сверху вниз
+ 4.f,6.f,3.5f,4.5f,// правое ухо справа
+ 3.5f,4.5f,4.f,3.f,// от правого уха вниз до щеки
+ 4.f,3.f,3.5f,1.5f,// правая скула
+ 3.5f,1.5f,2.5f,1.f,// подбородок справа
+ 2.5f,1.f,2.f,1.f,// подбородок снизу
+ 2.f,1.f,1.f,1.5f,// подбородок слева
+ 1.f,1.5f,0.5f,3.f,// левая скула
+ // туловище
+ 4.f,3.f,5.5f,3.5f,// спина от головы вправо
+ 5.5f,3.5f,7.f,3.5f,// спина верх
+ 7.f,3.5f,7.5f,2.5f,// спина сверху до хвоста
+ 7.5f,2.5f,8.f,2.5f,// хвост сверху
+ 8.f,2.5f,8.f,2.f,// хвост справа
+ 8.f,2.f,7.5f,2.f,// хвост низ справа налево
+ 7.5f,2.f,7.5f,0.5f,// задняя нога справа сверху вниз
+ 7.5f,0.5f,6.5f,0.5f,// задняя нога низ
+ 6.5f,0.5f,6.5f,1.f,// задняя нога слева
+ 6.5f,1.f,6.f,1.f,// между задних ног
+ 6.f,1.f,6.f,0.5f,// левая задняя нога справа
+ 6.f,0.5f,5.f,0.5f,// левая задняя нога низ
+ 5.f,0.5f,5.f,1.f,// левая задняя нога слева
+ 5.f,1.f,4.f,1.f,// между задними и передними ногами
+ 4.f,1.f,4.f,0.5f,// правая передняя нога справа
+ 4.f,0.5f,3.f,0.5f,// правая передняя нога низ
+ 3.f,0.5f,3.f,1.f,// правая передняя нога слева
+ 3.f,1.f,2.5f,1.f,// между передних ног
+ 2.5f,1.f,2.5f,0.5f,// передняя нога справа
+ 2.5f,0.5f,1.5f,0.5f,// передняя нога низ
+ 1.5f,0.5f,1.5f,1.25f,// передняя нога слева
+ // левый глаз
+ 1.5f,3.5f,1.5f,3.f,// левый глаз слева сверху вниз
+ 1.5f,3.f,2.f,3.f,// левый глаз низ
+ 2.f, 3.f,2.f,3.5f,// левый глаз справа
+ 2.f,3.5f,1.5f,3.5f,// левый глаз верх
+ // правый глаз
+ 2.5f,3.5f,2.5f,3.f,// правый глаз слева
+ 2.5f,3.f,3.f, 3.f,// правый глаз снизу
+ 3.f,3.f,3.f,3.5f,// правый глаз справа
+ 3.f,3.5f,2.5f,3.5f,// правый глаз сверху
+ // ушные раковины
+ 1.f,5.5f,1.f,7.f,// левая ушная раковина
+ 3.5f,5.5f,3.5f,7.f,// правая ушная раковина
+ // нос
+ 2.f,2.5f,2.5f,2.5f,// нос сверху
+ 2.5f,2.5f,2.25f,2.f,// нос справа
+ 2.25f,2.f,2.f,2.5f// нос слева
+ };
+ unsigned int rabbitSize = sizeof(rabbit) / sizeof(float);
+ 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)
+ {
+ delete components;
+ }
+ }
+
+ private:
+ /// <summary>
+ /// Îáÿçàòåëüíàÿ ïåðåìåííàÿ êîíñòðóêòîðà.
+ /// </summary>
+ System::ComponentModel::Container ^components;
+
+#pragma region Windows Form Designer generated code
+ /// <summary>
+ /// Òðåáóåìûé ìåòîä äëÿ ïîääåðæêè êîíñòðóêòîðà — íå èçìåíÿéòå
+ /// ñîäåðæèìîå ýòîãî ìåòîäà ñ ïîìîùüþ ðåäàêòîðà êîäà.
+ /// </summary>
+ void InitializeComponent(void)
+ {
+ this->SuspendLayout();
+ //
+ // MyForm
+ //
+ this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
+ this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
+ this->ClientSize = System::Drawing::Size(553, 557);
+ 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: bool keepAspectRatio;
+ private: bool showClown;
+ private: float* lines = clown;
+ private: unsigned int arrayLength = clownSize;
+ private: float Vx = clownVx;
+ private: float Vy = clownVy;
+
+ private: System::Void MyForm_Resize(System::Object^ sender, System::EventArgs^ e) {
+ Refresh();
+ }
+ private: System::Void MyForm_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
+ Graphics^ g = e->Graphics;
+ Pen^ blackPen = gcnew Pen(Color::Black, 2);
+
+ float Wx = ClientRectangle.Width;
+ float Wy = ClientRectangle.Height;
+
+ float aspectFig = Vx / Vy;
+ float aspectForm = Wx / Wy;
+
+ float Sx, Sy;
+ if (keepAspectRatio) {
+ Sx = Sy = aspectFig < aspectForm ? Wy / Vy : Wx / Vx;
+ }
+ else {
+ Sx = Wx / Vx;
+ Sy = Wy / Vy;
+ }
+
+ float Ty = Sy * Vy;
+
+ for (int i = 0; i < arrayLength; i += 4) {
+ g->DrawLine(blackPen, Sx * lines[i], Ty - Sy * lines[i + 1],
+ Sx * lines[i + 2], Ty - Sy * lines[i + 3]);
+ }
+ }
+ private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) {
+ keepAspectRatio = true;
+ }
+ private: System::Void MyForm_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) {
+ switch (e->KeyCode) {
+ case Keys::M :
+ keepAspectRatio = !keepAspectRatio;
+ break;
+ case Keys::N :
+ if (showClown)
+ {
+ lines = rabbit;
+ arrayLength = rabbitSize;
+ Vx = rabbitVx;
+ Vy = rabbitVy;
+ }
+ else
+ {
+ lines = clown;
+ arrayLength = clownSize;
+ Vx = clownVx;
+ Vy = clownVy;
+ }
+ showClown = !showClown;
+ break;
+ default:
+ break;
+ }
+ Refresh();
+ }
+ };
+}
diff --git a/task02/Guschin/MyForm.resx b/task02/Guschin/MyForm.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/task02/Guschin/MyForm.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/task03/Guschin.sln b/task03/Guschin.sln
new file mode 100644
index 0000000..0a37280
--- /dev/null
+++ b/task03/Guschin.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29806.167
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Guschin", "Guschin\Guschin.vcxproj", "{7FD831C6-82A0-4285-8C15-41D557E54312}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x64.ActiveCfg = Debug|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x64.Build.0 = Debug|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x86.ActiveCfg = Debug|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x86.Build.0 = Debug|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x64.ActiveCfg = Release|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x64.Build.0 = Release|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x86.ActiveCfg = Release|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {44500E7D-60B5-4F8A-8A21-14C0785E2BF7}
+ EndGlobalSection
+EndGlobal
diff --git a/task03/Guschin/Figure.h b/task03/Guschin/Figure.h
new file mode 100644
index 0000000..4a4b143
--- /dev/null
+++ b/task03/Guschin/Figure.h
@@ -0,0 +1,18 @@
+#pragma once
+#include "Matrix.h"
+#include <vector>
+
+class path
+{
+public:
+ std::vector<vec2> vertices;
+ vec3 color;
+ float thickness;
+
+ path(std::vector<vec2> verts, vec3 col, float thickn)
+ {
+ vertices = verts;
+ color = col;
+ thickness = thickn;
+ }
+}; \ No newline at end of file
diff --git a/task03/Guschin/Guschin.vcxproj b/task03/Guschin/Guschin.vcxproj
new file mode 100644
index 0000000..2065a14
--- /dev/null
+++ b/task03/Guschin/Guschin.vcxproj
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>16.0</VCProjectVersion>
+ <ProjectGuid>{7FD831C6-82A0-4285-8C15-41D557E54312}</ProjectGuid>
+ <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+ <Keyword>ManagedCProj</Keyword>
+ <RootNamespace>Guschin</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>Main</EntryPointSymbol>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>Main</EntryPointSymbol>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="Figure.h" />
+ <ClInclude Include="Matrix.h" />
+ <ClInclude Include="MyForm.h">
+ <FileType>CppForm</FileType>
+ </ClInclude>
+ <ClInclude Include="Transform.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MyForm.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="MyForm.resx">
+ <DependentUpon>MyForm.h</DependentUpon>
+ </EmbeddedResource>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/task03/Guschin/Guschin.vcxproj.filters b/task03/Guschin/Guschin.vcxproj.filters
new file mode 100644
index 0000000..c8d9b00
--- /dev/null
+++ b/task03/Guschin/Guschin.vcxproj.filters
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Исходные файлы">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Файлы заголовков">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
+ </Filter>
+ <Filter Include="Файлы ресурсов">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="MyForm.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ <ClInclude Include="Matrix.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ <ClInclude Include="Transform.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ <ClInclude Include="Figure.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MyForm.cpp">
+ <Filter>Исходные файлы</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="MyForm.resx">
+ <Filter>Файлы ресурсов</Filter>
+ </EmbeddedResource>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/task03/Guschin/Guschin.vcxproj.user b/task03/Guschin/Guschin.vcxproj.user
new file mode 100644
index 0000000..88a5509
--- /dev/null
+++ b/task03/Guschin/Guschin.vcxproj.user
@@ -0,0 +1,4 @@
+<?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/Matrix.h b/task03/Guschin/Matrix.h
new file mode 100644
index 0000000..3aa0bbf
--- /dev/null
+++ b/task03/Guschin/Matrix.h
@@ -0,0 +1,98 @@
+#pragma once
+
+class vec2
+{
+public:
+ float x, y;
+ vec2() {}
+ vec2(float a, float b) : x(a), y(b) {}
+};
+
+class vec3
+{
+public:
+ float x, y, z;
+ vec3() {}
+ vec3(float a, float b, float c) : x(a), y(b), z(c) {}
+ vec3(vec2 v, float c) : vec3(v.x, v.y, c) {}
+
+ vec3& operator*=(const vec3& v)
+ {
+ x *= v.x;
+ y *= v.y;
+ z *= v.z;
+ return *this;
+ }
+
+ const vec3 operator*(const vec3& v)
+ {
+ return vec3(*this) *= v;
+ }
+
+ float& operator[](int i)
+ {
+ return ((float*)this)[i];
+ }
+};
+
+float dot(vec3 v1, vec3 v2)
+{
+ vec3 tmp = v1 * v2;
+ return tmp.x + tmp.y + tmp.z;
+}
+
+class mat3
+{
+public:
+ vec3 row1, row2, row3;
+ mat3() {}
+ mat3(vec3 r1, vec3 r2, vec3 r3) : row1(r1), row2(r2), row3(r3) {}
+ mat3(float a)
+ {
+ row1 = vec3(a, 0.f, 0.f);
+ row2 = vec3(0.f, a, 0.f);
+ row3 = vec3(0.f, 0.f, a);
+ }
+
+ vec3& operator[](int i)
+ {
+ return ((vec3*)this)[i];
+ }
+
+ mat3 transpose()
+ {
+ mat3 tmp(*this);
+ for (int i = 0; i < 3; ++i)
+ for (int j = 0; j < 3; ++j)
+ (*this)[i][j] = tmp[j][i];
+ return *this;
+ }
+
+ const vec3 operator*(const vec3& v)
+ {
+ vec3* res = new(vec3);
+ for (int i = 0; i < 3; ++i)
+ (*res)[i] = dot((*this)[i], v);
+ return *res;
+ }
+
+ mat3& operator*=(const mat3& m)
+ {
+ mat3 A(*this), B(m);
+ B.transpose();
+ for (int i = 0; i < 3; ++i)
+ (*this)[i] = A * B[i];
+ return (*this).transpose();
+ }
+
+ const mat3 operator*(const mat3& m)
+ {
+ return mat3(*this) *= m;
+ }
+};
+
+vec2 normalize(vec3 v)
+{
+ return vec2(v.x / v.z, v.y / v.z);
+}
+
diff --git a/task03/Guschin/MyForm.cpp b/task03/Guschin/MyForm.cpp
new file mode 100644
index 0000000..b33e1e5
--- /dev/null
+++ b/task03/Guschin/MyForm.cpp
@@ -0,0 +1,19 @@
+#include "Matrix.h"
+#include <math.h>
+#include "Transform.h"
+#include "Figure.h"
+#include <vector>
+#include <fstream>
+#include <sstream>
+#include "MyForm.h"
+
+using namespace System;
+using namespace System::Windows::Forms;
+
+[STAThreadAttribute]
+void Main(array<String^> ^ args) {
+ Application::EnableVisualStyles();
+ Application::SetCompatibleTextRenderingDefault(false);
+ Guschin::MyForm form;
+ Application::Run(% form);
+} \ No newline at end of file
diff --git a/task03/Guschin/MyForm.h b/task03/Guschin/MyForm.h
new file mode 100644
index 0000000..bc09fd3
--- /dev/null
+++ b/task03/Guschin/MyForm.h
@@ -0,0 +1,298 @@
+#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;
+
+ float Vx;
+ float Vy;
+ float aspectFig;
+ vector<path> figure;
+ 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)
+ {
+ delete components;
+ }
+ }
+ private: System::Windows::Forms::OpenFileDialog^ openFileDialog;
+ private: System::Windows::Forms::Button^ btnOpen;
+ protected:
+
+ 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());
+ 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: System::Void MyForm_Resize(System::Object^ sender, System::EventArgs^ e) {
+ Refresh();
+ }
+ private: System::Void MyForm_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
+ Graphics^ g = e->Graphics;
+ g->Clear(Color::Aquamarine);
+
+ 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;
+ vec2 start = normalize(T * vec3(lines.vertices[0], 1.0));
+ for (int j = 1; j < lines.vertices.size(); ++j)
+ {
+ vec2 end = normalize(T * vec3(lines.vertices[j], 1.0));
+ g->DrawLine(pen, start.x, start.y, end.x, end.y);
+ start = end;
+ }
+ }
+ }
+ private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) { }
+ 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;
+
+ 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::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::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::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)
+ {
+ 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())
+ {
+ figure.clear();
+ 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 Wx = ClientRectangle.Width;
+ float Wy = ClientRectangle.Height;
+ float aspectForm = Wx / Wy;
+ float S = aspectFig < aspectForm ? Wy / Vy : Wx / Vx;
+ float Ty = S * Vy;
+ initT = translate(0.f, Ty) * scale(S, -S);
+ 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));
+ }
+ }
+ getline(in, str);
+ }
+ Refresh();
+ }
+ }
+ }
+};
+}
diff --git a/task03/Guschin/MyForm.resx b/task03/Guschin/MyForm.resx
new file mode 100644
index 0000000..12048a9
--- /dev/null
+++ b/task03/Guschin/MyForm.resx
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root> \ No newline at end of file
diff --git a/task03/Guschin/Transform.h b/task03/Guschin/Transform.h
new file mode 100644
index 0000000..d606647
--- /dev/null
+++ b/task03/Guschin/Transform.h
@@ -0,0 +1,45 @@
+#pragma once
+
+mat3 translate(float Tx, float Ty)
+{
+ mat3* res = new mat3(1.f);
+ (*res)[0][2] = Tx;
+ (*res)[1][2] = Ty;
+ return *res;
+}
+
+mat3 scale(float Sx, float Sy)
+{
+ mat3* res = new mat3(1.f);
+ (*res)[0][0] = Sx;
+ (*res)[1][1] = Sy;
+ return *res;
+}
+
+mat3 scale(float S)
+{
+ return scale(S, S);
+}
+
+mat3 rotate(float theta)
+{
+ mat3* res = new mat3(1.f);
+ (*res)[0][0] = (*res)[1][1] = (float)cos(theta);
+ (*res)[0][1] = (float)sin(theta);
+ (*res)[1][0] = -(*res)[0][1];
+ return *res;
+}
+
+mat3 mirrorX()
+{
+ mat3* res = new mat3(1.f);
+ (*res)[1][1] = -1;
+ return *res;
+}
+
+mat3 mirrorY()
+{
+ mat3* res = new mat3(1.f);
+ (*res)[0][0] = -1;
+ return *res;
+} \ No newline at end of file
diff --git a/task03/Hare_full.txt b/task03/Hare_full.txt
new file mode 100644
index 0000000..a214ad0
--- /dev/null
+++ b/task03/Hare_full.txt
@@ -0,0 +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 #
+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 #
+1.5 1.25
+
+#
+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
+
+#
+path 5
+2.5 3.5 #
+2.5 3. #
+3. 3. #
+3. 3.5 #
+2.5 3.5
+
+#
+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
+path 4
+2. 2.5 #
+2.5 2.5 #
+2.25 2. #
+2. 2.5
diff --git a/task03/clown.txt b/task03/clown.txt
new file mode 100644
index 0000000..a1a906a
--- /dev/null
+++ b/task03/clown.txt
@@ -0,0 +1,251 @@
+frame 20 30
+
+# шляпа
+color 255 255 0
+thickness 5
+path 17
+8. 29.
+12. 29.
+13. 28.
+14. 26.
+13. 24.
+15. 23.
+15. 22.
+14. 21.
+12. 22.
+8. 22.
+6. 21.
+5. 22.
+5. 23.
+7. 24.
+6. 26.
+7. 28.
+8. 29.
+
+# лопасти
+color 255 0 255
+thickness 3
+path 9
+14. 26.
+15. 26.
+16. 27.
+16. 26.
+17. 25.
+16. 25.
+15. 24.
+15. 25.
+14. 26.
+
+# ручка
+color 255 0 255
+thickness 3
+path 6
+15. 25.
+15. 26.
+16. 26.
+16. 25.
+15. 25.
+12. 23.
+
+# лицо правая часть
+color 255 255 255
+thickness 3
+path 3
+15. 17.
+16. 15.
+16. 10.
+
+# лицо левая часть
+color 255 255 255
+thickness 3
+path 3
+5. 17.
+4. 15.
+4. 10.
+
+# голова
+color 255 100 0
+thickness 3
+path 22
+15. 22.
+19. 17.
+19. 15.
+18. 16.
+19. 14.
+18. 13.
+17. 15.
+18. 12.
+16. 10.
+15. 8.
+11. 6.
+9. 6.
+5. 8.
+4. 10.
+2. 12.
+3. 15.
+2. 13.
+1. 14.
+2. 16.
+1. 15.
+1. 17.
+5. 22.
+
+# левый глаз
+color 0 0 255
+thickness 3
+path 16
+7. 16.
+5. 17.
+5. 19.
+7. 21.
+9. 21.
+10. 18.5
+9. 16.
+7. 16.
+6. 17.
+7. 19.
+8. 19.
+9. 17.
+8. 16.
+8. 17.
+7. 17.
+7. 16.
+
+# правый глаз
+color 0 0 255
+thickness 3
+path 16
+13. 16.
+15. 17.
+15. 19.
+13. 21.
+11. 21.
+10. 18.5
+11. 16.
+13. 16.
+14. 17.
+13. 19.
+12. 19.
+11. 17.
+12. 16.
+12. 17.
+13. 17.
+13. 16.
+
+# нос
+color 255 0 0
+thickness 5
+path 10
+9. 16.
+11. 16.
+13. 15.
+14. 13.
+13. 12.
+10. 11.
+7. 12.
+6. 13.
+7. 15.
+9. 16.
+
+# губы
+color 255 255 255
+thickness 5
+path 11
+6. 13.
+5. 13.
+4. 12.
+4. 11.
+7. 9.
+10. 8.
+13. 9.
+16. 11.
+16. 12.
+15. 13.
+14. 13.
+
+# левая ямочка
+color 255 0 0
+thickness 5
+path 2
+6. 12.
+5. 11.
+
+# правая ямочка
+color 255 0 0
+thickness 5
+path 2
+14. 12.
+15. 11.
+
+# рот
+color 255 0 0
+thickness 5
+path 5
+6. 11.
+7. 10.
+10. 9.
+13. 10.
+14. 11.
+
+### узоры на бантике
+color 255 255 0
+thickness 3
+path 5
+12. 5.
+13. 5.
+13. 4.
+12. 4.
+12. 5.
+
+color 100 0 200
+thickness 3
+path 2
+13. 6.
+14. 5.
+
+color 100 0 100
+thickness 3
+path 3
+14. 4.
+13. 3.
+14. 2.
+
+color 255 0 255
+thickness 3
+path 5
+8. 3.
+7. 3.
+7. 4.
+8. 4.
+8. 3.
+
+color 255 255 0
+thickness 3
+path 2
+7. 2.
+6. 3.
+
+color 0 0 255
+thickness 3
+path 3
+6. 4.
+7. 5.
+6. 6.
+
+# левый контур бантика
+color 255 0 0
+thickness 5
+path 4
+10. 3.
+6. 7.
+6. 1.
+10. 5.
+
+# правый контур бантика
+color 255 0 0
+thickness 5
+path 4
+10. 5.
+14. 1.
+14. 7.
+10. 3.
diff --git a/task04/Geometric.txt b/task04/Geometric.txt
new file mode 100644
index 0000000..6153292
--- /dev/null
+++ b/task04/Geometric.txt
@@ -0,0 +1,38 @@
+frame 20 10
+
+model 1.5 1 3 2
+color 0 255 0
+thickness 3
+path 5
+0.5 0.5
+0.5 1.5
+2.5 1.5
+2.5 0.5
+0.5 0.5
+
+pushTransform
+rotate -45
+pushTransform
+scale 2.25
+translate 5 5
+figure
+popTransform
+scale 0.75
+translate 15 1
+figure
+translate 0 8
+figure
+popTransform
+
+model 1 1.25 2 2.5
+color 255 0 0
+path 4
+0.5 0.5
+1 2
+1.5 0.5
+0.5 0.5
+
+rotate 90
+scale 1.5
+translate 15 5
+figure \ No newline at end of file
diff --git a/task04/Guschin.sln b/task04/Guschin.sln
new file mode 100644
index 0000000..0a37280
--- /dev/null
+++ b/task04/Guschin.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29806.167
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Guschin", "Guschin\Guschin.vcxproj", "{7FD831C6-82A0-4285-8C15-41D557E54312}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x64.ActiveCfg = Debug|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x64.Build.0 = Debug|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x86.ActiveCfg = Debug|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Debug|x86.Build.0 = Debug|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x64.ActiveCfg = Release|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x64.Build.0 = Release|x64
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x86.ActiveCfg = Release|Win32
+ {7FD831C6-82A0-4285-8C15-41D557E54312}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {44500E7D-60B5-4F8A-8A21-14C0785E2BF7}
+ EndGlobalSection
+EndGlobal
diff --git a/task04/Guschin/Clip.h b/task04/Guschin/Clip.h
new file mode 100644
index 0000000..10a613a
--- /dev/null
+++ b/task04/Guschin/Clip.h
@@ -0,0 +1,54 @@
+#pragma once
+#include "Matrix.h"
+#include <algorithm>
+
+unsigned int codeKS(vec2 P, float minX, float minY, float maxX, float maxY) {
+ unsigned int code = 0;
+
+ if (P.x < minX) {
+ code += 1;
+ }
+ else if (P.x > maxX) {
+ code += 2;
+ }
+ if (P.y < minY) {
+ code += 4;
+ }
+ else if (P.y > maxY) {
+ code += 8;
+ }
+
+ return code;
+}
+
+bool clip(vec2 & A, vec2 & B, float minX, float minY, float maxX, float maxY) {
+ unsigned int codeA = codeKS(A, minX, minY, maxX, maxY);
+ unsigned int codeB = codeKS(B, minX, minY, maxX, maxY);
+ while (codeA | codeB) {
+ if (codeA & codeB) {
+ return false;
+ }
+ if (codeA == 0) {
+ std::swap(A, B);
+ std::swap(codeA, codeB);
+ }
+ if (codeA & 1) {
+ A.y = A.y + (B.y - A.y) * (minX - A.x) / (B.x - A.x);
+ A.x = minX;
+ }
+ else if (codeA & 2) {
+ A.y = A.y + (B.y - A.y) * (maxX - A.x) / (B.x - A.x);
+ A.x = maxX;
+ }
+ else if (codeA & 4) {
+ A.x = A.x + (B.x - A.x) * (minY - A.y) / (B.y - A.y);
+ A.y = minY;
+ }
+ else {
+ A.x = A.x + (B.x - A.x) * (maxY - A.y) / (B.y - A.y);
+ A.y = maxY;
+ }
+ codeA = codeKS(A, minX, minY, maxX, maxY);
+ }
+ return true;
+}
diff --git a/task04/Guschin/Figure.h b/task04/Guschin/Figure.h
new file mode 100644
index 0000000..cf2a63e
--- /dev/null
+++ b/task04/Guschin/Figure.h
@@ -0,0 +1,27 @@
+#pragma once
+#include "Matrix.h"
+#include <vector>
+
+class path
+{
+public:
+ std::vector<vec2> vertices;
+ vec3 color;
+ float thickness;
+
+ path(std::vector<vec2> verts, vec3 col, float thickn)
+ {
+ vertices = verts;
+ color = col;
+ thickness = thickn;
+ }
+};
+
+class model {
+public:
+ std::vector<path> figure;
+ mat3 modelM;
+ model(std::vector<path> fig, mat3 mat) {
+ figure = fig; modelM = mat;
+ }
+}; \ No newline at end of file
diff --git a/task04/Guschin/Guschin.vcxproj b/task04/Guschin/Guschin.vcxproj
new file mode 100644
index 0000000..bbc67b9
--- /dev/null
+++ b/task04/Guschin/Guschin.vcxproj
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>16.0</VCProjectVersion>
+ <ProjectGuid>{7FD831C6-82A0-4285-8C15-41D557E54312}</ProjectGuid>
+ <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+ <Keyword>ManagedCProj</Keyword>
+ <RootNamespace>Guschin</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v142</PlatformToolset>
+ <CLRSupport>true</CLRSupport>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>Main</EntryPointSymbol>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>Main</EntryPointSymbol>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies />
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="Clip.h" />
+ <ClInclude Include="Figure.h" />
+ <ClInclude Include="Matrix.h" />
+ <ClInclude Include="MyForm.h">
+ <FileType>CppForm</FileType>
+ </ClInclude>
+ <ClInclude Include="Transform.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MyForm.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="MyForm.resx">
+ <DependentUpon>MyForm.h</DependentUpon>
+ </EmbeddedResource>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/task04/Guschin/Guschin.vcxproj.filters b/task04/Guschin/Guschin.vcxproj.filters
new file mode 100644
index 0000000..f93e64e
--- /dev/null
+++ b/task04/Guschin/Guschin.vcxproj.filters
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Исходные файлы">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Файлы заголовков">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
+ </Filter>
+ <Filter Include="Файлы ресурсов">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="MyForm.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ <ClInclude Include="Matrix.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ <ClInclude Include="Transform.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ <ClInclude Include="Figure.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ <ClInclude Include="Clip.h">
+ <Filter>Файлы заголовков</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MyForm.cpp">
+ <Filter>Исходные файлы</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="MyForm.resx">
+ <Filter>Файлы ресурсов</Filter>
+ </EmbeddedResource>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/task04/Guschin/Guschin.vcxproj.user b/task04/Guschin/Guschin.vcxproj.user
new file mode 100644
index 0000000..88a5509
--- /dev/null
+++ b/task04/Guschin/Guschin.vcxproj.user
@@ -0,0 +1,4 @@
+<?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/Matrix.h b/task04/Guschin/Matrix.h
new file mode 100644
index 0000000..3aa0bbf
--- /dev/null
+++ b/task04/Guschin/Matrix.h
@@ -0,0 +1,98 @@
+#pragma once
+
+class vec2
+{
+public:
+ float x, y;
+ vec2() {}
+ vec2(float a, float b) : x(a), y(b) {}
+};
+
+class vec3
+{
+public:
+ float x, y, z;
+ vec3() {}
+ vec3(float a, float b, float c) : x(a), y(b), z(c) {}
+ vec3(vec2 v, float c) : vec3(v.x, v.y, c) {}
+
+ vec3& operator*=(const vec3& v)
+ {
+ x *= v.x;
+ y *= v.y;
+ z *= v.z;
+ return *this;
+ }
+
+ const vec3 operator*(const vec3& v)
+ {
+ return vec3(*this) *= v;
+ }
+
+ float& operator[](int i)
+ {
+ return ((float*)this)[i];
+ }
+};
+
+float dot(vec3 v1, vec3 v2)
+{
+ vec3 tmp = v1 * v2;
+ return tmp.x + tmp.y + tmp.z;
+}
+
+class mat3
+{
+public:
+ vec3 row1, row2, row3;
+ mat3() {}
+ mat3(vec3 r1, vec3 r2, vec3 r3) : row1(r1), row2(r2), row3(r3) {}
+ mat3(float a)
+ {
+ row1 = vec3(a, 0.f, 0.f);
+ row2 = vec3(0.f, a, 0.f);
+ row3 = vec3(0.f, 0.f, a);
+ }
+
+ vec3& operator[](int i)
+ {
+ return ((vec3*)this)[i];
+ }
+
+ mat3 transpose()
+ {
+ mat3 tmp(*this);
+ for (int i = 0; i < 3; ++i)
+ for (int j = 0; j < 3; ++j)
+ (*this)[i][j] = tmp[j][i];
+ return *this;
+ }
+
+ const vec3 operator*(const vec3& v)
+ {
+ vec3* res = new(vec3);
+ for (int i = 0; i < 3; ++i)
+ (*res)[i] = dot((*this)[i], v);
+ return *res;
+ }
+
+ mat3& operator*=(const mat3& m)
+ {
+ mat3 A(*this), B(m);
+ B.transpose();
+ for (int i = 0; i < 3; ++i)
+ (*this)[i] = A * B[i];
+ return (*this).transpose();
+ }
+
+ const mat3 operator*(const mat3& m)
+ {
+ return mat3(*this) *= m;
+ }
+};
+
+vec2 normalize(vec3 v)
+{
+ return vec2(v.x / v.z, v.y / v.z);
+}
+
diff --git a/task04/Guschin/MyForm.cpp b/task04/Guschin/MyForm.cpp
new file mode 100644
index 0000000..a7e65d4
--- /dev/null
+++ b/task04/Guschin/MyForm.cpp
@@ -0,0 +1,20 @@
+#include "Matrix.h"
+#include <math.h>
+#include "Transform.h"
+#include "Figure.h"
+#include "Clip.h"
+#include <vector>
+#include <fstream>
+#include <sstream>
+#include "MyForm.h"
+
+using namespace System;
+using namespace System::Windows::Forms;
+
+[STAThreadAttribute]
+void Main(array<String^> ^ args) {
+ Application::EnableVisualStyles();
+ Application::SetCompatibleTextRenderingDefault(false);
+ Guschin::MyForm form;
+ Application::Run(% form);
+} \ No newline at end of file
diff --git a/task04/Guschin/MyForm.h b/task04/Guschin/MyForm.h
new file mode 100644
index 0000000..ee13fc6
--- /dev/null
+++ b/task04/Guschin/MyForm.h
@@ -0,0 +1,376 @@
+#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;
+
+ 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: äîáàâüòå êîä êîíñòðóêòîðà
+ //
+ }
+
+ protected:
+ /// <summary>
+ /// Îñâîáîäèòü âñå èñïîëüçóåìûå ðåñóðñû.
+ /// </summary>
+ ~MyForm()
+ {
+ if (components)
+ {
+ delete components;
+ }
+ }
+ private: System::Windows::Forms::OpenFileDialog^ openFileDialog;
+ private: System::Windows::Forms::Button^ btnOpen;
+ protected:
+
+ 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());
+ 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);
+
+ 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;
+
+ 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; // �������� ����� ������������� ������� ���������� ��������� ������ ����������
+ }
+ }
+ }
+
+ }
+ 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;
+
+ 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::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::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::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';
+
+ // ���������� � �������� �����
+ ifstream in;
+ in.open(fileName);
+ if (in.is_open()) {
+ // ���� ������� ������
+ models.clear(); // ������� ��������� ������ �������
+ // ��������� ���������� ��� ������ �� �����
+
+ 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 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);
+
+ 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();
+ }
+ }
+ }
+};
+}
diff --git a/task04/Guschin/MyForm.resx b/task04/Guschin/MyForm.resx
new file mode 100644
index 0000000..12048a9
--- /dev/null
+++ b/task04/Guschin/MyForm.resx
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root> \ No newline at end of file
diff --git a/task04/Guschin/Transform.h b/task04/Guschin/Transform.h
new file mode 100644
index 0000000..d606647
--- /dev/null
+++ b/task04/Guschin/Transform.h
@@ -0,0 +1,45 @@
+#pragma once
+
+mat3 translate(float Tx, float Ty)
+{
+ mat3* res = new mat3(1.f);
+ (*res)[0][2] = Tx;
+ (*res)[1][2] = Ty;
+ return *res;
+}
+
+mat3 scale(float Sx, float Sy)
+{
+ mat3* res = new mat3(1.f);
+ (*res)[0][0] = Sx;
+ (*res)[1][1] = Sy;
+ return *res;
+}
+
+mat3 scale(float S)
+{
+ return scale(S, S);
+}
+
+mat3 rotate(float theta)
+{
+ mat3* res = new mat3(1.f);
+ (*res)[0][0] = (*res)[1][1] = (float)cos(theta);
+ (*res)[0][1] = (float)sin(theta);
+ (*res)[1][0] = -(*res)[0][1];
+ return *res;
+}
+
+mat3 mirrorX()
+{
+ mat3* res = new mat3(1.f);
+ (*res)[1][1] = -1;
+ return *res;
+}
+
+mat3 mirrorY()
+{
+ mat3* res = new mat3(1.f);
+ (*res)[0][0] = -1;
+ return *res;
+} \ No newline at end of file
diff --git a/task04/result.txt b/task04/result.txt
new file mode 100644
index 0000000..09a735b
--- /dev/null
+++ b/task04/result.txt
@@ -0,0 +1,474 @@
+frame 40 20
+
+############
+## Кролик ##
+############
+model 4.25 4.25 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 # левая скула
+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 # передняя нога слева
+1.5 1.25
+
+# глаза
+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
+
+# правый глаз
+path 5
+2.5 3.5 # правый глаз слева
+2.5 3. # правый глаз снизу
+3. 3. # правый глаз справа
+3. 3.5 # правый глаз сверху
+2.5 3.5
+
+# ушные раковины
+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
+path 4
+2. 2.5 # нос сверху
+2.5 2.5 # нос справа
+2.25 2. # нос слева
+2. 2.5
+
+####################
+## Преобразования ##
+####################
+scale 1.5
+
+# Первая четверть
+pushTransform
+rotate 360
+translate 8 0
+rotate 360
+translate 20 10
+figure
+popTransform
+
+pushTransform
+rotate 60
+translate 8 0
+rotate 60
+translate 20 10
+figure
+popTransform
+
+# Вторая четверть
+pushTransform
+rotate 120
+translate 8 0
+rotate 120
+translate 20 10
+figure
+popTransform
+
+pushTransform
+rotate 180
+translate 8 0
+rotate 180
+translate 20 10
+figure
+popTransform
+
+# Третья четверть
+pushTransform
+rotate 240
+translate 8 0
+rotate 240
+translate 20 10
+figure
+popTransform
+
+# Четвёртая четверть
+pushTransform
+rotate 300
+translate 8 0
+rotate 300
+translate 20 10
+figure
+popTransform
+
+
+###########
+## Клоун ##
+###########
+model 10 15 20 30
+
+# шляпа
+color 255 255 0
+thickness 5
+path 17
+8. 29.
+12. 29.
+13. 28.
+14. 26.
+13. 24.
+15. 23.
+15. 22.
+14. 21.
+12. 22.
+8. 22.
+6. 21.
+5. 22.
+5. 23.
+7. 24.
+6. 26.
+7. 28.
+8. 29.
+
+# лопасти
+color 255 0 255
+thickness 3
+path 9
+14. 26.
+15. 26.
+16. 27.
+16. 26.
+17. 25.
+16. 25.
+15. 24.
+15. 25.
+14. 26.
+
+# ручка
+color 255 0 255
+thickness 3
+path 6
+15. 25.
+15. 26.
+16. 26.
+16. 25.
+15. 25.
+12. 23.
+
+# лицо правая часть
+color 255 255 255
+thickness 3
+path 3
+15. 17.
+16. 15.
+16. 10.
+
+# лицо левая часть
+color 255 255 255
+thickness 3
+path 3
+5. 17.
+4. 15.
+4. 10.
+
+# голова
+color 255 100 0
+thickness 3
+path 22
+15. 22.
+19. 17.
+19. 15.
+18. 16.
+19. 14.
+18. 13.
+17. 15.
+18. 12.
+16. 10.
+15. 8.
+11. 6.
+9. 6.
+5. 8.
+4. 10.
+2. 12.
+3. 15.
+2. 13.
+1. 14.
+2. 16.
+1. 15.
+1. 17.
+5. 22.
+
+# левый глаз
+color 0 0 255
+thickness 3
+path 16
+7. 16.
+5. 17.
+5. 19.
+7. 21.
+9. 21.
+10. 18.5
+9. 16.
+7. 16.
+6. 17.
+7. 19.
+8. 19.
+9. 17.
+8. 16.
+8. 17.
+7. 17.
+7. 16.
+
+# правый глаз
+color 0 0 255
+thickness 3
+path 16
+13. 16.
+15. 17.
+15. 19.
+13. 21.
+11. 21.
+10. 18.5
+11. 16.
+13. 16.
+14. 17.
+13. 19.
+12. 19.
+11. 17.
+12. 16.
+12. 17.
+13. 17.
+13. 16.
+
+# нос
+color 255 0 0
+thickness 5
+path 10
+9. 16.
+11. 16.
+13. 15.
+14. 13.
+13. 12.
+10. 11.
+7. 12.
+6. 13.
+7. 15.
+9. 16.
+
+# губы
+color 255 255 255
+thickness 5
+path 11
+6. 13.
+5. 13.
+4. 12.
+4. 11.
+7. 9.
+10. 8.
+13. 9.
+16. 11.
+16. 12.
+15. 13.
+14. 13.
+
+# левая ямочка
+color 255 0 0
+thickness 5
+path 2
+6. 12.
+5. 11.
+
+# правая ямочка
+color 255 0 0
+thickness 5
+path 2
+14. 12.
+15. 11.
+
+# рот
+color 255 0 0
+thickness 5
+path 5
+6. 11.
+7. 10.
+10. 9.
+13. 10.
+14. 11.
+
+### узоры на бантике
+color 255 255 0
+thickness 3
+path 5
+12. 5.
+13. 5.
+13. 4.
+12. 4.
+12. 5.
+
+color 100 0 200
+thickness 3
+path 2
+13. 6.
+14. 5.
+
+color 100 0 100
+thickness 3
+path 3
+14. 4.
+13. 3.
+14. 2.
+
+color 255 0 255
+thickness 3
+path 5
+8. 3.
+7. 3.
+7. 4.
+8. 4.
+8. 3.
+
+color 255 255 0
+thickness 3
+path 2
+7. 2.
+6. 3.
+
+color 0 0 255
+thickness 3
+path 3
+6. 4.
+7. 5.
+6. 6.
+
+# левый контур бантика
+color 255 0 0
+thickness 5
+path 4
+10. 3.
+6. 7.
+6. 1.
+10. 5.
+
+# правый контур бантика
+color 255 0 0
+thickness 5
+path 4
+10. 5.
+14. 1.
+14. 7.
+10. 3.
+
+####################
+## Преобразования ##
+####################
+scale 1.5
+
+# Первая четверть
+pushTransform
+rotate 30
+translate 8 0
+rotate 30
+translate 20 10
+figure
+popTransform
+
+pushTransform
+rotate 90
+translate 8 0
+rotate 90
+translate 20 10
+figure
+popTransform
+
+# Вторая четверть
+pushTransform
+rotate 150
+translate 8 0
+rotate 150
+translate 20 10
+figure
+popTransform
+
+# Третья четверть
+pushTransform
+rotate 210
+translate 8 0
+rotate 210
+translate 20 10
+figure
+popTransform
+
+pushTransform
+rotate 270
+translate 8 0
+rotate 270
+translate 20 10
+figure
+popTransform
+
+# Четвёртая четверть
+pushTransform
+rotate 330
+translate 8 0
+rotate 330
+translate 20 10
+figure
+popTransform \ No newline at end of file