/
Alexandr_mamonov
/
lab
Обзор
Документация
Войти
/
Alexandr_mamonov
/
lab
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Lab1_BaseObjects/fcCubeVcl.cpp
137 строк
3 KB
Александр Мамонов
Add visualization lab projects
11 май 2026, 20:15
11 май 2026, 20:15
e92b10e
Код
Авторство
О чём код?
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "fcCubeVcl.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "GLS.BaseClasses" #pragma link "GLS.Scene" #pragma link "GLS.SceneViewer" #pragma link "GLS.Coordinates" #pragma link "GLS.Objects" #pragma link "GLS.Cadencer" #pragma link "GLS.SimpleNavigation" #pragma link "GLS.GeomObjects" #pragma link "GLS.VectorFileObjects" #pragma resource "*.dfm" TfrmMain *frmMain; int mode = 1; //--------------------------------------------------------------------------- __fastcall TfrmMain::TfrmMain(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TfrmMain::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key != 32) { GLCube1->Visible = false; GLSphere1->Visible = false; GLDisk1->Visible = false; GLCone1->Visible = false; GLDodecahedron1->Visible = false; GLIcosahedron1->Visible = false; GLOctahedron1->Visible = false; GLTetrahedron1->Visible = false; GLTorus1->Visible = false; GLTeapot1->Visible = false; } switch (Key) { case 32: { switch (mode) { case 0: { GLCube1->Material->PolygonMode = pmFill; GLSphere1->Material->PolygonMode = pmFill; GLDisk1->Material->PolygonMode = pmFill; GLCone1->Material->PolygonMode = pmFill; GLDodecahedron1->Material->PolygonMode = pmFill; GLIcosahedron1->Material->PolygonMode = pmFill; GLOctahedron1->Material->PolygonMode = pmFill; GLTetrahedron1->Material->PolygonMode = pmFill; GLTorus1->Material->PolygonMode = pmFill; GLTeapot1->Material->PolygonMode = pmFill; break; } case 1: { GLCube1->Material->PolygonMode = pmLines; GLSphere1->Material->PolygonMode = pmLines; GLDisk1->Material->PolygonMode = pmLines; GLCone1->Material->PolygonMode = pmLines; GLDodecahedron1->Material->PolygonMode = pmLines; GLIcosahedron1->Material->PolygonMode = pmLines; GLOctahedron1->Material->PolygonMode = pmLines; GLTetrahedron1->Material->PolygonMode = pmLines; GLTorus1->Material->PolygonMode = pmLines; GLTeapot1->Material->PolygonMode = pmLines; break; } case 2: { GLCube1->Material->PolygonMode = pmPoints; GLSphere1->Material->PolygonMode = pmPoints; GLDisk1->Material->PolygonMode = pmPoints; GLCone1->Material->PolygonMode = pmPoints; GLDodecahedron1->Material->PolygonMode = pmPoints; GLIcosahedron1->Material->PolygonMode = pmPoints; GLOctahedron1->Material->PolygonMode = pmPoints; GLTetrahedron1->Material->PolygonMode = pmPoints; GLTorus1->Material->PolygonMode = pmPoints; GLTeapot1->Material->PolygonMode = pmPoints; break; } default: ; } mode = (mode + 1) % 3; break; } case 49: { GLCube1->Visible = true; break; } case 50: { GLSphere1->Visible = true; break; } case 51: { GLDisk1->Visible = true; break; } case 52: { GLCone1->Visible = true; break; } case 53: { GLDodecahedron1->Visible = true; break; } case 54: { GLIcosahedron1->Visible = true; break; } case 55: { GLOctahedron1->Visible = true; break; } case 56: { GLTetrahedron1->Visible = true; break; } case 57: { GLTorus1->Visible = true; break; } case 48: { GLTeapot1->Visible = true; break; } default: GLCube1->Visible = true; } } //---------------------------------------------------------------------------