dmj5
Class DMJ_TrapModeSecondClosest

Object
  extended by common:Generic
      extended by common:TrapMode
          extended by common:TrapModeWithThreshold
              extended by dmj5:DMJ_TrapModeSecondClosest
Direct Known Subclasses:
DMJ_TrapModeTwoClosest

class 
TrapModeWithThreshold:DMJ_TrapModeSecondClosest



Ultra Fractal Source

Toggle UF Source Code Display

 class DMJ_TrapModeSecondClosest(common.ulb:TrapModeWithThreshold) {
 public:
   import "common.ulb"
 
   func DMJ_TrapModeSecondClosest(Generic pparent)
     TrapModeWithThreshold.TrapModeWithThreshold(pparent)
   endfunc
   
   func Init(complex pz)
     TrapModeWithThreshold.Init(pz)
     
     m_Solid = true
     int j = 0
     while (j < 4)
       m_Distances[j] = 1e20
       ; Note that textures are left initialized to zero.
       j = j + 1
     endwhile
   endfunc
   
   func Iterate(complex pz, complex pzt, float pdistance, float ptexture)
     TrapModeWithThreshold.Iterate(pz, pzt, pdistance, ptexture)
     
     if (pdistance < m_Threshold)
       m_Solid = false
     endif
     if (pdistance < m_Distances[0])
       m_Distances[1] = m_Distances[0]
       m_Textures[1] = m_Textures[0]
       m_UntransformedPoints[1] = m_UntransformedPoints[0]
       m_TransformedPoints[1] = m_TransformedPoints[0]
       m_IterationPoints[1] = m_IterationPoints[0]
       
       m_Distances[0] = pdistance
       m_Textures[0] = ptexture
       m_UntransformedPoints[0] = pz
       m_TransformedPoints[0] = pzt
       m_IterationPoints[0] = m_Iterations
     elseif (pdistance < m_Distances[1])
       m_Distances[1] = pdistance
       m_Textures[1] = ptexture
       m_UntransformedPoints[1] = pz
       m_TransformedPoints[1] = pzt
       m_IterationPoints[1] = m_Iterations
     endif
   endfunc
 
   func Result()
     m_Distances[0] = abs(m_Distances[0] - m_Distances[1])
     m_Textures[0] = m_Textures[0] - m_Textures[1]
     m_UntransformedPoints[0] = m_UntransformedPoints[0] - m_UntransformedPoints[1]
     m_TransformedPoints[0] = m_TransformedPoints[0] - m_TransformedPoints[1]
     m_IterationPoints[0] = abs(m_IterationPoints[0] - m_IterationPoints[1])
   endfunc
 
 default:
   title = "Second Closest"
 
   int param v_dmj_trapmodesecondclosest
     caption = "Version (DMJ_TrapModeSecondClosest)"
     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_dmj_trapmodesecondclosest < 100
   endparam
 }
 


Constructor Summary
DMJ_TrapModeSecondClosest()
           
DMJ_TrapModeSecondClosest(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 Result()
          call this to compute final results
 
Methods inherited from class common:TrapModeWithThreshold
GetThreshold, SetThreshold, UsesThreshold
 
Methods inherited from class common:TrapMode
GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, IsSolid, IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

DMJ_TrapModeSecondClosest

public DMJ_TrapModeSecondClosest(Generic pparent)

DMJ_TrapModeSecondClosest

public DMJ_TrapModeSecondClosest()
Method Detail

Init

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

Overrides:
Init in class TrapMode

Iterate

public void Iterate(complex pz,
                    complex pzt,
                    float pdistance,
                    float ptexture)
Description copied from class: TrapMode
call this for each point

Overrides:
Iterate in class TrapMode

Result

public void Result()
Description copied from class: TrapMode
call this to compute final results

Overrides:
Result in class TrapMode