Сечение многогранников

Курсовой проект - Математика и статистика

Другие курсовые по предмету Математика и статистика

Скачать Бесплатно!
Для того чтобы скачать эту работу.
1. Пожалуйста введите слова с картинки:

2. И нажмите на эту кнопку.
закрыть



j:integer;

k:TColor;

begin

{Стираем старое изображение}

for j:=1 to 4 do

WindowProection[j].Picture:=nil;

for i:=1 to M do

ColorLight(i,ColorEder,ColorUnEder);

if Form1.IntWiew.Enabled then

begin

BildInter;

ColorLight(M+1,ColorIntersection,ColorIntersection);

for j:=1 to 3 do

Scene[j].G[M+1].Visible:=true;

end;

DrawGrane;

Puk;

end;

//* Задание точек сечения

Procedure EnterPointIntersection(i:byte;X,Y:integer);

var k:integer;

Par:TPoint;

begin

if Scene[i].Active then

begin

X0:=X;

Y0:=Y;

if Form1.N36.Checked then

begin

k:=SelectGran(i,X,Y);

if k<>0 then

Scene[i].G[k].Paint:=false;

end;

if Form1.N37.Checked then

begin

k:=SelectGran(i,X,Y);

if k<>0 then

Scene[i].G[k].Paint:=true;

end;

if Form1.N40.Checked then

begin

inc(Count);

InterPoint[Count]:=UnSer(i,X,Y,0,0,0,Scene[i].M);

Puk;

if Count=3 then

begin

Form1.N40.Checked:=false;

Form1.N40.Enabled:=false;

Form1.N41.Enabled:=true;

Form1.ToolButton13.Enabled:=false;

BildInter;

end;

end;

if Form1.N27.Checked and Form1.IntWiew.Enabled then

for k:=1 to 3 do

if First[k] and SelReber(i,x,y,Par) then

begin

MagPoint[k,1]:=V[Par.x];

MagPoint[k,2]:=V[Par.y];

First[k]:=false;

end;

Form1.Repaint;

end;

end;

