@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdOpenFlightModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
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
<filename>.epsg
): see TLcdEPSGModelReferenceDecoder
for more info.<filename>.prj
): see TLcdWKTModelReferenceDecoder
for more info.<filename>.ref
): see TLcdModelReferenceDecoder
for more info.TLcdOpenFlightFileDecoder
Constructor and Description |
---|
TLcdOpenFlightModelDecoder() |
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(ILcdStatusListener aStatusListener)
Adds a status listener to be notified of decoding progress.
|
boolean |
canDecodeSource(String aSourceName)
Checks whether this model decoder can decode the specified data source.
|
protected ILcdModelReference |
createModelReference(TLcdOpenFlightHeaderNode aRoot)
Creates an
ILcdModelReference for the OpenFlight scene being
decoded. |
ILcdModel |
decode(String aSourceName)
Decodes an OpenFlight database from the specified source.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the input stream factory that is used.
|
ILcdModelReferenceDecoder |
getModelReferenceDecoder()
Returns the model reference decoder that is used for creating model
references for decoded models.
|
boolean |
removeStatusListener(ILcdStatusListener aStatusListener)
Removes a previously registered status listener
|
void |
setInputStreamFactory(ILcdInputStreamFactory aILcdInputStreamFactory)
Sets the input stream factory to be used.
|
void |
setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
Sets the model reference decoder to be used when decoding an OpenFlight
model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public void setInputStreamFactory(ILcdInputStreamFactory aILcdInputStreamFactory)
ILcdInputStreamFactoryCapable
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aILcdInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
ILcdInputStreamFactoryCapable
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public void addStatusListener(ILcdStatusListener aStatusListener)
aStatusListener
- an ILcdStatusListenerpublic boolean removeStatusListener(ILcdStatusListener aStatusListener)
aStatusListener
- an ILcdStatusListenerpublic ILcdModelReferenceDecoder getModelReferenceDecoder()
setModelReferenceDecoder(com.luciad.model.ILcdModelReferenceDecoder)
public void setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
aModelReferenceDecoder
- a model reference decodercreateModelReference(com.luciad.format.object3d.openflight.model.TLcdOpenFlightHeaderNode)
public String getDisplayName()
ILcdModelDecoder
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
ILcdModelDecoder
.public boolean canDecodeSource(String aSourceName)
ILcdModelDecoder
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.
canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the data source to be verified; typically a file name or a URL.true
if this decoder can likely decode the data specified by the source name, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public ILcdModel decode(String aSourceName) throws IOException
decode
in interface ILcdModelDecoder
aSourceName
- the OpenFlight file to be decodedIOException
- if the file cannot be decodedILcdModelDecoder.canDecodeSource(String)
protected ILcdModelReference createModelReference(TLcdOpenFlightHeaderNode aRoot) throws IOException
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.aRoot
- the OpenFlight root node for which to create a model referenceIOException
- in case the model reference decoder throws an InterruptedIOException
setModelReferenceDecoder(com.luciad.model.ILcdModelReferenceDecoder)