Standard
Class Standard_EmbossedHelper

Object
  extended by Standard:Standard_EmbossedHelper

class 
Object:Standard_EmbossedHelper

Helper class for Standard_Embossed.


Ultra Fractal Source

Toggle UF Source Code Display

 class Standard_EmbossedHelper {
 ; Helper class for Standard_Embossed.
 public:
   import "common.ulb"
 
   func Standard_EmbossedHelper(Standard_Embossed owner)
     fOwner = owner
     fFormula = new @formulaClass(owner)
   endfunc
   
   func Init(const complex pz)
     fZ = fFormula.Init(pz)
     fBailedOut = false
     fResult = 0
   endfunc
   
   complex func Iterate()
     if !fBailedOut
       fZ = fFormula.Iterate(fZ)
       if fFormula.IsBailedOut(fZ)
         fBailedOut = true
 
         ; Handle emboss types that only work with the last iteration.
         if (@parttype == 0)
           fResult = fOwner.getIteration()
         elseif (@parttype == 4)
           fResult = real(trunc(log(fZ)))
         elseif (@parttype == 5)
           float t = 0.5 * atan2(fZ) / #pi
           if (t < 0.0)
             t = t + 1.0
           endif
           t = t * @numsect
           fResult = real(trunc(t))
         endif
       endif
 
       ; Handle emboss types that need to do something for each iteration.
       if (@parttype == 1)
         if (real(fZ) > 0.0)
           fResult = fResult + 1.0
         endif
       elseif (@parttype == 2)
         if (imag(fZ) > 0.0)
           fResult = fResult + 1.0
         endif
       elseif (@parttype == 3)
         float r = |fZ|
         if fOwner.updateRMin(r)
           fResult = fOwner.getIteration()
         endif
       endif
     endif
     return fZ
   endfunc
   
   bool func IsBailedOut()
     return fBailedOut
   endfunc
 
   float func GetResult()
     return fResult
   endfunc
   
 private:
   bool fBailedOut
   Formula fFormula
   Standard_Embossed fOwner
   float fResult
   complex fZ
   
 default:
   Formula param formulaClass
     caption = "Fractal formula"
     default = Standard_Mandelbrot
     hint = "Sets the actual fractal formula to use for the embossing effect."
   endparam
   param parttype
     caption="Emboss Type"
     default=0
     hint = "Specifies what information from the fractal is used to \
             create the embossing effect. This changes the shape of \
             the embossing lines."
     enum="Iteration" "Real(z) > 0" "Imag(z) > 0" "Smallest Magnitude" \
       "Magnitude" "Angle"
   endparam
   param numsect
     caption="Number of Sections"
     default=2
     min=1
     hint = "Specifies the number of sections to use for the Angle \
             emboss type."
     visible = @parttype == "Angle"
   endparam
 }
 


Constructor Summary
Standard_EmbossedHelper()
           
Standard_EmbossedHelper(Standard_Embossed owner)
           
 
Method Summary
 float GetResult()
           
 void Init(complex pz)
           
 boolean IsBailedOut()
           
 complex Iterate()
           
 
Methods inherited from class Object
 

Constructor Detail

Standard_EmbossedHelper

public Standard_EmbossedHelper(Standard_Embossed owner)

Standard_EmbossedHelper

public Standard_EmbossedHelper()
Method Detail

Init

public void Init(complex pz)

Iterate

public complex Iterate()

IsBailedOut

public boolean IsBailedOut()

GetResult

public float GetResult()