apophysis/2.10/Source/BaseVariation.pas

84 lines
2.1 KiB
ObjectPascal
Raw Normal View History

2005-09-11 06:30:54 -04:00
unit BaseVariation;
interface
type
TCalcFunction = procedure of object;
2005-09-11 06:30:54 -04:00
type
TBaseVariation = class
2005-09-11 06:30:54 -04:00
protected
procedure CalcFunction; virtual; abstract;
2005-09-11 06:30:54 -04:00
public
vvar: double; // normalized interp coefs between variations
FTx, FTy: ^double;
FPx, FPy: ^double;
class function GetName: string; virtual; abstract;
class function GetInstance: TBaseVariation; virtual; abstract;
class function GetNrVariables: integer; virtual;
class function GetVariableNameAt(const Index: integer): string; virtual;
function SetVariable(const Name: string; var value: double): boolean; virtual;
function GetVariable(const Name: string; var value: double): boolean; virtual;
function ResetVariable(const Name: string): boolean; virtual;
2005-09-11 06:30:54 -04:00
procedure Prepare; virtual;
procedure GetCalcFunction(var Delphi_Suxx: TCalcFunction); virtual;
2005-09-11 06:30:54 -04:00
end;
TBaseVariationClass = class of TBaseVariation;
implementation
{ TBaseVariation }
///////////////////////////////////////////////////////////////////////////////
class function TBaseVariation.GetNrVariables: integer;
begin
Result := 0;
end;
///////////////////////////////////////////////////////////////////////////////
function TBaseVariation.GetVariable(const Name: string; var value: double): boolean;
begin
Result := False;
end;
///////////////////////////////////////////////////////////////////////////////
function TBaseVariation.SetVariable(const Name: string; var value: double): boolean;
begin
Result := False;
end;
class function TBaseVariation.GetVariableNameAt(const Index: integer): string;
begin
Result := ''
end;
function TBaseVariation.ResetVariable(const Name: string): boolean;
var
zero: double;
begin
zero := 0;
Result := SetVariable(Name, zero);
end;
2005-09-11 06:30:54 -04:00
///////////////////////////////////////////////////////////////////////////////
procedure TBaseVariation.Prepare;
2005-09-11 06:30:54 -04:00
begin
end;
///////////////////////////////////////////////////////////////////////////////
procedure TBaseVariation.GetCalcFunction(var Delphi_Suxx: TCalcFunction);
begin
Delphi_Suxx := CalcFunction;
end;
2005-09-11 06:30:54 -04:00
end.