jlb
Class JLB_AdvancedBailout

Object
  extended by common:Generic
      extended by jlb:Reduction
          extended by jlb:JLB_AdvancedBailout

class 
Reduction:JLB_AdvancedBailout

The Iterate code is a direct copy from Ron Barnett's code, which appears in several places.


Ultra Fractal Source

Toggle UF Source Code Display

 class JLB_AdvancedBailout(Reduction) {
 ; The Iterate code is a direct copy from Ron Barnett's code, which appears in
 ; several places.
 
 public:
   import "common.ulb"
 
   func JLB_AdvancedBailout(Generic pparent)
     Reduction.Reduction(pparent)
   endfunc
   
   func Init(complex pz)
     m_BailoutValue = real(pz)
   endfunc
 
   ; @param pz
   ; @return true if bailed out.
   bool func Iterate(complex pz)
     if @bailout_type == "mod"
       return (|pz| > m_BailoutValue)
     elseif @bailout_type == "real"
       return (sqr(real(pz)) > m_BailoutValue)
     elseif @bailout_type == "imag"
       return (sqr(imag(pz)) > m_BailoutValue)
     elseif @bailout_type == "or"
       return (sqr(real(pz)) > m_BailoutValue || sqr(imag(pz)) > m_BailoutValue)  
     elseif @bailout_type == "and"
       return (sqr(real(pz)) > m_BailoutValue && sqr(imag(pz)) > m_BailoutValue)  
     elseif @bailout_type == "manh"
       return (sqr(abs(real(pz)) + abs(imag(pz))) > m_BailoutValue)
     elseif @bailout_type == "manr"
       return (sqr(real(pz) + imag(pz)) > m_BailoutValue)
     else;if @bailout_type == "function"
       return (sqr(real(@bailout_func(pz))) > m_BailoutValue)
     endif
   endfunc
   
 protected:
   float m_BailoutValue
 
 default:
   title = "Advanced Bailout"
   int param v_AdvancedBailout
     caption = "Version (AdvancedBailout)"
     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_AdvancedBailout < 100
   endparam
 
   Heading
    caption = "Bailout"
   Endheading  
 
   param bailout_type
     caption = "Bailout test type"
     default = 0
     enum = "mod" "real" "imag" "or" "and" "manh" "manr" "function"
     hint = "mod gives the usual behavior"
   endparam
 
   func bailout_func
    caption = "Bailout Function"
    default = ident ()
    visible = @bailout_type == 7
   endfunc
 }
 


Constructor Summary
JLB_AdvancedBailout()
           
JLB_AdvancedBailout(Generic pparent)
           
 
Method Summary
 void Init(complex pz)
           
 boolean Iterate(complex pz)
           
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

JLB_AdvancedBailout

public JLB_AdvancedBailout(Generic pparent)

JLB_AdvancedBailout

public JLB_AdvancedBailout()
Method Detail

Init

public void Init(complex pz)
Overrides:
Init in class Reduction

Iterate

public boolean Iterate(complex pz)
Overrides:
Iterate in class Reduction
Parameters:
pz -
Returns:
true if bailed out.