Standard
Class Standard_TrapShapeWaves

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by Standard:Standard_TrapShapeWaves

class 
TrapShape:Standard_TrapShapeWaves



Ultra Fractal Source

Toggle UF Source Code Display

 class Standard_TrapShapeWaves(common.ulb:TrapShape) {
 public:
   float func Iterate(complex pz)
     float d
     float d2
     if @style == "Normal"
       d = abs(abs(imag(pz) + sin(real(pz)*@trapfreq)*@traporder) - @diameter)
     elseif @style == "Mirrored"
       d = abs(abs(imag(pz)) - @diameter + sin(real(pz)*@trapfreq)*@traporder)
     elseif @style == "Mirrored 2"
       d2 = @diameter - sin(real(pz)*@trapfreq)*@traporder ; compute wave height
       d = abs(abs(imag(pz)) - d2)  ; distance to each wave
       d2 = abs(abs(imag(pz)) + d2)
       if d2 < d
         d = d2
       endif
     elseif @style == "Radial"
       d2 = atan2(pz)
       d = abs(cabs(pz) * (1 - sin(d2*@trapfreq)*@traporder*0.5) - @diameter)
     else ; "Radial 2"
       d2 = atan2(pz)
       d2 = sin(d2*@trapfreq)*@traporder*0.5
       d = abs(cabs(pz) * (1 - d2) - @diameter)
       d2 = abs(cabs(pz) * (1 + d2) - @diameter)
       if d2 < d
         d = d2
       endif
     endif
     return d
   endfunc
 default:
   title = "Waves"
   int param style
     caption = "Style"
     enum = "Normal" "Mirrored" "Mirrored 2" "Radial" "Radial 2"
     default = 0
     hint = "Chooses between various types of waves."
   endparam
   float param diameter
     caption = "Diameter"
     default = 1
     hint = "This is the distance between the waves."
   endparam
   float param traporder
     caption = "Height"
     default = 1
     hint = "This is the height of the waves. In the old Orbit Traps coloring \
             algorithm, this is the trap order divided by 4."
   endparam
   float param trapfreq
     caption = "Frequency"
     default = 1
     hint = "This is the frequency of the waves."
   endparam
 }
 


Constructor Summary
Standard_TrapShapeWaves()
           
 
Method Summary
 float Iterate(complex pz)
          call this for each iteration being trapped
 
Methods inherited from class common:TrapShape
GetColorChannel, GetTextureValue, GetTransformedPoint, Init, IterateSilent, SetThreshold
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

Standard_TrapShapeWaves

public Standard_TrapShapeWaves()
Method Detail

Iterate

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

Overrides:
Iterate in class TrapShape