reb
Class REB_Switch_FractalTiler

Object
  extended by common:Generic
      extended by common:Formula
          extended by reb:Switch
              extended by reb:REB_Switch_FractalTiler

class 
Switch:REB_Switch_FractalTiler

A tiling formula that can be used with any object switch formualas.



Ultra Fractal Source

Toggle UF Source Code Display

 class REB_Switch_FractalTiler(reb.ulb:Switch) {
 ; A tiling formula that can be used with any object switch formualas. <br>
 ; <p>
 public:
   import "common.ulb"
 
   func REB_Switch_FractalTiler(Generic pparent)
     Switch(pparent)
      m_mand = @p_mand
      m_jul = @p_jul
      m_c = @m_c
     fFormula = new @formulaclass(this)
   endfunc
 
   complex func Init(complex pz)
     Switch.Init(pz)
     fFormula.SetParams(m_mand, m_jul, m_c)
     pz=(@fn1(@fn2(real(pz)))+flip(@fn1(@fn2(imag(pz)))))/@p2
     pz = fFormula.Init(pz)
     return pz
   endfunc
 
   ; call for each iterated point. Overrides the parent Iterate function. <br>
   ;  <p>
   complex func Iterate(complex pz)
     pz = fFormula.Iterate(pz)
     return pz
   endfunc
 
   ; Override the default function for bailout
   bool func IsBailedOut(complex pz)
     return fFormula.IsBailedOut(pz)
   endfunc
 
 private:
   switch fFormula
 
 default:
   title = "Switch Fractal Tiler"
   heading
     text = "This a formula that can create seamless tiles with any fractal \
             object. For the best results, set the magnification on the location \
             tab to 0.6366 and do not change the other location tab settings \
             other than position. Set the Image width equal to the image height. \
             There are other combinations that will give seamless tiles."
   endheading
   int param v_switchfractaltiler
     caption = "Version (Switch Fractal Tiler)"
     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_switchfractaltiler < 100
   endparam
   Switch param formulaclass
     caption = "Fractal Formula"
     default = REB_MandelbrotJulia_Switch
     hint = "Sets the actual fractal formula to use for tiing."
   endparam
   param p2
      caption = "Zoom"
      default = 2.0
   endparam
   func fn1
      caption = "First Function"
      default = tan()
   endfunc
   func fn2
      caption = "Second Function"
      default = sin()
   endfunc
   float param p_upperbailout
     caption = "Bailout value (Divergent)"
     default = 1e10
     min = 1.0
     visible = false
   endparam
   float param p_lowerbailout
     caption = "Bailout value"
     default = 1e-10
     visible = false
   endparam
   complex param p_power ; Overrides p_power from Formula
     caption = "Power"
     default = (2,0)
     visible = false
   endparam
   bool param p_mand
     caption = "Mandel Type"
     default = true
     visible = false
   endparam
   bool param p_jul
     caption = "Julia Type"
     default = false
     visible = false
   endparam
   complex param m_c
     caption = "Julia Seed"
     default = (0,0)
     visible = false
   endparam
 }
 


Constructor Summary
REB_Switch_FractalTiler()
           
REB_Switch_FractalTiler(Generic pparent)
           
 
Method Summary
 complex Init(complex pz)
          Set up for a sequence of values
 boolean IsBailedOut(complex pz)
          Override the default function for bailout
 complex Iterate(complex pz)
          call for each iterated point.
 
Methods inherited from class reb:Switch
GetParams, SetParams
 
Methods inherited from class common:Formula
GetLowerBailout, GetPrimaryExponent, GetUpperBailout
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

REB_Switch_FractalTiler

public REB_Switch_FractalTiler(Generic pparent)

REB_Switch_FractalTiler

public REB_Switch_FractalTiler()
Method Detail

Init

public complex Init(complex pz)
Description copied from class: Formula
Set up for a sequence of values

This function will be called at the beginning of each sequence of values (e.g. at the beginning of each fractal orbit).

Overrides:
Init in class Switch
Parameters:
pz - seed value for the sequence; for a normal fractal formula, this will be #pixel
Returns:
first value in the sequence; this corresponds to #z in a fractal formula

Iterate

public complex Iterate(complex pz)
call for each iterated point. Overrides the parent Iterate function.

Overrides:
Iterate in class Switch
Parameters:
pz - previous value in the sequence; corresponds to #z in a fractal formula. Note that you should always use this value for computing the next iteration, rather than a saved value, as the calling code may modify the returned value before passing it back to the next Iterate() call.
Returns:
the next value in the sequence

IsBailedOut

public boolean IsBailedOut(complex pz)
Override the default function for bailout

Overrides:
IsBailedOut in class Switch
Parameters:
pz - last sequence value to test; this should be the value returned from the previous Iterate() call. Note that it is acceptable to ignore pz and use m_BailedOut, but any code calling IsBailedOut() should pass in the correct pz for Formula classes which do not use m_BailedOut.
Returns:
true if the sequence has bailed out (i.e. should be terminated)