mmf
Class MMF_TransformSum

Object
  extended by common:Generic
      extended by common:Transform
          extended by common:UserTransform
              extended by mmf:MMF_TransformSum

class 
UserTransform:MMF_TransformSum

Sums up to 10 transforms together (with coefficients)


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_TransformSum(common.ulb:UserTransform) {
 ; Sums up to 10 transforms together (with coefficients)<br>
 public:
   import "common.ulb"
   
   ; @param pparent the parent, generally "this" for the parent, or zero
   func MMF_TransformSum(Generic pparent)
     UserTransform.UserTransform(pparent)
     fTransform1 = new @p_Transform1(this)
     fTransform2 = new @p_Transform2(this)
     fTransform3 = new @p_Transform3(this)
     fTransform4 = new @p_Transform4(this)
     fTransform5 = new @p_Transform5(this)
     fTransform6 = new @p_Transform6(this)
     fTransform7 = new @p_Transform7(this)
     fTransform8 = new @p_Transform8(this)
     fTransform9 = new @p_Transform9(this)
     fTransform10 = new @p_Transform10(this)
   endfunc
 
   func Init(complex pz)
 ;    m_Iterations = 0 not used in this transform
     m_Solid = false
     fTransform1.Init(pz)
     fTransform2.Init(pz)
     fTransform3.Init(pz)
     fTransform4.Init(pz)
     fTransform5.Init(pz)
     fTransform6.Init(pz)
     fTransform7.Init(pz)
     fTransform8.Init(pz)
     fTransform9.Init(pz)
     fTransform10.Init(pz)
   endfunc
 
   complex func Iterate(complex pz)
 ;    m_Iterations = m_Iterations + 1 not used in this transform
     complex zz = @p_coeff1*fTransform1.Iterate(pz) \
                  + @p_coeff2*fTransform2.Iterate(pz)
     if @p_numtrans=="3" || @p_numtrans=="4" || @p_numtrans=="5" \
        || @p_numtrans=="6" || @p_numtrans=="7" || @p_numtrans=="8" \
        || @p_numtrans=="9" || @p_numtrans=="10"
       zz = zz + @p_coeff3*fTransform3.Iterate(pz)
     endif
     if @p_numtrans=="4" || @p_numtrans=="5" \
        || @p_numtrans=="6" || @p_numtrans=="7" || @p_numtrans=="8" \
        || @p_numtrans=="9" || @p_numtrans=="10"
       zz = zz + @p_coeff4*fTransform4.Iterate(pz)
     endif
     if @p_numtrans=="5" \
        || @p_numtrans=="6" || @p_numtrans=="7" || @p_numtrans=="8" \
        || @p_numtrans=="9" || @p_numtrans=="10"
       zz = zz + @p_coeff5*fTransform5.Iterate(pz)
     endif
     if @p_numtrans=="6" || @p_numtrans=="7" || @p_numtrans=="8" \
        || @p_numtrans=="9" || @p_numtrans=="10"
       zz = zz + @p_coeff6*fTransform6.Iterate(pz)
     endif
     if @p_numtrans=="7" || @p_numtrans=="8" \
        || @p_numtrans=="9" || @p_numtrans=="10"
       zz = zz + @p_coeff7*fTransform7.Iterate(pz)
     endif
     if @p_numtrans=="8" || @p_numtrans=="9" || @p_numtrans=="10"
       zz = zz + @p_coeff8*fTransform8.Iterate(pz)
     endif
     if @p_numtrans=="9" || @p_numtrans=="10"
       zz = zz + @p_coeff9*fTransform8.Iterate(pz)
     endif
     if @p_numtrans=="10"
       zz = zz + @p_coeff10*fTransform8.Iterate(pz)
     endif
     return zz
   endfunc
 
 private:
   Transform fTransform1
   Transform fTransform2
   Transform fTransform3
   Transform fTransform4
   Transform fTransform5
   Transform fTransform6
   Transform fTransform7
   Transform fTransform8
   Transform fTransform9
   Transform fTransform10
 
 default:
   title = "Transform Sum"
   int param p_numtrans
     caption = "Number of terms"
     enum = "2" "3" "4" "5" "6" "7" "8" "9" "10"
     default = 0
     hint = "Each transform term is multiplied by its coefficient \
             and the results are summed together."
   endparam
   heading
     text = "The first term in the sum."
   endheading
   complex param p_coeff1
     caption = "Coefficient 1"
     default = (1,0)
     hint = "The coefficient of the first term."
   endparam
   Transform param p_Transform1
     caption = "First Transform"
     default = MMF_GeneralTransform
   endparam
   heading
     text = "The second term in the sum."
   endheading
   complex param p_coeff2
     caption = "Coefficient 2"
     default = (1,0)
     hint = "The coefficient of the second term."
   endparam
   Transform param p_Transform2
     caption = "Second Transform"
     default = MMF_GeneralTransform
   endparam
   heading
     text = "The third term in the sum."
     visible = @p_numtrans>0
   endheading
   complex param p_coeff3
     caption = "Coefficient 3"
     default = (1,0)
     hint = "The coefficient of the third term."
     visible = @p_numtrans>0
   endparam
   Transform param p_Transform3
     caption = "Third Transform"
     default = MMF_GeneralTransform
     visible = @p_numtrans>0
   endparam
   heading
     text = "The fourth term in the sum."
     visible = @p_numtrans>1
   endheading
   complex param p_coeff4
     caption = "Coefficient 4"
     default = (1,0)
     hint = "The coefficient of the fourth term."
     visible = @p_numtrans>1
   endparam
   Transform param p_Transform4
     caption = "Fourth Transform"
     default = MMF_GeneralTransform
     visible = @p_numtrans>1
   endparam
   heading
     text = "The fifth term in the sum."
     visible = @p_numtrans>2
   endheading
   complex param p_coeff5
     caption = "Coefficient 5"
     default = (1,0)
     hint = "The coefficient of the fifth term."
     visible = @p_numtrans>2
   endparam
   Transform param p_Transform5
     caption = "Fifth Transform"
     default = MMF_GeneralTransform
     visible = @p_numtrans>2
   endparam
   heading
     text = "The sixth term in the sum."
     visible = @p_numtrans>3
   endheading
   complex param p_coeff6
     caption = "Coefficient 6"
     default = (1,0)
     hint = "The coefficient of the sixth term."
     visible = @p_numtrans>3
   endparam
   Transform param p_Transform6
     caption = "Sixth Transform"
     default = MMF_GeneralTransform
     visible = @p_numtrans>3
   endparam
   heading
     text = "The seventh term in the sum."
     visible = @p_numtrans>4
   endheading
   complex param p_coeff7
     caption = "Coefficient 7"
     default = (1,0)
     hint = "The coefficient of the seventh term."
     visible = @p_numtrans>4
   endparam
   Transform param p_Transform7
     caption = "Seventh Transform"
     default = MMF_GeneralTransform
     visible = @p_numtrans>4
   endparam
   heading
     text = "The eighth term in the sum."
     visible = @p_numtrans>5
   endheading
   complex param p_coeff8
     caption = "Coefficient 8"
     default = (1,0)
     hint = "The coefficient of the eighth term."
     visible = @p_numtrans>5
   endparam
   Transform param p_Transform8
     caption = "Eighth Transform"
     default = MMF_GeneralTransform
     visible = @p_numtrans>5
   endparam
   heading
     text = "The ninth term in the sum."
     visible = @p_numtrans>6
   endheading
   complex param p_coeff9
     caption = "Coefficient 9"
     default = (1,0)
     hint = "The coefficient of the ninth term."
     visible = @p_numtrans>6
   endparam
   Transform param p_Transform9
     caption = "Ninth Transform"
     default = MMF_GeneralTransform
     visible = @p_numtrans>6
   endparam
   heading
     text = "The tenth term in the sum."
     visible = @p_numtrans>7
   endheading
   complex param p_coeff10
     caption = "Coefficient 10"
     default = (1,0)
     hint = "The coefficient of the tenth term."
     visible = @p_numtrans>7
   endparam
   Transform param p_Transform10
     caption = "Tenth Transform"
     default = MMF_GeneralTransform
     visible = @p_numtrans>7
   endparam
 }
 


Constructor Summary
MMF_TransformSum()
           
MMF_TransformSum(Generic pparent)
           
 
Method Summary
 void Init(complex pz)
          Set up for a sequence of values
 complex Iterate(complex pz)
          Transform a single point within a sequence
 
Methods inherited from class common:Transform
IsSolid, IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_TransformSum

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

MMF_TransformSum

public MMF_TransformSum()
Method Detail

Init

public void Init(complex pz)
Description copied from class: Transform
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). It will be called even if only one value is being transformed (e.g. a normal transformation formula). Use this to perform any setup that is exactly the same for each value in the sequence being transformed.

Overrides:
Init in class Transform
Parameters:
pz - the value representing the sequence; for a normal transformation formula use, this will be #pixel. In some cases this may differ from the first value passed to Iterate() if the calling code applies some other transformations.

Iterate

public complex Iterate(complex pz)
Description copied from class: Transform
Transform a single point within a sequence

After a sequence has been set up with Init(), this function will be called once for each value in the sequence. Note that all values in the sequence must be processed in order (they cannot be processed out of order). If the sequence contains only one value, Init() will still be called and then Iterate() will be called just once.

Overrides:
Iterate in class Transform
Parameters:
pz - the complex value to be transformed
Returns:
the transformed value