|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic common:Formula common:DivergentFormula
class
Divergent Formula base class.
This class extends Formula to provide automatic, simple
bailout tests. Formulas for which the outside points
become arbitrarily large should derive from this class
so as to avoid having to write the bailout tests and
the GetUpperBailout() function.
class DivergentFormula(Formula) { ; Divergent Formula base class. ; <p> ; This class extends Formula to provide automatic, simple ; bailout tests. Formulas for which the outside points ; become arbitrarily large should derive from this class ; so as to avoid having to write the bailout tests and ; the GetUpperBailout() function. public: ; Constructor ; ; @param pparent a reference to the object creating the new object; typically, 'this' func DivergentFormula(Generic pparent) Formula.Formula(pparent) endfunc ; Set up for a sequence of values ; <p> ; This function will be called at the beginning of each ; sequence of values (e.g. at the beginning of each fractal ; orbit). ; ; @param pz seed value for the sequence; for a normal fractal formula, this will be #pixel ; @return first value in the sequence; this corresponds to #z in a fractal formula complex func Init(complex pz) Formula.Init(pz) ; Base class implementation flags the sequence to end ; immediately. We clear the flag here. m_BailedOut = false return pz endfunc ; Test whether the formula has bailed out (i.e. the sequence is complete) ; <p> ; Since this is a divergent fractal, the test is easy: if it's ; bigger than the bailout, the sequence is done. ; ; @param pz last sequence value to test; this should be the value returned from the previous Iterate() call. Note that it is acceptable to ignore pz and use m_BailedOut, but any code calling IsBailedOut() should pass in the correct pz for Formula classes which do not use m_BailedOut. ; @return true if the sequence has bailed out (i.e. should be terminated) bool func IsBailedOut(complex pz) return |pz| > @p_bailout endfunc ; Determine the upper bailout boundary. ; ; @return the upper bailout parameter float func GetUpperBailout() return @p_bailout endfunc default: int param v_divergentformula caption = "Version (DivergentFormula)" 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_divergentformula < 100 endparam float param p_bailout caption = "Bailout" default = 1.0e20 hint = "Defines how soon an orbit bails out, i.e. doesn't belong to the fractal set anymore. Note: larger values result in more iterations being calculated." endparam }
Constructor Summary | |
---|---|
DivergentFormula()
|
|
DivergentFormula(Generic pparent)
Constructor |
Method Summary | |
---|---|
float |
GetUpperBailout()
Determine the upper bailout boundary. |
complex |
Init(complex pz)
Set up for a sequence of values |
boolean |
IsBailedOut(complex pz)
Test whether the formula has bailed out (i.e. |
Methods inherited from class common:Formula |
---|
GetLowerBailout, GetPrimaryExponent, Iterate |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public DivergentFormula(Generic pparent)
pparent
- a reference to the object creating the new object; typically, 'this'public DivergentFormula()
Method Detail |
---|
public complex Init(complex pz)
This function will be called at the beginning of each sequence of values (e.g. at the beginning of each fractal orbit).
Init
in class Formula
pz
- seed value for the sequence; for a normal fractal formula, this will be #pixel
public boolean IsBailedOut(complex pz)
Since this is a divergent fractal, the test is easy: if it's bigger than the bailout, the sequence is done.
IsBailedOut
in class Formula
pz
- last sequence value to test; this should be the value returned from the previous Iterate() call. Note that it is acceptable to ignore pz and use m_BailedOut, but any code calling IsBailedOut() should pass in the correct pz for Formula classes which do not use m_BailedOut.
public float GetUpperBailout()
GetUpperBailout
in class Formula
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |