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
- EPSG references (
<filename>.epsg): seeTLcdEPSGModelReferenceDecoderfor more info. - WKT references (
<filename>.prj): seeTLcdWKTModelReferenceDecoderfor more info. - Luciad encoded model references (
<filename>.ref): seeTLcdModelReferenceDecoderfor more info.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStatusListener(ILcdStatusListener aStatusListener) Adds a status listener to be notified of decoding progress.booleancanDecodeSource(String aSourceName) Checks whether this model decoder can decode the specified data source.protected ILcdModelReferenceCreates anILcdModelReferencefor the OpenFlight scene being decoded.Decodes an OpenFlight database from the specified source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.Returns the input stream factory that is used.Returns the model reference decoder that is used for creating model references for decoded models.booleanremoveStatusListener(ILcdStatusListener aStatusListener) Removes a previously registered status listenervoidsetInputStreamFactory(ILcdInputStreamFactory aILcdInputStreamFactory) Sets the input stream factory to be used.voidsetModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder) Sets the model reference decoder to be used when decoding an OpenFlight model.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Constructor Details
-
TLcdOpenFlightModelDecoder
public TLcdOpenFlightModelDecoder()
-
-
Method Details
-
setInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableSets the input stream factory to be used.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aILcdInputStreamFactory- the input stream factory to be used.
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableReturns the input stream factory that is used.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the input stream factory that is used.
-
addStatusListener
Adds a status listener to be notified of decoding progress.- Parameters:
aStatusListener- an ILcdStatusListener
-
removeStatusListener
Removes a previously registered status listener- Parameters:
aStatusListener- an ILcdStatusListener- Returns:
- true if the status listener was successfully removed
-
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
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
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
canDecodeSource
Description copied from interface:ILcdModelDecoderChecks whether this model decoder can decode the specified data source. It is acceptable for this method to returntruefor a source name whiledecodethrows 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:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be verified; typically a file name or a URL.- Returns:
trueif this decoder can likely decode the data specified by the source name,falseotherwise.- See Also:
-
decode
Decodes an OpenFlight database from the specified source. Returns a model containing a TLcdOpenFlightHeaderNode object.- Specified by:
decodein interfaceILcdModelDecoder- 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 anILcdModelReferencefor the OpenFlight scene being decoded. The information describing the geographic reference of the scene is available in the suppliedTLcdOpenFlightHeaderNode. 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 anInterruptedIOException- See Also:
-