|
|||||||||
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 mmf:MMF_TrapModeSmoothProduct
class
Note that this implimentation is slightly different to normal
TrapModeProduct in that IterationPoints is kept as a trap counter
and TransformedPoints and UntransformedPoints are initialised to
1 and multiplied by (1 + pz/cabs(pz)) and (1 + pzt/cabs(pzt))
respectively.
class MMF_TrapModeSmoothProduct(MMF_TrapModeSmoothWithThreshold) { ; ; Note that this implimentation is slightly different to normal ; TrapModeProduct in that IterationPoints is kept as a trap counter ; and TransformedPoints and UntransformedPoints are initialised to ; 1 and multiplied by (1 + pz/cabs(pz)) and (1 + pzt/cabs(pzt)) ; respectively.<br> ; public: import "common.ulb" func MMF_TrapModeSmoothProduct(Generic pparent) MMF_TrapModeSmoothWithThreshold.MMF_TrapModeSmoothWithThreshold(pparent) endfunc func Init(complex pz) m_Iterations = 0 m_Solid = true int j = 3 repeat m_UntransformedPoints[j] = m_OldUntransformedPoints[j] = (1,0) m_TransformedPoints[j] = m_OldTransformedPoints[j] = (1,0) m_IterationPoints[j] = m_OldIterationPoints[j] = 0 m_Distances[j] = m_OldDistances[j] = 1.0 m_Textures[j] = m_OldTextures[j] = 1.0 until (j=j-1)<0 m_wastrapped = false endfunc func Iterate(complex pz, complex pzt, float pdistance, float ptexture) MMF_TrapModeSmoothWithThreshold.Iterate(pz, pzt, pdistance, ptexture) if (pdistance < m_Threshold) float id = 1.0 / m_Threshold m_Distances[0] = m_Distances[0] * (pdistance + @adjust) * id m_Textures[0] = m_Textures[0] * ptexture * id m_UntransformedPoints[0] = m_UntransformedPoints[0] \ * (1.0 + pz / cabs(pz)) m_TransformedPoints[0] = m_TransformedPoints[0] \ * (1.0 + pzt / cabs(pzt)) m_IterationPoints[0] = m_IterationPoints[0] + 1 m_Solid = false m_wastrapped = true endif endfunc func Result() m_Distances[0] = abs(m_Distances[0]) ; Note that texture is not forced to positive here. endfunc func OldResult() if m_OldIterationPoints[0]>0 m_Distances[0] = abs(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 ; Note that texture is not forced to positive here. endif endfunc default: title = "Smooth Product" heading text = "Note that this implimentation is slightly different to \ normal Trap Mode Product in that the Iteration value is \ kept as a trap counter and TransformedPoints and \ UntransformedPoints will actually produce values when \ using an appropriate Trap Color Mode such as Magnitude, \ Real or Imaginary etc." endheading float param adjust caption = "Offset Distance" default = 0.0 hint = "Modifies the distances found by this value before \ multiplying. Try non-zero values if you get little \ or no colouring variation, note that often increases \ in the Trap Threshold will require increases in this \ value and vice-versa." endparam }
Constructor Summary | |
---|---|
MMF_TrapModeSmoothProduct()
|
|
MMF_TrapModeSmoothProduct(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 |
OldResult()
call this to compute penultimate results |
void |
Result()
call this to compute final results |
Methods inherited from class mmf:MMF_TrapModeSmoothWithThreshold |
---|
IterateSilent |
Methods inherited from class common:TrapModeWithThreshold |
---|
GetThreshold, SetThreshold, UsesThreshold |
Methods inherited from class common:TrapMode |
---|
GetDistance, GetIteration, GetTexture, GetTransformedPoint, GetUntransformedPoint, IsSolid |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public MMF_TrapModeSmoothProduct(Generic pparent)
public MMF_TrapModeSmoothProduct()
Method Detail |
---|
public void Init(complex pz)
MMF_TrapModeSmoothWithThreshold
Init
in class MMF_TrapModeSmoothWithThreshold
pz
- the initial z valuepublic void Iterate(complex pz, complex pzt, float pdistance, float ptexture)
MMF_TrapModeSmoothWithThreshold
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 MMF_TrapModeSmoothWithThreshold
pz
- the z valuepzt
- the transformed z valuepdistance
- the trap distanceptexture
- tyhe texture valuepublic void Result()
TrapMode
Result
in class TrapMode
public void OldResult()
MMF_TrapModeSmoothWithThreshold
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.
OldResult
in class MMF_TrapModeSmoothWithThreshold
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |