Package geomss.geom.reader
Class VECCGeomReader
- java.lang.Object
-
- geomss.geom.reader.AbstractGeomReader
-
- geomss.geom.reader.VECCGeomReader
-
- All Implemented Interfaces:
GeomReader
,java.lang.Comparable
public class VECCGeomReader extends AbstractGeomReader
AGeomReader
for reading and writing vehicle geometry from/to a VECC (Viscous Effects on Complex Configurations) MK5 formatted geometry file. This class can also read the related VECC GEO file.Modified by: Joseph A. Huwaldt
- Version:
- September 9, 2016
- Author:
- Joseph A. Huwaldt, Date: April 10, 2009
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EXTENSION
-
Fields inherited from interface geomss.geom.reader.GeomReader
MAYBE, NO, YES
-
-
Constructor Summary
Constructors Constructor Description VECCGeomReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
canReadData(java.io.File inputFile)
Method that determines if this reader can read paneled geometry from the specified input file.boolean
canWriteData()
Returns true.java.lang.String
getExtension()
Returns the preferred file extension (not including the ".") for files of this GeomReader's type.boolean
isUnitAware()
Returns true if this reader is unit aware and false if it is not.PointVehicle
read(java.io.File inputFile)
Reads in a VECC MK5 or GEO geometry file from the specified input file and returns aPointVehicle
object that contains the geometry from the file.java.lang.String
toString()
Returns a string representation of the object.void
write(java.io.File outputFile, GeometryList geometry)
Writes out a VECC MK5 geometry file for the geometry contained in the suppliedPointVehicle
object.-
Methods inherited from class geomss.geom.reader.AbstractGeomReader
compareTo, getWarnings, setFileUnits
-
-
-
-
Field Detail
-
EXTENSION
public static final java.lang.String EXTENSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VECCGeomReader
public VECCGeomReader()
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string representation of the object. This will return a brief description of the format read by this reader.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A brief description of the format read by this reader.
-
getExtension
public java.lang.String getExtension()
Returns the preferred file extension (not including the ".") for files of this GeomReader's type.- Returns:
- The preferred file extension for files of this readers type.
-
canReadData
public int canReadData(java.io.File inputFile) throws java.io.IOException
Method that determines if this reader can read paneled geometry from the specified input file.- Specified by:
canReadData
in interfaceGeomReader
- Overrides:
canReadData
in classAbstractGeomReader
- Parameters:
inputFile
- The input file containing the geometry to be read in.- Returns:
- GeomReader.NO if the file format is not recognized by this reader. GeomReader.YES if the file has the extension ".geo" or ".mk5". GeomReader.MAYBE if the file has the extension ".lib".
- Throws:
java.io.IOException
- If there is a problem reading from the specified file.
-
canWriteData
public boolean canWriteData()
Returns true. This class can write PointVehicle data to a VECC Geometry file.- Specified by:
canWriteData
in interfaceGeomReader
- Overrides:
canWriteData
in classAbstractGeomReader
- Returns:
- this method always returns true.
-
read
public PointVehicle read(java.io.File inputFile) throws java.io.IOException
Reads in a VECC MK5 or GEO geometry file from the specified input file and returns aPointVehicle
object that contains the geometry from the file.- Specified by:
read
in interfaceGeomReader
- Overrides:
read
in classAbstractGeomReader
- Parameters:
inputFile
- The input file containing the geometry to be read in. May not be null.- Returns:
- A
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). - Throws:
java.io.IOException
- If there is a problem reading the specified file.- See Also:
AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
-
write
public void write(java.io.File outputFile, GeometryList geometry) throws java.io.IOException
Writes out a VECC MK5 geometry file for the geometry contained in the suppliedPointVehicle
object.- Specified by:
write
in interfaceGeomReader
- Overrides:
write
in classAbstractGeomReader
- Parameters:
outputFile
- The output File to which the geometry is to be written. May not be null.geometry
- ThePointVehicle
object to be written out. May not be null.- Throws:
java.io.IOException
- If there is a problem writing to the specified file.
-
isUnitAware
public boolean isUnitAware()
Returns true if this reader is unit aware and false if it is not. VECC MK5 files are unit aware and this method returns true by default. However, the related GEO files do not encode the units that are being used (are not unit aware). You must callsetFileUnits
to set the units being used before reading from a file of GEO format. If "canReadData" is called with either a GEO or MK5 file before calling this method, then this method will return the correct value.- Returns:
- true if this reader is unit aware.
- See Also:
AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
,canReadData(java.io.File)
-
-