IsoSurface Rendering of an AR Representation

rlaramee
Class FromASCIItoBinaryFloat

java.lang.Object
  |
  +--rlaramee.FromASCIItoBinaryFloat

public class FromASCIItoBinaryFloat
extends java.lang.Object

Description This program converts a uniform resolution of floats from ASCII to binary format

start date Fri 2 Mar '01

Version:
1.0
Author:
Robert S Laramee
See Also:

Field Summary
private  boolean breakOut
           
private  FileHandler fileHandler
           
private  short xDimension
           
private  short yDimension
           
private  short zDimension
           
 
Constructor Summary
FromASCIItoBinaryFloat()
          constructor
 
Method Summary
private  boolean getBreakOut()
           
private  FileHandler getFileHandler()
           
private  short getXdimension()
           
private  short getYdimension()
           
private  short getZdimension()
           
static void main(java.lang.String[] args)
          The main() method runs the program
private  float parseFloat()
          This method parses an ASCII text floating point number
private  int readAndWriteFloats(java.lang.String outputFileName)
           
private  float readFloat()
          This method reads a single floating point number from ASCII file
private  void setBreakOut(boolean trueOrFalse)
           
private  void setFileHandler(FileHandler newFileHandler)
           
private  void setXdimension(short newX)
           
private  void setYdimension(short newY)
           
private  void setZdimension(short newZ)
           
 boolean startReading(java.lang.String inputFileName, java.lang.String outputFileName)
          This method starts the reading process
private  boolean validRange(double value, double min, double max)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

fileHandler

private FileHandler fileHandler

breakOut

private boolean breakOut

xDimension

private short xDimension

yDimension

private short yDimension

zDimension

private short zDimension
Constructor Detail

FromASCIItoBinaryFloat

public FromASCIItoBinaryFloat()
constructor
Method Detail

getXdimension

private short getXdimension()
Returns:
xDimension the number of scalars along the x dimension of the data set

setXdimension

private void setXdimension(short newX)
Parameters:
newX - the number of scalars along the x dimension of the data set

getYdimension

private short getYdimension()
Returns:
yDimension the number of scalars along the y dimension of the data set

setYdimension

private void setYdimension(short newY)
Parameters:
newY - the number of scalars along the y dimension of the data set

getZdimension

private short getZdimension()
Returns:
zDimension the number of scalars along the z dimension of the data set

setZdimension

private void setZdimension(short newZ)
Parameters:
newZ - the number of scalars along the z dimension of the data set

getFileHandler

private FileHandler getFileHandler()
Returns:
the fileHandler object

setFileHandler

private void setFileHandler(FileHandler newFileHandler)
Parameters:
newFileHandler - a fileHandler object

getBreakOut

private boolean getBreakOut()
Returns:
TRUE if we are to break out of a loop

setBreakOut

private void setBreakOut(boolean trueOrFalse)
Parameters:
trueOrFalse - is TRUE if we are to break out of a loop

startReading

public boolean startReading(java.lang.String inputFileName,
                            java.lang.String outputFileName)
This method starts the reading process

Parameters:
inputFileName - the name of the input file to read
outputFileName - the name of the output file to write

readAndWriteFloats

private int readAndWriteFloats(java.lang.String outputFileName)
Parameters:
outputFileName - the name of the output file to write
Returns:
numCubesWritten return the number of cubes written

readFloat

private float readFloat()
This method reads a single floating point number from ASCII file

parseFloat

private float parseFloat()
This method parses an ASCII text floating point number
Parameters:
stream - a handle to the input stream
Returns:
float the floating point number parsed
Throws:
java.io.IOException -  

validRange

private boolean validRange(double value,
                           double min,
                           double max)
Parameters:
value - the value to validate
min - the minimum allowable value
max - the maximum allowable value
Returns:
true if the value is in the proper range

main

public static void main(java.lang.String[] args)
The main() method runs the program

Parameters:
inputFileName - an input file name
outputFileName - an output file name
level - the level of resolution the current being read is

IsoSurface Rendering of an AR Representation