common
Class TrapMode

Object
  extended by common:Generic
      extended by common:TrapMode
Direct Known Subclasses:
DMJ_TrapModeChangeAverage, DMJ_TrapModeSignAverage, MMF_TrapModeSmooth, TrapModeWithThreshold

class 
Generic:TrapMode

This is a generic trap mode formula. It takes a sequence of complex point pairs (untransformed and transformed) and distances and produces a final result


Ultra Fractal Source

Toggle UF Source Code Display

 class TrapMode(Generic) {
   ; This is a generic trap mode formula. It takes a sequence of
   ; complex point pairs (untransformed and transformed) and
   ; distances and produces a final result
   
 public:
   ; constructor
   func TrapMode(Generic pparent)
     Generic.Generic(pparent)
   endfunc
   
   ; call this at the beginning of each sequence
   func Init(complex pz)
     m_Iterations = 0
     m_Solid = false
     
     int j = 0
     while (j < 4)
       m_UntransformedPoints[j] = (0,0)
       m_TransformedPoints[j] = (0,0)
       m_IterationPoints[j] = 0
       m_Distances[j] = 0.0
       m_Textures[j] = 0.0
       j = j + 1
     endwhile
   endfunc
   
   ; call this for each point
   func Iterate(complex pz, complex pzt, float pdistance, float ptexture)
     m_Iterations = m_Iterations + 1
   endfunc
   
   ; call this for each point that is ignored
   func IterateSilent()
     m_Iterations = m_Iterations + 1
   endfunc
   
   ; call this to compute final results
   func Result()
   endfunc
   
   ; call this to determine if the last sequence produced a solid point
   bool func IsSolid()
     return m_Solid
   endfunc
   
   ; get a final untransformed point
   complex func GetUntransformedPoint(int pindex)
     return m_UntransformedPoints[pindex]
   endfunc
 
   ; get a final transformed point
   complex func GetTransformedPoint(int pindex)
     return m_TransformedPoints[pindex]
   endfunc
 
   ; get a final distance
   float func GetDistance(int pindex)
     return m_Distances[pindex]
   endfunc
 
   ; get a final texture
   float func GetTexture(int pindex)
     return m_Textures[pindex]
   endfunc
 
   ; get a final iteration
   float func GetIteration(int pindex)
     return m_IterationPoints[pindex]
   endfunc
 
   ; get threshold value
   float func GetThreshold()
     return 1.0
   endfunc
   
   func SetThreshold(float pthreshold)
   endfunc
   
   ; get whether threshold is even used
   bool func UsesThreshold()
     return false
   endfunc
 
 protected:
   int m_Iterations    ; count the number of iterations
   bool m_Solid      ; flag indicating whether sequence was solid or not
 
   complex m_UntransformedPoints[4]
   complex m_TransformedPoints[4]
   float m_IterationPoints[4]
   float m_Distances[4]
   float m_Textures[4]
 
 default:
   int param v_trapmode
     caption = "Version (TrapMode)"
     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_trapmode < 100
   endparam
 }
 


Constructor Summary
TrapMode()
           
TrapMode(Generic pparent)
          constructor
 
Method Summary
 float GetDistance(int pindex)
          get a final distance
 float GetIteration(int pindex)
          get a final iteration
 float GetTexture(int pindex)
          get a final texture
 float GetThreshold()
          get threshold value
 complex GetTransformedPoint(int pindex)
          get a final transformed point
 complex GetUntransformedPoint(int pindex)
          get a final untransformed point
 void Init(complex pz)
          call this at the beginning of each sequence
 boolean IsSolid()
          call this to determine if the last sequence produced a solid point
 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
 void Result()
          call this to compute final results
 void SetThreshold(float pthreshold)
           
 boolean UsesThreshold()
          get whether threshold is even used
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

TrapMode

public TrapMode(Generic pparent)
constructor


TrapMode

public TrapMode()
Method Detail

Init

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


Iterate

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


IterateSilent

public void IterateSilent()
call this for each point that is ignored


Result

public void Result()
call this to compute final results


IsSolid

public boolean IsSolid()
call this to determine if the last sequence produced a solid point


GetUntransformedPoint

public complex GetUntransformedPoint(int pindex)
get a final untransformed point


GetTransformedPoint

public complex GetTransformedPoint(int pindex)
get a final transformed point


GetDistance

public float GetDistance(int pindex)
get a final distance


GetTexture

public float GetTexture(int pindex)
get a final texture


GetIteration

public float GetIteration(int pindex)
get a final iteration


GetThreshold

public float GetThreshold()
get threshold value


SetThreshold

public void SetThreshold(float pthreshold)

UsesThreshold

public boolean UsesThreshold()
get whether threshold is even used