common
Class TrapShapeBlock

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by common:TrapShapeBlock

class 
TrapShape:TrapShapeBlock

This is a generic trap "block". This is essentially a small wrapper around a transformation, a trap shape, and a transfer function. You can use it anywhere a TrapShape is needed.


Ultra Fractal Source

Toggle UF Source Code Display

 class TrapShapeBlock(TrapShape) {
   ; This is a generic trap "block". This is essentially a small
   ; wrapper around a transformation, a trap shape, and a transfer
   ; function. You can use it anywhere a TrapShape is needed.
   
 public:
   func TrapShapeBlock(Generic pparent)
     TrapShape.TrapShape(pparent)
 
     m_TrapTransform = new @f_traptransform(this)
     m_TrapShape = new @f_trapshape(this)
     m_TrapTransfer = new @f_traptransfer(this)
   endfunc
 
   func Init(complex pz)
     TrapShape.Init(pz)
     
     m_TrapTransform.Init(pz)
     m_TrapShape.Init(pz)
     m_TrapTransfer.Init(pz)
   endfunc
 
   float func Iterate(complex pz)
     complex zt = m_TrapTransform.Iterate(pz)
     float distance = m_TrapShape.Iterate(zt)
     distance = m_TrapTransfer.Iterate(distance)
     return distance
   endfunc
   
   func SetThreshold(float pthreshold)
     m_TrapShape.SetThreshold(pthreshold)
   endfunc
   
   complex func GetTransformedPoint()
     return m_TrapShape.GetTransformedPoint()
   endfunc
 
   float func GetTextureValue()
     return m_TrapShape.GetTextureValue()
   endfunc
   
   int func GetColorChannel()
     return m_TrapShape.GetColorChannel()
   endfunc
   
 protected:
   UserTransform m_TrapTransform
   TrapShape m_TrapShape
   Transfer m_TrapTransfer
 
 default:
   title = "TrapShape Block"
 
   int param v_trapshapeblock
     caption = "Version (TrapShapeBlock)"
     default = 101
     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_trapshapeblock < 100
   endparam
 
   UserTransform param f_traptransform
     caption = "Trap Position"
     default = TrapTransform
     expanded = false
   endparam
   TrapShape param f_trapshape
     caption = "Trap Shape"
     default = TrapShapePoint
   endparam
   Transfer param f_traptransfer
     caption = "Trap Transfer"
     default = NullTransfer
   endparam
 }
 


Constructor Summary
TrapShapeBlock()
           
TrapShapeBlock(Generic pparent)
           
 
Method Summary
 int GetColorChannel()
          Get color channel.
 float GetTextureValue()
          Get texture value.
 complex GetTransformedPoint()
          Get transformed point.
 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 SetThreshold(float pthreshold)
          call this to set the threshold selected by the user it's up to the calling code to apply the threshold, but some trap shapes or merges need to know the threshold to work properly
 
Methods inherited from class common:TrapShape
IterateSilent
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

TrapShapeBlock

public TrapShapeBlock(Generic pparent)

TrapShapeBlock

public TrapShapeBlock()
Method Detail

Init

public void Init(complex pz)
Description copied from class: TrapShape
call this before each sequence of values to be trapped

Overrides:
Init in class TrapShape

Iterate

public float Iterate(complex pz)
Description copied from class: TrapShape
call this for each iteration being trapped

Overrides:
Iterate in class TrapShape

SetThreshold

public void SetThreshold(float pthreshold)
Description copied from class: TrapShape
call this to set the threshold selected by the user it's up to the calling code to apply the threshold, but some trap shapes or merges need to know the threshold to work properly

Overrides:
SetThreshold in class TrapShape

GetTransformedPoint

public complex GetTransformedPoint()
Description copied from class: TrapShape
Get transformed point.

Some trap modes and trap coloring modes require access to the "transformed" point. This is the final point that is actually used by the trap shape class to test against the trap. For most trap shape classes this will be exactly the same as the pz passed into Iterate(), and those classes can use this base class functionality. However, some trap shape classes (e.g. TrapShapeMerge, TrapShapeBlock) perform some internal transformations on pz before passing it to the trap shape; this gives them the opportunity to call their trap shape's function to get the final transformed point.

Overrides:
GetTransformedPoint in class TrapShape
Returns:
the last transformed point used (i.e. call GetTransformedPoint() after calling Iterate(), not before)

GetTextureValue

public float GetTextureValue()
Description copied from class: TrapShape
Get texture value.

Ordinarily, a trap shape does not have a native texture (it is flat). Some formulas may pair trap shapes with trap textures, and may need more information about trap textures when trap shapes are nested via TrapShapeMerge. This function provides support for accessing texture information.

Overrides:
GetTextureValue in class TrapShape
Returns:
the texture value for the last point used (i.e. call GetTextureValue() after calling Iterate(), not before)

GetColorChannel

public int GetColorChannel()
Description copied from class: TrapShape
Get color channel.

Some trap shapes may be inherently multi-colored. Such trap shapes may either override this function to return a different color index, or may simply store the index in m_LastChannel and this function will return it. The color index is just an indication of which color channel (in a GradientWrapper object) should be used.

Overrides:
GetColorChannel in class TrapShape
Returns:
the color channel value for the last point used (i.e. call GetColorChannel() after calling Iterate(), not before)