Főprogram (Surface.pas)

Top  Previous  Next

 

unit frmMain;

 

interface

 

uses

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

Dialogs, Menus, frmGLMDI, mesh, opengl, frmDEMCollection,

StdCtrls;

 

type

TMainForm = class(TForm)

   MainMenu1: TMainMenu;

   N5: TMenuItem;

   Grayface1: TMenuItem;

   N8: TMenuItem;

   N9: TMenuItem;

   N13: TMenuItem;

   N14: TMenuItem;

   N15: TMenuItem;

   OpenDialog1: TOpenDialog;

   SaveDialog1: TSaveDialog;

   N20: TMenuItem;

   N21: TMenuItem;

   N23: TMenuItem;

   N24: TMenuItem;

   procedure N24Click(Sender: TObject);

   procedure N26Click(Sender: TObject);

   procedure N30Click(Sender: TObject);

   procedure N31Click(Sender: TObject);

   procedure N8Click(Sender: TObject);

   procedure N9Click(Sender: TObject);

   procedure N16Click(Sender: TObject);

   procedure N21Click(Sender: TObject);

   procedure N14Click(Sender: TObject);

   procedure N15Click(Sender: TObject);

   procedure N1Click(Sender: TObject);

private

   { Private declarations }

public

   { Public declarations }

 

   GLChild : TfrmGL;

end;

 

var

MainForm: TMainForm;

 

implementation

 

{$R *.dfm}

 

procedure TMainForm.N24Click(Sender: TObject);

begin

       Close;

end;

 

procedure TMainForm.N26Click(Sender: TObject);

begin

//        GLChild := TfrmGL.Create(Application, );

end;

 

procedure TMainForm.N30Click(Sender: TObject);

begin

       TileMode := tbVertical;

       Tile;

end;

 

procedure TMainForm.N31Click(Sender: TObject);

begin

 

       Cascade;

end;

 

procedure TMainForm.N8Click(Sender: TObject);

begin

       if MDIChildCount > 0 then begin

               GLChild.MyMesh.MeshConfig.mode:= gl_triangles;

               InvalidateRect(GLChild.Handle, nil, False);

   end;

end;

 

procedure TMainForm.N9Click(Sender: TObject);

begin

       if MDIChildCount > 0 then begin

               GLChild.MyMesh.MeshConfig.mode:= gl_Line_loop;

               InvalidateRect(GLChild.Handle, nil, False);

   end;

end;

 

procedure TMainForm.N16Click(Sender: TObject);

begin

       ;

end;

 

procedure TMainForm.N21Click(Sender: TObject);

begin

       with TDEMCollectionForm.Create(nil) do begin

          ShowModal;

       if ListView1.ItemIndex >= 0 then begin

              if GLChild <> nil then GLChild.Free;

                       GLChild := TfrmGL.Create(Application, ListView1.Selected.SubItems[0], ListView1.Selected.SubItems[1]);               

       end;

       Free;

   end;

end;

 

procedure TMainForm.N14Click(Sender: TObject);

begin

       if MDIChildCount > 0 then begin

        glEnable(GL_LIGHTING);

               InvalidateRect(GLChild.Handle, nil, False);

   end;

end;

 

procedure TMainForm.N15Click(Sender: TObject);

begin

       if MDIChildCount > 0 then begin

               glDisable(GL_LIGHTING);

               InvalidateRect(GLChild.Handle, nil, False);

   end;

 

end;

 

procedure TMainForm.N1Click(Sender: TObject);

begin

       if (MDIChildCount > 0) and (not Assigned(GLChild.MyMesh.Root)) then begin

               GLChild.MyMesh.BuildTree;

   end;

 

end;

 

end.