plugins.engines
Class ApplyFunction

java.lang.Object
  extended by Utilities.NoiseEngine
      extended by plugins.engines.ApplyFunction
All Implemented Interfaces:
FunctionEngine
Direct Known Subclasses:
Adjustments, BasedFunction, InverseFunctions, Logarithm, PreviewVerticesFunction, Range, RotateFunction

public class ApplyFunction
extends NoiseEngine
implements FunctionEngine

Author:
David

Nested Class Summary
protected  class ApplyFunction.Function
           
 
Field Summary
protected  java.lang.String functionName
           
protected  ApplyFunction.Function math
           
protected  NoiseEngine noise
           
protected  NoisePanel panel
           
 
Fields inherited from class Utilities.NoiseEngine
gridProjection, max, min, noiseArray, preview, previewNoise, scanlineSize, terrain, xGap
 
Constructor Summary
ApplyFunction()
          Creates a new instance of function
 
Method Summary
 NoiseEngine copy()
           
 java.lang.String description()
           
 java.lang.String getDetails()
           
 NoiseEngine getNoiseEngine()
           
 double getNoiseForVertex(int vertex)
           
 double getNoiseForVertex(Vertex vertex)
           
 Vertex getNoiseOffset()
           
 Vertex getNoiseSize()
           
 javax.swing.JPanel getPanel()
           
 double[] getPreviewNoise()
           
 Vertex[] getPreviewVertices()
           
 double getScaledMovedNoiseForVertex(double x, double y, double z)
          Range 0 to 1 spans the width of the preview window.
 Landscape getTerrain()
           
 Vertex getVertex(int index)
           
 void initNoise()
           
 void load(java.io.ObjectInputStream file)
           
static void main(java.lang.String[] args)
           
 void makePreview()
           
 java.lang.String name()
           
 void paintIcon(java.awt.Graphics2D g2, java.awt.image.ImageObserver component)
           
 void restoreSettings()
           
 void save(java.io.ObjectOutputStream file)
           
 void setFunction(java.lang.String functionName)
           
 void setNoiseEngine(NoiseEngine noise)
           
 void setProjection(int projection)
           
 void setTerrain(Landscape terrain)
           
 void storeSettings()
           
 
Methods inherited from class Utilities.NoiseEngine
getMax, getMin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

protected NoisePanel panel

math

protected ApplyFunction.Function math

noise

protected NoiseEngine noise

functionName

protected java.lang.String functionName
Constructor Detail

ApplyFunction

public ApplyFunction()
Creates a new instance of function

Method Detail

main

public static void main(java.lang.String[] args)

name

public java.lang.String name()
Specified by:
name in interface FunctionEngine
Specified by:
name in class NoiseEngine

description

public java.lang.String description()
Specified by:
description in interface FunctionEngine
Specified by:
description in class NoiseEngine

getPanel

public javax.swing.JPanel getPanel()
Specified by:
getPanel in interface FunctionEngine
Specified by:
getPanel in class NoiseEngine

initNoise

public void initNoise()
Specified by:
initNoise in class NoiseEngine

getScaledMovedNoiseForVertex

public double getScaledMovedNoiseForVertex(double x,
                                           double y,
                                           double z)
Description copied from class: NoiseEngine
Range 0 to 1 spans the width of the preview window.

Specified by:
getScaledMovedNoiseForVertex in class NoiseEngine
Returns:

getNoiseForVertex

public double getNoiseForVertex(Vertex vertex)
Specified by:
getNoiseForVertex in class NoiseEngine

getNoiseSize

public Vertex getNoiseSize()
Overrides:
getNoiseSize in class NoiseEngine

getNoiseOffset

public Vertex getNoiseOffset()
Overrides:
getNoiseOffset in class NoiseEngine

setProjection

public void setProjection(int projection)
Overrides:
setProjection in class NoiseEngine

getNoiseForVertex

public double getNoiseForVertex(int vertex)
Specified by:
getNoiseForVertex in class NoiseEngine

setTerrain

public void setTerrain(Landscape terrain)
Overrides:
setTerrain in class NoiseEngine

getTerrain

public Landscape getTerrain()
Overrides:
getTerrain in class NoiseEngine

setFunction

public void setFunction(java.lang.String functionName)
Specified by:
setFunction in interface FunctionEngine

getVertex

public Vertex getVertex(int index)
Overrides:
getVertex in class NoiseEngine

paintIcon

public void paintIcon(java.awt.Graphics2D g2,
                      java.awt.image.ImageObserver component)
Specified by:
paintIcon in interface FunctionEngine
Overrides:
paintIcon in class NoiseEngine

setNoiseEngine

public void setNoiseEngine(NoiseEngine noise)
Specified by:
setNoiseEngine in interface FunctionEngine

getNoiseEngine

public NoiseEngine getNoiseEngine()
Specified by:
getNoiseEngine in interface FunctionEngine

makePreview

public void makePreview()
Specified by:
makePreview in interface FunctionEngine
Specified by:
makePreview in class NoiseEngine

getPreviewNoise

public double[] getPreviewNoise()
Overrides:
getPreviewNoise in class NoiseEngine

getPreviewVertices

public Vertex[] getPreviewVertices()
Overrides:
getPreviewVertices in class NoiseEngine

storeSettings

public void storeSettings()
Specified by:
storeSettings in interface FunctionEngine
Specified by:
storeSettings in class NoiseEngine

restoreSettings

public void restoreSettings()
Specified by:
restoreSettings in interface FunctionEngine
Specified by:
restoreSettings in class NoiseEngine

save

public void save(java.io.ObjectOutputStream file)
          throws java.io.IOException
Specified by:
save in interface FunctionEngine
Specified by:
save in class NoiseEngine
Throws:
java.io.IOException

load

public void load(java.io.ObjectInputStream file)
          throws java.lang.ClassNotFoundException,
                 java.io.IOException
Specified by:
load in interface FunctionEngine
Specified by:
load in class NoiseEngine
Throws:
java.lang.ClassNotFoundException
java.io.IOException

getDetails

public java.lang.String getDetails()
Specified by:
getDetails in interface FunctionEngine
Specified by:
getDetails in class NoiseEngine

copy

public NoiseEngine copy()
Specified by:
copy in class NoiseEngine