Class TLcdOpenFlightModelDecoder

java.lang.Object
com.luciad.format.object3d.openflight.TLcdOpenFlightModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdOpenFlightModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
Decoder for OpenFlight scene databases. This decoder generates a model which contains a single ILcdOpenFlightNode object. This object represents the scene graph as described in the OpenFlight database.

The current implementation only supports databases with the "flat earth" projection type.

The model reference is obtained from an ILcdModelReferenceDecoder. The default reference decoder set on this model decoder is based on all model reference decoders annotated with the LcdService annotation, and can handle

If this fails, the decoder's default model reference is returned. Unless set by the user, the default model reference is null.

See Also:
  • Constructor Details

    • TLcdOpenFlightModelDecoder

      public TLcdOpenFlightModelDecoder()
  • Method Details

    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aILcdInputStreamFactory)
      Description copied from interface: ILcdInputStreamFactoryCapable
      Sets the input stream factory to be used.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aILcdInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Description copied from interface: ILcdInputStreamFactoryCapable
      Returns the input stream factory that is used.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is used.
    • addStatusListener

      public void addStatusListener(ILcdStatusListener aStatusListener)
      Adds a status listener to be notified of decoding progress.
      Parameters:
      aStatusListener - an ILcdStatusListener
    • removeStatusListener

      public boolean removeStatusListener(ILcdStatusListener aStatusListener)
      Removes a previously registered status listener
      Parameters:
      aStatusListener - an ILcdStatusListener
      Returns:
      true if the status listener was successfully removed
    • getModelReferenceDecoder

      public ILcdModelReferenceDecoder getModelReferenceDecoder()
      Returns the model reference decoder that is used for creating model references for decoded models. The default value supports WKT (*.prj), REF (*.ref), and EPSG (*.epsg).
      Returns:
      the model reference decoder used by this decoder
      See Also:
    • setModelReferenceDecoder

      public void setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
      Sets the model reference decoder to be used when decoding an OpenFlight model. If the model reference decoder is null or fails to decode a model reference for the given source name, the model's georeference is constructed from the information present in the header of the .FLT file. Otherwise, the model reference returned by the model reference decoder is used.
      Parameters:
      aModelReferenceDecoder - a model reference decoder
      See Also:
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Description copied from interface: ILcdModelDecoder
      Checks whether this model decoder can decode the specified data source. It is acceptable for this method to return true for a source name while decode throws an exception for that same source name.

      For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.

      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be verified; typically a file name or a URL.
      Returns:
      true if this decoder can likely decode the data specified by the source name, false otherwise.
      See Also:
    • decode

      public ILcdModel decode(String aSourceName) throws IOException
      Decodes an OpenFlight database from the specified source. Returns a model containing a TLcdOpenFlightHeaderNode object.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSourceName - the OpenFlight file to be decoded
      Returns:
      an ILcdModel
      Throws:
      IOException - if the file cannot be decoded
      See Also:
    • createModelReference

      protected ILcdModelReference createModelReference(TLcdOpenFlightHeaderNode aRoot) throws IOException
      Creates an ILcdModelReference for the OpenFlight scene being decoded. The information describing the geographic reference of the scene is available in the supplied TLcdOpenFlightHeaderNode. If a model reference decoder has been set on this OpenFlight decoder, however, it takes precedence over the information present in the file itself.
      Parameters:
      aRoot - the OpenFlight root node for which to create a model reference
      Returns:
      a model reference for the current OpenFlight scene
      Throws:
      IOException - in case the model reference decoder throws an InterruptedIOException
      See Also: