mmf
Class MMF_SwitchConvergentDivergentFormula

Object
  extended by common:Generic
      extended by common:Formula
          extended by common:ConvergentDivergentFormula
              extended by mmf:MMF_SwitchConvergentDivergentFormula
Direct Known Subclasses:
MMF_SwitchFormulaTransformWrapper, MMF_SwitchFormulaWars2, MMF_SwitchMagnet1, MMF_SwitchMagnet2, MMF_SwitchNova, MMF_SwitchRecursion

class 
ConvergentDivergentFormula:MMF_SwitchConvergentDivergentFormula

Switch Convergent/Divergent Formula base class.

This class extends Formula to provide automatic, simple bailout tests. Formulas for which the outside points converge on points OR grow without bound should derive from this class so as to avoid having to write the bailout tests and the GetUpperBailout() and GetLowerBailout() function.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_SwitchConvergentDivergentFormula(common.ulb:ConvergentDivergentFormula) {
   ; Switch Convergent/Divergent Formula base class.<p>
   ;
   ; This class extends Formula to provide automatic, simple
   ; bailout tests. Formulas for which the outside points
   ; converge on points OR grow without bound should derive
   ; from this class so as to avoid having to write the
   ; bailout tests and the GetUpperBailout() and
   ; GetLowerBailout() function.<br>
   
 public:
   ; @param pparent the parent, generally "this" for the parent, or zero
   func MMF_SwitchConvergentDivergentFormula(Generic pparent)
     ConvergentDivergentFormula.ConvergentDivergentFormula(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 location (normally #pixel)
   ; @return initial z for iteration
   complex func Init(complex pz)
     ConvergentDivergentFormula.Init(pz)
     if fType
       fConstant = pz
       if @p_addpixel
         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_mmfswitchconvergentdivergentformula
     caption = "Version (MMF_SwitchConvergentDivergentFormula)"
     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_mmfswitchconvergentdivergentformula < 100
   endparam
   heading
     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."
   endheading
   heading
     enabled = false
   endheading
   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
   bool param p_addpixel
     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
 }
 


Constructor Summary
MMF_SwitchConvergentDivergentFormula()
           
MMF_SwitchConvergentDivergentFormula(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:ConvergentDivergentFormula
GetLowerBailout, GetUpperBailout, IsBailedOut, Iterate
 
Methods inherited from class common:Formula
GetPrimaryExponent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_SwitchConvergentDivergentFormula

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

MMF_SwitchConvergentDivergentFormula

public MMF_SwitchConvergentDivergentFormula()
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 ConvergentDivergentFormula
Parameters:
pz - the location (normally #pixel)
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