mmf
Class MMF_TrapModeSmoothNearestAbove

Object
  extended by common:Generic
      extended by common:TrapMode
          extended by common:TrapModeWithThreshold
              extended by mmf:MMF_TrapModeSmoothWithThreshold
                  extended by mmf:MMF_TrapModeSmoothNearestAbove

class 
MMF_TrapModeSmoothWithThreshold:MMF_TrapModeSmoothNearestAbove

Returns values from the trapped iteration with the nearest distance greater than or equal to the user value and within the threshold of it.


Ultra Fractal Source

Toggle UF Source Code Display

 class MMF_TrapModeSmoothNearestAbove(MMF_TrapModeSmoothWithThreshold) {
 ; Returns values from the trapped iteration with the nearest distance
 ; greater than or equal to the user value and within the threshold of it.<br>
 public:
   import "common.ulb"
 
   func MMF_TrapModeSmoothNearestAbove(Generic pparent)
     MMF_TrapModeSmoothWithThreshold.MMF_TrapModeSmoothWithThreshold(pparent)
   endfunc
   
   func Init(complex pz)
     m_Iterations = 0
     m_Solid = true
     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] = 1e20
       m_Textures[j] = m_OldTextures[j] = 0.0
      until  (j=j-1)<0
      m_wastrapped = false
   endfunc
   
   func Iterate(complex pz, complex pzt, float pdistance, float ptexture)
     MMF_TrapModeSmoothWithThreshold.Iterate(pz, pzt, pdistance, ptexture)
     if (pdistance = pdistance - @p_testdist)>=0
       if (pdistance < m_Threshold)
         m_Solid = false
       endif
       if (pdistance < m_Distances[0])
         m_Distances[0] = pdistance
         m_Textures[0] = ptexture
         m_UntransformedPoints[0] = pz
         m_TransformedPoints[0] = pzt
         m_IterationPoints[0] = m_Iterations
         m_wastrapped = true
       endif
     endif
   endfunc
 
   func OldResult()
     if m_OldIterationPoints[0]>0
        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
     endif
   endfunc
   
 default:
   title = "Smooth Nearest Above"
   rating = recommended
   float param p_testdist
     caption = "Trap Test Distance"
     default = 0.5
     hint = "Traps the result nearest this distance from the trap but only \
             if it's more than this distance from the trap."
   endparam
 }
 


Constructor Summary
MMF_TrapModeSmoothNearestAbove()
           
MMF_TrapModeSmoothNearestAbove(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 OldResult()
          call this to compute penultimate results
 
Methods inherited from class mmf:MMF_TrapModeSmoothWithThreshold
IterateSilent
 
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_TrapModeSmoothNearestAbove

public MMF_TrapModeSmoothNearestAbove(Generic pparent)

MMF_TrapModeSmoothNearestAbove

public MMF_TrapModeSmoothNearestAbove()
Method Detail

Init

public void Init(complex pz)
Description copied from class: MMF_TrapModeSmoothWithThreshold
call this at the beginning of each sequence

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

Iterate

public void Iterate(complex pz,
                    complex pzt,
                    float pdistance,
                    float ptexture)
Description copied from class: MMF_TrapModeSmoothWithThreshold
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 MMF_TrapModeSmoothWithThreshold
Parameters:
pz - the z value
pzt - the transformed z value
pdistance - the trap distance
ptexture - tyhe texture value

OldResult

public void OldResult()
Description copied from class: MMF_TrapModeSmoothWithThreshold
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.

Overrides:
OldResult in class MMF_TrapModeSmoothWithThreshold