mmf Class MMF_SwitchConvergentFormula

Object common:Generic common:Formula common:ConvergentFormula mmf:MMF_SwitchConvergentFormula

class
ConvergentFormula:MMF_SwitchConvergentFormula

Base class for Convergent formulas that allow switching to be used with
mmf5.ufm-Generic Switch Formula

Ultra Fractal Source
class MMF_SwitchConvergentFormula(common.ulb:ConvergentFormula) {
; Base class for Convergent formulas that allow switching to be used with<br>
; mmf5.ufm-Generic Switch Formula<br>
public:
import "common.ulb"

; @param pparent the parent, generally "this" for the parent, or zero
func MMF_SwitchConvergentFormula(Generic pparent)
ConvergentFormula.ConvergentFormula(pparent)
if (fType = @p_mandy)
fValue = fConstant = @p_start
else
fValue = fConstant = @p_seed
endif
endfunc

; Note that here zold is initialised to initial z<p>
; What it's initialised to is normally irrelevant unless the derived
; formula uses zold in its main calculations in which case the user
; should be given the choice of initialising zold to either the location,
; the initial z value or a fixed constant.<br>
; @param pz the initial location
; @return initial z for iteration
complex func Init(complex pz)
ConvergentFormula.Init(pz)
if fType
fConstant = pz
m_ZOld = fValue + fConstant
return m_ZOld
else
m_ZOld = fValue
return fValue
endif
else
m_ZOld = pz
return pz
endif
endfunc

; @param f flag for Mandelbrot or Julia mode, is true for Mandelbrots
; @param v the value to be used as the start value or constant
func SetParams(bool f,complex v)
if !@p_manual
fType = f
fValue = fConstant = v
endif
endfunc

protected:
complex fConstant
complex fValue
bool fType

default:
int param v_mmfswitchconvergentformula
caption = "Version (MMF_ConvergentFormula)"
default = 100
hint = "This version parameter is used to detect when a change has \
been made to the formula that is incompatible with the \
previous version. When that happens, this field will reflect \
the old version number to alert you to the fact that an \
alternate rendering is being used."
visible = @v_mmfswitchconvergentformula < 100
endparam
caption = "Information"
text = "This formula object is intended for use with the 'Generic \
Switch Formula' in mmf5.ufm and in formula objects that \
allow switching, however it will still function without \
switching in non-switching formulas and formula objects."
enabled = false
bool param p_manual
caption = "Manual Over-ride"
default = false
hint = "When enabled you will have manual control of the \
Mandelbrot/Julia switching and the associated parameters \
i.e. you will be able to over-ride the settings from the \
parent object. Note that this will effectively disable \
UF's built-in switching but allow full use of this formula \
when not used with a compatible switching parent."
endparam
bool param p_mandy
caption = "Mandelbrot ?"
default = true
hint = "Disable for Julia mode."
visible = @p_manual
endparam
complex param p_start
caption = "Mandelbrot Start Value"
default = (0,0)
visible = @p_manual && @p_mandy
endparam
complex param p_seed
caption = "Julia Constant"
default = (-1.25,0)
visible = @p_manual && !@p_mandy
endparam
caption = "Offset z start"
default = false
hint = "When enabled the z start value (in Mandelbrot mode) is offset \
by the constant for the current position - normally '#pixel'."
visible = !@p_manual || @p_mandy
endparam
float param p_bailout
caption = "Bailout"
default = 1.0e-5
hint = "Defines how soon an orbit bails out, i.e. doesn't belong \
to the fractal set anymore. Note: smaller values result in \
more iterations being calculated."
endparam
}

Constructor Summary
MMF_SwitchConvergentFormula()

MMF_SwitchConvergentFormula(Generic pparent)

Method Summary
complex Init(complex pz)
Note that here zold is initialised to initial z
void SetParams(boolean f, complex v)

Methods inherited from class common:ConvergentFormula
GetLowerBailout, IsBailedOut, Iterate

Methods inherited from class common:Formula
GetPrimaryExponent, GetUpperBailout

Methods inherited from class common:Generic
GetParent

Methods inherited from class Object

Constructor Detail

MMF_SwitchConvergentFormula

public MMF_SwitchConvergentFormula(Generic pparent)
Parameters:
pparent - the parent, generally "this" for the parent, or zero

MMF_SwitchConvergentFormula

public MMF_SwitchConvergentFormula()
Method Detail

Init

public complex Init(complex pz)
Note that here zold is initialised to initial z

What it's initialised to is normally irrelevant unless the derived formula uses zold in its main calculations in which case the user should be given the choice of initialising zold to either the location, the initial z value or a fixed constant.

Overrides:
Init in class ConvergentFormula
Parameters:
pz - the initial location
Returns:
initial z for iteration

SetParams

public void SetParams(boolean f,
complex v)
Parameters:
f - flag for Mandelbrot or Julia mode, is true for Mandelbrots
v - the value to be used as the start value or constant