mmf
Class MMF_SwitchGradientSlopeHelper
Object
mmf:MMF_SwitchGradientSlopeHelper
class
- Object:MMF_SwitchGradientSlopeHelper
Helper class for SwitchGradientSlope.
By David Makin
First version May 2008
Ultra Fractal Source
Toggle UF Source Code Display
class MMF_SwitchGradientSlopeHelper {
;
; Helper class for SwitchGradientSlope.<br>
; By David Makin<br>
; First version May 2008<br>
;
public:
import "common.ulb"
import "Standard.ulb"
func MMF_SwitchGradientSlopeHelper(MMF_SwitchGradientSlope owner)
fFormula = new @formulaClass(owner)
fColouring = new @coloringClass(owner)
endfunc
complex func Init(const complex pz)
fZ = fFormula.Init(pz)
fColouring.Init(fZ,pz)
return fZ
endfunc
func SetParams(bool f,complex v)
if @formulaClass==MMF_SwitchFormula
MMF_SwitchFormula(fFormula).SetParams(f,v)
elseif @formulaClass==MMF_SwitchDivergentFormula
MMF_SwitchDivergentFormula(fFormula).SetParams(f,v)
elseif @formulaClass==MMF_SwitchConvergentFormula
MMF_SwitchConvergentFormula(fFormula).SetParams(f,v)
elseif @formulaClass==MMF_SwitchConvergentDivergentFormula
MMF_SwitchConvergentDivergentFormula(fFormula).SetParams(f,v)
endif
endfunc
complex func Iterate()
return (fZ = fFormula.Iterate(fZ))
endfunc
func IterateCol()
fColouring.Iterate(fZ)
return
endfunc
bool func IsBailedOut()
return fFormula.IsBailedOut(fZ)
endfunc
float func GetHeight()
return fColouring.ResultIndex(fZ)
endfunc
complex func GetPrimaryExponent()
return fFormula.GetPrimaryExponent()
endfunc
float func GetUpperBailout()
return fFormula.GetUpperBailout()
endfunc
float func GetLowerBailout()
return fFormula.GetLowerBailout()
endfunc
private:
Formula fFormula
GradientColoring fColouring
complex fZ
default:
title = "Switch Gradient Slope Helper"
int param v_mmfgradientslopehelper
caption = "Version (MMF Gradient Slope Helper)"
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_mmfgradientslopehelper<100
endparam
heading
text = "'Fractal Formula' is not a switch formula and so will \
not switch using UFs built-in switch method."
visible = @formulaClass!=MMF_SwitchFormula \
&& @formulaClass!=MMF_SwitchDivergentFormula \
&& @formulaClass!=MMF_SwitchConvergentFormula \
&& @formulaClass!=MMF_SwitchConvergentDivergentFormula
endheading
Formula param formulaClass
caption = "Fractal Formula"
default = MMF_SwitchStandard
hint = "Sets the actual fractal formula to use for the lighting effect."
endparam
GradientColoring param coloringClass
caption = "Colouring Algorithm"
default = Standard_Smooth
hint = "Selects the colouring algorithm to be used. Note that where \
necessary you should ensure duplicate parameters in the 'Fractal \
Formula' and the 'Colouring Algorithm' match each other - \
typically bailout values and degree/exponent/power values."
endparam
}
Methods inherited from class Object |
|
MMF_SwitchGradientSlopeHelper
public MMF_SwitchGradientSlopeHelper(MMF_SwitchGradientSlope owner)
MMF_SwitchGradientSlopeHelper
public MMF_SwitchGradientSlopeHelper()
Init
public complex Init(complex pz)
SetParams
public void SetParams(boolean f,
complex v)
Iterate
public complex Iterate()
IterateCol
public void IterateCol()
IsBailedOut
public boolean IsBailedOut()
GetHeight
public float GetHeight()
GetPrimaryExponent
public complex GetPrimaryExponent()
GetUpperBailout
public float GetUpperBailout()
GetLowerBailout
public float GetLowerBailout()