many changes, mostly in editor and adjust

This commit is contained in:
zueuk 2005-10-19 18:51:05 +00:00
parent 4cb9c04f1e
commit 4576862b26
9 changed files with 644 additions and 724 deletions

View File

@ -677,6 +677,7 @@ object AdjustForm: TAdjustForm
Height = 45 Height = 45
Align = alTop Align = alTop
BevelOuter = bvLowered BevelOuter = bvLowered
Color = clAppWorkSpace
TabOrder = 0 TabOrder = 0
object GradientImage: TImage object GradientImage: TImage
Left = 1 Left = 1

View File

@ -257,44 +257,42 @@ type
cp: TControlPoint; cp: TControlPoint;
// --Z-- // gradient stuff private // --Z-- // gradient stuff
Palette: TColorMap; Palette: TColorMap;
BackupPal: TColorMap; BackupPal: TColorMap;
scrollMode: (modeRotate, modeHue, modeSaturation, modeBrightness, modeContrast, scrollMode: (modeRotate,
modeHue, modeSaturation, modeBrightness, modeContrast,
modeBlur, modeFrequency); modeBlur, modeFrequency);
imgDrag, GradientChanged: boolean; imgDrag, GradientChanged: boolean;
dragX, oldX: integer; dragX, oldX: integer;
offset: integer; // for display... :-\ offset: integer; // for display...? :-\
procedure Apply;
function Blur(const radius: integer; const pal: TColorMap): TColorMap;
function Frequency(const times: Integer; const pal: TColorMap): TColorMap;
procedure SaveMap(FileName: string);
// --Z-- // image size stuff procedure UpdateGradient(Pal: TColorMap);
private // --Z-- // image size stuff
ImageHeight, ImageWidth: integer; ImageHeight, ImageWidth: integer;
Preset: array[1..3] of record Preset: array[1..3] of record
Left, Top, Width, Height: integer; Left, Top, Width, Height: integer;
end; end;
ratio: double; ratio: double;
// gradient stuff again
procedure Apply;
function Blur(const radius: integer; const pal: TColorMap): TColorMap;
function Frequency(const times: Integer; const pal: TColorMap): TColorMap;
procedure SaveMap(FileName: string);
// and image size stuff again
procedure ReadPreset(n: integer); procedure ReadPreset(n: integer);
procedure WritePreset(n: integer); procedure WritePreset(n: integer);
function PresetToStr(n: integer): string; function PresetToStr(n: integer): string;
procedure UpdateGradient(Pal: TColorMap);
// --
public public
PreviewDensity: double; PreviewDensity: double;
// cmap: TColorMap; // cmap: TColorMap;
// Sample_Density, Zoom: double; // Sample_Density, Zoom: double;
// Center: array[0..1] of double; // Center: array[0..1] of double;
procedure UpdateDisplay; procedure UpdateDisplay(PreviewOnly: boolean = false);
procedure UpdateFlame; procedure UpdateFlame;
end; end;
@ -317,14 +315,15 @@ uses
{$R *.DFM} {$R *.DFM}
procedure TAdjustForm.UpdateDisplay; procedure TAdjustForm.UpdateDisplay(PreviewOnly: boolean = false);
var var
pw, ph: integer; pw, ph: integer;
r: double; r: double;
begin begin
cp.copy(MainCp);
pw := PrevPnl.Width - 2; pw := PrevPnl.Width - 2;
ph := PrevPnl.Height - 2; ph := PrevPnl.Height - 2;
cp.copy(MainCp);
if (cp.width / cp.height) > (PrevPnl.Width / PrevPnl.Height) then if (cp.width / cp.height) > (PrevPnl.Width / PrevPnl.Height) then
begin begin
PreviewImage.Width := pw; PreviewImage.Width := pw;
@ -333,16 +332,19 @@ begin
PreviewImage.Left := 1; PreviewImage.Left := 1;
PreviewImage.Top := (ph - PreviewImage.Height) div 2; PreviewImage.Top := (ph - PreviewImage.Height) div 2;
end end
else else begin
begin
PreviewImage.Height := ph; PreviewImage.Height := ph;
r := cp.height / PreviewImage.height; r := cp.height / PreviewImage.height;
PreviewImage.Width := round(cp.Width / r); PreviewImage.Width := round(cp.Width / r);
PreviewImage.Top := 1; PreviewImage.Top := 1;
PreviewImage.Left := (pw - PreviewImage.Width) div 2; PreviewImage.Left := (pw - PreviewImage.Width) div 2;
end; end;
cp.cmap := MainCp.cmap;
AdjustScale(cp, PreviewImage.Width, PreviewImage.Height); AdjustScale(cp, PreviewImage.Width, PreviewImage.Height);
cp.cmap := MainCp.cmap;
if not PreviewOnly then begin //***
// zoom := MainForm.zoom; // zoom := MainForm.zoom;
// cp.zoom := zoom; // cp.zoom := zoom;
Resetting := True; // So the preview doesn't get drawn with these changes.. Resetting := True; // So the preview doesn't get drawn with these changes..
@ -368,14 +370,14 @@ begin
// gradient // gradient
if cp.cmapindex >= 0 then if cp.cmapindex >= 0 then
cmbPalette.ItemIndex := cp.cmapindex; cmbPalette.ItemIndex := cp.cmapindex;
// ScrollBar.Position := 0; ScrollBar.Position := 0;
Palette := cp.cmap; Palette := cp.cmap;
BackupPal := cp.cmap; BackupPal := cp.cmap;
Resetting := False; Resetting := False;
DrawPreview;
//DrawPalette; end; //***
DrawPreview;
end; end;
procedure TAdjustForm.UpdateFlame; procedure TAdjustForm.UpdateFlame;
@ -398,7 +400,8 @@ var
Row: pRGBTripleArray; Row: pRGBTripleArray;
BitMap: TBitMap; BitMap: TBitMap;
begin begin
if not Resetting then begin if Resetting then exit;
Render.Stop; Render.Stop;
// AdjustScale(cp, PreviewImage.Width, PreviewImage.Height); // AdjustScale(cp, PreviewImage.Width, PreviewImage.Height);
cp.sample_density := PreviewDensity; cp.sample_density := PreviewDensity;
@ -413,8 +416,7 @@ begin
BM.Assign(Render.GetImage); BM.Assign(Render.GetImage);
PreviewImage.Picture.Graphic := bm; PreviewImage.Picture.Graphic := bm;
if mnuInstantPreview.Checked then if mnuInstantPreview.Checked then PreviewImage.Refresh;
PreviewImage.Refresh;
//--begin DrawPalette //--begin DrawPalette
BitMap := TBitMap.Create; BitMap := TBitMap.Create;
@ -422,17 +424,14 @@ begin
Bitmap.PixelFormat := pf24bit; Bitmap.PixelFormat := pf24bit;
BitMap.Width := 256; BitMap.Width := 256;
BitMap.Height := 1; BitMap.Height := 1;
Row := Bitmap.Scanline[0]; Row := Bitmap.Scanline[0];
for i := 0 to 255 do for i := 0 to 255 do
begin
with Row[i] do with Row[i] do
begin begin
rgbtRed := Palette[i][0]; rgbtRed := Palette[i][0];
rgbtGreen := Palette[i][1]; rgbtGreen := Palette[i][1];
rgbtBlue := Palette[i][2]; rgbtBlue := Palette[i][2];
end; end;
end;
GradientImage.Picture.Graphic := Bitmap; GradientImage.Picture.Graphic := Bitmap;
GradientImage.Refresh; GradientImage.Refresh;
@ -441,7 +440,6 @@ begin
end; end;
//--end DrawPalette //--end DrawPalette
end; end;
end;
procedure TAdjustForm.FormCreate(Sender: TObject); procedure TAdjustForm.FormCreate(Sender: TObject);
begin begin
@ -494,23 +492,6 @@ begin
Render.free; Render.free;
end; end;
{
procedure TAdjustForm.btnOKClick(Sender: TObject);
begin
ModalResult := mrOK;
end;
procedure TAdjustForm.btnCancelClick(Sender: TObject);
begin
ModalResult := mrCancel;
end;
procedure TAdjustForm.btnCanelClick(Sender: TObject);
begin
ModalResult := mrCancel;
end;
}
procedure TAdjustForm.FormShow(Sender: TObject); procedure TAdjustForm.FormShow(Sender: TObject);
var var
Registry: TRegistry; Registry: TRegistry;
@ -535,7 +516,6 @@ begin
if Registry.OpenKey('Software\' + APP_NAME + '\ImageSizePresets', False) then if Registry.OpenKey('Software\' + APP_NAME + '\ImageSizePresets', False) then
begin begin
// --Zueuk-- // image size presets
for i:=1 to 3 do begin for i:=1 to 3 do begin
strx:='Preset'+IntToStr(i)+'Left'; strx:='Preset'+IntToStr(i)+'Left';
stry:='Preset'+IntToStr(i)+'Top'; stry:='Preset'+IntToStr(i)+'Top';
@ -1044,8 +1024,7 @@ begin
if EditForm.visible then EditForm.UpdateDisplay; if EditForm.visible then EditForm.UpdateDisplay;
if MutateForm.Visible then MutateForm.UpdateDisplay; if MutateForm.Visible then MutateForm.UpdateDisplay;
if mnuInstantPreview.Checked then if mnuInstantPreview.Checked then DrawPreview;
DrawPreview; //hmm
MainForm.RedrawTimer.enabled := true; MainForm.RedrawTimer.enabled := true;
end; end;
@ -1086,10 +1065,10 @@ begin
BackupPal := Pal; BackupPal := Pal;
// DrawPalette; // DrawPalette;
cp.copy(MainCp); cp.cmap := pal;
// cp.copy(MainCp);
if mnuInstantPreview.Checked then if mnuInstantPreview.Checked then DrawPreview;
DrawPreview; //hmm
end; end;
procedure HSVToRGB(H, S, V: real; var Rb, Gb, Bb: integer); procedure HSVToRGB(H, S, V: real; var Rb, Gb, Bb: integer);
@ -1333,18 +1312,15 @@ var
intens, i, r, g, b: integer; intens, i, r, g, b: integer;
h, s, v: real; h, s, v: real;
begin begin
GradientChanged:=true; // hmm
lblVal.Caption := IntToStr(ScrollBar.Position); lblVal.Caption := IntToStr(ScrollBar.Position);
lblVal.Refresh; lblVal.Refresh;
{
wtf???? this is ridiculous!
=>> if btnMenu.Caption = 'Hue' then <<= (and 6 more like this follows...) if Resetting then exit;
}
GradientChanged:=true; // hmm
case scrollMode of case scrollMode of
modeHue: modeHue:
begin
for i := 0 to 255 do for i := 0 to 255 do
begin begin
RGBToHSV(BackupPal[i][0], BackupPal[i][1], BackupPal[i][2], h, s, v); RGBToHSV(BackupPal[i][0], BackupPal[i][1], BackupPal[i][2], h, s, v);
@ -1354,19 +1330,16 @@ begin
HSVToRGB(h, s, v, Palette[i][0], Palette[i][1], Palette[i][2]); HSVToRGB(h, s, v, Palette[i][0], Palette[i][1], Palette[i][2]);
end; end;
end; end;
end;
modeSaturation: modeSaturation:
begin
for i := 0 to 255 do for i := 0 to 255 do
begin begin
RGBToHSV(BackupPal[i][0], BackupPal[i][1], BackupPal[i][2], h, s, v); RGBToHSV(BackupPal[i][0], BackupPal[i][1], BackupPal[i][2], h, s, v);
// if s <> 0 then // --Z-- //(?) if s <> 0 then // --Z-- //(?)
// begin begin
s := s + ScrollBar.Position; s := s + ScrollBar.Position;
if s > 100 then s := 100; if s > 100 then s := 100;
if s < 0 then s := 0; if s < 0 then s := 0;
HSVToRGB(h, s, v, Palette[i][0], Palette[i][1], Palette[i][2]); HSVToRGB(h, s, v, Palette[i][0], Palette[i][1], Palette[i][2]);
// end;
end; end;
end; end;
modeContrast: modeContrast:
@ -1389,9 +1362,7 @@ begin
Palette[i][2] := b; Palette[i][2] := b;
end; end;
end; end;
// if btnMenu.Caption = 'Brightness' then
modeBrightness: modeBrightness:
begin
for i := 0 to 255 do for i := 0 to 255 do
begin begin
Palette[i][0] := BackupPal[i][0] + ScrollBar.Position; Palette[i][0] := BackupPal[i][0] + ScrollBar.Position;
@ -1404,29 +1375,19 @@ modeBrightness:
if Palette[i][2] > 255 then Palette[i][2] := 255; if Palette[i][2] > 255 then Palette[i][2] := 255;
if Palette[i][2] < 0 then Palette[i][2] := 0; if Palette[i][2] < 0 then Palette[i][2] := 0;
end; end;
end;
modeRotate: modeRotate:
begin
for i := 0 to 255 do for i := 0 to 255 do
begin begin
Palette[i][0] := BackupPal[(255 + i - ScrollBar.Position) mod 256][0]; Palette[i][0] := BackupPal[(255 + i - ScrollBar.Position) mod 256][0];
Palette[i][1] := BackupPal[(255 + i - ScrollBar.Position) mod 256][1]; Palette[i][1] := BackupPal[(255 + i - ScrollBar.Position) mod 256][1];
Palette[i][2] := BackupPal[(255 + i - ScrollBar.Position) mod 256][2]; Palette[i][2] := BackupPal[(255 + i - ScrollBar.Position) mod 256][2];
end; end;
end;
// if scrollMode = modeBlur then
// if btnMenu.Caption = 'Blur' then
modeBlur: modeBlur:
begin
Palette := Blur(ScrollBar.Position, BackupPal); Palette := Blur(ScrollBar.Position, BackupPal);
end;
// if scrollMode = modeFrequency then
modeFrequency: modeFrequency:
begin
Palette := Frequency(ScrollBar.Position, BackupPal); Palette := Frequency(ScrollBar.Position, BackupPal);
end; end;
end;
// DrawPalette;
cp.cmap:=Palette; cp.cmap:=Palette;
DrawPreview; DrawPreview;
end; end;

View File

@ -1930,6 +1930,7 @@ begin
end; end;
end; end;
// I don't like this... :-/
for j := -1 to Result-1 do for j := -1 to Result-1 do
for i := 0 to 2 do for i := 0 to 2 do
triangles[j].y[i] := -triangles[j].y[i]; triangles[j].y[i] := -triangles[j].y[i];

View File

@ -1,8 +1,8 @@
object EditForm: TEditForm object EditForm: TEditForm
Left = 350 Left = 279
Top = 163 Top = 240
Width = 586 Width = 586
Height = 586 Height = 576
Caption = 'Transform Editor' Caption = 'Transform Editor'
Color = clBtnFace Color = clBtnFace
Constraints.MinHeight = 400 Constraints.MinHeight = 400
@ -54,7 +54,7 @@ object EditForm: TEditForm
TextHeight = 13 TextHeight = 13
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Top = 544 Top = 533
Width = 578 Width = 578
Height = 15 Height = 15
Panels = < Panels = <
@ -265,92 +265,19 @@ object EditForm: TEditForm
ShowHint = True ShowHint = True
end end
end end
object PreviewToolBar: TToolBar
Left = 443
Top = 1
Width = 134
Height = 22
Align = alRight
Caption = 'PreviewToolBar'
EdgeBorders = []
Flat = True
Images = MainForm.Buttons
TabOrder = 1
Visible = False
object tbFullView: TToolButton
Left = 0
Top = 0
Caption = 'tbFullView'
ImageIndex = 52
OnClick = tbFullViewClick
end
object ToolButton7: TToolButton
Left = 23
Top = 0
Width = 8
Caption = 'ToolButton7'
ImageIndex = 3
Style = tbsSeparator
end
object tbLowQ: TToolButton
Left = 31
Top = 0
Caption = 'tbLowQ'
Grouped = True
ImageIndex = 45
Style = tbsCheck
OnClick = mnuLowQualityClick
end
object tbMedQ: TToolButton
Left = 54
Top = 0
Caption = 'tbMedQ'
Down = True
Grouped = True
ImageIndex = 45
Style = tbsCheck
OnClick = mnuMediumQualityClick
end
object tbHiQ: TToolButton
Left = 77
Top = 0
Caption = 'tbHiQ'
Grouped = True
ImageIndex = 45
Style = tbsCheck
OnClick = mnuHighQualityClick
end
object ToolButton9: TToolButton
Left = 100
Top = 0
Width = 8
Caption = 'ToolButton9'
ImageIndex = 14
Style = tbsSeparator
end
object tbResetLoc: TToolButton
Left = 108
Top = 0
Hint = 'Reset location on/off'
Caption = 'tbResetLoc'
Down = True
ImageIndex = 12
OnClick = mnuResetLocClick
end
end
end end
object EditPnl: TPanel object EditPnl: TPanel
Left = 0 Left = 0
Top = 24 Top = 24
Width = 578 Width = 578
Height = 520 Height = 509
Align = alClient Align = alClient
TabOrder = 1 TabOrder = 1
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 396 Left = 396
Top = 1 Top = 1
Width = 9 Width = 9
Height = 518 Height = 507
Align = alRight Align = alRight
AutoSnap = False AutoSnap = False
Beveled = True Beveled = True
@ -361,7 +288,7 @@ object EditForm: TEditForm
Left = 1 Left = 1
Top = 1 Top = 1
Width = 395 Width = 395
Height = 518 Height = 507
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
Color = clAppWorkSpace Color = clAppWorkSpace
@ -371,14 +298,14 @@ object EditForm: TEditForm
Left = 405 Left = 405
Top = 1 Top = 1
Width = 172 Width = 172
Height = 518 Height = 507
Align = alRight Align = alRight
Alignment = taLeftJustify Alignment = taLeftJustify
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 1 TabOrder = 1
object Splitter2: TSplitter object Splitter2: TSplitter
Left = 0 Left = 0
Top = 128 Top = 130
Width = 172 Width = 172
Height = 8 Height = 8
Cursor = crVSplit Cursor = crVSplit
@ -392,7 +319,7 @@ object EditForm: TEditForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 172 Width = 172
Height = 128 Height = 130
Align = alTop Align = alTop
BevelOuter = bvLowered BevelOuter = bvLowered
Color = clAppWorkSpace Color = clAppWorkSpace
@ -401,17 +328,16 @@ object EditForm: TEditForm
Left = 1 Left = 1
Top = 1 Top = 1
Width = 170 Width = 170
Height = 126 Height = 130
IncrementalDisplay = True IncrementalDisplay = True
PopupMenu = QualityPopup PopupMenu = QualityPopup
OnDblClick = PreviewImageDblClick
end end
end end
object ControlPanel: TPanel object ControlPanel: TPanel
Left = 0 Left = 0
Top = 136 Top = 138
Width = 172 Width = 172
Height = 382 Height = 369
Align = alClient Align = alClient
TabOrder = 0 TabOrder = 0
object lblTransform: TLabel object lblTransform: TLabel
@ -442,10 +368,10 @@ object EditForm: TEditForm
end end
object PageControl: TPageControl object PageControl: TPageControl
Left = 1 Left = 1
Top = 27 Top = 24
Width = 170 Width = 170
Height = 354 Height = 344
ActivePage = tabXForm ActivePage = TriangleTab
Align = alBottom Align = alBottom
Anchors = [akLeft, akTop, akRight, akBottom] Anchors = [akLeft, akTop, akRight, akBottom]
MultiLine = True MultiLine = True
@ -457,7 +383,7 @@ object EditForm: TEditForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 162 Width = 162
Height = 308 Height = 298
HorzScrollBar.Visible = False HorzScrollBar.Visible = False
VertScrollBar.Smooth = True VertScrollBar.Smooth = True
VertScrollBar.Style = ssFlat VertScrollBar.Style = ssFlat
@ -470,8 +396,8 @@ object EditForm: TEditForm
object TrianglePanel: TPanel object TrianglePanel: TPanel
Left = 0 Left = 0
Top = 0 Top = 0
Width = 158 Width = 162
Height = 305 Height = 277
BevelOuter = bvNone BevelOuter = bvNone
TabOrder = 0 TabOrder = 0
object Label9: TLabel object Label9: TLabel
@ -497,7 +423,7 @@ object EditForm: TEditForm
end end
object btTrgRotateRight: TSpeedButton object btTrgRotateRight: TSpeedButton
Left = 106 Left = 106
Top = 102 Top = 78
Width = 23 Width = 23
Height = 24 Height = 24
Hint = 'Rotate triangle clockwise' Hint = 'Rotate triangle clockwise'
@ -517,7 +443,7 @@ object EditForm: TEditForm
end end
object btTrgRotateLeft: TSpeedButton object btTrgRotateLeft: TSpeedButton
Left = 32 Left = 32
Top = 102 Top = 78
Width = 23 Width = 23
Height = 24 Height = 24
Hint = 'Rotate triangle counter clockwise' Hint = 'Rotate triangle counter clockwise'
@ -555,7 +481,7 @@ object EditForm: TEditForm
end end
object btTrgMoveUp: TSpeedButton object btTrgMoveUp: TSpeedButton
Left = 68 Left = 68
Top = 129 Top = 105
Width = 25 Width = 25
Height = 25 Height = 25
Hint = 'Move triangle up' Hint = 'Move triangle up'
@ -593,7 +519,7 @@ object EditForm: TEditForm
end end
object btTrgMoveRight: TSpeedButton object btTrgMoveRight: TSpeedButton
Left = 106 Left = 106
Top = 154 Top = 130
Width = 25 Width = 25
Height = 25 Height = 25
Hint = 'Move triangle right' Hint = 'Move triangle right'
@ -631,7 +557,7 @@ object EditForm: TEditForm
end end
object btTrgMoveLeft: TSpeedButton object btTrgMoveLeft: TSpeedButton
Left = 30 Left = 30
Top = 154 Top = 130
Width = 25 Width = 25
Height = 25 Height = 25
Hint = 'Move triangle left' Hint = 'Move triangle left'
@ -669,7 +595,7 @@ object EditForm: TEditForm
end end
object btTrgMoveDown: TSpeedButton object btTrgMoveDown: TSpeedButton
Left = 68 Left = 68
Top = 179 Top = 155
Width = 25 Width = 25
Height = 25 Height = 25
Hint = 'Move triangle down' Hint = 'Move triangle down'
@ -707,7 +633,7 @@ object EditForm: TEditForm
end end
object btTrgScaleUp: TSpeedButton object btTrgScaleUp: TSpeedButton
Left = 106 Left = 106
Top = 206 Top = 182
Width = 23 Width = 23
Height = 24 Height = 24
Hint = 'Scale triangle up' Hint = 'Scale triangle up'
@ -727,7 +653,7 @@ object EditForm: TEditForm
end end
object btTrgScaleDown: TSpeedButton object btTrgScaleDown: TSpeedButton
Left = 32 Left = 32
Top = 206 Top = 182
Width = 23 Width = 23
Height = 24 Height = 24
Hint = 'Scale triangle down' Hint = 'Scale triangle down'
@ -746,8 +672,8 @@ object EditForm: TEditForm
OnClick = btTrgScaleDownClick OnClick = btTrgScaleDownClick
end end
object btTrgRotateRight90: TSpeedButton object btTrgRotateRight90: TSpeedButton
Left = 132 Left = 130
Top = 102 Top = 78
Width = 23 Width = 23
Height = 24 Height = 24
Hint = 'Rotate triangle clockwise 90'#176 Hint = 'Rotate triangle clockwise 90'#176
@ -800,8 +726,8 @@ object EditForm: TEditForm
OnClick = btTrgRotateRight90Click OnClick = btTrgRotateRight90Click
end end
object btTrgRotateLeft90: TSpeedButton object btTrgRotateLeft90: TSpeedButton
Left = 6 Left = 8
Top = 102 Top = 78
Width = 23 Width = 23
Height = 24 Height = 24
Hint = 'Rotate triangle counter clockwise 90'#176 Hint = 'Rotate triangle counter clockwise 90'#176
@ -855,7 +781,7 @@ object EditForm: TEditForm
end end
object btTrgMoveLU: TSpeedButton object btTrgMoveLU: TSpeedButton
Left = 42 Left = 42
Top = 129 Top = 105
Width = 25 Width = 25
Height = 25 Height = 25
Hint = 'Move triangle left-up' Hint = 'Move triangle left-up'
@ -893,7 +819,7 @@ object EditForm: TEditForm
end end
object btTrgMoveLD: TSpeedButton object btTrgMoveLD: TSpeedButton
Left = 42 Left = 42
Top = 179 Top = 155
Width = 25 Width = 25
Height = 25 Height = 25
Hint = 'Move triangle left-down' Hint = 'Move triangle left-down'
@ -931,7 +857,7 @@ object EditForm: TEditForm
end end
object btTrgMoveRU: TSpeedButton object btTrgMoveRU: TSpeedButton
Left = 94 Left = 94
Top = 129 Top = 105
Width = 25 Width = 25
Height = 25 Height = 25
Hint = 'Move triangle right-up' Hint = 'Move triangle right-up'
@ -969,7 +895,7 @@ object EditForm: TEditForm
end end
object btTrgMoveRD: TSpeedButton object btTrgMoveRD: TSpeedButton
Left = 94 Left = 94
Top = 179 Top = 155
Width = 25 Width = 25
Height = 25 Height = 25
Hint = 'Move triangle right-down' Hint = 'Move triangle right-down'
@ -1008,7 +934,7 @@ object EditForm: TEditForm
object txtCy: TEdit object txtCy: TEdit
Left = 88 Left = 88
Top = 52 Top = 52
Width = 66 Width = 65
Height = 21 Height = 21
AutoSelect = False AutoSelect = False
TabOrder = 5 TabOrder = 5
@ -1071,19 +997,9 @@ object EditForm: TEditForm
OnExit = CornerEditExit OnExit = CornerEditExit
OnKeyPress = CornerEditKeyPress OnKeyPress = CornerEditKeyPress
end end
object chkPreserve: TCheckBox
Left = 32
Top = 80
Width = 105
Height = 17
Caption = 'Preserve weights'
Checked = True
State = cbChecked
TabOrder = 6
end
object rgPivot: TRadioGroup object rgPivot: TRadioGroup
Left = 16 Left = 16
Top = 240 Top = 210
Width = 129 Width = 129
Height = 65 Height = 65
BiDiMode = bdLeftToRight BiDiMode = bdLeftToRight
@ -1099,18 +1015,18 @@ object EditForm: TEditForm
'( 0; 0 )') '( 0; 0 )')
ParentBiDiMode = False ParentBiDiMode = False
ParentCtl3D = False ParentCtl3D = False
TabOrder = 7 TabOrder = 6
OnClick = rgPivotClicked OnClick = rgPivotClicked
end end
object txtTrgMoveValue: TComboBox object txtTrgMoveValue: TComboBox
Left = 56 Left = 56
Top = 156 Top = 132
Width = 49 Width = 49
Height = 21 Height = 21
AutoComplete = False AutoComplete = False
ItemHeight = 13 ItemHeight = 13
ItemIndex = 3 ItemIndex = 3
TabOrder = 9 TabOrder = 8
Text = '0.1' Text = '0.1'
OnExit = txtValidateValue OnExit = txtValidateValue
OnKeyPress = txtValKeyPress OnKeyPress = txtValKeyPress
@ -1125,13 +1041,12 @@ object EditForm: TEditForm
end end
object txtTrgRotateValue: TComboBox object txtTrgRotateValue: TComboBox
Left = 56 Left = 56
Top = 104 Top = 80
Width = 49 Width = 49
Height = 21 Height = 21
AutoComplete = False AutoComplete = False
ItemHeight = 13 ItemHeight = 13
ItemIndex = 1 TabOrder = 7
TabOrder = 8
Text = '15' Text = '15'
OnExit = txtValidateValue OnExit = txtValidateValue
OnKeyPress = txtValKeyPress OnKeyPress = txtValKeyPress
@ -1140,23 +1055,24 @@ object EditForm: TEditForm
'15' '15'
'30' '30'
'45' '45'
'60'
'90' '90'
'120'
'180') '180')
end end
object txtTrgScaleValue: TComboBox object txtTrgScaleValue: TComboBox
Left = 56 Left = 56
Top = 208 Top = 184
Width = 49 Width = 49
Height = 21 Height = 21
AutoComplete = False AutoComplete = False
ItemHeight = 13 ItemHeight = 13
ItemIndex = 1 ItemIndex = 1
TabOrder = 10 TabOrder = 9
Text = '110' Text = '125'
OnExit = txtValidateValue OnExit = txtValidateValue
OnKeyPress = txtValKeyPress OnKeyPress = txtValKeyPress
Items.Strings = ( Items.Strings = (
'105'
'110' '110'
'125' '125'
'150' '150'
@ -1164,74 +1080,107 @@ object EditForm: TEditForm
'200') '200')
end end
end end
object chkPreserve: TCheckBox
Left = 30
Top = 280
Width = 105
Height = 17
Caption = 'Preserve weights'
Checked = True
State = cbChecked
TabOrder = 1
end
end end
end end
object tabXForm: TTabSheet object tabXForm: TTabSheet
Caption = 'Transform' Caption = 'Transform'
object lbla: TLabel
Left = 4
Top = 8
Width = 10
Height = 13
Caption = 'a:'
end
object Label1: TLabel
Left = 82
Top = 8
Width = 10
Height = 13
Caption = 'b:'
end
object Label2: TLabel
Left = 4
Top = 32
Width = 9
Height = 13
Caption = 'c:'
end
object Label3: TLabel
Left = 82
Top = 32
Width = 10
Height = 13
Caption = 'd:'
end
object Label4: TLabel
Left = 4
Top = 56
Width = 10
Height = 13
Caption = 'e:'
end
object Label5: TLabel
Left = 82
Top = 56
Width = 8
Height = 13
Caption = 'f:'
end
object Label6: TLabel object Label6: TLabel
Left = 36 Left = 36
Top = 84 Top = 100
Width = 38 Width = 38
Height = 13 Height = 13
Caption = 'Weight:' Caption = 'Weight:'
end end
object Label29: TLabel object Label29: TLabel
Left = 36 Left = 36
Top = 108 Top = 124
Width = 52 Width = 52
Height = 13 Height = 13
Caption = 'Symmetry:' Caption = 'Symmetry:'
end end
object btnResetCoefs: TSpeedButton
Left = 8
Top = 148
Width = 145
Height = 22
Hint = 'Reset all vectors to default'
Caption = 'Reset Coefs'
ParentShowHint = False
ShowHint = False
OnClick = mnuResetClick
end
object btnXcoefs: TSpeedButton
Left = 8
Top = 4
Width = 25
Height = 21
Hint = 'Reset point A'
Caption = 'A'
ParentShowHint = False
ShowHint = False
OnClick = btnXcoefsClick
end
object btnYcoefs: TSpeedButton
Left = 8
Top = 28
Width = 25
Height = 21
Hint = 'Reset point C'
Caption = 'C'
ParentShowHint = False
ShowHint = False
OnClick = btnYcoefsClick
end
object btnOcoefs: TSpeedButton
Left = 8
Top = 52
Width = 25
Height = 21
Hint = 'Reset point B'
Caption = 'B'
ParentShowHint = False
ShowHint = False
OnClick = btnOcoefsClick
end
object btnCoefsRect: TSpeedButton
Left = 8
Top = 76
Width = 71
Height = 17
GroupIndex = 1
Down = True
Caption = 'Rectangular'
Flat = True
OnClick = btnCoefsModeClick
end
object btnCoefsPolar: TSpeedButton
Left = 82
Top = 76
Width = 71
Height = 17
GroupIndex = 1
Caption = 'Polar (deg)'
Flat = True
OnClick = btnCoefsModeClick
end
object txtA: TEdit object txtA: TEdit
Left = 20 Left = 36
Top = 4 Top = 4
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 0 TabOrder = 0
Text = '0' Text = '0'
OnExit = CoefExit OnExit = CoefValidate
OnKeyPress = CoefKeyPress OnKeyPress = CoefKeyPress
end end
object txtB: TEdit object txtB: TEdit
@ -1241,17 +1190,17 @@ object EditForm: TEditForm
Height = 21 Height = 21
TabOrder = 1 TabOrder = 1
Text = '0' Text = '0'
OnExit = CoefExit OnExit = CoefValidate
OnKeyPress = CoefKeyPress OnKeyPress = CoefKeyPress
end end
object txtC: TEdit object txtC: TEdit
Left = 20 Left = 36
Top = 28 Top = 28
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 2 TabOrder = 2
Text = '0' Text = '0'
OnExit = CoefExit OnExit = CoefValidate
OnKeyPress = CoefKeyPress OnKeyPress = CoefKeyPress
end end
object txtD: TEdit object txtD: TEdit
@ -1261,17 +1210,17 @@ object EditForm: TEditForm
Height = 21 Height = 21
TabOrder = 3 TabOrder = 3
Text = '0' Text = '0'
OnExit = CoefExit OnExit = CoefValidate
OnKeyPress = CoefKeyPress OnKeyPress = CoefKeyPress
end end
object txtE: TEdit object txtE: TEdit
Left = 20 Left = 36
Top = 52 Top = 52
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 4 TabOrder = 4
Text = '0' Text = '0'
OnExit = CoefExit OnExit = CoefValidate
OnKeyPress = CoefKeyPress OnKeyPress = CoefKeyPress
end end
object txtF: TEdit object txtF: TEdit
@ -1281,12 +1230,12 @@ object EditForm: TEditForm
Height = 21 Height = 21
TabOrder = 5 TabOrder = 5
Text = '0' Text = '0'
OnExit = CoefExit OnExit = CoefValidate
OnKeyPress = CoefKeyPress OnKeyPress = CoefKeyPress
end end
object txtP: TEdit object txtP: TEdit
Left = 96 Left = 96
Top = 80 Top = 96
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 6 TabOrder = 6
@ -1296,7 +1245,7 @@ object EditForm: TEditForm
end end
object txtSymmetry: TEdit object txtSymmetry: TEdit
Left = 96 Left = 96
Top = 104 Top = 120
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 7 TabOrder = 7
@ -1311,7 +1260,7 @@ object EditForm: TEditForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 162 Width = 162
Height = 308 Height = 298
Align = alClient Align = alClient
ScrollBars = ssVertical ScrollBars = ssVertical
TabOrder = 0 TabOrder = 0
@ -1337,7 +1286,7 @@ object EditForm: TEditForm
Left = 0 Left = 0
Top = 0 Top = 0
Width = 162 Width = 162
Height = 308 Height = 298
Align = alClient Align = alClient
ScrollBars = ssVertical ScrollBars = ssVertical
TabOrder = 0 TabOrder = 0
@ -1543,20 +1492,6 @@ object EditForm: TEditForm
ImageIndex = 1 ImageIndex = 1
OnClick = mnuAddClick OnClick = mnuAddClick
end end
object MenuItem2: TMenuItem
Caption = '-'
end
object mnuReset: TMenuItem
Caption = 'Reset Triangle'
Hint = 'Reset triangle to reference position'
OnClick = mnuResetClick
end
object mnuResetAll: TMenuItem
Caption = 'Reset All'
Hint = 'Reset all triangles to reference position'
ImageIndex = 0
OnClick = mnuResetAllClick
end
object N4: TMenuItem object N4: TMenuItem
Caption = '-' Caption = '-'
end end
@ -1640,7 +1575,7 @@ object EditForm: TEditForm
Left = 353 Left = 353
Top = 80 Top = 80
Bitmap = { Bitmap = {
494C01010E001300040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 494C01010E001300040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000005000000001002000000000000050 0000000000003600000028000000400000005000000001002000000000000050
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -1916,7 +1851,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
000000000000000000005C5C5C00000000000000000000000000000000000000 000000000000000000005C5C5C00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000005C5C5C000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000008000000000000000000000000000 0000000000000000000000000000000000008000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -1924,8 +1859,8 @@ object EditForm: TEditForm
5C00000000000000000000000000000000000000000000000000000000005C5C 5C00000000000000000000000000000000000000000000000000000000005C5C
5C00000000000000000000000000000000000000000000000000000000000000 5C00000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000005C5C5C000000000000000000000000000000 00000000000000000000000000005C5C5C000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000005C5C
00005C5C5C000000000000000000000000000000000000000000000000000000 5C00000000005C5C5C0000000000000000000000000000000000000000000000
0000000000000000000000000000000000008000000080000000000000000000 0000000000000000000000000000000000008000000080000000000000000000
0000000000000000000000000000800080000000000000000000000000000000 0000000000000000000000000000800080000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -1933,7 +1868,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000600000006000000000000000000000005C5C5C0000000000000000000000 0000600000006000000000000000000000005C5C5C0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000005C5C5C0000000000000000000000000000000000000000000000 00005C5C5C00000000005C5C5C00000000000000000000000000000000000000
0000000000000000000000000000000000008000000080606000800000000000 0000000000000000000000000000000000008000000080606000800000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000005C5C5C0000000000000000000000000000000000000000000000 0000000000005C5C5C0000000000000000000000000000000000000000000000
@ -1941,7 +1876,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000006000 0000000000000000000000000000000000000000000000000000000000006000
000000000000000000000000000000000000000000005C5C5C00000000000000 000000000000000000000000000000000000000000005C5C5C00000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
000000000000000000005C5C5C00000000000000000000000000000000000000 0000000000005C5C5C00000000005C5C5C000000000000000000000000000000
0000000000000000000000000000000000008000000000000000806060008000 0000000000000000000000000000000000008000000000000000806060008000
0000000000000000000000000000800080000000000000000000000000000000 0000000000000000000000000000800080000000000000000000000000000000
00005C5C5C000000000000000000000000000000000000000000000000000000 00005C5C5C000000000000000000000000000000000000000000000000000000
@ -1949,7 +1884,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000006000 0000000000000000000000000000000000000000000000000000000000006000
00000000000000000000000000000000000000000000000000005C5C5C000000 00000000000000000000000000000000000000000000000000005C5C5C000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000005C5C5C000000000000000000000000000000 000000000000000000005C5C5C00000000005C5C5C0000000000000000000000
0000000000000000000000000000000000008000000000000000000000008060 0000000000000000000000000000000000008000000000000000000000008060
6000800000000000000000000000000000000000000000000000000000005C5C 6000800000000000000000000000000000000000000000000000000000005C5C
5C00000000000000000000000000000000000000000000000000000000000000 5C00000000000000000000000000000000000000000000000000000000000000
@ -1957,7 +1892,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000600000000000 0000000000000000000000000000000000000000000000000000600000000000
0000000000000000000000000000000000000000000000000000000000005C5C 0000000000000000000000000000000000000000000000000000000000005C5C
5C00000000000000000000000000000000000000000000000000000000000000 5C00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000005C5C5C0000000000000000000000 00000000000000000000000000005C5C5C00000000005C5C5C00000000000000
0000000000000000000000000000000000008000000000000000000000000000 0000000000000000000000000000000000008000000000000000000000000000
00008060600080000000000000008000800000000000000000005C5C5C000000 00008060600080000000000000008000800000000000000000005C5C5C000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
@ -1965,7 +1900,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000600000000000 0000000000000000000000000000000000000000000000000000600000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000005C5C5C00000000000000 0000000000000000000000000000000000005C5C5C00000000005C5C5C000000
0000000000000000000000000000000000008000000000000000000000000000 0000000000000000000000000000000000008000000000000000000000000000
000000000000806060008000000000000000000000005C5C5C00000000000000 000000000000806060008000000000000000000000005C5C5C00000000000000
0000000000000000000000000000000000008000800000000000800080000000 0000000000000000000000000000000000008000800000000000800080000000
@ -1973,24 +1908,24 @@ object EditForm: TEditForm
0000800080000000000080008000000000000000000000000000600000000000 0000800080000000000080008000000000000000000000000000600000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000005C5C5C000000 000000000000000000000000000000000000000000005C5C5C00000000005C5C
0000000000000000000000000000000000008000000000000000000000000000 5C00000000000000000000000000000000008000000000000000000000000000
00008060600080000000000000008000800000000000000000005C5C5C000000 00008060600080000000000000008000800000000000000000005C5C5C000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000800000000000000000000000000000000000 0000000000000000000000000000800000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000600000000000 0000000000000000000000000000000000000000000000000000600000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000005C5C 00000000000000000000000000000000000000000000000000005C5C5C000000
5C00000000000000000000000000000000008000000000000000000000008060 00005C5C5C000000000000000000000000008000000000000000000000008060
6000800000000000000000000000000000000000000000000000000000005C5C 6000800000000000000000000000000000000000000000000000000000005C5C
5C00000000000000000000000000000000000000000000000000000000000000 5C00000000000000000000000000000000000000000000000000000000000000
0000000000000000000080000000806060008000000000000000000000000000 0000000000000000000080000000806060008000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000006000 0000000000000000000000000000000000000000000000000000000000006000
0000000000000000000000000000000000000000000000000000600000006000 0000000000000000000000000000000000000000000000000000600000006000
0000600000006000000000000000000000000000000000000000000000000000 0000600000006000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000005C5C
00005C5C5C000000000000000000000000008000000000000000806060008000 5C00000000000000000000000000000000008000000000000000806060008000
0000000000000000000000000000800080000000000000000000000000000000 0000000000000000000000000000800080000000000000000000000000000000
00005C5C5C000000000000000000000000000000000000000000000000000000 00005C5C5C000000000000000000000000000000000000000000000000000000
0000000000008000000080606000000000008060600080000000000000000000 0000000000008000000080606000000000008060600080000000000000000000
@ -1998,7 +1933,7 @@ object EditForm: TEditForm
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000600000006000000000000000000000000000000000000000000000000000 0000600000006000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000008000000080606000800000000000 00005C5C5C000000000000000000000000008000000080606000800000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000005C5C5C0000000000000000000000000000000000000000000000 0000000000005C5C5C0000000000000000000000000000000000000000000000
0000800000008060600000000000000000000000000080606000800000000000 0000800000008060600000000000000000000000000080606000800000000000
@ -2006,7 +1941,7 @@ object EditForm: TEditForm
0000600000006000000000000000000000000000000000000000600000006000 0000600000006000000000000000000000000000000000000000600000006000
0000000000006000000000000000000000000000000000000000000000000000 0000000000006000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000008000000080000000000000000000 0000000000005C5C5C0000000000000000008000000080000000000000000000
0000000000000000000000000000800080000000000000000000000000000000 0000000000000000000000000000800080000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000008000 0000000000000000000000000000000000000000000000000000000000008000
0000806060000000000000000000000000000000000000000000806060008000 0000806060000000000000000000000000000000000000000000806060008000
@ -2293,9 +2228,9 @@ object EditForm: TEditForm
FF73F3E700000000FF73F3E700000000FB73000000000000F363F3E700000000 FF73F3E700000000FF73F3E700000000FB73000000000000F363F3E700000000
E007F3E700000000E00FF1C700000000F37FF80F00000000FB7FFC1F00000000 E007F3E700000000E00FF1C700000000F37FF80F00000000FB7FFC1F00000000
FF7FFFFF00000000FF7FFFFF00000000FFFFFFFFFFFFFFFFF0070001FEFF8003 FF7FFFFF00000000FF7FFFFF00000000FFFFFFFFFFFFFFFFF0070001FEFF8003
F9F780017FFDCFE7FCF7C7F93EF9E7CFF277E3F91FF1F39FEF37F1F94EE5F93F F9F79FFD7FFDCFE7FCF7C8053EF9E7CFF277E4F51FF1F39FEF37F2754EE5F93F
EF97F8F967CDFC7FDFC7FC79729DFEFFDFE7FE39793D5555DFF7FF19729DFEFF EF97F93567CDFC7FDFC7FC95729DFEFFDFE7FE45793D5555DFF7FF25729DFEFF
DFFFFF8967CDFC7FEFC3FFC14EE5F93FEFF3FFE11FF1F39FF3CBFFF13EF9E7CF DFFFFF9567CDFC7FEFC3FFCD4EE5F93FEFF3FFE51FF1F39FF3CBFFF13EF9E7CF
FC3BFFF97FFDCFE7FFFFFFFDFEFF8003FFFFFFFFFFCFFFFFFFFFFFFFFF87FEFF FC3BFFF97FFDCFE7FFFFFFFDFEFF8003FFFFFFFFFFCFFFFFFFFFFFFFFF87FEFF
FFFFFFFFF787FC7FFFFFFFFFF30FF83FFFF7EFFFF00FFEFFC1F7EF83F01FFEFF FFFFFFFFF787FC7FFFFFFFFFF30FF83FFFF7EFFFF00FFEFFC1F7EF83F01FFEFF
C3FBDFC3F003DEF7C7FBDFE3F0079EF3CBFBDFD3F00F0001DCF7EF3BF01F9EF3 C3FBDFC3F003DEF7C7FBDFE3F0079EF3CBFBDFD3F00F0001DCF7EF3BF01F9EF3
@ -2304,7 +2239,6 @@ object EditForm: TEditForm
C003E001E001E001C003F1F9F1F9F1F9C003F8F90009D8D9C003FC7980098C09 C003E001E001E001C003F1F9F1F9F1F9C003F8F90009D8D9C003FC7980098C09
C003F239C609C619C003F319E309E219C003F389F189F009C003F3C1F8C1F8C1 C003F239C609C619C003F319E309E219C003F389F189F009C003F3C1F8C1F8C1
C0030021FC41F061C0070031FE01E231C00FF3F9FF09C719C01FF3FDFF8D8F8D C0030021FC41F061C0070031FE01E231C00FF3F9FF09C719C01FF3FDFF8D8F8D
C03FF3FFFFCFDFDFFFFFF3FFFFEFFFFF00000000000000000000000000000000 C03FF3FFFFCFDFDFFFFFF3FFFFEFFFFF}
000000000000}
end end
end end

