Class ElevationModel

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.Node
              |
              +--javax.media.j3d.Group
                    |
                    +--javax.media.j3d.BranchGroup
                          |
                          +--ElevationModel
All Implemented Interfaces:
ElevationModelInterface

public class ElevationModel
extends javax.media.j3d.BranchGroup
implements ElevationModelInterface

ElevationModel is a specialization of a BranchGroup that holds Java3D geometry objects representing a terrain map. The map is divided into segments each segment contains a Level-of-Detail switch containing the geometry for the segment in three levels of detail. This allows for faster drawing and navigation of the model as a whole.

Author:
Mark Pendergast
See Also:
LODSegment

Field Summary
private  float deltaCol
          space in meters between each column of elevation data
private  float deltaRow
          space in meters between each row of elevation data
private  float east_X
          maximum X coordinate
 float exageration
          factor each elevation reading is multiplied by when drawing the model.
 GroundCoordinates groundCoordinates
          ground coordinates for the model, contains the lat/long of the four corners in arc seconds
 int maxElevation
          maximum elevation in meters
 int minElevation
          minimum elevation in meters
 java.lang.String name
          geographic name or title of the data
private  float north_Z
          minimum Z coordinate
private static int SECONDS_PER_SEGMENT
          number of seconds high/wide of each segment is
private  LODSegment[][] segments
          two dimensional array of segments comprising the model data
private  float south_Z
          maximum Z coordinate, note, positive Z axis is in the south due to Java3D
private  float west_X
          minimum X coordinate
 
Fields inherited from class javax.media.j3d.BranchGroup
ALLOW_DETACH
 
Fields inherited from class javax.media.j3d.Group
ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Fields inherited from class javax.media.j3d.SceneGraphObject
 
Constructor Summary
ElevationModel(java.lang.String aFileName, StatusWindow stat)
          Load the DEM file and create a set of LODSegments based on its data.
 
Method Summary
 float getElevationAt(float x, float z)
          Fetches the elevation at a particular location on the terrain map given the x,z coordinates.
 float getMaxElevation()
          retrieve the model maximum elevation, adjusted by the elevation exageration
 float getMinElevation()
          retrieve the model minimum elevation, adjusted by the elevation exageration
 float getModelLength()
          retrieve the model length, distance in meters from west to east
 float getModelWidth()
          retrieve the model width, distance in meters from south to north
 
Methods inherited from class javax.media.j3d.BranchGroup
cloneNode, compile, detach, pickAll, pickAllSorted, pickAny, pickClosest
 
Methods inherited from class javax.media.j3d.Group
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, insertChild, moveTo, numChildren, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds
 
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData, updateNodeReferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groundCoordinates

public GroundCoordinates groundCoordinates
ground coordinates for the model, contains the lat/long of the four corners in arc seconds


west_X

private float west_X
minimum X coordinate


east_X

private float east_X
maximum X coordinate


south_Z

private float south_Z
maximum Z coordinate, note, positive Z axis is in the south due to Java3D


north_Z

private float north_Z
minimum Z coordinate


SECONDS_PER_SEGMENT

private static int SECONDS_PER_SEGMENT
number of seconds high/wide of each segment is


deltaRow

private float deltaRow
space in meters between each row of elevation data


deltaCol

private float deltaCol
space in meters between each column of elevation data


exageration

public float exageration
factor each elevation reading is multiplied by when drawing the model. Makes elevation differences stand out


minElevation

public int minElevation
minimum elevation in meters


maxElevation

public int maxElevation
maximum elevation in meters


name

public java.lang.String name
geographic name or title of the data


segments

private LODSegment[][] segments
two dimensional array of segments comprising the model data

Constructor Detail

ElevationModel

public ElevationModel(java.lang.String aFileName,
                      StatusWindow stat)
               throws java.lang.IllegalArgumentException
Load the DEM file and create a set of LODSegments based on its data.

Parameters:
aFileName - name of the DEM file
stat - reference to a StatusWindow object used to display load progress
Method Detail

getElevationAt

public float getElevationAt(float x,
                            float z)
Fetches the elevation at a particular location on the terrain map given the x,z coordinates. X,Z coordinates represent the distance in meters from the center of the terrain image

Specified by:
getElevationAt in interface ElevationModelInterface
Parameters:
x - x coordinate
z - z coordinate
Returns:
the elevation (y coordinate) in meters (adjusted for exageration)

getModelLength

public float getModelLength()
retrieve the model length, distance in meters from west to east

Specified by:
getModelLength in interface ElevationModelInterface
Returns:
the length in meters

getModelWidth

public float getModelWidth()
retrieve the model width, distance in meters from south to north

Specified by:
getModelWidth in interface ElevationModelInterface
Returns:
the width in meters

getMaxElevation

public float getMaxElevation()
retrieve the model maximum elevation, adjusted by the elevation exageration

Specified by:
getMaxElevation in interface ElevationModelInterface
Returns:
the adjusted maximum elevation in meters

getMinElevation

public float getMinElevation()
retrieve the model minimum elevation, adjusted by the elevation exageration

Specified by:
getMinElevation in interface ElevationModelInterface
Returns:
the adjusted minimum elevation in meters