JHeightMap
Class JLineDataMap

java.lang.Object
  extended by JHeightMap.JLineDataMap

public class JLineDataMap
extends java.lang.Object

Class JLineDataMap extends class AbstractDataMap (first level). Class used to create all of necessary data for height map. The class JLineDataMap is designed to store data for class JLineHeightMap

Author:
Martin Kinkor

Field Summary
protected  int height
          width loaded maps
protected  int[] indexes
          array points height map
protected  float maxHeight
          height loaded maps
protected  javax.vecmath.Vector3f[] normals
          array indexes points
protected  javax.vecmath.Point3f[] points
          maximum value from loaded maps
protected  float stepX
          array values, where the value is a number of used points in row (TriangleStrip, LineStrip)
protected  float stepY
          step in the x-axis
protected  int[] stripCounts
          array normals points
protected  int width
           
 
Constructor Summary
JLineDataMap(JHeightMap.AbstractLoadMap load)
          The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.
JLineDataMap(float[] dataArea)
          The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.
JLineDataMap(float[] dataArea, float dX, float dY)
          The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.
JLineDataMap(float[] dataArea, int widthMap, int heightMap)
          The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.
JLineDataMap(float[] dataArea, int widthMap, int heightMap, float stepX, float stepY)
          The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.
JLineDataMap(javax.vecmath.Point3f[] dataAreaPoints)
          The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.
JLineDataMap(javax.vecmath.Point3f[] dataAreaPoints, int[] indexes)
          The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.
JLineDataMap(javax.vecmath.Point3f[] dataAreaPoints, javax.vecmath.Vector3f[] normals)
          The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.
 
Method Summary
 void createDataMap(float[] dataArea, float stepX, float stepY)
          The method creates points from values (z-coordinates) loaded map.
 void createIndexes()
          The method creates indexes points of the height map.
 void createNormals()
          The method creates normals points of the height map.
 void createStripCounts()
          The method create array values (for LineStrip).
 int getHeight()
          The method returns height loaded map.
 int[] getIndexes()
          The method returns array indexes of a height map.
 javax.vecmath.Vector3f[] getNormals()
          The method returns array normals of a height map.
 javax.vecmath.Point3f[] getPoints()
          The method returns array points of a height map.
 float getStepX()
          The method returns step in the x-axis.
 float getStepY()
          The method returns step in the y-axis.
 int[] getStripCounts()
          The method returns array values (for TriangleStrip) of a height map.
 int getWidth()
          The method returns width loaded map.
static float[] matrix2vector(float[][] matrix)
          Converts matrix array to vector
static float[] matrix2vector(float[][] matrix, double multiple)
          Converts matrix array to vector and multiplies values with the coefficient
 void setIndexes(int[] areaIndexes)
          The method sets array indexes.
 void setStripCounts(int[] areaStripCounts)
          The method sets array values for LineStrip.
 boolean validDimension()
          The method controls the dimensions loaded map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

protected int width

height

protected int height
width loaded maps


maxHeight

protected float maxHeight
height loaded maps


points

protected javax.vecmath.Point3f[] points
maximum value from loaded maps


indexes

protected int[] indexes
array points height map


normals

protected javax.vecmath.Vector3f[] normals
array indexes points


stripCounts

protected int[] stripCounts
array normals points


stepX

protected float stepX
array values, where the value is a number of used points in row (TriangleStrip, LineStrip)


stepY

protected float stepY
step in the x-axis

Constructor Detail

JLineDataMap

public JLineDataMap(float[] dataArea)
The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.

Parameters:
dataArea - Values of height map

JLineDataMap

public JLineDataMap(float[] dataArea,
                    int widthMap,
                    int heightMap)
The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.

Parameters:
dataArea - Values of height map
widthMap - width height map
heightMap - height loaded height map

JLineDataMap

public JLineDataMap(float[] dataArea,
                    int widthMap,
                    int heightMap,
                    float stepX,
                    float stepY)
The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.

Parameters:
dataArea - Values of height map
widthMap - width height map
heightMap - height loaded height map
stepX - step in the x-axis
stepY - step in the y-axis

JLineDataMap

public JLineDataMap(JHeightMap.AbstractLoadMap load)
The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.

Parameters:
load - Data is loaded for file (using class AbstractLoadMap)

JLineDataMap

public JLineDataMap(float[] dataArea,
                    float dX,
                    float dY)
The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.

Parameters:
dataArea - Values of height map
dX - step in the x-axis
dY - step in the y-axis

JLineDataMap

public JLineDataMap(javax.vecmath.Point3f[] dataAreaPoints)
The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.

Parameters:
dataAreaPoints - Array points of height map

JLineDataMap

public JLineDataMap(javax.vecmath.Point3f[] dataAreaPoints,
                    javax.vecmath.Vector3f[] normals)
The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.

Parameters:
dataAreaPoints - Array points of height map
normals - Array normals of height map

JLineDataMap

public JLineDataMap(javax.vecmath.Point3f[] dataAreaPoints,
                    int[] indexes)
The constructor creates an arrays: array points, array normals, array indexes and array strip (for LineStrip)from input values.

Parameters:
dataAreaPoints - Array points of height map
indexes - Array indexes of height map
Method Detail

createDataMap

public void createDataMap(float[] dataArea,
                          float stepX,
                          float stepY)
The method creates points from values (z-coordinates) loaded map.

Parameters:
dataArea - Array values (z-coordinates) loaded map
stepX - Step in the x-axis
stepY - Step in the y-axis

createIndexes

public void createIndexes()
The method creates indexes points of the height map.


createNormals

public void createNormals()
The method creates normals points of the height map.


createStripCounts

public void createStripCounts()
The method create array values (for LineStrip).


setIndexes

public void setIndexes(int[] areaIndexes)
The method sets array indexes.

Parameters:
areaIndexes - Array indexes loaded map.

setStripCounts

public void setStripCounts(int[] areaStripCounts)
The method sets array values for LineStrip.

Parameters:
areaStripCounts - Array values (for LineStrip) loaded map

getPoints

public javax.vecmath.Point3f[] getPoints()
The method returns array points of a height map.

Returns:
Array points of a height map.

getIndexes

public int[] getIndexes()
The method returns array indexes of a height map.

Returns:
Array indexes of a height map.

getStripCounts

public int[] getStripCounts()
The method returns array values (for TriangleStrip) of a height map.

Returns:
Array values (for TriangleStrip) of a height map.

getNormals

public javax.vecmath.Vector3f[] getNormals()
The method returns array normals of a height map.

Returns:
Array normals of a height map.

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

getStepX

public float getStepX()
The method returns step in the x-axis.

Returns:
Step in the x-axis

getStepY

public float getStepY()
The method returns step in the y-axis.

Returns:
Step in the y-axis

validDimension

public boolean validDimension()
The method controls the dimensions loaded map.

Returns:
The method returns "true" if the dimensions is correct, else the method returns "false"

matrix2vector

public static float[] matrix2vector(float[][] matrix,
                                    double multiple)
Converts matrix array to vector and multiplies values with the coefficient

Parameters:
matrix - original 2D array
multiple - multiplication coefficient (if =1 values are not changed)
Returns:
multiplied values from matrix in the 1D vector

matrix2vector

public static float[] matrix2vector(float[][] matrix)
Converts matrix array to vector

Parameters:
matrix - original 2D array
Returns:
values from matrix in the 1D vector