@LcdService(service=ILcdModelDecoder.class, priority=19999) public class TLcdPegasusModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
External Orientation.csv
naming schema
File | Required | Entry point | Description |
---|---|---|---|
External Orientation.csv | x | x | This file contains the information about the panoramic images. |
Internal Orientation.txt | x | This file contains camera-specific information that counts for all images. | |
<image files> | x | The External orientation.csv file refers to image files. |
*_Sphere.csv
naming schema
File | Required | Entry point | Description |
---|---|---|---|
*_Sphere.csv | x | x | This file contains the information about the panoramic images. |
*_Sphere.txt | x | This file contains camera-specific information that counts for all images. The file name part before the
.txt extension must exactly match the .csv file name. |
|
<image files> | x | The <job-name>_<track-name>_Sphere.csv file refers to image files. |
ILcdInputStreamFactory
of this decoder.External orientation.csv
file.ILcd2DBoundsIndexedModel
.ILcdPanoramaModelDescriptor
.External Orientation.csv
naming schema: the decoder will try to derive the name from the directory
structure: path/to/<project>/<track>/External Orientation.csv.
_Sphere.csv
naming schema: the decoder will derive the name from the filename of the entry point:
<project>_<track>_Sphere.csv.
ILcdPanorama
. ILcdModelDecoder decoder = new TLcdPegasusModelDecoder();
ILcdModel model = decoder.decode("External orientation.csv");
Note that visualizing the panoramic images in LuciadLightspeed is not supported.
The models that are decoded with this decoder are intended to be converted to the Luciad Panorama Format, that can be served
with LuciadFusion for visualisation with LuciadRIA.
See the Panoramic images guide for more information.
Constructor and Description |
---|
TLcdPegasusModelDecoder() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(String aSourceName)
Checks whether this model decoder can decode the specified data source.
|
ILcdModel |
decode(String aSourceName)
Creates a new model from the given data source.
|
ILcdModelReference |
getDefaultModelReference()
Returns the default model reference that is assigned to decoded models
whose files don't specify model references.
|
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 will be used while decoding.
|
void |
setDefaultModelReference(ILcdModelReference aDefaultModelReference)
Sets the default model reference to be assigned to decoded models whose
files don't specify model references.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory to be used.
|
void |
setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
Sets the model reference decoder that will be used for files that don't specify model
references.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
public static final String TYPE_NAME
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 void setModelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
aModelReferenceDecoder
- the model reference decoder.public ILcdModelReferenceDecoder getModelReferenceDecoder()
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.setModelReferenceDecoder(com.luciad.model.ILcdModelReferenceDecoder)
public void setDefaultModelReference(ILcdModelReference aDefaultModelReference)
aDefaultModelReference
- the default model reference.public ILcdModelReference getDefaultModelReference()
public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
ILcdInputStreamFactoryCapable
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory to be used.public ILcdInputStreamFactory getInputStreamFactory()
ILcdInputStreamFactoryCapable
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
public ILcdModel decode(String aSourceName) throws IOException
ILcdModelDecoder
decode
in interface ILcdModelDecoder
aSourceName
- the data source to be decoded; typically a file name or a URL.null
is allowed, implementors are advised to throw an error instead.IOException
- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost
always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException,
IllegalArgumentException, ...) on unexpected places, implementations are advised to catch
RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated
in the code snippet below.
public ILcdModel decode( String aSourceName ) throws IOException {
try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) {
// Perform decoding ...
} catch (RuntimeException e) {
throw new IOException(e);
}
}
InterruptedIOException
- When the thread on which this method is called is interrupted: it is recommended to stop the decoding
and throw an InterruptedIOException
.
This same exception can also be used if the decoder shows UI to the user, and the user cancels the decoding
through the UI.ILcdModelDecoder.canDecodeSource(String)