jwo.landserf.process
Class TinToDemThread

java.lang.Object
  extended by java.lang.Thread
      extended by jwo.landserf.process.LSThread
          extended by jwo.landserf.process.TinToDemThread
All Implemented Interfaces:
Runnable, Scriptable, JWInterruptionListener

public class TinToDemThread
extends LSThread
implements Scriptable

Converts a TIN to DEM representation. Can either use planar or quadratic interpolation.

Version:
2.3, 2nd August, 2006.
Author:
Jo Wood

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TinToDemThread(GISFrame gisFrame)
          Prepares class for converting a TIN into DEM representation using planar interpolation.
TinToDemThread(GISFrame gisFrame, boolean doQuadratic)
          Prepares class for converting a TIN into DEM representation.
 
Method Summary
 boolean doCommand(LSCommand command)
          Creates a raster map representation of the vector map.
 void doProcessing()
          Convert the TIN into DEM representation.
 LSCommand getCommand()
          Reports the syntax required to allow convert TIN or vector into a raster via a scripting command.
 RasterMap getDEM()
          Retrieves the newly created DEM.
 GISFrame getGISFrame()
          Retrieves the GISFrame that can be used for storing multiple spatial objects.
 Object getReturnedObject()
          Returns a raster map holding the transformed object.
 
Methods inherited from class jwo.landserf.process.LSThread
checkStoppedThread, interruptionRequested, resetTimer, run, setErrorMessage, setFinalMessage, setMessage
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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

TinToDemThread

public TinToDemThread(GISFrame gisFrame)
Prepares class for converting a TIN into DEM representation using planar interpolation.

Parameters:
gisFrame - GUI containing TIN and DEM.

TinToDemThread

public TinToDemThread(GISFrame gisFrame,
                      boolean doQuadratic)
Prepares class for converting a TIN into DEM representation. Can either use simple planar interpolation (gives triangular facets), or a smoother quadratic interpolation (can give overshoots and undershoots).

Parameters:
gisFrame - GUI containing TIN and DEM.
doQuadratic - Uses quadratic interpolation if true, otherwise planar.
Method Detail

getCommand

public LSCommand getCommand()
Reports the syntax required to allow convert TIN or vector into a raster via a scripting command.

Specified by:
getCommand in interface Scriptable
Returns:
Command syntax.

doCommand

public boolean doCommand(LSCommand command)
Creates a raster map representation of the vector map. If the vector map is a TIN, the result will be a DEM, otherwise a regular raster representation of the vector map.

Specified by:
doCommand in interface Scriptable
Parameters:
command - Command containing parameter values.
Returns:
True if the conversion is successful. If false, the details of the problem are reported to the gisFrame.

getReturnedObject

public Object getReturnedObject()
Returns a raster map holding the transformed object. If command has yet to be issued this will return null.

Specified by:
getReturnedObject in interface Scriptable
Returns:
New spatial object or null if problems converting or command has not yet been issued.

getGISFrame

public GISFrame getGISFrame()
Retrieves the GISFrame that can be used for storing multiple spatial objects.

Specified by:
getGISFrame in interface Scriptable
Returns:
GISFrame storing spatial objects.

doProcessing

public void doProcessing()
Convert the TIN into DEM representation. The resulting DEM can be retrieved via getDEM() or by calling gisFrame.getRaster1().

Note that this method will be called automatically if this is run as a threaded process (e.g. myTinToDemThread.start()). Alternatively it can be called directly as a non-threaded process.

Specified by:
doProcessing in class LSThread
See Also:
GISFrame

getDEM

public RasterMap getDEM()
Retrieves the newly created DEM.

Returns:
New DEM, or null if process yet to take place.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009