procedure TForm1.ITopMouseDown(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

begin

EnterPointIntersection(1,X,Y);

end;

procedure TForm1.IFrontMouseDown(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

begin

EnterPointIntersection(2,X,Y);

end;

procedure TForm1.ILeftMouseDown(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

begin

EnterPointIntersection(3,X,Y);

end;

//* Включение сетки

procedure TForm1.N25Click(Sender: TObject);

var i:byte;

begin

for i:=1 to 3 do

if Scene[i].Active then

Scene[i].M.Net:=not Scene[i].M.Net;

Form1.Repaint;

end;

//* Включение ребер

procedure TForm1.N21Click(Sender: TObject);

var i,j:integer;

begin

Form1.N21.Checked:=not Form1.N21.Checked;

for i:=1 to 4 do

for j:=1 to M do

Scene[i].G[j].PenRb:=Form1.N21.Checked;

Form1.Repaint;

end;

//* Включение заливки

procedure TForm1.N22Click(Sender: TObject);

var i,j:integer;

begin

Form1.N22.Checked:=not Form1.N22.Checked;

for i:=1 to 3 do

for j:=1 to M do

Scene[i].G[j].BrushGr:=Form1.N22.Checked;

Form1.Repaint;

end;

//* Вызов диалога изменения цвета

procedure TForm1.N16Click(Sender: TObject);

begin

Application.CreateForm(TForm2,Form2);

end;

//* Вызов окна просмотра сечения

procedure TForm1.IntWiewClick(Sender: TObject);

begin

Application.CreateForm(TForm3,Form3);

end;

//Панель инструментов--------------------------------------

procedure TForm1.N8Click(Sender: TObject);

var i:integer;

begin

Form1.ToolButton12.Down:=Form1.N8.Checked;

end;

procedure TForm1.N27Click(Sender: TObject);

begin

Form1.ToolButton4.Down:=true;

end;

procedure TForm1.N28Click(Sender: TObject);

begin

Form1.ToolButton5.Down:=true;

end;

procedure TForm1.N29Click(Sender: TObject);

begin

Form1.ToolButton6.Down:=true;

end;

procedure TForm1.N34Click(Sender: TObject);

begin

Form1.ToolButton7.Down:=true;

end;

procedure TForm1.N36Click(Sender: TObject);

begin

Form1.ToolButton8.Down:=true;

end;

procedure TForm1.N37Click(Sender: TObject);

begin

Form1.ToolButton9.Down:=true;

end;

procedure TForm1.N9Click(Sender: TObject);

begin

Form1.ToolButton11.Down:=Form1.N9.Checked;

end;

procedure TForm1.N10Click(Sender: TObject);

begin

Form1.ToolButton19.Down:=Form1.N10.Checked;

end;

//---------------------------------------------------------

procedure TForm1.IPerspectiveClick(Sender: TObject);

begin

if not Scene[4].Active then{Активация окна перспективы}

ActivWindowProection(4);

end;

//* Удаление сечения

procedure TForm1.N41Click(Sender: TObject);

var i:integer;

begin

Count:=0;

for i:=1 to 3 do

First[i]:=false;

Form1.N40.Enabled:=true;

Form1.N40.Checked:=false;

Form1.N41.Enabled:=false;

Form1.ToolButton13.Enabled:=true;

Form1.ToolButton13.Down:=false;

Form1.IntWiew.Enabled:=false;

Form1.Label1.Caption:=Сечение не задано.;

for i:=1 to 3 do

Scene[i].G[M+1].Visible:=false;

Form1.Repaint;

end;

//* Сброс

procedure TForm1.N14Click(Sender: TObject);

var i:integer;

begin

ActivColor:=clYellow;

ColorEder:=clAqua;

ColorUnEder:=clSilver;

ColorRebro:=clBlack;

ColorIntersection:=clRed;

ColorPointIntersection:=clBlue;

ColorNet:=clBtnFace;

for i:=1 to 3 do

Scene[i].M.Mash:=100;

Form1.N41.Click;

M:=0;

N:=0;

Form1.StatusBar2.Panels[3].Text:=Файл не загружен;

Form1.Repaint;

end;

//---------------------------------------------------------

procedure TForm1.N18Click(Sender: TObject);

begin

Form1.Repaint;

end;

procedure TForm1.ToolButton4Click(Sender: TObject);

begin

Form1.N27.Click;

end;

procedure TForm1.ToolButton5Click(Sender: TObject);

begin

Form1.N28.Click;

end;

procedure TForm1.ToolButton6Click(Sender: TObject);

begin

Form1.N29.Click;

end;

procedure TForm1.ToolButton7Click(Sender: TObject);

begin

Form1.N34.Click;

end;

procedure TForm1.ToolButton8Click(Sender: TObject);

begin

Form1.N36.Click;

end;

procedure TForm1.ToolButton9Click(Sender: TObject);

begin

Form1.N37.Click;

end;

procedure TForm1.ToolButton12Click(Sender: TObject);

begin

Form1.N8.Click;

end;

procedure TForm1.ToolButton11Click(Sender: TObject);

begin

Form1.N9.Click;

end;

procedure TForm1.ToolButton19Click(Sender: TObject);

begin

Form1.N10.Click;

end;

procedure TForm1.ToolButton13Click(Sender: TObject);

begin

Form1.N40.Click;

end;

procedure TForm1.N24Click(Sender: TObject);

begin

Form1.Repaint;

end;

procedure TForm1.N19Click(Sender: TObject);

begin

Form1.Repaint;

end;

//---------------------------------------------------------

procedure TForm1.Mag1Click(Sender: TObject);

begin

if Mag1.Checked then

First[1]:=true;

end;

procedure TForm1.Mag2Click(Sender: TObject);

begin

if Mag2.Checked then

First[2]:=true;

end;

procedure TForm1.Mag3Click(Sender: TObject);

begin

if Mag3.Checked then

First[3]:=true;

end;

end.

unit Unit2;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Buttons, ComCtrls, ExtCtrls;

type

TForm2 = class(TForm)

BitBtn1: TBitBtn;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

Shape1: TShape;

Shape2: TShape;

Shape3: TShape;

Shape4: TShape;

Shape5: TShape;

Label6: TLabel;

Shape6: TShape;

CD1: TColorDialog;

Label7: TLabel;

Shape7: TShape;

procedure FormCreate(Sender: TObject);

procedure Shape1MouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure Shape2MouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure Shape3MouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure Shape4MouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure Shape5MouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure Shape6MouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure BitBtn1Click(Sender: TObject);

procedure CD1Close(Sender: TObject);

procedure Shape7MouseUp(Sender: TObject; Button: TMou

s