kcc5
Class KCC_PlaneCurveTrapBase

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by kcc5:KCC_PlaneCurveTrapBase
Direct Known Subclasses:
KCC_AmpersandTrap, KCC_ArcTangentTrap, KCC_BeanCurveTrap, KCC_BicornCurveTrap, KCC_BicuspidCurveTrap, KCC_BifoliateTrap, KCC_BifoliumTrap, KCC_BowTrap, KCC_ButterflyCurveTrap, KCC_CassiniOvalsTrap, KCC_CirclesTrap, KCC_CissoidOfDioclesTrap, KCC_CochleoidTrap, KCC_CockedHatTrap, KCC_ConchoidOfNicomedesTrap, KCC_CruciformTrap, KCC_DevilsCurveTrap, KCC_DiamondTrap, KCC_DumbbellCurveTrap, KCC_DurersConchoidTrap, KCC_EightCurveTrap, KCC_HappyAccidentTrap, KCC_HyperbolaTrap, KCC_KappaCurveTrap, KCC_KepplersFoliumTrap, KCC_KeratoidCuspTrap, KCC_KnotCurveTrap, KCC_LemniscateCorrectedTrap, KCC_LemniscateTrap, KCC_LimaconTrap, KCC_LineTrap, KCC_LinksCurveTrap, KCC_MalteseCrossCurveTrap, KCC_ParabolaTrap, KCC_PearShapedCurveTrap, KCC_PiriformTrap, KCC_QuadrifoliumTrap, KCC_RoseCurveTrap, KCC_SerpentineCurveTrap, KCC_SinusCosinusTrap, KCC_sinXTrap, KCC_SpiralTrap, KCC_SquareTrap, KCC_StirrupCurveTrap, KCC_StrangeShapeTrap, KCC_SwastikaCurveTrap, KCC_TangentTrap, KCC_TrefoilTrap, KCC_TridentOfDescartesTrap, KCC_TridentTrap, KCC_TrifoliumTrap, KCC_TrisectrixOfMaclaurinTrap, KCC_TwistedCrossTrap, KCC_WitchOfAgnesiTrap

class 
TrapShape:KCC_PlaneCurveTrapBase

This is the base class for the Plane Curve Traps. All of the Plane Curve Trap types will derive from this class.


Ultra Fractal Source

Toggle UF Source Code Display

 class KCC_PlaneCurveTrapBase( common.ulb:TrapShape ) {
 ; This is the base class for the Plane Curve Traps.
 ; All of the Plane Curve Trap types will derive from
 ; this class.
 ;
 public:
   import "common.ulb"
 
   ; constructor
   func KCC_PlaneCurveTrapBase( Generic pparent )
     TrapShape.TrapShape( pparent )
   endfunc
 
   ; call this before each sequence of values to be trapped
   func Init( complex pz )
     TrapShape.Init( pz )
   endfunc
 
   ; call this for each iteration being trapped
   float func Iterate( complex pz )
     TrapShape.Iterate( pz )
 
     minDist = abs( real( pz ) )
 
     if( minDist < @width )
         m_LastChannel = m_Iterations
         m_Texture = minDist / @width
         return minDist
     else
       return 1e20
     endif
   endfunc
   
   complex func ApplyRatioAndSize( complex pz )
     pz = pz / @size
     float x = sqrt( @ratio ) * real( pz )
     float y = 1 / sqrt( @ratio ) * imag( pz )
     
     return x + flip( y )
   endfunc
 
   float func GetTextureValue()
     return m_Texture
   endfunc
 
 protected:
   float minDist
   float m_Texture
 
 default:
   int param v_KCC_PlaneCurveTrapBase
     caption = "Version (KCC_PlaneCurveTrapBase)"
     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_KCC_PlaneCurveTrapBase < 100
   endparam
 
   float param size
     caption = "Size"
     default = 1.0
     hint = "The size of the trap shape."
   endparam
 
   float param width
     caption = "Width"
     default = 0.1
     hint = "The width of the trap."
   endparam
 
 ;   float param borderWidth
 ;     caption = "Shape Border Width"
 ;     default = 0.0
 ;     hint = "The width of the border around each shape."
 ; ;     visible = (@colorPreset == "Gradient") && (@colorMode != "Normal")
 ; ;     visible = (GradientColors( @colors ) )
 ;   endparam
 
 ;   color param borderColor
 ;     caption = "Border Color"
 ;     default = rgb(0,0,0)
 ;     hint = "Specifies the color assigned to the border of the shapes."
 ;     visible = (@solidBorder == false)
 ; ;     visible = (@solidBorder == false) && (@colorPreset == "Gradient") && \
 ; ;               (@colorMode != "Normal") && (@borderWidth > 0.0)
 ;   endparam
 
 ;   bool param solidBorder
 ;     caption = "Solid Border"
 ;     hint = "If this is enabled orbits, the border around the shapes is \
 ;             made solid."
 ;     default = false
 ; ;     visible = (@colorPreset == "Gradient") && (@colorMode != "Normal") && \
 ; ;               (@borderWidth > 0.0)
 ;   endparam
 
   float param ratio
     caption = "H/W Ratio"
     default = 1.0
     hint = "The ration of height to width."
   endparam
 
   param adv
     caption = "Advanced Options"
     hint = "Additional shaping parameters and functions."
     default = false
   endparam
 }
 


Constructor Summary
KCC_PlaneCurveTrapBase()
           
KCC_PlaneCurveTrapBase(Generic pparent)
          constructor
 
Method Summary
 complex ApplyRatioAndSize(complex pz)
           
 float GetTextureValue()
          Get texture value.
 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
 
Methods inherited from class common:TrapShape
GetColorChannel, GetTransformedPoint, IterateSilent, SetThreshold
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

KCC_PlaneCurveTrapBase

public KCC_PlaneCurveTrapBase(Generic pparent)
constructor


KCC_PlaneCurveTrapBase

public KCC_PlaneCurveTrapBase()
Method Detail

Init

public void Init(complex pz)
call this before each sequence of values to be trapped

Overrides:
Init in class TrapShape

Iterate

public float Iterate(complex pz)
call this for each iteration being trapped

Overrides:
Iterate in class TrapShape

ApplyRatioAndSize

public complex ApplyRatioAndSize(complex pz)

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)