Class TLcdGDFModelEncoder

java.lang.Object
com.luciad.format.gdf.TLcdGDFModelEncoder
All Implemented Interfaces:
ILcdOutputStreamFactoryCapable, ILcdModelEncoder, Serializable

@LcdService(service=ILcdModelEncoder.class, priority=20000) public class TLcdGDFModelEncoder extends Object implements ILcdModelEncoder, ILcdOutputStreamFactoryCapable
This ILcdModelEncoder encodes GDF models.
Since:
5.1
See Also:
  • Constructor Details

    • TLcdGDFModelEncoder

      public TLcdGDFModelEncoder()
  • Method Details

    • setXYMultiplicationFactor

      public void setXYMultiplicationFactor(int aXYMultiplicationFactor)
      Sets this multiplication factor of the X- and Y-coordinates. Each X- and Y-coordinate will be multiplicated by the given multiplication factor when it is stored to disk. The multiplication factor should be a given as the 10LOG of the intended multiplication factor. E.g., for a multiplication factor 100000, 5 should be given as an argument. (required by the GDF specification).
      Parameters:
      aXYMultiplicationFactor - the multiplication factor for X- and Y-coordinates.
      Throws:
      IllegalArgumentException - if aXYMultiplicationFactor < -9 || aXYMultiplicationFactor > 9.
    • setZMultiplicationFactor

      public void setZMultiplicationFactor(double aXYMultiplicationFactor)
      Sets this multiplication factor of the Z-coordinates. Each Z-coordinate will be multiplicated by the given multiplication factor when it is stored to disk. The multiplication factor should be a power of 10 (1,10,100,1000,...) (required by the GDF specification).
      Parameters:
      aXYMultiplicationFactor - the multiplication factor forZ-coordinates.
    • setXOffset

      public void setXOffset(long aXOfsset)
      Sets the offset for X-values. Each X-value will be decreased by the given offset before it is stored to disk.
      Parameters:
      aXOfsset - the offset for X-values.
    • setYOffset

      public void setYOffset(long aYOfsset)
      Sets the offset for Y-values. Each Y-value will be decreased by the given offset before it is stored to disk.
      Parameters:
      aYOfsset - the offset for X-values.
    • setZOffset

      public void setZOffset(long aZOfsset)
      Sets the offset for Z-values. Each Z-value will be decreased by the given offset before it is stored to disk.
      Parameters:
      aZOfsset - the offset for X-values.
    • setOutputStreamFactory

      public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
      Description copied from interface: ILcdOutputStreamFactoryCapable
      Sets the output stream factory to be used.
      Specified by:
      setOutputStreamFactory in interface ILcdOutputStreamFactoryCapable
      Parameters:
      aOutputStreamFactory - the output stream factory to be used.
    • getOutputStreamFactory

      public ILcdOutputStreamFactory getOutputStreamFactory()
      Description copied from interface: ILcdOutputStreamFactoryCapable
      Returns the output stream factory that is used.
      Specified by:
      getOutputStreamFactory in interface ILcdOutputStreamFactoryCapable
      Returns:
      the output stream factory that is used.
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelEncoder
      Returns a short, displayable name for the format this ILcdModelEncoder encodes to.
      Specified by:
      getDisplayName in interface ILcdModelEncoder
      Returns:
      the displayable name of this ILcdModelEncoder.
    • canSave

      public boolean canSave(ILcdModel aLcdModel)
      Description copied from interface: ILcdModelEncoder
      Returns whether this model encoder can save the specified model to the location it originally came from. Often this will only be a simple test, for example checking the type of the model's model descriptor.
      Specified by:
      canSave in interface ILcdModelEncoder
      Parameters:
      aLcdModel - the model to be verified.
      Returns:
      true if this encoder can save the model in the location where it originally came from, false otherwise.
      See Also:
    • save

      public void save(ILcdModel aLcdModel) throws IllegalArgumentException, IOException
      Description copied from interface: ILcdModelEncoder
      Saves the model to the location where it originally came from.
      Specified by:
      save in interface ILcdModelEncoder
      Parameters:
      aLcdModel - the model to be saved.
      Throws:
      IllegalArgumentException - if the model cannot be saved by this encoder (!canSave(aModel)).
      IOException - if an I/O error occurs during encoding.
    • canExport

      public boolean canExport(ILcdModel aLcdModel, String s)
      Description copied from interface: ILcdModelEncoder
      Returns whether this encoder can export the specified model to the specified destination. This method will typically check whether the contents of the specified model are compatible with the format this encoder is written for.
      Specified by:
      canExport in interface ILcdModelEncoder
      Parameters:
      aLcdModel - the model to be verified.
      s - the location where the model should be exported to.
      Returns:
      true if this encoder can export the specified model to the specified location, false otherwise.
      See Also:
    • export

      public void export(ILcdModel aModel, String aSourceName) throws IllegalArgumentException, IOException
      Description copied from interface: ILcdModelEncoder
      Exports the specified model to the specified destination.
      Specified by:
      export in interface ILcdModelEncoder
      Parameters:
      aModel - the model to be exported.
      aSourceName - the location where the model should be saved. Typically, this is a name for the output file, but it can also point to a file containing the required properties to create a set of data files.
      Throws:
      IllegalArgumentException - if the model cannot be saved by this encoder (!canExport(aModel, aDestinationName)).
      IOException - if an I/O error occurs during encoding.