mmf
Class MMF_TrapShapeZold

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by mmf:MMF_TrapShapeZold
Direct Known Subclasses:
MMF_TrapShapeCentreOfCurvature, MMF_TrapShapeCurvature, MMF_TrapShapeInterpolation, MMF_TrapShapeOldAngles, MMF_TrapShapeOrbitals, MMF_TrapShapeSimpleVergence

class 
TrapShape:MMF_TrapShapeZold

This is a base class specifically for Trap Shapes that require old values of z.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_TrapShapeZold(common.ulb:TrapShape) {
 ; This is a base class specifically for Trap Shapes that require
 ; old values of z.<br>
 public:
   import "common.ulb"
 
   ; @param pparent the parent, generally "this" for the parent, or zero
   func MMF_TrapShapeZold(Generic pparent)
     TrapShape.TrapShape(pparent)
   endfunc
   
   ; call this before each sequence of values to be trapped<br>
   ; @param pz the initial z value
   func Init(complex pz)
     m_Iterations = 0
     m_LastZ = m_zold = m_zolder = pz
     m_zoldok = m_zolderok = false
   endfunc
   
   ; call this for each iteration being trapped<p>
   ; It's up to the derived function to copy zold to zolder and
   ; pz to zold after using the values of zolder, zold and pz
   ; (without modifying them obviously).<p>
   ; And to (finally) copy zoldok to zolderok and set zoldok to true.<p>
   ; Note that if there's no result (due to no zold or zolder) then
   ; the function could return +infinity as the value to ensure the
   ; value is outside any threshold.<br>
   ; @param pz the z value
   ; @return trap distance
   float func Iterate(complex pz)
     m_Iterations = m_Iterations + 1
     m_LastZ = pz
     return real(pz)
   endfunc
   
   ; Update internal counters without transforming a value<br>
   ; Flag for "got old z values" set to false<br>
   func IterateSilent()
     m_zoldok = m_zolderok = false
     m_Iterations = m_Iterations + 1
   endfunc
 
   ; Update internal counters without transforming a value<br>
   ; Keep updating old z values<br>
   ; @param pz the z value
   func IterateSilentZold(complex pz)
     m_zolder = m_zold
     m_zold = pz
     m_zolderok = m_zoldok
     m_zoldok = true
     m_Iterations = m_Iterations + 1
   endfunc
 
 protected:
   complex m_zold
   complex m_zolder
   bool m_zoldok
   bool m_zolderok
 
 default:
   int param v_mmftrapshapezold
     caption = "Version (MMF TrapShapeZold)"
     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_mmftrapshapezold < 100
   endparam
 }
 


Constructor Summary
MMF_TrapShapeZold()
           
MMF_TrapShapeZold(Generic pparent)
           
 
Method Summary
 void Init(complex pz)
          call this before each sequence of values to be trapped
 float Iterate(complex pz)
          call this for each iteration being trapped
 void IterateSilent()
          Update internal counters without transforming a value
Flag for "got old z values" set to false
 void IterateSilentZold(complex pz)
          Update internal counters without transforming a value
Keep updating old z values
 
Methods inherited from class common:TrapShape
GetColorChannel, GetTextureValue, GetTransformedPoint, SetThreshold
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_TrapShapeZold

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

MMF_TrapShapeZold

public MMF_TrapShapeZold()
Method Detail

Init

public void Init(complex pz)
call this before each sequence of values to be trapped

Overrides:
Init in class TrapShape
Parameters:
pz - the initial z value

Iterate

public float Iterate(complex pz)
call this for each iteration being trapped

It's up to the derived function to copy zold to zolder and pz to zold after using the values of zolder, zold and pz (without modifying them obviously).

And to (finally) copy zoldok to zolderok and set zoldok to true.

Note that if there's no result (due to no zold or zolder) then the function could return +infinity as the value to ensure the value is outside any threshold.

Overrides:
Iterate in class TrapShape
Parameters:
pz - the z value
Returns:
trap distance

IterateSilent

public void IterateSilent()
Update internal counters without transforming a value
Flag for "got old z values" set to false

Overrides:
IterateSilent in class TrapShape

IterateSilentZold

public void IterateSilentZold(complex pz)
Update internal counters without transforming a value
Keep updating old z values

Parameters:
pz - the z value