jwo.landserf.process
Class FracSurfaceThread

java.lang.Object
  extended byjava.lang.Thread
      extended byjwo.landserf.process.LSThread
          extended byjwo.landserf.process.FracSurfaceThread
All Implemented Interfaces:
JWInterruptionListener, Runnable

public class FracSurfaceThread
extends LSThread

Calculates a fractal surface using spectral synthesis. Algorithm from Peitgen and Saupe (1988).

Version:
2.2, 5th December, 2004.
Author:
Jo Wood

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FracSurfaceThread(GISFrame gisFrame)
          Fills the current primary raster with a fractal surface with default fractal dimension of 2.1, mean of 500, and standard deviation of 100.
FracSurfaceThread(GISFrame gisFrame, float fracDim)
          Fills the current primary raster with a fractal surface with given fractal dimension and default mean of 500, and standard deviation of 100.
FracSurfaceThread(GISFrame gisFrame, float fracDim, float mean, float stdev)
          Fills the current primary raster with a fractal surface with given fractal dimension, mean, and standard deviation.
FracSurfaceThread(GISFrame gisFrame, float fracDim, float mean, float stdev, long seed)
          Fills the current primary raster with a fractal surface with given fractal dimension, mean, standard deviation and random seed.
 
Method Summary
 void doProcessing()
          Creates the raster surface and places the contents into the currently selected primary raster map.
 boolean spectralSynthesis(float[] realNum, float[] imagNum, int nn, float h)
          Creates a 2-d fractal surface via spectral synthesis.
 
Methods inherited from class jwo.landserf.process.LSThread
checkStoppedThread, interruptionRequested, resetTimer, run, setErrorMessage, setMessage
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FracSurfaceThread

public FracSurfaceThread(GISFrame gisFrame)
Fills the current primary raster with a fractal surface with default fractal dimension of 2.1, mean of 500, and standard deviation of 100.

Parameters:
gisFrame - Frame in which to report results.

FracSurfaceThread

public FracSurfaceThread(GISFrame gisFrame,
                         float fracDim)
Fills the current primary raster with a fractal surface with given fractal dimension and default mean of 500, and standard deviation of 100.

Parameters:
gisFrame - Frame in which to report results.
fracDim - Fractal dimension of surface.

FracSurfaceThread

public FracSurfaceThread(GISFrame gisFrame,
                         float fracDim,
                         float mean,
                         float stdev)
Fills the current primary raster with a fractal surface with given fractal dimension, mean, and standard deviation.

Parameters:
gisFrame - Frame in which to report results.
fracDim - Fractal dimension of surface.
mean - Mean of surface values.
stdev - Standard deviation of surface values.

FracSurfaceThread

public FracSurfaceThread(GISFrame gisFrame,
                         float fracDim,
                         float mean,
                         float stdev,
                         long seed)
Fills the current primary raster with a fractal surface with given fractal dimension, mean, standard deviation and random seed.

Parameters:
gisFrame - Frame in which to report results.
fracDim - Fractal dimension of surface.
mean - Mean of surface values.
stdev - Standard deviation of surface values.
Method Detail

doProcessing

public void doProcessing()
Creates the raster surface and places the contents into the currently selected primary raster map. Note that unlike some of the classes in the jwo.landser.process package, this class does not create a new raster map, but instead 'fills' the existing primary raster stored in the GISFrame provided to the constructor. This is to make it easier to allow a fractal surface to be created by default in a new GISFrame. To retrieve the fractal surface, call GISFrame.getRaster1() after this process has completed.

Specified by:
doProcessing in class LSThread

spectralSynthesis

public boolean spectralSynthesis(float[] realNum,
                                 float[] imagNum,
                                 int nn,
                                 float h)
Creates a 2-d fractal surface via spectral synthesis. Algorithm is based on the one by D. Sauper (1988), p.108.

Parameters:
realNum - Array of real components of coefficients and fractal surface.
imagNum - Array of imaginary components of coefficients and fractal surface.
nn - Size of array along one dimensions (2^n).
h - Relates to fractal dimension (D) as D = 3 - h.
Returns:
True if surface created sucessfully.


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005