Package geomss.geom.reader
Interface GeomReader
-
- All Superinterfaces:
java.lang.Comparable
- All Known Implementing Classes:
AbstractGeomReader
,BDSGeomReader
,CARDGeomReader
,GGPGeomReader
,GTCGeomReader
,IGESGeomReader
,LaWGSGeomReader
,POIGeomReader
,STLGeomReader
,TecplotGeomReader
,TRIGeomReader
,VECCGeomReader
,XGSSGeomReader
public interface GeomReader extends java.lang.Comparable
Interface for classes that read and write geometry files of various formats. Sub-classes actually do the translation to and from the data file's format.Modified by: Joseph A. Huwaldt
- Version:
- September 9, 2016
- Author:
- Joseph A. Huwaldt, Date: April 14, 2000
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAYBE
Constant indicating that a reader might be able to read a specified file, but can't determine for sure.static int
NO
Constant indicating that a reader certainly can not read a specified file.static int
YES
Constant indicating that a reader certainly can read a specified file.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
canReadData(java.io.File inputFile)
Method that determines if this reader can read geometry from the specified input file.boolean
canWriteData()
Returns true if this class can write at least some data in the format supported by this class.java.lang.String
getExtension()
Returns the preferred file extension (not including the ".") for files of this GeomReader's type.java.util.List<java.lang.String>
getWarnings()
Return a list of any warning messages that the reader/writer may have issued.boolean
isUnitAware()
Returnstrue
if this reader is unit aware (the format it reads from or writes to stores the units being used) and returnsfalse
otherwise.GeometryList
read(java.io.File inputFile)
Reads in a geometry file from the supplied input file and returns aGeometryList
object that contains the geometry from the file.void
setFileUnits(javax.measure.unit.Unit<javax.measure.quantity.Length> units)
Sets the units used for the geometry as stored in a non-unit aware geometry file being read in.void
write(java.io.File outputFile, GeometryList geometry)
Writes out a geometry file for the geometry contained in the suppliedGeometryList
object.
-
-
-
Field Detail
-
NO
static final int NO
Constant indicating that a reader certainly can not read a specified file.- See Also:
- Constant Field Values
-
YES
static final int YES
Constant indicating that a reader certainly can read a specified file.- See Also:
- Constant Field Values
-
MAYBE
static final int MAYBE
Constant indicating that a reader might be able to read a specified file, but can't determine for sure.- See Also:
- Constant Field Values
-
-
Method Detail
-
read
GeometryList read(java.io.File inputFile) throws java.io.IOException
Reads in a geometry file from the supplied input file and returns aGeometryList
object that contains the geometry from the file.WARNING: If the file being read in is not unit aware, then you must set the units to be used by calling "setFileUnits()" before calling this method!
- Parameters:
inputFile
- The input file containing the geometry to be read in. May not be null.- Returns:
- A
GeometryList
object containing the geometry read in from the file. - Throws:
java.io.IOException
- If there is a problem reading the specified file.- See Also:
setFileUnits(javax.measure.unit.Unit)
-
write
void write(java.io.File outputFile, GeometryList geometry) throws java.io.IOException
Writes out a geometry file for the geometry contained in the suppliedGeometryList
object.WARNING: If the format being written is not unit aware, then the values are written out in whatever their current units are! Make sure to convert to the desired units for the file before calling this method.
- Parameters:
outputFile
- The output File to which the geometry is to be written. May not be null.geometry
- TheGeometryList
object containing the geometry to be written out. May not be null.- Throws:
java.io.IOException
- If there is a problem writing to the specified file.
-
canReadData
int canReadData(java.io.File inputFile) throws java.io.IOException
Method that determines if this reader can read geometry from the specified input file.- 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 format is definitely recognized by this reader. GeomReader.MAYBE if the file format might be readable by this reader, but that can't easily be determined without actually reading the file.
- Throws:
java.io.IOException
- If there is a problem reading from the specified file.
-
canWriteData
boolean canWriteData()
Returns true if this class can write at least some data in the format supported by this class. Returns false if it can not.- Returns:
- true if this class can write at least some data in the format supported by this class.
-
getExtension
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.
-
setFileUnits
void setFileUnits(javax.measure.unit.Unit<javax.measure.quantity.Length> units)
Sets the units used for the geometry as stored in a non-unit aware geometry file being read in. The geometry is returned in these units for file types which are not unit aware. If the file format specifies units, the input from this method will be ignored. If this method is not called before reading a non-unit aware geometry file, then the units of the returned geometry will be the system default units. When writing out geometry, this is ignored.- Parameters:
units
- The units used for the geometry in the file being read in. If null is passed, the units will default to the default system units.- See Also:
isUnitAware()
-
isUnitAware
boolean isUnitAware()
Returnstrue
if this reader is unit aware (the format it reads from or writes to stores the units being used) and returnsfalse
otherwise.- Returns:
- true if this reader (and its format) is unit aware.
- See Also:
setFileUnits(javax.measure.unit.Unit)
-
getWarnings
java.util.List<java.lang.String> getWarnings()
Return a list of any warning messages that the reader/writer may have issued.- Returns:
- A list of any warning messages that the reader/writer may have issued.
-
-