com.c5corp.c5j3d
Class DEM3d

java.lang.Object
  extended by Shape3D
      extended by com.c5corp.c5j3d.DEM3d
Direct Known Subclasses:
DEM3dAppearance

public class DEM3d
extends Shape3D

DEM3d creates a 3D object that represents a Digital Elevation Model. Additionally, the 3D object is rotated from its original UTM orientation to an orientation that is aligned with the j3d scene's axes. (This angle can be accessed through getUTMAngle() which makes it simple to rotate the object back to its original UTM orientation.)

DEM3d has been tested using 24k California DEMs which are typically range from 1 to 2 megabytes in size. When testing the class' main program, it has required an allocation of 128 megabytes of memory (ex. from the command line: java -Xmx128M DEM3d ___.dem). In theory, DEM3d should be able to generate a 3D object from any DEM, but larger DEMs containing a high number of points may require an impractical amount of memory. (A solution to this problem would be to manipulate the DEM data through the DemTable class before passing it in.)

Author:
Brandon Stow

Field Summary
protected  IndexedQuadArray indexedQuadArray
          The central j3d object encapsulated by DEM3d
 
Constructor Summary
DEM3d(DemTable demTable)
          Constructs a DEM3d object from a DemTable.
DEM3d(DemTable demTable, float objectWidth, float objectBreadth, float objectHeight)
          Constructs a DEM3d object with specified dimensions from a DemTable
 
Method Summary
 float getBreadth()
          Returns the breadth of the object
 DemTable getDemTable()
          Returns the DemTable used to construct the DEM3d object.
 float getHeight()
          Returns the height of the object
 Color3f getHighElevationColor()
          Returns the color of the highest point of the object.
 Color3f getLowElevationColor()
          Returns the color of the lowest point of the object.
 java.lang.String getName()
          Returns the DEM spefication Data Element 1 - the file name
 Point3f getNECorner()
          Returns the j3d coordinates of the north-east corner (in DEM terms) of the object.
 Point3f getNWCorner()
          Returns the j3d coordinates of the north-west corner (in DEM terms) of the object.
 Point3f getSECorner()
          Returns the j3d coordinate of the south-east corner (in DEM terms) of the object.
 Point3f getSWCorner()
          Returns the j3d coordinate of the south-west corner (in DEM terms) of the object.
 float getUTMAngle()
          Returns the angle in radians by which the object was rotated to change its orientation from UTM to an orientation aligned with the j3d scene's axes.
 float getWidth()
          Returns the width of the object
 void setColoringScheme(Color3f highElevationColor, Color3f lowElevationColor)
          Sets the coloring scheme for the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexedQuadArray

protected IndexedQuadArray indexedQuadArray
The central j3d object encapsulated by DEM3d

Constructor Detail

DEM3d

public DEM3d(DemTable demTable)
Constructs a DEM3d object from a DemTable.

Parameters:
demTable - the DemTable object

DEM3d

public DEM3d(DemTable demTable,
             float objectWidth,
             float objectBreadth,
             float objectHeight)
Constructs a DEM3d object with specified dimensions from a DemTable

Parameters:
demTable - the DemTable object
objectWidth - the object's width
objectBreadth - the object's breadth
objectHeight - the object's height
Method Detail

getName

public java.lang.String getName()
Returns the DEM spefication Data Element 1 - the file name


getDemTable

public DemTable getDemTable()
Returns the DemTable used to construct the DEM3d object. Comprehensive information can be obtained about the DEM from its DemTable object

See Also:
DemTable

getUTMAngle

public float getUTMAngle()
Returns the angle in radians by which the object was rotated to change its orientation from UTM to an orientation aligned with the j3d scene's axes.


getWidth

public float getWidth()
Returns the width of the object


getBreadth

public float getBreadth()
Returns the breadth of the object


getHeight

public float getHeight()
Returns the height of the object


getNWCorner

public Point3f getNWCorner()
Returns the j3d coordinates of the north-west corner (in DEM terms) of the object. (This does not account for any transformations made after construction.)


getNECorner

public Point3f getNECorner()
Returns the j3d coordinates of the north-east corner (in DEM terms) of the object. (This does not account for any transformations made after construction.)


getSECorner

public Point3f getSECorner()
Returns the j3d coordinate of the south-east corner (in DEM terms) of the object. (This does not account for any transformations made after construction.)


getSWCorner

public Point3f getSWCorner()
Returns the j3d coordinate of the south-west corner (in DEM terms) of the object. (This does not account for any transformations made after construction.)


getHighElevationColor

public Color3f getHighElevationColor()
Returns the color of the highest point of the object.


getLowElevationColor

public Color3f getLowElevationColor()
Returns the color of the lowest point of the object.


setColoringScheme

public void setColoringScheme(Color3f highElevationColor,
                              Color3f lowElevationColor)
Sets the coloring scheme for the object. The object's color is writable so this can be set after the object has been rendered.

Parameters:
highElevationColor - the color for the highest point of the object
lowElevationColor - the color for the lowest point of the object