JHeightMap
Class JLineHeightMap

java.lang.Object
  extended by javax.media.j3d.SceneGraphObject
      extended by javax.media.j3d.Node
          extended by javax.media.j3d.Leaf
              extended by javax.media.j3d.Shape3D
                  extended by JHeightMap.JLineHeightMap

public class JLineHeightMap
extends javax.media.j3d.Shape3D

Class JLineHeightMap extends class AbstractHeightMap (second level). Class used to represent the height map. Class displays the map using the class JLineDataMap (LineStrip).

Author:
Martin Kinkor

Field Summary
static int LINES_X_AXES
           
static int LINES_Y_AXES
           
 
Fields inherited from class javax.media.j3d.Shape3D
ALLOW_APPEARANCE_OVERRIDE_READ, ALLOW_APPEARANCE_OVERRIDE_WRITE, ALLOW_APPEARANCE_READ, ALLOW_APPEARANCE_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE, ALLOW_GEOMETRY_READ, ALLOW_GEOMETRY_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
JLineHeightMap()
          The constructor creates geometry and appearance height map.
JLineHeightMap(JLineDataMap dataMap)
          The constructor creates geometry and appearance height map.
JLineHeightMap(JLineDataMap dataMap, java.lang.String fileNameTexture)
          The constructor creates geometry and appearance height map.
 
Method Summary
 void createAppearance()
          The method creates default appearance of the loaded map.
 void createAppearance(java.lang.String fileNameTexture, JHeightMap.AbstractDataMap map)
          The method creates default appearance of the loaded map.
 void createGeometry(JHeightMap.AbstractDataMap dataMap)
          The method creates a geometry of the loaded map.
 int getHeight()
          The method returns height loaded map.
 float getMaxZ()
          The method returns maximum value from loaded maps
 int getWidth()
          The method returns width loaded map.
 void indexLine(int i, int status)
          The method displays line map.
 int[] indexLineIndexsX(int line, JLineDataMap m)
          The method create array indexes for map with line in the x-axis.
 int[] indexLineIndexsY(int line, JLineDataMap m)
          The method create array indexes for map with line in the y-axis.
 int[] indexLineStripCountsX(int line, JLineDataMap m)
          The method create array strips for map with line in the x-axis.
 int[] indexLineStripCountsY(int line, JLineDataMap m)
          The method create array strips for map with line in the y-axis.
 void indexLineX(int i)
          The method creates map with line in x-axis.
 void indexLineY(int i)
          The method creates map with line in y-axis.
 boolean isMatrixZero(float[] matrix)
          The method calculates whether filter matrix is zero
 boolean isValidCoordinates(int x, int y, int width, int height)
          The method detects whether a point is on the map ore not.
 void resetAppearance()
          The method resets appearance map.
 void resetMap()
          The method resets geometry map.
 void setFilter(float[] matrix, int size)
          The method changes the geometry of a loaded map according to a filter.
 void setMap(JHeightMap.AbstractDataMap map)
          The method sets a new height map that map is specified parameter dataMap.
 void setMaterial(javax.media.j3d.Material material)
          The method sets material map.
 void setTexture(java.lang.String fileNameTexture)
          The method sets texture for map.
 
Methods inherited from class javax.media.j3d.Shape3D
addGeometry, cloneNode, duplicateNode, getAllGeometries, getAppearance, getAppearanceOverrideEnable, getBounds, getCollisionBounds, getGeometry, getGeometry, indexOfGeometry, insertGeometry, intersect, intersect, intersect, numGeometries, removeAllGeometries, removeGeometry, removeGeometry, setAppearance, setAppearanceOverrideEnable, setCollisionBounds, setGeometry, setGeometry
 
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, 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

LINES_Y_AXES

public static final int LINES_Y_AXES
See Also:
Constant Field Values

LINES_X_AXES

public static final int LINES_X_AXES
See Also:
Constant Field Values
Constructor Detail

JLineHeightMap

public JLineHeightMap()
The constructor creates geometry and appearance height map.