View File

@ -46,7 +46,6 @@ type
MenuItem1: TMenuItem; MenuItem1: TMenuItem;
mnuDelete: TMenuItem; mnuDelete: TMenuItem;
mnuDuplicate: TMenuItem; mnuDuplicate: TMenuItem;
MenuItem2: TMenuItem;
mnuAdd: TMenuItem; mnuAdd: TMenuItem;
mnuAutoZoom: TMenuItem; mnuAutoZoom: TMenuItem;
N1: TMenuItem; N1: TMenuItem;
@ -65,12 +64,6 @@ type
PageControl: TPageControl; PageControl: TPageControl;
TriangleTab: TTabSheet; TriangleTab: TTabSheet;
tabXForm: TTabSheet; tabXForm: TTabSheet;
lbla: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel; Label6: TLabel;
Label29: TLabel; Label29: TLabel;
txtA: TEdit; txtA: TEdit;
@ -106,7 +99,6 @@ type
Label9: TLabel; Label9: TLabel;
Label7: TLabel; Label7: TLabel;
Label11: TLabel; Label11: TLabel;
chkPreserve: TCheckBox;
btTrgRotateRight: TSpeedButton; btTrgRotateRight: TSpeedButton;
btTrgRotateLeft: TSpeedButton; btTrgRotateLeft: TSpeedButton;
btTrgMoveUp: TSpeedButton; btTrgMoveUp: TSpeedButton;
@ -148,21 +140,18 @@ type
Label8: TLabel; Label8: TLabel;
pnlGridColor1: TPanel; pnlGridColor1: TPanel;
pnlGridColor2: TPanel; pnlGridColor2: TPanel;
PreviewToolBar: TToolBar;
tbFullView: TToolButton;
tbLowQ: TToolButton;
tbMedQ: TToolButton;
ToolButton7: TToolButton;
tbResetLoc: TToolButton;
tbHiQ: TToolButton;
ToolButton9: TToolButton;
TabSheet4: TTabSheet; TabSheet4: TTabSheet;
vleVariables: TValueListEditor; vleVariables: TValueListEditor;
mnuReset: TMenuItem;
mnuResetAll: TMenuItem;
tbResetAll: TToolButton; tbResetAll: TToolButton;
Label10: TLabel; Label10: TLabel;
pnlHelpersColor: TPanel; pnlHelpersColor: TPanel;
btnResetCoefs: TSpeedButton;
btnXcoefs: TSpeedButton;
btnYcoefs: TSpeedButton;
btnOcoefs: TSpeedButton;
btnCoefsRect: TSpeedButton;
btnCoefsPolar: TSpeedButton;
chkPreserve: TCheckBox;
procedure ValidateVariable; procedure ValidateVariable;
procedure vleVariablesValidate(Sender: TObject; ACol, ARow: Integer; const KeyName, KeyValue: string); procedure vleVariablesValidate(Sender: TObject; ACol, ARow: Integer; const KeyName, KeyValue: string);
procedure vleVariablesKeyPress(Sender: TObject; var Key: Char); procedure vleVariablesKeyPress(Sender: TObject; var Key: Char);
@ -178,7 +167,7 @@ type
Shift: TShiftState; X, Y: integer); Shift: TShiftState; X, Y: integer);
procedure TriangleViewMouseWheel(Sender: TObject; Shift: TShiftState; procedure TriangleViewMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure TriangleViewDblClick(Sender: TObject); // procedure TriangleViewDblClick(Sender: TObject);
procedure TriangleViewKeyDown(Sender: TObject; var Key: Word; procedure TriangleViewKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
procedure TriangleViewKeyUp(Sender: TObject; var Key: Word; procedure TriangleViewKeyUp(Sender: TObject; var Key: Word;
@ -212,7 +201,7 @@ type
procedure mnuFlipHorizontalClick(Sender: TObject); procedure mnuFlipHorizontalClick(Sender: TObject);
procedure cbTransformsChange(Sender: TObject); procedure cbTransformsChange(Sender: TObject);
procedure CoefKeyPress(Sender: TObject; var Key: Char); procedure CoefKeyPress(Sender: TObject; var Key: Char);
procedure CoefExit(Sender: TObject); procedure CoefValidate(Sender: TObject);
procedure scrlXFormColorScroll(Sender: TObject; procedure scrlXFormColorScroll(Sender: TObject;
ScrollCode: TScrollCode; var ScrollPos: Integer); ScrollCode: TScrollCode; var ScrollPos: Integer);
procedure scrlXFormColorChange(Sender: TObject); procedure scrlXFormColorChange(Sender: TObject);
@ -242,7 +231,6 @@ type
procedure btTrgScaleDownClick(Sender: TObject); procedure btTrgScaleDownClick(Sender: TObject);
procedure splitterMoved(Sender: TObject); procedure splitterMoved(Sender: TObject);
procedure tbSelectClick(Sender: TObject); procedure tbSelectClick(Sender: TObject);
procedure PreviewImageDblClick(Sender: TObject);
procedure EditKeyPress(Sender: TObject; var Key: Char); procedure EditKeyPress(Sender: TObject; var Key: Char);
procedure rgPivotClicked(Sender: TObject); procedure rgPivotClicked(Sender: TObject);
procedure tbEditModeClick(Sender: TObject); procedure tbEditModeClick(Sender: TObject);
@ -269,7 +257,6 @@ type
Rect: TRect; State: TOwnerDrawState); Rect: TRect; State: TOwnerDrawState);
procedure tbFullViewClick(Sender: TObject); procedure tbFullViewClick(Sender: TObject);
{ {
procedure ColorImageMouseDown(Sender: TObject; Button: TMouseButton; procedure ColorImageMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
@ -285,6 +272,10 @@ type
procedure mnuResetClick(Sender: TObject); procedure mnuResetClick(Sender: TObject);
procedure mnuResetAllClick(Sender: TObject); procedure mnuResetAllClick(Sender: TObject);
procedure pnlHelpersColorClick(Sender: TObject); procedure pnlHelpersColorClick(Sender: TObject);
procedure btnXcoefsClick(Sender: TObject);
procedure btnYcoefsClick(Sender: TObject);
procedure btnOcoefsClick(Sender: TObject);
procedure btnCoefsModeClick(Sender: TObject);
private private
TriangleView: TCustomDrawControl; TriangleView: TCustomDrawControl;
@ -307,6 +298,11 @@ type
varDragPos, varDragOld: integer; varDragPos, varDragOld: integer;
varMM: boolean; //hack? varMM: boolean; //hack?
spinnerMode: boolean;
spinnerOld, spinnerPos: integer;
spinnerValue: double;
SpinnerAssoc: TEdit;
// --Z-- variables moved from outside // --Z-- variables moved from outside
GraphZoom: double; GraphZoom: double;
TriangleCaught, CornerCaught: boolean; TriangleCaught, CornerCaught: boolean;
@ -347,7 +343,8 @@ type
SelectedTriangle: integer; SelectedTriangle: integer;
procedure UpdateDisplay(preview_only: boolean = false); procedure UpdatePreview;
procedure UpdateDisplay(PreviewOnly: boolean = false); //(?)
procedure AutoZoom; procedure AutoZoom;
procedure TriangleViewPaint(Sender: TObject); procedure TriangleViewPaint(Sender: TObject);
end; end;
@ -372,7 +369,7 @@ function Centroid(t: TTriangle): TSPoint;
function OffsetTriangleRandom(t: TTriangle): TTriangle; function OffsetTriangleRandom(t: TTriangle): TTriangle;
function ScaleTriangleCenter(t: TTriangle; scale: double): TTriangle; function ScaleTriangleCenter(t: TTriangle; scale: double): TTriangle;
function ScaleTrianglePoint(t: TTriangle; x, y, scale: double): TTriangle; function ScaleTrianglePoint(t: TTriangle; x, y, scale: double): TTriangle;
procedure ScaleAll; //procedure ScaleAll;
implementation implementation
@ -489,6 +486,7 @@ begin
end; end;
end; end;
{
procedure ScaleAll; procedure ScaleAll;
var var
i, j: integer; i, j: integer;
@ -505,6 +503,7 @@ begin
MainTriangles[j].x[i] := MainTriangles[j].x[i] * 0.2; MainTriangles[j].x[i] := MainTriangles[j].x[i] * 0.2;
end; end;
end; end;
}
function RotateTriangleCenter(t: TTriangle; rad: double): TTriangle; function RotateTriangleCenter(t: TTriangle; rad: double): TTriangle;
var var
@ -549,22 +548,11 @@ begin
result := c[i][2] shl 16 + c[i][1] shl 8 + c[i][0]; result := c[i][2] shl 16 + c[i][1] shl 8 + c[i][0];
end; end;
procedure TEditForm.UpdateDisplay(preview_only: boolean = false); procedure TEditForm.UpdatePreview;
var var
i: integer;
pw, ph: integer; pw, ph: integer;
r: double; r: double;
begin begin
// currently EditForm does not really know if we selected another
// flame in the Main Window - which is kinda not good...
if NumXForms(cp) <> NumXForms(MainCp) then
begin
SelectedTriangle := 0;
mouseOverTriangle := -1;
end;
cp.copy(MainCp);
pw := PrevPnl.Width - 2; pw := PrevPnl.Width - 2;
ph := PrevPnl.Height - 2; ph := PrevPnl.Height - 2;
if (cp.width / cp.height) > (PrevPnl.Width / PrevPnl.Height) then if (cp.width / cp.height) > (PrevPnl.Width / PrevPnl.Height) then
@ -582,21 +570,53 @@ begin
PreviewImage.Top := 1; PreviewImage.Top := 1;
PreviewImage.Left := (pw - PreviewImage.Width) div 2; PreviewImage.Left := (pw - PreviewImage.Width) div 2;
end; end;
AdjustScale(cp, PreviewImage.Width, PreviewImage.Height); AdjustScale(cp, PreviewImage.Width, PreviewImage.Height);
DrawPreview; DrawPreview;
if preview_only then exit; end;
procedure TEditForm.UpdateDisplay(PreviewOnly: boolean = false);
var
i: integer;
pw, ph: integer;
r: double;
begin
// currently EditForm does not really know if we select another
// flame in the Main Window - which is not good...
{
if NumXForms(cp) <> NumXForms(MainCp) then
begin
SelectedTriangle := 0;
mouseOverTriangle := -1;
end;
}
cp.copy(MainCp);
if SelectedTriangle >= NumXForms(cp) then
begin
SelectedTriangle := NumXForms(cp)-1;
mouseOverTriangle := -1;
end;
UpdatePreview;
if PreviewOnly then exit;
cp.cmap := MainCp.cmap; cp.cmap := MainCp.cmap;
cmap := MainCp.cmap; cmap := MainCp.cmap;
cbTransforms.Clear; cbTransforms.Clear;
for i := 0 to Transforms - 1 do for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i));
cbTransforms.Items.Add(IntToStr(i + 1));
// just in case:
SetCaptureControl(nil);
HasChanged := false;
viewDragMode := false;
varDragMode := false;
CornerCaught := false;
TriangleCaught := false;
ShowSelectedInfo; ShowSelectedInfo;
AutoZoom; if MainForm.UndoIndex = 0 then AutoZoom // auto-zoom only on 'new' flame - hmm...?
else TriangleView.Invalidate;
end; end;
procedure TEditForm.DrawPreview; procedure TEditForm.DrawPreview;
@ -655,76 +675,73 @@ end;
procedure TEditForm.ShowSelectedInfo; procedure TEditForm.ShowSelectedInfo;
var var
t: integer;
i: integer; i: integer;
a, b, c, d, e, f: double;
v: double; v: double;
strval: string; strval: string;
begin begin
t := SelectedTriangle; // why 't' ? if (SelectedTriangle >= Transforms) then SelectedTriangle := Transforms - 1;
if (t >= Transforms) then t := Transforms - 1; cbTransforms.ItemIndex := SelectedTriangle;
//if EditForm.cbTransforms.ItemIndex <> t then EditForm.cbTransforms.ItemIndex := t; cbTransforms.Refresh;
EditForm.cbTransforms.ItemIndex := t;
//select combobox item
EditForm.txtAx.text := Format('%.6g', [MainTriangles[t].x[0]]);
EditForm.txtAy.text := Format('%.6g', [MainTriangles[t].y[0]]);
EditForm.txtBx.text := Format('%.6g', [MainTriangles[t].x[1]]);
EditForm.txtBy.text := Format('%.6g', [MainTriangles[t].y[1]]);
EditForm.txtCx.text := Format('%.6g', [MainTriangles[t].x[2]]);
EditForm.txtCy.text := Format('%.6g', [MainTriangles[t].y[2]]);
EditForm.lblTransform.Refresh;
EditForm.txtAx.Refresh;
EditForm.txtAy.Refresh;
EditForm.txtBx.Refresh;
EditForm.txtBy.Refresh;
EditForm.txtCx.Refresh;
EditForm.txtCy.Refresh;
a := EditForm.cp.xform[t].c[0][0];
b := EditForm.cp.xform[t].c[1][0];
c := EditForm.cp.xform[t].c[0][1];
d := EditForm.cp.xform[t].c[1][1];
e := EditForm.cp.xform[t].c[2][0];
f := EditForm.cp.xform[t].c[2][1];
EditForm.txtA.text := Format('%.6g', [a]); with MainTriangles[SelectedTriangle] do
EditForm.txtB.text := Format('%.6g', [b]); begin
EditForm.txtC.text := Format('%.6g', [c]); txtAx.text := Format('%.6g', [x[0]]);
EditForm.txtD.text := Format('%.6g', [d]); txtAy.text := Format('%.6g', [y[0]]);
EditForm.txtE.text := Format('%.6g', [e]); txtBx.text := Format('%.6g', [x[1]]);
EditForm.txtF.text := Format('%.6g', [f]); txtBy.text := Format('%.6g', [y[1]]);
txtCx.text := Format('%.6g', [x[2]]);
txtCy.text := Format('%.6g', [y[2]]);
end;
EditForm.txtP.text := Format('%.6g', [EditForm.cp.xform[t].density]); with cp.xform[SelectedTriangle] do
EditForm.txtSymmetry.text := Format('%.6g', [EditForm.cp.xform[t].symmetry]); begin
EditForm.txtA.Refresh; // OMG. and now these coefs are stored with inverse sign? :-\
EditForm.txtB.Refresh; if btnCoefsRect.Down then begin
EditForm.txtC.Refresh; txtA.text := Format('%.6g', [ c[0][0]]);
EditForm.txtD.Refresh; txtB.text := Format('%.6g', [-c[0][1]]);
EditForm.txtE.Refresh; txtC.text := Format('%.6g', [-c[1][0]]);
EditForm.txtF.Refresh; txtD.text := Format('%.6g', [ c[1][1]]);
EditForm.txtP.Refresh; txtE.text := Format('%.6g', [ c[2][0]]);
EditForm.pnlXFormColor.Color := ColorValToColor(EditForm.cp.cmap, EditForm.cp.xform[t].color); txtF.text := Format('%.6g', [-c[2][1]]);
EditForm.txtXFormColor.Text := Format('%1.3f', [cp.xform[t].color]);//FloatToStr(EditForm.cp.xform[t].color); end
EditForm.scrlXFormcolor.Position := Trunc(EditForm.cp.xform[t].color * scrlXFormColor.Max); else begin
txtA.text := Format('%.6g', [Hypot(c[0][0], c[0][1])]);
txtB.text := Format('%.6g', [arctan2(-c[0][1], c[0][0])*180/PI]);
txtC.text := Format('%.6g', [Hypot(c[1][0], c[1][1])]);
txtD.text := Format('%.6g', [arctan2(c[1][1], -c[1][0])*180/PI]);
txtE.text := Format('%.6g', [Hypot(c[2][0], c[2][1])]);
txtF.text := Format('%.6g', [arctan2(-c[2][1], c[2][0])*180/PI]);
end;
txtP.text := Format('%.6g', [density]);
txtSymmetry.text := Format('%.6g', [symmetry]);
pnlXFormColor.Color := ColorValToColor(cp.cmap, color);
txtXFormColor.Text := Format('%1.3f', [color]);
scrlXFormcolor.Position := Trunc(color * scrlXFormColor.Max);
for i := 0 to NRVAR-1 do begin for i := 0 to NRVAR-1 do begin
v:=EditForm.cp.xform[SelectedTriangle].vars[i]; v := vars[i];
if v <> VarsCache[i] then if v <> VarsCache[i] then
begin begin
VarsCache[i]:=v; VarsCache[i]:=v;
EditForm.VEVars.Values[VarNames(i)] := Format('%.6g', [v]); VEVars.Values[VarNames(i)] := Format('%.6g', [v]);
end; end;
end; end;
for i:= 0 to GetNrVariableNames - 1 do begin for i:= 0 to GetNrVariableNames - 1 do begin
cp.xform[SelectedTriangle].GetVariable(GetVariableNameAt(i), v); GetVariable(GetVariableNameAt(i), v);
strval := Format('%.6g', [v]); strval := Format('%.6g', [v]);
// kinda funny, but it's really helped... // kinda funny, but it really helped...
if vleVariables.Values[GetVariableNameAt(i)] <> strval then if vleVariables.Values[GetVariableNameAt(i)] <> strval then
vleVariables.Values[GetVariableNameAt(i)] := strval; vleVariables.Values[GetVariableNameAt(i)] := strval;
end; end;
end; end;
PageControl.Refresh;
end;
procedure TEditForm.Scale(var fx, fy: double; x, y: integer); procedure TEditForm.Scale(var fx, fy: double; x, y: integer);
var var
sc: double; sc: double;
@ -760,13 +777,9 @@ begin
gCentery := yminz + gylength / 2; gCentery := yminz + gylength / 2;
if gxlength >= gylength then if gxlength >= gylength then
begin GraphZoom := TriangleView.Width / 60 / gxlength
GraphZoom := TriangleView.Width / 60 / gxlength;
end
else else
begin
GraphZoom := TriangleView.Height / 60 / gylength; GraphZoom := TriangleView.Height / 60 / gylength;
end;
EditForm.StatusBar.Panels[2].Text := Format('Zoom: %f', [GraphZoom]); EditForm.StatusBar.Panels[2].Text := Format('Zoom: %f', [GraphZoom]);
TriangleView.Invalidate;//Refresh; TriangleView.Invalidate;//Refresh;
@ -776,7 +789,7 @@ procedure TEditForm.UpdateFlameX;
var var
i: integer; i: integer;
begin begin
for i := 0 to transforms - 1 do for i := 0 to Transforms - 1 do
begin begin
// CP_compute(cp1, Triangles[i], Triangles[-1], i); // CP_compute(cp1, Triangles[i], Triangles[-1], i);
solve3(MainTriangles[-1].x[0], MainTriangles[-1].y[0], MainTriangles[i].x[0], solve3(MainTriangles[-1].x[0], MainTriangles[-1].y[0], MainTriangles[i].x[0],
@ -790,7 +803,7 @@ begin
cp.xform[i].c[0][1], cp.xform[i].c[1][1], cp.xform[i].c[2][1]); cp.xform[i].c[0][1], cp.xform[i].c[1][1], cp.xform[i].c[2][1]);
end; end;
cp.GetFromTriangles(MainTriangles, transforms); cp.GetFromTriangles(MainTriangles, Transforms);
// if not chkPreserve.checked then ComputeWeights(cp, MainTriangles, transforms); // if not chkPreserve.checked then ComputeWeights(cp, MainTriangles, transforms);
DrawPreview; DrawPreview;
ShowSelectedInfo; ShowSelectedInfo;
@ -855,8 +868,7 @@ begin
UpdateFlame(True); UpdateFlame(True);
end; end;
cbTransforms.clear; cbTransforms.clear;
for i := 0 to Transforms - 1 do for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i));
cbTransforms.Items.Add(IntToStr(i + 1));
cbTransforms.ItemIndex := SelectedTriangle; cbTransforms.ItemIndex := SelectedTriangle;
end; end;
end; end;
@ -1290,7 +1302,7 @@ begin
TriangleView.OnPaint := TriangleViewPaint; TriangleView.OnPaint := TriangleViewPaint;
TriangleView.OnDblClick := TriangleViewDblClick; TriangleView.OnDblClick := mnuAutoZoomClick;//TriangleViewDblClick;
TriangleView.OnMouseDown := TriangleViewMouseDown; TriangleView.OnMouseDown := TriangleViewMouseDown;
TriangleView.OnMouseMove := TriangleViewMouseMove; TriangleView.OnMouseMove := TriangleViewMouseMove;
TriangleView.OnMouseUp := TriangleViewMouseUp; TriangleView.OnMouseUp := TriangleViewMouseUp;
@ -1394,7 +1406,7 @@ begin
// -- from MouseDown -- for highlighting: // -- from MouseDown -- for highlighting:
// TODO: optimize... // TODO: optimize...
if j = rgPivot.ItemIndex then if (j = 1) and ((rgPivot.ItemIndex = 1) or (rgPivot.ItemIndex = 4)) then
begin begin
Pivot.x := 0; Pivot.x := 0;
Pivot.y := 0; Pivot.y := 0;
@ -1417,7 +1429,7 @@ begin
i := InsideTriangle(fx, fy); i := InsideTriangle(fx, fy);
if i >= 0 then mouseOverTriangle:=i if i >= 0 then mouseOverTriangle:=i
else mouseOverTriangle:=-2; else mouseOverTriangle:=-1;
FoundCorner: FoundCorner:
end; end;
@ -1467,10 +1479,10 @@ Skip1:
if LocalAxisLocked then with MainTriangles[SelectedTriangle] do if LocalAxisLocked then with MainTriangles[SelectedTriangle] do
begin begin
assert(SelectedCorner = 1); assert(SelectedCorner = 1);
x[0] := x[0] + vx-x[1]; x[0] := OldTriangle.x[0] + vx - OldTriangle.x[1];
y[0] := y[0] + vy-y[1]; y[0] := OldTriangle.y[0] + vy - OldTriangle.y[1];
x[2] := x[2] + vx-x[1]; x[2] := OldTriangle.x[2] + vx - OldTriangle.x[1];
y[2] := y[2] + vy-y[1]; y[2] := OldTriangle.y[2] + vy - OldTriangle.y[1];
end; end;
MainTriangles[SelectedTriangle].x[SelectedCorner] := Pivot.X+vx; MainTriangles[SelectedTriangle].x[SelectedCorner] := Pivot.X+vx;
MainTriangles[SelectedTriangle].y[SelectedCorner] := Pivot.Y+vy; MainTriangles[SelectedTriangle].y[SelectedCorner] := Pivot.Y+vy;
@ -1488,20 +1500,35 @@ Skip1:
else if (editMode = modeScale) then else if (editMode = modeScale) then
begin // move point along vector ("scale") begin // move point along vector ("scale")
if olddist<>0 then begin if olddist<>0 then begin
vy := (oldx*(fx-Pivot.X) + oldy*(fy-Pivot.Y))/(olddist*olddist); d := (oldx*(fx-Pivot.X) + oldy*(fy-Pivot.Y))/olddist;
if ssShift in Shift then // 'snapped' scale
begin
try // use move-value for 'scaling' point:
t := abs(StrToFloat(txtTrgMoveValue.Text));
//assert(t<>0);
except
t := 0.1;
txtTrgMoveValue.Text := '0.1';
end;
if t <> 0 then d := Trunc(d/t)*t;
end;
vx := oldx*d/olddist;
vy := oldy*d/olddist;
if LocalAxisLocked then with MainTriangles[SelectedTriangle] do if LocalAxisLocked then with MainTriangles[SelectedTriangle] do
begin begin
assert(SelectedCorner = 1); assert(SelectedCorner = 1);
x[0] := x[0] + oldx*vy-x[1]; x[0] := OldTriangle.x[0] + vx - OldTriangle.x[1];
y[0] := y[0] + oldy*vy-y[1]; y[0] := OldTriangle.y[0] + vy - OldTriangle.y[1];
x[2] := x[2] + oldx*vy-x[1]; x[2] := OldTriangle.x[2] + vx - OldTriangle.x[1];
y[2] := y[2] + oldy*vy-y[1]; y[2] := OldTriangle.y[2] + vy - OldTriangle.y[1];
end; end;
MainTriangles[SelectedTriangle].x[SelectedCorner] := Pivot.X + vx;
MainTriangles[SelectedTriangle].y[SelectedCorner] := Pivot.Y + vy;
MainTriangles[SelectedTriangle].x[SelectedCorner] := Pivot.X + oldx*vy; StatusBar.Panels[2].Text := Format('Distance: %3.3f Scale: %3.2f%%',
MainTriangles[SelectedTriangle].y[SelectedCorner] := Pivot.Y + oldy*vy; [Hypot(vx, vy), d*100/olddist]);
StatusBar.Panels[2].Text := Format('Scale: %3.2f%%', [vy*100]);
end end
else begin else begin
MainTriangles[SelectedTriangle].x[SelectedCorner] := Pivot.X; MainTriangles[SelectedTriangle].x[SelectedCorner] := Pivot.X;
@ -1569,6 +1596,19 @@ Skip2:
begin begin
if olddist<>0 then begin if olddist<>0 then begin
vy := (oldx*(fx-Pivot.X) + oldy*(fy-Pivot.Y))/(olddist*olddist); vy := (oldx*(fx-Pivot.X) + oldy*(fy-Pivot.Y))/(olddist*olddist);
if ssShift in Shift then // 'snapped' scale
begin
try
t := abs(StrToFloat(txtTrgScaleValue.Text)/100.0 - 1.0);
//assert(t<>0);
except
t := 0.1;
txtTrgRotateValue.Text := '0.1';
end;
if t <> 0 then vy := Trunc(vy/t)*t;
end;
MainTriangles[SelectedTriangle] := MainTriangles[SelectedTriangle] :=
ScaleTrianglePoint(OldTriangle, Pivot.X, Pivot.Y, vy); ScaleTrianglePoint(OldTriangle, Pivot.X, Pivot.Y, vy);
StatusBar.Panels[2].Text := Format('Scale: %3.2f%%', [vy*100]); StatusBar.Panels[2].Text := Format('Scale: %3.2f%%', [vy*100]);
@ -1647,7 +1687,7 @@ begin
SelectedCorner := j; SelectedCorner := j;
// Pivot := GetPivot; // Pivot := GetPivot;
if j = rgPivot.ItemIndex then // hmm if (j = 1) and ((rgPivot.ItemIndex = 1) or (rgPivot.ItemIndex = 4)) then
begin begin
Pivot.x := 0; Pivot.x := 0;
Pivot.y := 0; Pivot.y := 0;
@ -1658,6 +1698,7 @@ begin
Pivot := GetPivot; Pivot := GetPivot;
LocalAxisLocked := false; LocalAxisLocked := false;
end; end;
OldTriangle := MainTriangles[SelectedTriangle];
oldx := MainTriangles[SelectedTriangle].x[j] - Pivot.X; oldx := MainTriangles[SelectedTriangle].x[j] - Pivot.X;
oldy := MainTriangles[SelectedTriangle].y[j] - Pivot.Y; oldy := MainTriangles[SelectedTriangle].y[j] - Pivot.Y;
olddist := sqrt(oldx*oldx + oldy*oldy); olddist := sqrt(oldx*oldx + oldy*oldy);
@ -1792,7 +1833,7 @@ begin
if Registry.ValueExists('ResetLocation') then if Registry.ValueExists('ResetLocation') then
mnuResetLoc.checked := Registry.ReadBool('ResetLocation') mnuResetLoc.checked := Registry.ReadBool('ResetLocation')
else mnuResetLoc.checked := true; else mnuResetLoc.checked := true;
tbResetLoc.Down := mnuResetLoc.checked; //tbResetLoc.Down := mnuResetLoc.checked;
end end
else begin else begin
UseTransformColors := False; UseTransformColors := False;
@ -1803,7 +1844,7 @@ begin
HelpersColor := $808080; HelpersColor := $808080;
ReferenceTriangleColor := integer(clGray); ReferenceTriangleColor := integer(clGray);
mnuResetLoc.checked := true; mnuResetLoc.checked := true;
tbResetLoc.Down := true; //tbResetLoc.Down := true;
end; end;
Registry.CloseKey; Registry.CloseKey;
finally finally
@ -1832,17 +1873,15 @@ begin
if Transforms < NXFORMS then if Transforms < NXFORMS then
begin begin
MainForm.UpdateUndo; MainForm.UpdateUndo;
Transforms := Transforms + 1; MainTriangles[Transforms] := MainTriangles[-1];
MainTriangles[Transforms - 1] := MainTriangles[-1]; SelectedTriangle := Transforms;
SelectedTriangle := Transforms - 1; cp.xform[Transforms].density := 0.5;
// ComputeWeights(cp, MainTriangles, transforms); cp.xform[Transforms].vars[0] := 1;
cp.xform[Transforms - 1].density := 0.5;
cp.xform[Transforms - 1].vars[0] := 1;
for i := 1 to NRVAR - 1 do for i := 1 to NRVAR - 1 do
cp.xform[Transforms - 1].vars[i] := 0; cp.xform[Transforms].vars[i] := 0;
Inc(Transforms);
cbTransforms.clear; cbTransforms.clear;
for i := 0 to Transforms - 1 do for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i));
cbTransforms.Items.Add(IntToStr(i + 1));
UpdateFlame(True); UpdateFlame(True);
end; end;
end; end;
@ -1854,16 +1893,14 @@ begin
if Transforms < NXFORMS then if Transforms < NXFORMS then
begin begin
MainForm.UpdateUndo; MainForm.UpdateUndo;
Transforms := Transforms + 1; MainTriangles[Transforms] := MainTriangles[SelectedTriangle];
MainTriangles[Transforms - 1] := MainTriangles[SelectedTriangle]; cp.xform[Transforms].density := cp.xform[SelectedTriangle].density;
// ComputeWeights(cp, MainTriangles, transforms);
cp.xform[Transforms - 1].density := cp.xform[SelectedTriangle].density;
for i := 0 to NRVAR - 1 do for i := 0 to NRVAR - 1 do
cp.xform[Transforms - 1].vars[i] := cp.xform[SelectedTriangle].vars[i]; cp.xform[Transforms].vars[i] := cp.xform[SelectedTriangle].vars[i];
SelectedTriangle := Transforms - 1; SelectedTriangle := Transforms;
Inc(Transforms);
cbTransforms.clear; cbTransforms.clear;
for i := 0 to Transforms - 1 do for i := 1 to Transforms do cbTransforms.Items.Add(IntToStr(i));
cbTransforms.Items.Add(IntToStr(i + 1));
UpdateFlame(True); UpdateFlame(True);
end; end;
end; end;
@ -2128,7 +2165,7 @@ end;
procedure TEditForm.mnuLowQualityClick(Sender: TObject); procedure TEditForm.mnuLowQualityClick(Sender: TObject);
begin begin
mnuLowQuality.Checked := True; mnuLowQuality.Checked := True;
tbLowQ.Down := true; //tbLowQ.Down := true;
PreviewDensity := prevLowQuality; PreviewDensity := prevLowQuality;
EditPrevQual := 0; EditPrevQual := 0;
DrawPreview; DrawPreview;
@ -2137,7 +2174,7 @@ end;
procedure TEditForm.mnuHighQualityClick(Sender: TObject); procedure TEditForm.mnuHighQualityClick(Sender: TObject);
begin begin
mnuHighQuality.Checked := True; mnuHighQuality.Checked := True;
tbHiQ.Down := true; //tbHiQ.Down := true;
PreviewDensity := prevHighQuality; PreviewDensity := prevHighQuality;
EditPrevQual := 2; EditPrevQual := 2;
DrawPreview; DrawPreview;
@ -2146,7 +2183,7 @@ end;
procedure TEditForm.mnuMediumQualityClick(Sender: TObject); procedure TEditForm.mnuMediumQualityClick(Sender: TObject);
begin begin
mnuMediumQuality.Checked := True; mnuMediumQuality.Checked := True;
tbMedQ.Down := true; //tbMedQ.Down := true;
PreviewDensity := prevMediumQuality; PreviewDensity := prevMediumQuality;
EditPrevQual := 1; EditPrevQual := 1;
DrawPreview; DrawPreview;
@ -2158,7 +2195,7 @@ var
begin begin
reset:= not mnuResetLoc.Checked; reset:= not mnuResetLoc.Checked;
mnuResetLoc.Checked := reset; mnuResetLoc.Checked := reset;
tbResetLoc.Down := reset; //tbResetLoc.Down := reset;
if reset then if reset then
begin begin
cp.width := MainCp.width; cp.width := MainCp.width;
@ -2203,14 +2240,14 @@ var
p: double; p: double;
begin begin
MainForm.UpdateUndo; MainForm.UpdateUndo;
with MainTriangles[SelectedTriangle] do // --Z-- with MainTriangles[SelectedTriangle] do
begin begin
p := GetPivot.y * 2; p := GetPivot.y * 2;
y[0] := p - y[0]; y[0] := p - y[0];
y[1] := p - y[1]; y[1] := p - y[1];
y[2] := p - y[2]; y[2] := p - y[2];
end; end;
AutoZoom; //AutoZoom;
UpdateFlame(True); UpdateFlame(True);
end; end;
@ -2219,21 +2256,23 @@ var
p: double; p: double;
begin begin
MainForm.UpdateUndo; MainForm.UpdateUndo;
with MainTriangles[SelectedTriangle] do // --Z-- with MainTriangles[SelectedTriangle] do
begin begin
p := GetPivot.x * 2; p := GetPivot.x * 2;
x[0] := p - x[0]; x[0] := p - x[0];
x[1] := p - x[1]; x[1] := p - x[1];
x[2] := p - x[2]; x[2] := p - x[2];
end; end;
AutoZoom; //AutoZoom;
UpdateFlame(True); UpdateFlame(True);
end; end;
{
procedure TEditForm.TriangleViewDblClick(Sender: TObject); procedure TEditForm.TriangleViewDblClick(Sender: TObject);
begin begin
AutoZoom; AutoZoom;
end; end;
}
procedure TEditForm.cbTransformsChange(Sender: TObject); procedure TEditForm.cbTransformsChange(Sender: TObject);
begin begin
@ -2272,128 +2311,89 @@ begin
end; end;
procedure TEditForm.CoefKeyPress(Sender: TObject; var Key: Char); procedure TEditForm.CoefKeyPress(Sender: TObject; var Key: Char);
var
Allow: boolean;
i: integer;
OldVal, NewVal: double;
begin
i := 0; OldVal := 0;
if key = #13 then
begin begin
if key <> #13 then exit;
key := #0; key := #0;
Allow := True; CoefValidate(Sender);
if Sender = txtA then
i := 0
else if Sender = txtB then
i := 1
else if Sender = txtC then
i := 2
else if Sender = txtD then
i := 3
else if Sender = txtE then
i := 4
else if Sender = txtF then
i := 5;
case i of
0: OldVal := Round6(cp.xform[SelectedTriangle].c[0][0]); //a
1: OldVal := Round6(cp.xform[SelectedTriangle].c[1][0]); //b
2: OldVal := Round6(cp.xform[SelectedTriangle].c[0][1]); //c
3: OldVal := Round6(cp.xform[SelectedTriangle].c[1][1]); //d
4: OldVal := Round6(cp.xform[SelectedTriangle].c[2][0]); //e
5: OldVal := Round6(cp.xform[SelectedTriangle].c[2][1]); //f
end;
// OldText := Val;
{ Test that it's a valid floating point number }
try
StrToFloat(TEdit(Sender).Text);
except on Exception do
begin
{ It's not, so we restore the old value }
TEdit(Sender).Text := Format('%.6g', [OldVal]);
Allow := False;
end;
end;
NewVal := Round6(StrToFloat(TEdit(Sender).Text));
TEdit(Sender).Text := Format('%.6g', [NewVal]);
{ If it's not the same as the old value and it was valid }
if (NewVal <> OldVal) and Allow then
begin
MainForm.UpdateUndo;
case i of
0: cp.xform[SelectedTriangle].c[0][0] := NewVal; //a
1: cp.xform[SelectedTriangle].c[1][0] := NewVal; //b
2: cp.xform[SelectedTriangle].c[0][1] := NewVal; //c
3: cp.xform[SelectedTriangle].c[1][1] := NewVal; //d
4: cp.xform[SelectedTriangle].c[2][0] := NewVal; //e
5: cp.xform[SelectedTriangle].c[2][1] := NewVal; //f
end;
cp.TrianglesFromCP(MainTriangles);
ShowSelectedInfo;
UpdateFlame(true);
end;
end;
end; end;
procedure TEditForm.CoefExit(Sender: TObject); procedure TEditForm.CoefValidate(Sender: TObject);
var var
Allow: boolean; NewVal: double;
i: integer; x, y, r, a: double; // dumb... must optimize
NewVal, OldVal: double;
begin begin
i := 0; OldVal := 0;
Allow := True;
if Sender = txtA then
i := 0
else if Sender = txtB then
i := 1
else if Sender = txtC then
i := 2
else if Sender = txtD then
i := 3
else if Sender = txtE then
i := 4
else if Sender = txtF then
i := 5;
case i of
0: OldVal := Round6(cp.xform[SelectedTriangle].c[0][0]); //a
1: OldVal := Round6(cp.xform[SelectedTriangle].c[1][0]); //b
2: OldVal := Round6(cp.xform[SelectedTriangle].c[0][1]); //c
3: OldVal := Round6(cp.xform[SelectedTriangle].c[1][1]); //d
4: OldVal := Round6(cp.xform[SelectedTriangle].c[2][0]); //e
5: OldVal := Round6(cp.xform[SelectedTriangle].c[2][1]); //f
end;
// OldText := Val;
{ Test that it's a valid floating point number }
try try
StrToFloat(TEdit(Sender).Text); NewVal := Round6(StrToFloat(TEdit(Sender).Text));
except on Exception do except on Exception do
begin begin
{ It's not, so we restore the old value } ShowSelectedInfo; //TEdit(Sender).Text := Format('%.6g', [pVal^]);
TEdit(Sender).Text := Format('%.6g', [OldVal]); exit;
Allow := False;
end; end;
end; end;
NewVal := Round6(StrToFloat(TEdit(Sender).Text));
TEdit(Sender).Text := Format('%.6g', [NewVal]);
{ If it's not the same as the old value and it was valid } //TEdit(Sender).Text := Format('%.6g', [NewVal]);
if (NewVal <> OldVal) and Allow then
MainForm.UpdateUndo; // TODO - prevent unnecessary UpdateUndo...
with cp.xform[SelectedTriangle] do
begin begin
MainForm.UpdateUndo; if btnCoefsRect.Down = true then
case i of begin
0: cp.xform[SelectedTriangle].c[0][0] := NewVal; //a if Sender = txtA then
1: cp.xform[SelectedTriangle].c[1][0] := NewVal; //b cp.xform[SelectedTriangle].c[0][0] := NewVal
2: cp.xform[SelectedTriangle].c[0][1] := NewVal; //c else if Sender = txtB then
3: cp.xform[SelectedTriangle].c[1][1] := NewVal; //d cp.xform[SelectedTriangle].c[0][1] := -NewVal
4: cp.xform[SelectedTriangle].c[2][0] := NewVal; //e else if Sender = txtC then
5: cp.xform[SelectedTriangle].c[2][1] := NewVal; //f cp.xform[SelectedTriangle].c[1][0] := -NewVal
else if Sender = txtD then
cp.xform[SelectedTriangle].c[1][1] := NewVal
else if Sender = txtE then
cp.xform[SelectedTriangle].c[2][0] := NewVal
else if Sender = txtF then
cp.xform[SelectedTriangle].c[2][1] := -NewVal;
end
else begin
if (Sender = txtA) or (Sender = txtB) then begin
x := c[0][0];
y := -c[0][1];
end else
if (Sender = txtC) or (Sender = txtD) then begin
x := -c[1][0];
y := c[1][1];
end else
{if (Sender = txtE) or (Sender = txtF) then}
begin
x := c[2][0];
y := -c[2][1];
end;
r := Hypot(x, y);
a := arctan2(y, x);
if (Sender = txtA) or (Sender = txtC) or (Sender = txtE) then
r := NewVal
else
a := NewVal*PI/180;
x := r * cos(a);
y := r * sin(a);
if (Sender = txtA) or (Sender = txtB) then begin
c[0][0] := x;
c[0][1] := -y;
end else
if (Sender = txtC) or (Sender = txtD) then begin
c[1][0] := -x;
c[1][1] := y;
end else
{if (Sender = txtE) or (Sender = txtF) then}
begin
c[2][0] := x;
c[2][1] := -y;
end;
end;
end; end;
cp.TrianglesFromCP(MainTriangles); cp.TrianglesFromCP(MainTriangles);
ShowSelectedInfo; ShowSelectedInfo;
UpdateFlame(true); UpdateFlame(true);
end; end;
end;
procedure TEditForm.scrlXFormColorScroll(Sender: TObject; procedure TEditForm.scrlXFormColorScroll(Sender: TObject;
ScrollCode: TScrollCode; var ScrollPos: Integer); ScrollCode: TScrollCode; var ScrollPos: Integer);
@ -3176,7 +3176,7 @@ end;
procedure TEditForm.splitterMoved(Sender: TObject); procedure TEditForm.splitterMoved(Sender: TObject);
begin begin
UpdateDisplay; UpdatePreview;
end; end;
procedure TEditForm.tbSelectClick(Sender: TObject); procedure TEditForm.tbSelectClick(Sender: TObject);
@ -3209,14 +3209,6 @@ begin
Handled := true; Handled := true;
end; end;
procedure TEditForm.PreviewImageDblClick(Sender: TObject);
begin
MainForm.UpdateUndo;
MainForm.ResetLocation;
MainForm.RedrawTimer.enabled := true;
MainForm.UpdateWindows;
end;
procedure TEditForm.rgPivotClicked(Sender: TObject); procedure TEditForm.rgPivotClicked(Sender: TObject);
begin begin
TriangleView.Invalidate; TriangleView.Invalidate;
@ -3390,11 +3382,9 @@ var
begin begin
MainForm.UpdateUndo; MainForm.UpdateUndo;
MainTriangles[SelectedTriangle] := MainTriangles[-1]; MainTriangles[SelectedTriangle] := MainTriangles[-1];
cp.xform[SelectedTriangle].vars[0] := 1; // cp.xform[SelectedTriangle].vars[0] := 1;
for i := 1 to NRVAR - 1 do // for i := 1 to NRVAR - 1 do
begin // cp.xform[SelectedTriangle].vars[i] := 0;
cp.xform[SelectedTriangle].vars[i] := 0;
end;
UpdateFlame(True); UpdateFlame(True);
end; end;
@ -3426,5 +3416,50 @@ begin
UpdateFlame(True); UpdateFlame(True);
end; end;
// -----------------------------------------------------------------------------
procedure TEditForm.btnXcoefsClick(Sender: TObject);
begin
with cp.xform[SelectedTriangle] do
begin
if (c[0][0] = 1) and (c[0][1] = 0) then exit;
MainForm.UpdateUndo;
c[0][0] := 1;
c[0][1] := 0;
end;
cp.TrianglesFromCP(MainTriangles);
UpdateFlame(True);
end;
procedure TEditForm.btnYcoefsClick(Sender: TObject);
begin
if (cp.xform[SelectedTriangle].c[1][0] = 0) and
(cp.xform[SelectedTriangle].c[1][1] = 1) then exit;
MainForm.UpdateUndo;
cp.xform[SelectedTriangle].c[1][0] := 0;
cp.xform[SelectedTriangle].c[1][1] := 1;
cp.TrianglesFromCP(MainTriangles);
UpdateFlame(True);
end;
procedure TEditForm.btnOcoefsClick(Sender: TObject);
begin
if (cp.xform[SelectedTriangle].c[2][0] = 0) and
(cp.xform[SelectedTriangle].c[2][1] = 0) then exit;
MainForm.UpdateUndo;
cp.xform[SelectedTriangle].c[2][0] := 0;
cp.xform[SelectedTriangle].c[2][1] := 0;
cp.TrianglesFromCP(MainTriangles);
UpdateFlame(True);
end;
procedure TEditForm.btnCoefsModeClick(Sender: TObject);
begin
ShowSelectedInfo;
end;
end. end.

View File

@ -181,8 +181,8 @@ begin
end; end;
function dist(x1, y1, x2, y2: double): double; function dist(x1, y1, x2, y2: double): double;
var //var
d2: double; // d2: double;
begin begin
(* (*
{ From FDesign source { From FDesign source

View File

@ -27,7 +27,7 @@ object MainForm: TMainForm
Left = 160 Left = 160
Top = 28 Top = 28
Width = 4 Width = 4
Height = 522 Height = 520
end end
object ToolBar: TToolBar object ToolBar: TToolBar
Left = 0 Left = 0
@ -284,7 +284,7 @@ object MainForm: TMainForm
Left = 0 Left = 0
Top = 28 Top = 28
Width = 160 Width = 160
Height = 522 Height = 520
Align = alLeft Align = alLeft
Columns = < Columns = <
item item
@ -303,7 +303,7 @@ object MainForm: TMainForm
Left = 164 Left = 164
Top = 28 Top = 28
Width = 433 Width = 433
Height = 522 Height = 520
Align = alClient Align = alClient
BevelInner = bvLowered BevelInner = bvLowered
BevelOuter = bvNone BevelOuter = bvNone
@ -314,7 +314,7 @@ object MainForm: TMainForm
Left = 1 Left = 1
Top = 1 Top = 1
Width = 431 Width = 431
Height = 520 Height = 518
Align = alClient Align = alClient
AutoSize = True AutoSize = True
PopupMenu = DisplayPopup PopupMenu = DisplayPopup
@ -327,7 +327,7 @@ object MainForm: TMainForm
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Top = 550 Top = 548
Width = 597 Width = 597
Height = 19 Height = 19
Panels = < Panels = <
@ -2626,7 +2626,7 @@ object MainForm: TMainForm
Caption = 'Full Screen' Caption = 'Full Screen'
Hint = 'Show the flame in fullscreen mode' Hint = 'Show the flame in fullscreen mode'
ImageIndex = 52 ImageIndex = 52
ShortCut = 16454 ShortCut = 114
OnClick = mnuFullScreenClick OnClick = mnuFullScreenClick
end end
object N4: TMenuItem object N4: TMenuItem
@ -2636,44 +2636,44 @@ object MainForm: TMainForm
Caption = '&Editor' Caption = '&Editor'
Hint = 'Show the Transform Editor' Hint = 'Show the Transform Editor'
ImageIndex = 19 ImageIndex = 19
ShortCut = 16453 ShortCut = 115
OnClick = mnuEditorClick OnClick = mnuEditorClick
end end
object mnuAdjust: TMenuItem object mnuAdjust: TMenuItem
Caption = 'Adjust' Caption = 'Adjust'
Hint = 'Show the Adjust window' Hint = 'Show the Adjust window'
ImageIndex = 18 ImageIndex = 18
ShortCut = 16449 ShortCut = 116
OnClick = mnuAdjustClick OnClick = mnuAdjustClick
end end
object mnuGrad: TMenuItem object mnuGrad: TMenuItem
Caption = 'Gradient' Caption = 'Gradient'
Hint = 'Show the Gradient window' Hint = 'Show the Gradient window'
ImageIndex = 11 ImageIndex = 11
ShortCut = 16455 ShortCut = 117
OnClick = mnuGradClick OnClick = mnuGradClick
end end
object mnuMutate: TMenuItem object mnuMutate: TMenuItem
Caption = 'Mutation' Caption = 'Mutation'
Hint = 'Show the Mutation window' Hint = 'Show the Mutation window'
ImageIndex = 17 ImageIndex = 17
ShortCut = 16461 ShortCut = 118
OnClick = mnuMutateClick OnClick = mnuMutateClick
end end
object mnuimage: TMenuItem
Caption = 'Image '
Visible = False
OnClick = mnuimageClick
end
object N5: TMenuItem object N5: TMenuItem
Caption = '-' Caption = '-'
end end
object mnuImageSize: TMenuItem object mnuImageSize: TMenuItem
Caption = 'Image Size' Caption = 'Image Size'
ImageIndex = 51 ImageIndex = 51
ShortCut = 16457 ShortCut = 119
OnClick = mnuImageSizeClick OnClick = mnuImageSizeClick
end end
object mnuimage: TMenuItem
Caption = 'Image '
Visible = False
OnClick = mnuimageClick
end
end end
object F1: TMenuItem object F1: TMenuItem
Caption = 'Flame' Caption = 'Flame'
@ -2691,25 +2691,21 @@ object MainForm: TMainForm
object mnuRandom: TMenuItem object mnuRandom: TMenuItem
Caption = '&Randomize' Caption = '&Randomize'
Hint = 'Randomize flame parameters' Hint = 'Randomize flame parameters'
ShortCut = 120
OnClick = mnuRandomClick OnClick = mnuRandomClick
end end
object mnuRWeights: TMenuItem object mnuRWeights: TMenuItem
Caption = 'Random &Weights' Caption = 'Random &Weights'
Hint = 'Randomize transform weights' Hint = 'Randomize transform weights'
ShortCut = 116
OnClick = mnuRWeightsClick OnClick = mnuRWeightsClick
end end
object mnuEqualize: TMenuItem object mnuEqualize: TMenuItem
Caption = '&Equalize Weights' Caption = '&Equalize Weights'
Hint = 'Set all weights to the same value' Hint = 'Set all weights to the same value'
ShortCut = 117
OnClick = mnuEqualizeClick OnClick = mnuEqualizeClick
end end
object mnuNormalWeights: TMenuItem object mnuNormalWeights: TMenuItem
Caption = 'Compute Weights' Caption = 'Compute Weights'
Hint = 'Compute weights from triangle areas' Hint = 'Compute weights from triangle areas'
ShortCut = 118
OnClick = mnuNormalWeightsClick OnClick = mnuNormalWeightsClick
end end
object N7: TMenuItem object N7: TMenuItem
@ -2745,7 +2741,7 @@ object MainForm: TMainForm
Checked = True Checked = True
GroupIndex = 2 GroupIndex = 2
RadioItem = True RadioItem = True
ShortCut = 121 ShortCut = 122
OnClick = mnuVRandomClick OnClick = mnuVRandomClick
end end
object N8: TMenuItem object N8: TMenuItem
@ -2756,16 +2752,16 @@ object MainForm: TMainForm
object mnuScript: TMenuItem object mnuScript: TMenuItem
Caption = 'Script' Caption = 'Script'
object mnuRun: TMenuItem object mnuRun: TMenuItem
Caption = 'Run "Default Animation"' Caption = 'Run script'
Hint = 'Run the currently loaded script' Hint = 'Run the currently loaded script'
ImageIndex = 43 ImageIndex = 43
ShortCut = 119 ShortCut = 120
OnClick = mnuRunClick OnClick = mnuRunClick
end end
object mnuStop: TMenuItem object mnuStop: TMenuItem
Caption = 'Stop' Caption = 'Stop script'
ImageIndex = 36 ImageIndex = 36
ShortCut = 16468 ShortCut = 121
OnClick = mnuStopClick OnClick = mnuStopClick
end end
object N15: TMenuItem object N15: TMenuItem

View File

@ -1810,9 +1810,9 @@ begin
if (MainCp.width <> Image.Width) or (MainCp.height <> Image.height) then if (MainCp.width <> Image.Width) or (MainCp.height <> Image.height) then
begin begin
AdjustScale(MainCp, Image.width, Image.height); AdjustScale(MainCp, Image.width, Image.height);
if EditForm.Visible then EditForm.UpdateDisplay(true); // preview only if EditForm.Visible then EditForm.UpdateDisplay(true); // preview only?
end; end;
if AdjustForm.Visible then AdjustForm.UpdateDisplay; if AdjustForm.Visible then AdjustForm.UpdateDisplay(true); // preview only!
// following needed ? // following needed ?
// cp.Zoom := Zoom; // cp.Zoom := Zoom;
// cp.center[0] := center[0]; // cp.center[0] := center[0];
@ -2223,8 +2223,7 @@ begin
IntToStr(RandomIndex); IntToStr(RandomIndex);
Transforms := MainCp.TrianglesFromCP(MainTriangles); Transforms := MainCp.TrianglesFromCP(MainTriangles);
if AdjustForm.visible then if AdjustForm.visible then AdjustForm.UpdateDisplay;
AdjustForm.UpdateDisplay;
StatusBar.Panels[2].text := maincp.name; StatusBar.Panels[2].text := maincp.name;
ResetLocation; ResetLocation;
@ -2825,7 +2824,7 @@ begin
// Zoom := maincp.zoom; // Zoom := maincp.zoom;
Center[0] := maincp.Center[0]; Center[0] := maincp.Center[0];
Center[1] := maincp.Center[1]; Center[1] := maincp.Center[1];
MainCP.NormalizeWeights; // MainCP.NormalizeWeights;
mnuSaveUndo.Enabled := false; mnuSaveUndo.Enabled := false;
mnuUndo.Enabled := False; mnuUndo.Enabled := False;
mnuPopUndo.Enabled := False; mnuPopUndo.Enabled := False;
@ -2866,14 +2865,8 @@ end;
procedure TMainForm.UpdateWindows; procedure TMainForm.UpdateWindows;
begin begin
if AdjustForm.visible then if AdjustForm.visible then AdjustForm.UpdateDisplay;
AdjustForm.UpdateDisplay;
if EditForm.visible then EditForm.UpdateDisplay; if EditForm.visible then EditForm.UpdateDisplay;
// hmm I think I still have some problems with EditForm updating
// several times in a row with all these calls :-\
// if AdjustForm.visible then AdjustForm.UpdateDisplay;
if MutateForm.visible then MutateForm.UpdateDisplay; if MutateForm.visible then MutateForm.UpdateDisplay;
end; end;
@ -2937,15 +2930,13 @@ begin
Center[0] := maincp.Center[0]; Center[0] := maincp.Center[0];
Center[1] := maincp.Center[1]; Center[1] := maincp.Center[1];
// cp.CalcBoundbox; // cp.CalcBoundbox;
MainCP.NormalizeWeights; // MainCP.NormalizeWeights;
Transforms := MainCp.TrianglesFromCP(MainTriangles); Transforms := MainCp.TrianglesFromCP(MainTriangles);
// Trim undo index from title // Trim undo index from title
maincp.name := Copy(Fstrings[0], 6, length(Fstrings[0]) - 7); maincp.name := Copy(Fstrings[0], 6, length(Fstrings[0]) - 7);
if SavedPal then if SavedPal then maincp.cmap := palette;
maincp.cmap := palette; if AdjustForm.visible then AdjustForm.UpdateDisplay;
if AdjustForm.visible then
AdjustForm.UpdateDisplay;
RedrawTimer.Enabled := True; RedrawTimer.Enabled := True;
UpdateWindows; UpdateWindows;
@ -3636,7 +3627,7 @@ begin
if nxform < NXFORMS then if nxform < NXFORMS then
for i := nxform to NXFORMS - 1 do for i := nxform to NXFORMS - 1 do
cp1.xform[i].density := 0; cp1.xform[i].density := 0;
cp1.NormalizeWeights; // cp1.NormalizeWeights;
// Check for symmetry parameter // Check for symmetry parameter
if ParseCp.symmetry <> 0 then if ParseCp.symmetry <> 0 then
begin begin

View File

@ -19,7 +19,7 @@ implementation
uses uses
math; math;
// TVariationEyefish // TVariationEyefish, the correct "fish-eye" variation
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
procedure TVariationEyefish.CalcFunction; procedure TVariationEyefish.CalcFunction;
@ -61,6 +61,7 @@ asm
fadd qword ptr [ecx] fadd qword ptr [ecx]
fstp qword ptr [ecx] fstp qword ptr [ecx]
fwait
{$ifend} {$ifend}
end; end;