Class IGESGeomReader

  • All Implemented Interfaces:
    GeomReader, java.lang.Comparable

    public class IGESGeomReader
    extends AbstractGeomReader
    A GeomReader for reading and writing geometry to an IGES formatted transfer file. This implementation ignores many the IGES entity types at this time.

    Modified by: Joseph A. Huwaldt

    Version:
    September 9, 2016
    Author:
    Joseph A. Huwaldt, Date: August 21, 2010
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String EXTENSION  
    • Constructor Summary

      Constructors 
      Constructor Description
      IGESGeomReader()  
    • 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 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()
      This method always returns true as IGES files do encode the units that are being used though the list of available units is limited.
      GeometryList read​(java.io.File inputFile)
      Reads in an IGES geometry file from the specified input file and returns a GeometryList 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 geometry file for the geometry contained in the supplied GeometryList object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 class java.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 geometry from the specified input file.
        Specified by:
        canReadData in interface GeomReader
        Overrides:
        canReadData in class AbstractGeomReader
        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.
      • read

        public GeometryList read​(java.io.File inputFile)
                          throws java.io.IOException
        Reads in an IGES geometry file from the specified input file and returns a GeometryList object that contains the geometry from the file.
        Specified by:
        read in interface GeomReader
        Overrides:
        read in class AbstractGeomReader
        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. If the file has no readable geometry in it, then this list will have no elements in it (will have a size() of 0).
        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 geometry file for the geometry contained in the supplied GeometryList object. If the input geometry is not 3D, it will be forced to be 3D (by padding if there are too few or by truncating additional dimensions).
        Specified by:
        write in interface GeomReader
        Overrides:
        write in class AbstractGeomReader
        Parameters:
        outputFile - The output File to which the geometry is to be written. May not be null.
        geometry - The GeometryList 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.