JLineHeightMap

public JLineHeightMap(JLineDataMap dataMap)
The constructor creates geometry and appearance height map.

Parameters:
dataMap - The data required to create a height map.

JLineHeightMap

public JLineHeightMap(JLineDataMap dataMap,
                      java.lang.String fileNameTexture)
The constructor creates geometry and appearance height map.

Parameters:
dataMap - The data required to create a height map.
fileNameTexture - Name of file with texture
Method Detail

createAppearance

public void createAppearance()
The method creates default appearance of the loaded map.


createAppearance

public void createAppearance(java.lang.String fileNameTexture,
                             JHeightMap.AbstractDataMap map)
The method creates default appearance of the loaded map. The texture is used on the map.

Parameters:
fileNameTexture - Name of the file, where the texture is.
map - Data loaded map

createGeometry

public void createGeometry(JHeightMap.AbstractDataMap dataMap)
The method creates a geometry of the loaded map.

Parameters:
dataMap - Data loaded map

indexLine

public void indexLine(int i,
                      int status)
The method displays line map.

Parameters:
i - Order line.
status - The value determined whether to display line in the x-axis or in y-axis.

indexLineX

public void indexLineX(int i)
The method creates map with line in x-axis.

Parameters:
i - Order line

indexLineY

public void indexLineY(int i)
The method creates map with line in y-axis.

Parameters:
i - Order line

indexLineIndexsX

public int[] indexLineIndexsX(int line,
                              JLineDataMap m)
The method create array indexes for map with line in the x-axis.

Parameters:
line - Order line
m - Data of height map
Returns:
Array indexes

indexLineStripCountsX

public int[] indexLineStripCountsX(int line,
                                   JLineDataMap m)
The method create array strips for map with line in the x-axis.

Parameters:
line - Order line
m - Data of height map
Returns:
Array strips

indexLineIndexsY

public int[] indexLineIndexsY(int line,
                              JLineDataMap m)
The method create array indexes for map with line in the y-axis.

Parameters:
line - Order line
m - Data of height map
Returns:
Array indexes

indexLineStripCountsY

public int[] indexLineStripCountsY(int line,
                                   JLineDataMap m)
The method create array strips for map with line in the y-axis.

Parameters:
line - Order line
m - Data of height map
Returns:
Array strips

resetMap

public void resetMap()
The method resets geometry map.


isValidCoordinates

public boolean isValidCoordinates(int x,
                                  int y,
                                  int width,
                                  int height)
The method detects whether a point is on the map ore not.

Parameters:
x - Order point in the x-axis
y - Order point in the y-axis
width - width map
height - height map
Returns:
The method returns "true" if the point is on the map, else the method returns "false".

isMatrixZero

public boolean isMatrixZero(float[] matrix)
The method calculates whether filter matrix is zero

Parameters:
matrix - Filter matrix
Returns:
The method returns "true" if the filter matrix is zero, else the method returns "false".

setMap

public void setMap(JHeightMap.AbstractDataMap map)
The method sets a new height map that map is specified parameter dataMap.

Parameters:
map - Data new map

setFilter

public void setFilter(float[] matrix,
                      int size)
The method changes the geometry of a loaded map according to a filter. The filter is specified parameters: matrix and size.

Parameters:
matrix - Filter values
size - Size of a filter matrix

setTexture

public void setTexture(java.lang.String fileNameTexture)
The method sets texture for map.

Parameters:
fileNameTexture - Name of the file, where the texture is.

getHeight

public int getHeight()
The method returns height loaded map.

Returns:
Height loaded map.

getWidth

public int getWidth()
The method returns width loaded map.

Returns:
Width loaded map

getMaxZ

public float getMaxZ()
The method returns maximum value from loaded maps

Returns:
Maximum value from loaded map.

resetAppearance

public void resetAppearance()
The method resets appearance map.


setMaterial

public void setMaterial(javax.media.j3d.Material material)
The method sets material map.

Parameters:
material - Material map.