unit LightingModelsPanel;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TLightingModelPanel = class(TForm)
    Label1: TLabel;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    RadioButton5: TRadioButton;
    RadioButton6: TRadioButton;
    RadioButton7: TRadioButton;
    RadioButton8: TRadioButton;
    CheckBox1: TCheckBox;
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton3Click(Sender: TObject);
    procedure RadioButton4Click(Sender: TObject);
    procedure RadioButton5Click(Sender: TObject);
    procedure RadioButton6Click(Sender: TObject);
    procedure RadioButton7Click(Sender: TObject);
    procedure RadioButton8Click(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

const
  LM_LAMBERT                = $00000001;
  LM_OREN_NAYAR             = $00000002;
  LM_MINNAERT               = $00000003;
  LM_PHONG                  = $00000004;
  LM_BLINN_PHONG            = $00000005;
  LM_SCHLICK                = $00000006;
  LM_WARD_ISOTROPIC         = $00000007;
  LM_WARD_ANISOTROPIC       = $00000008;

var
  LightingModelPanel: TLightingModelPanel;
  LightingModel: cardinal = LM_LAMBERT;
  AnimateLight: boolean = false;

implementation

{$R *.dfm}

procedure TLightingModelPanel.CheckBox1Click(Sender: TObject);
begin
  AnimateLight := CheckBox1.Checked;
end;

procedure TLightingModelPanel.RadioButton1Click(Sender: TObject);
begin
  LightingModel := LM_LAMBERT;
  RadioButton2.Checked := false;
  RadioButton3.Checked := false;
  RadioButton4.Checked := false;
  RadioButton5.Checked := false;
  RadioButton6.Checked := false;
  RadioButton7.Checked := false;
  RadioButton8.Checked := false;
end;

procedure TLightingModelPanel.RadioButton2Click(Sender: TObject);
begin
  LightingModel := LM_OREN_NAYAR;
  RadioButton1.Checked := false;
  RadioButton3.Checked := false;
  RadioButton4.Checked := false;
  RadioButton5.Checked := false;
  RadioButton6.Checked := false;
  RadioButton7.Checked := false;
  RadioButton8.Checked := false;
end;

procedure TLightingModelPanel.RadioButton3Click(Sender: TObject);
begin
  LightingModel := LM_MINNAERT;
  RadioButton1.Checked := false;
  RadioButton2.Checked := false;
  RadioButton4.Checked := false;
  RadioButton5.Checked := false;
  RadioButton6.Checked := false;
  RadioButton7.Checked := false;
  RadioButton8.Checked := false;
end;

procedure TLightingModelPanel.RadioButton4Click(Sender: TObject);
begin
  LightingModel := LM_PHONG;
  RadioButton1.Checked := false;
  RadioButton2.Checked := false;
  RadioButton3.Checked := false;
  RadioButton5.Checked := false;
  RadioButton6.Checked := false;
  RadioButton7.Checked := false;
  RadioButton8.Checked := false;
end;

procedure TLightingModelPanel.RadioButton5Click(Sender: TObject);
begin
  LightingModel := LM_BLINN_PHONG;
  RadioButton1.Checked := false;
  RadioButton2.Checked := false;
  RadioButton3.Checked := false;
  RadioButton4.Checked := false;
  RadioButton6.Checked := false;
  RadioButton7.Checked := false;
  RadioButton8.Checked := false;
end;

procedure TLightingModelPanel.RadioButton6Click(Sender: TObject);
begin
  LightingModel := LM_SCHLICK;
  RadioButton1.Checked := false;
  RadioButton2.Checked := false;
  RadioButton3.Checked := false;
  RadioButton4.Checked := false;
  RadioButton5.Checked := false;
  RadioButton7.Checked := false;
  RadioButton8.Checked := false;
end;

procedure TLightingModelPanel.RadioButton7Click(Sender: TObject);
begin
  LightingModel := LM_WARD_ISOTROPIC;
  RadioButton1.Checked := false;
  RadioButton2.Checked := false;
  RadioButton3.Checked := false;
  RadioButton4.Checked := false;
  RadioButton5.Checked := false;
  RadioButton6.Checked := false;
  RadioButton8.Checked := false;
end;

procedure TLightingModelPanel.RadioButton8Click(Sender: TObject);
begin
  LightingModel := LM_WARD_ANISOTROPIC;
  RadioButton1.Checked := false;
  RadioButton2.Checked := false;
  RadioButton3.Checked := false;
  RadioButton4.Checked := false;
  RadioButton5.Checked := false;
  RadioButton6.Checked := false;
  RadioButton7.Checked := false;
end;

end.
