Density estimator parameters enabled to scripting engine.

This commit is contained in:
utak3r 2006-04-29 08:44:48 +00:00
parent 8fc89fea80
commit 32ebbdac40
2 changed files with 101 additions and 13 deletions

View File

@ -20,7 +20,7 @@ object ScriptEditor: TScriptEditor
TextHeight = 13 TextHeight = 13
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 0 Left = 0
Top = 250 Top = 244
Width = 531 Width = 531
Height = 4 Height = 4
Cursor = crVSplit Cursor = crVSplit
@ -30,7 +30,7 @@ object ScriptEditor: TScriptEditor
Left = 508 Left = 508
Top = 0 Top = 0
Width = 23 Width = 23
Height = 250 Height = 244
Align = alRight Align = alRight
AutoSize = True AutoSize = True
Caption = 'ToolBar' Caption = 'ToolBar'
@ -96,7 +96,7 @@ object ScriptEditor: TScriptEditor
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Top = 343 Top = 337
Width = 531 Width = 531
Height = 19 Height = 19
Anchors = [akLeft, akRight] Anchors = [akLeft, akRight]
@ -106,7 +106,7 @@ object ScriptEditor: TScriptEditor
Left = 0 Left = 0
Top = 0 Top = 0
Width = 508 Width = 508
Height = 250 Height = 244
Align = alClient Align = alClient
BevelInner = bvLowered BevelInner = bvLowered
BevelOuter = bvLowered BevelOuter = bvLowered
@ -116,7 +116,7 @@ object ScriptEditor: TScriptEditor
Left = 2 Left = 2
Top = 2 Top = 2
Width = 504 Width = 504
Height = 246 Height = 240
Cursor = crIBeam Cursor = crIBeam
PopupMenu = PopupMenu PopupMenu = PopupMenu
ActiveLineSettings.ShowActiveLine = False ActiveLineSettings.ShowActiveLine = False
@ -135,6 +135,8 @@ object ScriptEditor: TScriptEditor
BlockLineColor = clGray BlockLineColor = clGray
BkColor = clWindow BkColor = clWindow
BorderStyle = bsNone BorderStyle = bsNone
CodeFolding.Enabled = False
CodeFolding.LineColor = clGray
Ctl3D = False Ctl3D = False
DelErase = True DelErase = True
EnhancedHomeKey = False EnhancedHomeKey = False
@ -144,11 +146,6 @@ object ScriptEditor: TScriptEditor
Gutter.Font.Height = -13 Gutter.Font.Height = -13
Gutter.Font.Name = 'Courier New' Gutter.Font.Name = 'Courier New'
Gutter.Font.Style = [] Gutter.Font.Style = []
Gutter.LineNumberStart = 1
Gutter.LineNumberTextColor = clBlack
Gutter.ShowLineNumbers = True
Gutter.Visible = True
Gutter.ShowLeadingZeros = False
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -13 Font.Height = -13
@ -190,14 +187,14 @@ object ScriptEditor: TScriptEditor
UrlStyle.BkColor = clWhite UrlStyle.BkColor = clWhite
UrlStyle.Style = [fsUnderline] UrlStyle.Style = [fsUnderline]
UseStyler = True UseStyler = True
Version = '1.6.0.17' Version = '2.0.0.1'
WordWrap = wwNone WordWrap = wwNone
OnChange = EditorChange OnChange = EditorChange
end end
end end
object Console: TMemo object Console: TMemo
Left = 0 Left = 0
Top = 254 Top = 248
Width = 531 Width = 531
Height = 89 Height = 89
Align = alBottom Align = alBottom
@ -361,7 +358,9 @@ object ScriptEditor: TScriptEditor
end> end>
AutoCompletion.Strings = ( AutoCompletion.Strings = (
'ShowMessage' 'ShowMessage'
'MessageDlg') 'MessageDlg'
'Flame'
'Transform')
HintParameter.TextColor = clBlack HintParameter.TextColor = clBlack
HintParameter.BkColor = clInfoBk HintParameter.BkColor = clInfoBk
HintParameter.HintCharStart = '(' HintParameter.HintCharStart = '('
@ -379,6 +378,53 @@ object ScriptEditor: TScriptEditor
DefaultExtension = '.pas' DefaultExtension = '.pas'
StylerName = 'Pascal' StylerName = 'Pascal'
Extensions = 'pas;dpr;dpk;inc' Extensions = 'pas;dpr;dpk;inc'
RegionDefinitions = <
item
Identifier = 'procedure'
RegionStart = 'begin'
RegionEnd = 'end'
RegionType = rtClosed
ShowComments = False
end
item
Identifier = 'interface'
RegionStart = 'interface'
RegionType = rtOpen
ShowComments = False
end
item
Identifier = 'unit'
RegionStart = 'unit'
RegionType = rtFile
ShowComments = False
end
item
Identifier = 'implementation'
RegionStart = 'implementation'
RegionType = rtOpen
ShowComments = False
end
item
Identifier = 'case'
RegionStart = 'case'
RegionEnd = 'end'
RegionType = rtIgnore
ShowComments = False
end
item
Identifier = 'function'
RegionStart = 'begin'
RegionEnd = 'end'
RegionType = rtClosed
ShowComments = False
end
item
Identifier = '{$region'
RegionStart = '{$region'
RegionEnd = '{$endregion'
RegionType = rtClosed
ShowComments = False
end>
Left = 328 Left = 328
Top = 32 Top = 32
end end

