JHeightMap
Class JDefaultHeightMap

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.JDefaultHeightMap

public class JDefaultHeightMap
extends javax.media.j3d.Shape3D

Class JDefaultHeightMap extends class AbstractHeightMap (second level). Class used to represent the height map. Class displays the map using the class JDefaultDataMap (TriangleStrip).

Author:
Martin Kinkor

Field Summary
 
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
JDefaultHeightMap()
          The constructor creates geometry and appearance height map.
JDefaultHeightMap(JDefaultDataMap dataMap)
          The constructor creates geometry and appearance height map.
JDefaultHeightMap(JDefaultDataMap 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 dataMap)
          The method creates default appearance of the loaded map.
 void createGeometry(JHeightMap.AbstractDataMap map)
          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.
 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.
 boolean isWireModelMap()
          The method detects whether a wire model is switch on or 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.
 void setWireModelMap(boolean wireModel)
          The method sets the wire model (appearance height 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
 

Constructor Detail

JDefaultHeightMap

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


JDefaultHeightMap

public JDefaultHeightMap(JDefaultDataMap dataMap)
The constructor creates geometry and appearance height map.

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

JDefaultHeightMap

public JDefaultHeightMap(JDefaultDataMap 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 dataMap)
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.
dataMap - Data loaded map

createGeometry

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

Parameters:
map - Data loaded map

resetMap

public void resetMap()
The method resets geometry map.


isWireModelMap

public boolean isWireModelMap()
The method detects whether a wire model is switch on or not

Returns:
The method returns "true" if the wire model is switch on, else the method returns "false".

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".

setWireModelMap

public void setWireModelMap(boolean wireModel)
The method sets the wire model (appearance height map).

Parameters:
wireModel - A value that specifies display wire model

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.

getMaxZ

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

Returns:
Maximum value from loaded map.

getWidth

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

Returns:
Width 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.