|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Group
javax.media.j3d.BranchGroup
edu.d.umn.geometry.ElevationModel
public class ElevationModel
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.
LODSegment| Field Summary | |
|---|---|
protected float |
deltaCol
space in meters between each column of elevation data |
protected float |
deltaRow
space in meters between each row of elevation data |
float |
east_X
maximum X coordinate |
float |
exageration
Factor each elevation reading is multiplied by when drawing the model. |
protected ElevationFile |
file
The ElevationFile that holds the data. |
GroundCoordinates |
groundCoordinates
GroundCoordinates for the model, contains the lat/long of the four corners in arc seconds |
protected int |
maxElevation
maximum elevation in meters |
protected int |
minElevation
minimum elevation in meters |
java.lang.String |
name
geographic name or title of the data |
float |
north_Z
minimum Z coordinate |
static int |
SECONDS_PER_SEGMENT
number of seconds high/wide of each segment is |
protected LODSegment[][] |
segments
two dimensional array of segments comprising the model data |
float |
south_Z
maximum Z coordinate, note, positive Z axis is in the south due to Java3D |
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_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
| Constructor Summary | |
|---|---|
protected |
ElevationModel()
Empty constructor. |
|
ElevationModel(java.lang.String aFileName,
StatusWindow stat)
Sets up and compiles the ElevationModel. |
| Method Summary | |
|---|---|
void |
changeExageration(float amount)
Change the exageration of the model. |
protected void |
createLODSegments(StatusWindow stat)
Initializes the LODSegment array to a number of columns and rows based on the GroundCoordinates
length and width in seconds and the SECONDS_PER_SEGMENT. |
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 |
float |
getQuadResolution()
Retrieve the resolution of the dem. |
LODSegment |
getSegment(int col,
int row)
Returns an LODSegment located at [row][col] |
void |
recalcNormals()
Recalculates the normal values so that the lighting effects change when the elevation exageration change. |
void |
setColor(java.awt.Color color)
Changes the color of the model. |
void |
setTexture(javax.media.j3d.Texture2D tex)
Change the texture of the model. |
| Methods inherited from class javax.media.j3d.BranchGroup |
|---|
cloneNode, compile, detach, pickAll, pickAll, pickAllSorted, pickAllSorted, pickAny, pickAny, pickClosest, pickClosest |
| Methods inherited from class javax.media.j3d.Group |
|---|
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, indexOfChild, insertChild, moveTo, numChildren, removeAllChildren, removeChild, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds |
| Methods inherited from class javax.media.j3d.Node |
|---|
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
| Methods inherited from class javax.media.j3d.SceneGraphObject |
|---|
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public GroundCoordinates groundCoordinates
GroundCoordinates for the model, contains the lat/long of the four corners in arc seconds
public float west_X
public float east_X
public float south_Z
public float north_Z
public static final int SECONDS_PER_SEGMENT
protected float deltaRow
protected float deltaCol
public float exageration
protected int minElevation
protected int maxElevation
public java.lang.String name
protected LODSegment[][] segments
protected ElevationFile file
| Constructor Detail |
|---|
protected ElevationModel()
public ElevationModel(java.lang.String aFileName,
StatusWindow stat)
throws java.io.IOException
aFileName - full name of the file to use.stat - Reference to the status window to display loading status.
java.io.IOException - Thrown if the file does not exist.| Method Detail |
|---|
protected void createLODSegments(StatusWindow stat)
LODSegment array to a number of columns and rows based on the GroundCoordinates
length and width in seconds and the SECONDS_PER_SEGMENT.
Also stitches together the top and right sides to create a smooth mesh.
public float getElevationAt(float x,
float z)
getElevationAt in interface ElevationModelInterfacex - x coordinatez - z coordinate
public float getModelLength()
getModelLength in interface ElevationModelInterfacepublic float getModelWidth()
getModelWidth in interface ElevationModelInterfacepublic float getMaxElevation()
getMaxElevation in interface ElevationModelInterfacepublic float getMinElevation()
getMinElevation in interface ElevationModelInterfacepublic void setTexture(javax.media.j3d.Texture2D tex)
tex - The Texture2D to change to.public void changeExageration(float amount)
amount - The amount to change the exageration to.
public LODSegment getSegment(int col,
int row)
col - the column of the LODSegmentrow - the row of the LODSegment
public float getQuadResolution()
public void recalcNormals()
public void setColor(java.awt.Color color)
color - Desired color to change to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||