View File

@ -51,6 +51,9 @@ type
y: byte; y: byte;
Gradient: byte; Gradient: byte;
Background: byte; Background: byte;
estimator_radius: byte;
estimator_min: byte;
estimator_curve: byte;
end; end;
TScriptRender = class TScriptRender = class
public public
@ -154,6 +157,12 @@ type
procedure GetFlameURLProc(AMachine: TatVirtualMachine); procedure GetFlameURLProc(AMachine: TatVirtualMachine);
procedure SetFlameBatchesProc(AMachine: TatVirtualMachine); procedure SetFlameBatchesProc(AMachine: TatVirtualMachine);
procedure GetFlameBatchesProc(AMachine: TatVirtualMachine); procedure GetFlameBatchesProc(AMachine: TatVirtualMachine);
procedure GetFlameEstimatorRadius(AMachine: TatVirtualMachine);
procedure SetFlameEstimatorRadius(AMachine: TatVirtualMachine);
procedure GetFlameEstimatorMin(AMachine: TatVirtualMachine);
procedure SetFlameEstimatorMin(AMachine: TatVirtualMachine);
procedure GetFlameEstimatorCurve(AMachine: TatVirtualMachine);
procedure SetFlameEstimatorCurve(AMachine: TatVirtualMachine);
{ Transform interface } { Transform interface }
procedure GetTransformAProc(AMachine: TatVirtualMachine); procedure GetTransformAProc(AMachine: TatVirtualMachine);
@ -2389,6 +2398,36 @@ begin
cp.nbatches := GetInputArgAsInteger(0); cp.nbatches := GetInputArgAsInteger(0);
end; end;
procedure TScriptEditor.GetFlameEstimatorRadius(AMachine: TatVirtualMachine);
begin
AMachine.ReturnOutputArg(cp.estimator);
end;
procedure TScriptEditor.SetFlameEstimatorRadius(AMachine: TatVirtualMachine);
begin
cp.estimator := AMachine.GetInputArgAsFloat(0);
end;
procedure TScriptEditor.GetFlameEstimatorMin(AMachine: TatVirtualMachine);
begin
AMachine.ReturnOutputArg(cp.estimator_min);
end;
procedure TScriptEditor.SetFlameEstimatorMin(AMachine: TatVirtualMachine);
begin
cp.estimator_min := AMachine.GetInputArgAsFloat(0);
end;
procedure TScriptEditor.GetFlameEstimatorCurve(AMachine: TatVirtualMachine);
begin
AMachine.ReturnOutputArg(cp.estimator_curve);
end;
procedure TScriptEditor.SetFlameEstimatorCurve(AMachine: TatVirtualMachine);
begin
cp.estimator_curve := AMachine.GetInputArgAsFloat(0);
end;
{ *************************** Transform interface **************************** } { *************************** Transform interface **************************** }
@ -2632,6 +2671,9 @@ begin
DefineProp('URL', tkString, GetFlameURLProc, SetFlameURLProc); DefineProp('URL', tkString, GetFlameURLProc, SetFlameURLProc);
DefineProp('Hue', tkFloat, GetFlameHueProc, SetFlameHueProc); DefineProp('Hue', tkFloat, GetFlameHueProc, SetFlameHueProc);
DefineProp('Batches', tkInteger, GetFlameBatchesProc, SetFlameBatchesProc); DefineProp('Batches', tkInteger, GetFlameBatchesProc, SetFlameBatchesProc);
DefineProp('estimator_radius', tkFloat, GetFlameEstimatorRadius, SetFlameEstimatorRadius);
DefineProp('estimator_min', tkFloat, GetFlameEstimatorMin, SetFlameEstimatorMin);
DefineProp('estimator_curve', tkFloat, GetFlameEstimatorCurve, SetFlameEstimatorCurve);
end; end;
Scripter.AddObject('Flame', Flame); Scripter.AddObject('Flame', Flame);
{ Transform interface } { Transform interface }