public class GGPGeomReader extends AbstractGeomReader
GeomReader
for reading vehicle geometry from a GGP formatted geometry file.
This is a geometry file format often used in conjunction with solution output from A502
(PANAIR) and A633 (TRANAIR). This class will only read in parameters from the GGP file
with the names "X", "Y", and "Z". All other parameters are ignored. This class also
assumes that all the parameters are contained in a single line and that the 1st format
is duplicated throughout the file.
Modified by: Joseph A. Huwaldt
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTENSION |
MAYBE, NO, YES
Constructor and Description |
---|
GGPGeomReader() |
Modifier and Type | Method and Description |
---|---|
int |
canReadData(java.io.File inputFile)
Method that determines if this reader can read geometry from the specified input
file.
|
java.lang.String |
getExtension()
Returns the preferred file extension (not including the ".") for files of this
GeomReader's type.
|
boolean |
isUnitAware()
This method always returns
false as GGP files do not encode the units
that are being used. |
PointVehicle |
read(java.io.File inputFile)
Reads in a GGP formatted geometry file from the specified input file and returns a
PointVehicle object that contains the geometry from the GGP file. |
java.lang.String |
toString()
Returns a string representation of the object.
|
canWriteData, compareTo, getWarnings, setFileUnits, write
public static final java.lang.String EXTENSION
public GGPGeomReader()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getExtension()
public int canReadData(java.io.File inputFile) throws java.io.IOException
canReadData
in interface GeomReader
canReadData
in class AbstractGeomReader
inputFile
- The input file containing the geometry to be read in. May not be
null.java.io.IOException
- If there is a problem reading from the specified
file.public PointVehicle read(java.io.File inputFile) throws java.io.IOException
PointVehicle
object that contains the geometry from the GGP file.
A GGP file does not support multiple components, therefore, the vehicle returned will always contain a single component (or none at all if there was no data in the file).
WARNING: This file format is not unit aware. You must set the units to be used by calling "setFileUnits()" before calling this method!
read
in interface GeomReader
read
in class AbstractGeomReader
inputFile
- The input file containing the geometry to be read in. May not be
null.PointVehicle
object containing the geometry read in from the
file. If the file has no geometry in it, then this list will have no
components in it (will have a size() of zero).java.io.IOException
- If there is a problem reading the specified file.AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
public boolean isUnitAware()
false
as GGP files do not encode the units
that are being used. You must call setFileUnits
to set the units being
used before reading from a file of this format.AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)