|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic common:TrapMode common:TrapModeWithThreshold mmf:MMF_TrapModeSmoothWithThreshold
class
Essentially a variant of TrapModeSmooth that is thresholdable
Derived from TrapModeThreshold to ensure that the threshold parameter
will be visible if used with non-smoothed orbit traps.
class MMF_TrapModeSmoothWithThreshold(common.ulb:TrapModeWithThreshold) { ; ; Essentially a variant of TrapModeSmooth that is thresholdable<p> ; Derived from TrapModeThreshold to ensure that the threshold parameter ; will be visible if used with non-smoothed orbit traps.<br> ; public: ; @param pparent the parent, generally "this" for the parent, or zero func MMF_TrapModeSmoothWithThreshold(Generic pparent) TrapModeWithThreshold.TrapModeWithThreshold(pparent) endfunc ; call this at the beginning of each sequence<br> ; @param pz the initial z value func Init(complex pz) m_Iterations = 0 m_Solid = false int j = 3 repeat m_UntransformedPoints[j] = m_OldUntransformedPoints[j] = (0,0) m_TransformedPoints[j] = m_OldTransformedPoints[j] = (0,0) m_IterationPoints[j] = m_OldIterationPoints[j] = 0 m_Distances[j] = m_OldDistances[j] = 0.0 m_Textures[j] = m_OldTextures[j] = 0.0 until (j=j-1)<0 m_wastrapped = false endfunc ; call this for each point ; <p>Note that derived functions should always copy all used ; parameters to the "old" versions when they are changed as here.<p> ; m_wastrapped should be set to true in the derived ; function when the main (current) values get changed<br> ; @param pz the z value ; @param pzt the transformed z value ; @param pdistance the trap distance ; @param ptexture tyhe texture value func Iterate(complex pz, complex pzt, float pdistance, float ptexture) if m_wastrapped m_OldDistances[0] = m_Distances[0] m_OldTextures[0] = m_Textures[0] m_OldUntransformedPoints[0] = m_UntransformedPoints[0] m_OldTransformedPoints[0] = m_TransformedPoints[0] m_OldIterationPoints[0] = m_IterationPoints[0] endif m_Iterations = m_Iterations + 1 endfunc ; call this for each point that is ignored (for smooth orbit traps)<br> ; if the last point was trapped then copy the current values into ; the "old" ones func IterateSilent() if m_wastrapped m_OldDistances[0] = m_Distances[0] m_OldTextures[0] = m_Textures[0] m_OldUntransformedPoints[0] = m_UntransformedPoints[0] m_OldTransformedPoints[0] = m_TransformedPoints[0] m_OldIterationPoints[0] = m_IterationPoints[0] m_wastrapped = false endif m_Iterations = m_Iterations + 1 endfunc ; call this to compute penultimate results<p> ; This should only be called after previously calling Result() ; and getting the actual result value using the Trap Color Mode ; since the original result values are destroyed by this call.<br> func OldResult() ; Note that in some cases if less than two values were trapped this ; should be skipped i.e. old result should be the same as result<br> m_Distances[0] = m_OldDistances[0] m_Textures[0] = m_OldTextures[0] m_UntransformedPoints[0] = m_OldUntransformedPoints[0] m_TransformedPoints[0] = m_OldTransformedPoints[0] m_IterationPoints[0] = m_OldIterationPoints[0] m_Iterations = m_Iterations - 1 endfunc protected: complex m_OldUntransformedPoints[4] complex m_OldTransformedPoints[4] float m_OldIterationPoints[4] float m_OldDistances[4] float m_OldTextures[4] bool m_wastrapped default: int param v_mmf_trapmodesmoothwiththreshold caption = "Version (MMF_TrapModeSmoothWithThreshold)" 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_mmf_trapmodesmoothwiththreshold < 100 endparam }
Constructor Summary | |
---|---|
MMF_TrapModeSmoothWithThreshold()
|
|
MMF_TrapModeSmoothWithThreshold(Generic pparent)
|
Method Summary | |
---|---|
void |
Init(complex pz)
call this at the beginning of each sequence |
void |
Iterate(complex pz,
complex pzt,
float pdistance,
float ptexture)
call this for each point |
void |
IterateSilent()
call this for each point that is ignored (for smooth orbit traps) if the last point was trapped then copy the current values into the "old" ones |
void |
OldResult()
call this to compute penultimate results |
Methods inherited from class common:TrapModeWithThreshold |
---|
GetThreshold, SetThreshold, UsesThreshold |
Methods inherited from class common:TrapMode |
---|
GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, IsSolid, Result |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public MMF_TrapModeSmoothWithThreshold(Generic pparent)
pparent
- the parent, generally "this" for the parent, or zeropublic MMF_TrapModeSmoothWithThreshold()
Method Detail |
---|
public void Init(complex pz)
Init
in class TrapMode
pz
- the initial z valuepublic void Iterate(complex pz, complex pzt, float pdistance, float ptexture)
Note that derived functions should always copy all used parameters to the "old" versions when they are changed as here.
m_wastrapped should be set to true in the derived
function when the main (current) values get changed
Iterate
in class TrapMode
pz
- the z valuepzt
- the transformed z valuepdistance
- the trap distanceptexture
- tyhe texture valuepublic void IterateSilent()
IterateSilent
in class TrapMode
public void OldResult()
This should only be called after previously calling Result()
and getting the actual result value using the Trap Color Mode
since the original result values are destroyed by this call.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |