mmf
Class MMF_TrapModeSmoothWithThreshold

Object
  extended by common:Generic
      extended by common:TrapMode
          extended by common:TrapModeWithThreshold
              extended by mmf:MMF_TrapModeSmoothWithThreshold
Direct Known Subclasses:
JLB_TrapModeCollection, MMF_TrapModeSmoothAverage, MMF_TrapModeSmoothClosest, MMF_TrapModeSmoothFarthest, MMF_TrapModeSmoothFarthestAbove, MMF_TrapModeSmoothFarthestBelow, MMF_TrapModeSmoothFarthestDist, MMF_TrapModeSmoothLast, MMF_TrapModeSmoothNearest, MMF_TrapModeSmoothNearestAbove, MMF_TrapModeSmoothNearestBelow, MMF_TrapModeSmoothNth, MMF_TrapModeSmoothProduct, MMF_TrapModeSmoothProductAbove, MMF_TrapModeSmoothProductBelow, MMF_TrapModeSmoothProductDist, MMF_TrapModeSmoothSecondClosest, MMF_TrapModeSmoothSecondFarthest, MMF_TrapModeSmoothSum, MMF_TrapModeSmoothSumAbove, MMF_TrapModeSmoothSumBelow, MMF_TrapModeSmoothSumDist, MMF_TrapModeSmoothTurningPoints

class 
TrapModeWithThreshold:MMF_TrapModeSmoothWithThreshold

Essentially a variant of TrapModeSmooth that is thresholdable

Derived from TrapModeThreshold to ensure that the threshold parameter will be visible if used with non-smoothed orbit traps.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_TrapModeSmoothWithThreshold(common.ulb:TrapModeWithThreshold) {
 ;
 ; Essentially a variant of TrapModeSmooth that is thresholdable<p>
 ; Derived from TrapModeThreshold to ensure that the threshold parameter
 ; will be visible if used with non-smoothed orbit traps.<br>
 ;  
 public:
 
   ; @param pparent the parent, generally "this" for the parent, or zero
   func MMF_TrapModeSmoothWithThreshold(Generic pparent)
     TrapModeWithThreshold.TrapModeWithThreshold(pparent)
   endfunc
   
   ; call this at the beginning of each sequence<br>
   ; @param pz the initial z value
   func Init(complex pz)
     m_Iterations = 0
     m_Solid = false
     int j = 3
      repeat
       m_UntransformedPoints[j] = m_OldUntransformedPoints[j] = (0,0)
       m_TransformedPoints[j] = m_OldTransformedPoints[j] = (0,0)
        m_IterationPoints[j] = m_OldIterationPoints[j] = 0
        m_Distances[j] = m_OldDistances[j] = 0.0
       m_Textures[j] = m_OldTextures[j] = 0.0
      until  (j=j-1)<0
      m_wastrapped = false
   endfunc
   
   ; call this for each point
   ; <p>Note that derived functions should always copy all used
   ; parameters to the "old" versions when they are changed as here.<p>
   ;  m_wastrapped should be set to true in the derived
   ; function when the main (current) values get changed<br>
   ; @param pz the z value
   ; @param pzt the transformed z value
   ; @param pdistance the trap distance
   ; @param ptexture tyhe texture value
   func Iterate(complex pz, complex pzt, float pdistance, float ptexture)
     if m_wastrapped
       m_OldDistances[0] = m_Distances[0]
       m_OldTextures[0] = m_Textures[0]
       m_OldUntransformedPoints[0] = m_UntransformedPoints[0]
       m_OldTransformedPoints[0] = m_TransformedPoints[0]
       m_OldIterationPoints[0] = m_IterationPoints[0]
     endif
     m_Iterations = m_Iterations + 1
   endfunc
   
   ; call this for each point that is ignored (for smooth orbit traps)<br>
   ; if the last point was trapped then copy the current values into
   ; the "old" ones
   func IterateSilent()
     if m_wastrapped
       m_OldDistances[0] = m_Distances[0]
       m_OldTextures[0] = m_Textures[0]
       m_OldUntransformedPoints[0] = m_UntransformedPoints[0]
       m_OldTransformedPoints[0] = m_TransformedPoints[0]
       m_OldIterationPoints[0] = m_IterationPoints[0]
       m_wastrapped = false
     endif
     m_Iterations = m_Iterations + 1
   endfunc
 
   ; call this to compute penultimate results<p>
   ; This should only be called after previously calling Result()
   ; and getting the actual result value using the Trap Color Mode
   ; since the original result values are destroyed by this call.<br>
   func OldResult()
     ; Note that in some cases if less than two values were trapped this
     ; should be skipped i.e. old result should be the same as result<br>
      m_Distances[0] = m_OldDistances[0]
     m_Textures[0] = m_OldTextures[0]
     m_UntransformedPoints[0] = m_OldUntransformedPoints[0]
      m_TransformedPoints[0] = m_OldTransformedPoints[0]
     m_IterationPoints[0] = m_OldIterationPoints[0]
     m_Iterations = m_Iterations - 1
   endfunc
 
 protected:
   complex m_OldUntransformedPoints[4]
   complex m_OldTransformedPoints[4]
   float m_OldIterationPoints[4]
   float m_OldDistances[4]
   float m_OldTextures[4]
   bool m_wastrapped
 
 default:
   int param v_mmf_trapmodesmoothwiththreshold
     caption = "Version (MMF_TrapModeSmoothWithThreshold)"
     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_mmf_trapmodesmoothwiththreshold < 100
   endparam
 }
 


Constructor Summary
MMF_TrapModeSmoothWithThreshold()
           
MMF_TrapModeSmoothWithThreshold(Generic pparent)
           
 
Method Summary
 void Init(complex pz)
          call this at the beginning of each sequence
 void Iterate(complex pz, complex pzt, float pdistance, float ptexture)
          call this for each point
 void IterateSilent()
          call this for each point that is ignored (for smooth orbit traps)
if the last point was trapped then copy the current values into the "old" ones
 void OldResult()
          call this to compute penultimate results
 
Methods inherited from class common:TrapModeWithThreshold
GetThreshold, SetThreshold, UsesThreshold
 
Methods inherited from class common:TrapMode
GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, IsSolid, Result
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MMF_TrapModeSmoothWithThreshold

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

MMF_TrapModeSmoothWithThreshold

public MMF_TrapModeSmoothWithThreshold()
Method Detail

Init

public void Init(complex pz)
call this at the beginning of each sequence

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

Iterate

public void Iterate(complex pz,
                    complex pzt,
                    float pdistance,
                    float ptexture)
call this for each point

Note that derived functions should always copy all used parameters to the "old" versions when they are changed as here.

m_wastrapped should be set to true in the derived function when the main (current) values get changed

Overrides:
Iterate in class TrapMode
Parameters:
pz - the z value
pzt - the transformed z value
pdistance - the trap distance
ptexture - tyhe texture value

IterateSilent

public void IterateSilent()
call this for each point that is ignored (for smooth orbit traps)
if the last point was trapped then copy the current values into the "old" ones

Overrides:
IterateSilent in class TrapMode

OldResult

public void OldResult()
call this to compute penultimate results

This should only be called after previously calling Result() and getting the actual result value using the Trap Color Mode since the original result values are destroyed by this call.