com.yobotics.simulationconstructionset.util.ground
Class GroundProfileFromFile

java.lang.Object
  extended by com.yobotics.simulationconstructionset.util.ground.GroundProfileFromFile
All Implemented Interfaces:
GroundProfile, HeightMap

public class GroundProfileFromFile
extends java.lang.Object
implements GroundProfile

Title:

Description:

Copyright: Copyright (c) 2006

Company:

Version:
1.0
Author:
not attributable

Nested Class Summary
static class GroundProfileFromFile.VariableType
           
 
Constructor Summary
GroundProfileFromFile(java.lang.String BDITerrainFilePath, int maxPointsInLeaves, javax.media.j3d.Transform3D transform3D)
           
GroundProfileFromFile(java.lang.String BDITerrainFilePath, int maxPointsInLeaves, javax.media.j3d.Transform3D transform3D, GroundProfileFromFile.VariableType[] variableOrder)
          Creates a KDTree from an array of (X, Y) terrain points and an equally sized array of (Z) terrain heights.
GroundProfileFromFile(java.lang.String BDITerrainFilePath, javax.media.j3d.Transform3D transform3D)
           
 
Method Summary
 void closestIntersectionAndNormalAt(double x, double y, double z, javax.vecmath.Point3d point3d, javax.vecmath.Vector3d vector3d)
           
 void closestIntersectionTo(double x, double y, double z, javax.vecmath.Point3d point3d)
           
 double getXMax()
           
 double getXMin()
           
 double getXTiles()
           
 double getYMax()
           
 double getYMin()
           
 double getYTiles()
           
 double getZMax()
           
 double getZMin()
           
 double heightAt(double x, double y, double z)
           
 boolean isClose(double x, double y, double z)
           
static double[][] loadPoints3D(java.io.BufferedReader bufferedReader, javax.media.j3d.Transform3D transform3D, GroundProfileFromFile.VariableType[] variableOrder)
          Loads terrain data from a BufferedReader and returns a 2D array of doubles.
static double[][] loadPoints3D(java.lang.String filename, javax.media.j3d.Transform3D transform3D, GroundProfileFromFile.VariableType[] variableOrder)
          Loads an ASCII file of 3D points.
static void main(java.lang.String[] args)
           
 void surfaceNormalAt(double x, double y, double z, javax.vecmath.Vector3d vector3d)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroundProfileFromFile

public GroundProfileFromFile(java.lang.String BDITerrainFilePath,
                             int maxPointsInLeaves,
                             javax.media.j3d.Transform3D transform3D)

GroundProfileFromFile

public GroundProfileFromFile(java.lang.String BDITerrainFilePath,
                             javax.media.j3d.Transform3D transform3D)

GroundProfileFromFile

public GroundProfileFromFile(java.lang.String BDITerrainFilePath,
                             int maxPointsInLeaves,
                             javax.media.j3d.Transform3D transform3D,
                             GroundProfileFromFile.VariableType[] variableOrder)
Creates a KDTree from an array of (X, Y) terrain points and an equally sized array of (Z) terrain heights. The value MaxPointsInLeaves specifies the maximum number of points in a leaf Node. Use a small value (5-20) unless building the tree takes too long.

Parameters:
points - double[][]
maxPointsInLeaves - int
Method Detail

loadPoints3D

public static double[][] loadPoints3D(java.lang.String filename,
                                      javax.media.j3d.Transform3D transform3D,
                                      GroundProfileFromFile.VariableType[] variableOrder)
Loads an ASCII file of 3D points. The first line of the file must contain the number of points, and all subsequent lines must contain three scalar values.

Parameters:
filename - String
Returns:
OneDTerrainGrid

loadPoints3D

public static double[][] loadPoints3D(java.io.BufferedReader bufferedReader,
                                      javax.media.j3d.Transform3D transform3D,
                                      GroundProfileFromFile.VariableType[] variableOrder)
Loads terrain data from a BufferedReader and returns a 2D array of doubles. The first line of the file must contain the number of points, and all subsequent lines must contain three scalar values. Returns null if the operation does not succeed.

Parameters:
bufferedReader - BufferedReader
Returns:
BreadthFirstStateEnumerator

heightAt

public double heightAt(double x,
                       double y,
                       double z)
Specified by:
heightAt in interface GroundProfile
Specified by:
heightAt in interface HeightMap

isClose

public boolean isClose(double x,
                       double y,
                       double z)
Specified by:
isClose in interface GroundProfile

closestIntersectionTo

public void closestIntersectionTo(double x,
                                  double y,
                                  double z,
                                  javax.vecmath.Point3d point3d)
Specified by:
closestIntersectionTo in interface GroundProfile

surfaceNormalAt

public void surfaceNormalAt(double x,
                            double y,
                            double z,
                            javax.vecmath.Vector3d vector3d)
Specified by:
surfaceNormalAt in interface GroundProfile

closestIntersectionAndNormalAt

public void closestIntersectionAndNormalAt(double x,
                                           double y,
                                           double z,
                                           javax.vecmath.Point3d point3d,
                                           javax.vecmath.Vector3d vector3d)
Specified by:
closestIntersectionAndNormalAt in interface GroundProfile

getXMin

public double getXMin()
Specified by:
getXMin in interface HeightMap

getXMax

public double getXMax()
Specified by:
getXMax in interface HeightMap

getXTiles

public double getXTiles()
Specified by:
getXTiles in interface HeightMap

getYMin

public double getYMin()
Specified by:
getYMin in interface HeightMap

getYMax

public double getYMax()
Specified by:
getYMax in interface HeightMap

getZMin

public double getZMin()

getZMax

public double getZMax()

getYTiles

public double getYTiles()
Specified by:
getYTiles in interface HeightMap

main

public static void main(java.lang.String[] args)