plugins.engines
Class CellBasis

java.lang.Object
  extended by Utilities.NoiseEngine
      extended by plugins.engines.CellBasis
Direct Known Subclasses:
Craters

public class CellBasis
extends NoiseEngine

Author:
burnetd To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

Nested Class Summary
protected  class CellBasis.ChessBoard
           
protected static interface CellBasis.DistanceCalculation
           
protected  class CellBasis.Euclidean
           
protected  class CellBasis.Manhattan
           
protected  class CellBasis.QuasiEuclidean
           
protected  class CellBasis.SineSquared
           
 
Field Summary
protected  int cellCount
           
protected  java.util.Hashtable<java.lang.Double,double[][]> cells
           
protected  CellBasis.DistanceCalculation distanceCalc
           
protected  int gridProjection
           
protected static double HASH_MOD_VALUE
           
protected  java.lang.String metric
           
protected  ExtendedHashBasedPanel panel
           
protected  java.awt.image.BufferedImage preview
           
protected  double[] previewNoise
           
protected  java.util.Random rand
           
protected  long seed
           
protected  double xNoise
           
protected  double xOffset
           
protected  double yNoise
           
protected  double yOffset
           
protected  double zNoise
           
protected  double zOffset
           
 
Fields inherited from class Utilities.NoiseEngine
max, min, noiseArray, scanlineSize, terrain, xGap
 
Constructor Summary
CellBasis()
           
 
Method Summary
protected  double calculateSumDistances(Vertex vertex)
           
 NoiseEngine copy()
           
 java.lang.String description()
           
protected  double FindNeighbours(double x1, double y1, double z1, double xFloor, double yFloor, double zFloor, double distanceSoFar)
           
 java.lang.String getDetails()
           
 double getNoiseForVertex(int vertex)
           
 double getNoiseForVertex(Vertex vertex)
           
 Vertex getNoiseOffset()
           
 Vertex getNoiseSize()
           
 javax.swing.JPanel getPanel()
          returns JPanel for noise settings
 double[] getPreviewNoise()
           
 double getScaledMovedNoiseForVertex(double x, double y, double z)
          Range 0 to 1 spans the width of the preview window.
 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 Parameters()
           
 void restoreSettings()
           
 void save(java.io.ObjectOutputStream file)
           
 void setProjection(int projection)
           
 void setTerrain(Landscape terrain)
           
 void storeSettings()
           
 
Methods inherited from class Utilities.NoiseEngine
getMax, getMin, getPreviewVertices, getTerrain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

protected ExtendedHashBasedPanel panel

metric

protected java.lang.String metric

rand

protected java.util.Random rand

gridProjection

protected int gridProjection

cellCount

protected int cellCount

distanceCalc

protected CellBasis.DistanceCalculation distanceCalc

cells

protected java.util.Hashtable<java.lang.Double,double[][]> cells

xNoise

protected double xNoise

yNoise

protected double yNoise

zNoise

protected double zNoise

xOffset

protected double xOffset

yOffset

protected double yOffset

zOffset

protected double zOffset

seed

protected long seed

preview

protected final java.awt.image.BufferedImage preview

previewNoise

protected final double[] previewNoise

HASH_MOD_VALUE

protected static final double HASH_MOD_VALUE
Constructor Detail

CellBasis

public CellBasis()
Method Detail

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

getNoiseForVertex

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

calculateSumDistances

protected double calculateSumDistances(Vertex vertex)

FindNeighbours

protected double FindNeighbours(double x1,
                                double y1,
                                double z1,
                                double xFloor,
                                double yFloor,
                                double zFloor,
                                double distanceSoFar)

initNoise

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

setProjection

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

getPanel

public javax.swing.JPanel getPanel()
returns JPanel for noise settings

Specified by:
getPanel in class NoiseEngine

main

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

storeSettings

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

restoreSettings

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

getVertex

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

paintIcon

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

makePreview

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

getNoiseSize

public Vertex getNoiseSize()
Overrides:
getNoiseSize in class NoiseEngine

getNoiseOffset

public Vertex getNoiseOffset()
Overrides:
getNoiseOffset in class NoiseEngine

getPreviewNoise

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

save

public void save(java.io.ObjectOutputStream file)
          throws java.io.IOException
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 class NoiseEngine
Throws:
java.lang.ClassNotFoundException
java.io.IOException

getDetails

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

name

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

description

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

Parameters

public void Parameters()

setTerrain

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

copy

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