|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic common:Coloring common:GradientColoring Standard:Standard_OrbitTraps
class
Object version of Orbit Traps in Standard.ucl. This generalizes the orbit
trap concept using various classes in common.ulb, so everyone can write new
trap shapes, trap colorings, etc.
Originally written by Damien M. Jones
class Standard_OrbitTraps(common.ulb:GradientColoring) { ; ; Object version of Orbit Traps in Standard.ucl. This generalizes the orbit ; trap concept using various classes in common.ulb, so everyone can write new ; trap shapes, trap colorings, etc. ; ; Originally written by Damien M. Jones ; public: func Standard_OrbitTraps(Generic pparent) GradientColoring(pparent) fTransform = new @transform(this) fShape = new @shape(this) fTransfer = new @transfer(this) fMode = new @mode(this) fColoring = new @coloring(this) fShape.SetThreshold(@threshold) fMode.SetThreshold(@threshold) endfunc func Init(complex pz, complex ppixel) GradientColoring.Init(pz, ppixel) fTransform.init(pz) fShape.init(pz) fTransfer.init(pz) fMode.init(pz) endfunc func Iterate(complex pz) ; Don't call inherited Iterate() for efficiency. complex zt = fTransform.Iterate(pz) float distance = fShape.Iterate(zt) distance = fTransfer.Iterate(distance) if !fTransform.IsSolid() fMode.Iterate(pz, zt, distance, 0.0) ; No texture support here else fMode.IterateSilent() endif endfunc float func ResultIndex(complex pz) fMode.Result() if @usesolid m_Solid = fMode.IsSolid() endif return fColoring.Result(fMode) endfunc private: TrapColoring fColoring TrapMode fMode TrapShape fShape Transfer fTransfer UserTransform fTransform default: title = "Orbit Traps" helpfile = "Uf*.chm" helptopic = "Html/coloring/standard/orbittraps.html" rating = recommended UserTransform param transform caption = "Trap Position" default = TrapTransform expanded = false hint = "Transforms the orbit values from the fractal formula before they \ are passed to the trap shape." endparam TrapShape param shape caption = "Trap Shape" default = Standard_TrapShapePoint hint = "Selects the shape of the orbit trap." endparam Transfer param transfer caption = "Trap Transfer" default = TrapTransfer expanded = false hint = "Provides additional options to scale and transform the distance \ that the trap shape returns." endparam TrapMode param mode caption = "Trap Mode" default = Standard_TrapModeClosest hint = "Selects how points will be chosen to use for coloring." endparam float param threshold caption = "Trap Threshold" default = 0.25 hint = "This is the overall size or thickness of the trap area." visible = (@mode == TrapModeWithThreshold) endparam bool param usesolid caption = "Use Solid Color" default = false hint = "If checked, any areas not inside any trap shape will be colored the solid color." endparam TrapColoring param coloring caption = "Trap Coloring" default = Standard_TrapColoringDistance hint = "Selects what information from the chosen points (see Trap Mode) \ is used to produce a color." endparam }
Constructor Summary | |
---|---|
Standard_OrbitTraps()
|
|
Standard_OrbitTraps(Generic pparent)
|
Method Summary | |
---|---|
void |
Init(complex pz,
complex ppixel)
Set up for a sequence of values |
void |
Iterate(complex pz)
Process the next value in the sequence |
float |
ResultIndex(complex pz)
Produce a resulting color index after a sequence is finished |
Methods inherited from class common:GradientColoring |
---|
IsGradient, IsSolid, Result |
Methods inherited from class common:Coloring |
---|
GetPixel |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public Standard_OrbitTraps(Generic pparent)
public Standard_OrbitTraps()
Method Detail |
---|
public void Init(complex pz, complex ppixel)
GradientColoring
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 GradientColoring
pz
- first value for the sequence; for a normal coloring formula, this will be #zppixel
- seed value for the sequence; for a normal coloring formula, this will be #pixelpublic void Iterate(complex pz)
GradientColoring
As long as the sequence has not bailed out, this function will be continually called to produce sequence values. Note that such processing generally will not know in advance precisely how long the sequence is, and should be prepared to deal with sequences of arbitrary length.
Your coloring may determine at some point that a solid color should be used rather than an index value.
Iterate
in class GradientColoring
pz
- next value in the sequence; corresponds to #z in a coloring formulapublic float ResultIndex(complex pz)
GradientColoring
This corresponds to the final: section in a coloring formula. Once it is called, no further calls to Iterate() should be made without calling Init() first.
ResultIndex
in class GradientColoring
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |