Utilities
Class PostProcessHelper

java.lang.Object
  extended by Utilities.NoiseEngine
      extended by Utilities.PostProcess
          extended by Utilities.PostProcessHelper
Direct Known Subclasses:
DerivativeX, Precipiton

public abstract class PostProcessHelper
extends PostProcess

This class provides a set of utility methods to simplify development of PostProcess nodes.

Author:
su_liam

Field Summary
 
Fields inherited from class Utilities.PostProcess
noise
 
Fields inherited from class Utilities.NoiseEngine
gridProjection, max, min, noiseArray, panel, preview, previewNoise, scanlineSize, terrain, xGap
 
Constructor Summary
PostProcessHelper()
           
 
Method Summary
 int getIndex(double x, double y)
          This method returns the index into the storage array of a point (x,y).
 Vertex getVertex(int index)
           
 int move(double x, double y, double deltaX, double deltaY)
          This method returns the index representing a point, (x+deltaX,y+deltaY), in other words, the point deltaX to the right of the original point and deltaY above the original point.
protected  int moveClamped(double x, double y, double deltaX, double deltaY)
          This method returns the index representing a point, (x+deltaX,y+deltaY), in other words, the point deltaX to the right of the original point and deltaY above the original point.
protected  int movePlanet(double x, double y, double deltaX, double deltaY)
          This method returns the index representing a point, (x+deltaX,y+deltaY), in other words, the point deltaX to the right of the original point and deltaY above the original point.
protected  int moveScroll(double x, double y, double deltaX, double deltaY)
          This method returns the index representing a point, (x+deltaX,y+deltaY), in other words, the point deltaX to the right of the original point and deltaY above the original point.
protected  void setScroll(boolean scroll)
          Kind of a bonehead method here.
 
Methods inherited from class Utilities.PostProcess
initNoise, populateNoiseMap, process, processNoiseMap, setNoiseEngine, setTerrain
 
Methods inherited from class Utilities.NoiseEngine
copy, description, getDetails, getMax, getMin, getNoiseForVertex, getNoiseForVertex, getNoiseOffset, getNoiseSize, getPanel, getPreviewNoise, getPreviewVertices, getScaledMovedNoiseForVertex, getTerrain, load, makePreview, name, paintIcon, restoreSettings, save, setProjection, storeSettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostProcessHelper

public PostProcessHelper()
Method Detail

setScroll

protected void setScroll(boolean scroll)
Kind of a bonehead method here. It allows inheriting classes to control whether effects scroll across the maps in a manner appropriate to the terrain shape chosen. The default is false, so, by default effects are clamped to the edge of the screen. Depending on the node-programmers choice, scrolling can be set by the user, set by the node, or hardwired. Oh, sweet freedom...

Parameters:
scroll -

getIndex

public int getIndex(double x,
                    double y)
This method returns the index into the storage array of a point (x,y).

Parameters:
x - the x-coordinate of the desired point
y - the y-coordinate of the desired point
Returns:
the index to the storage array corresponding to the point (x,y)

move

public int move(double x,
                double y,
                double deltaX,
                double deltaY)
This method returns the index representing a point, (x+deltaX,y+deltaY), in other words, the point deltaX to the right of the original point and deltaY above the original point. Values of x and y outside of the screen space are dealt with appropriately.

Parameters:
x - the x-coordinate of the original point
y - the y_coordinate of the original point
deltaX - the distance moved to the right
deltaY - the distance moved down
Returns:
the storage array index corresponding to the new point

moveScroll

protected int moveScroll(double x,
                         double y,
                         double deltaX,
                         double deltaY)
This method returns the index representing a point, (x+deltaX,y+deltaY), in other words, the point deltaX to the right of the original point and deltaY above the original point. Values of x and y outside of the screen space are scrolled over.

Parameters:
x - the x-coordinate of the original point
y - the y_coordinate of the original point
deltaX - the distance moved to the right
deltaY - the distance moved down
Returns:
the storage array index corresponding to the new point

movePlanet

protected int movePlanet(double x,
                         double y,
                         double deltaX,
                         double deltaY)
This method returns the index representing a point, (x+deltaX,y+deltaY), in other words, the point deltaX to the right of the original point and deltaY above the original point. Values of x and y outside of the screen space are scrolled over in a manner appropriate to a sphere.

Parameters:
x - the x-coordinate of the original point
y - the y_coordinate of the original point
deltaX - the distance moved to the right
deltaY - the distance moved down
Returns:
the storage array index corresponding to the new point

moveClamped

protected int moveClamped(double x,
                          double y,
                          double deltaX,
                          double deltaY)
This method returns the index representing a point, (x+deltaX,y+deltaY), in other words, the point deltaX to the right of the original point and deltaY above the original point. Values of x and y outside of the screen space are clamped to the edge of the screen space.

Parameters:
x - the x-coordinate of the original point
y - the y_coordinate of the original point
deltaX - the distance moved to the right
deltaY - the distance moved down
Returns:
the storage array index corresponding to the new point

getVertex

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