#include <RasterElementImporterShell.h>

This class provides capabilities for importers to load data from a file which is stored in a RasterElement object. The default input arg list contains two objects: Progress and RasterElement. The default output arg list contains a single View object in interactive mode.
On a typical import from interactive mode, derived importers must override the getImportDescriptors() method to parse a file for the valid data set parameters. The user may then modify the fields in the DataDescriptor, and a RasterElement object is created from the modified DataDescriptor. This RasterElement object is then set into the input arg list before execute() is called.
The default implementation of the execute() method calls createRasterPager() and copies the selected data into the import RasterElement. A view is automatically created if the plug-in is in interactive mode. If the DataDescriptor input arg is NULL, one is created and the getImportDescriptors() method is called to set the values. The plug-in contains aborting capabilities which aborts the copy in progress.
Importers that have a special format to load data from the file only need to override createRasterPager() to create the format-specific RasterPager. Importers that desire more control can do so by overriding execute(). The parseInputArgList() method can be called to extract the Progress and RasterElement values from the arg list, and the createView() method can be called to create a view for the RasterElement in interactive mode. A derived importer can also override abort() to properly allow the user to abort the import.
Definition at line 66 of file RasterElementImporterShell.h.
| RasterElementImporterShell::RasterElementImporterShell | ( | ) |
Creates a raster element importer plug-in.
The constructor sets the plug-in subtype to "Raster Element" and sets the plug-in to allow multiple instances.
| virtual RasterElementImporterShell::~RasterElementImporterShell | ( | ) | [virtual] |
Destroys the raster element importer plug-in.
| virtual bool RasterElementImporterShell::getInputSpecification | ( | PlugInArgList *& | pArgList | ) | [virtual] |
Retrieves the plug-in input parameters.
This method queries the plug-in for its input parameters that are needed to execute properly. The input arguments may be different in interactive mode and batch mode.
| pArgList | A plug-in arg list pointer that is set to a created input argument list specifying the plug-in input parameters. NULL is a valid pointer value if the plug-in does not require any input arguments. |
Implements Executable.
| virtual bool RasterElementImporterShell::getOutputSpecification | ( | PlugInArgList *& | pArgList | ) | [virtual] |
Retrieves the plug-in output parameters.
This method queries the plug-in for its output parameters that are created during execution. The output arguments may be different in interactive mode and batch mode.
| pArgList | A plug-in arg list pointer that is set to a created output argument list specifying the plug-in output parameters. NULL is a valid pointer value if the plug-in does not provide any output arguments. |
Implements Executable.
| virtual bool RasterElementImporterShell::execute | ( | PlugInArgList * | pInArgList, | |
| PlugInArgList * | pOutArgList | |||
| ) | [virtual] |
Executes the plug-in.
| pInArgList | On input, pInArgList contains a complete input argument list for the plug-in. The actual values are used as inputs when executing the plug-in. Default values may be used if an actual value is not present. | |
| pOutArgList | On input, pOutArgList contains a complete output argument list for the plug-in, although actual values and default values will be ignored. On return, the actual values in the argument list will be updated to include all output parameters defined by the plug-in. |
Implements Executable.
| virtual bool RasterElementImporterShell::validate | ( | const DataDescriptor * | pDescriptor, | |
| std::string & | errorMessage | |||
| ) | const [virtual] |
Queries whether a given data descriptor can be successfully loaded by the importer.
This method is called for the importer to parse the current settings in the data descriptor to see if it supports loading the data as currently specified in the data descriptor. This allows importers that do not support certain combinations of values to indicate as such. This method is called each time the user changes a value in the import options dialog. This method is also called by ImportAgent::execute() before executing the importer.
| pDescriptor | The data descriptor to query if it can be successfully imported. | |
| errorMessage | An error message that is populated with the reason why the importer cannot load the given data descriptor. This message will be displayed to the user via the importer's Progress object. If this method returns true, this message will be displayed to the user as a warning. If this method returns false, this message will be displayed to the user as an error. |
true if the importer can successfully import the given data descriptor; otherwise returns false.
true. Reimplemented from ImporterShell.
Reimplemented in HdfImporterShell, and Nitf::NitfImporterShell.
| virtual bool RasterElementImporterShell::isProcessingLocationSupported | ( | ProcessingLocation | location | ) | const [virtual] |
Queries whether the user can select the given processing location.
| location | The processing location being queried to determine if it is supported. |
Reimplemented from ImporterShell.
| virtual QWidget* RasterElementImporterShell::getPreview | ( | const DataDescriptor * | pDescriptor, | |
| Progress * | pProgress | |||
| ) | [virtual] |
Returns a preview of a given data set.
This method provides the means by which the user can preview a data set before importing. Derived importers can override this method to create a Qt widget displaying preview contents.
This method is called by the core when the user views a preview of a data set before importing. The core application assumes ownership of the Qt widget, so the importer should not delete it. A View object can also be created for the preview, where the returned value should be View::getWidget().
| pDescriptor | The data set to preview. | |
| pProgress | A progress object in which the importer can report progress while getting the preview. |
Reimplemented from ImporterShell.
| virtual bool RasterElementImporterShell::parseInputArgList | ( | PlugInArgList * | pInArgList | ) | [protected, virtual] |
Extracts the progress and sensor data from the given input arg list.
This method extracts the progress and sensor data values from the input args in the given arg list. The values are stored and can be retrieved by calling the getProgress() and getRasterElement() methods.
| pInArgList | The input arg list for which to extract the progress and raster element values. |
| Progress* RasterElementImporterShell::getProgress | ( | ) | const [protected] |
Returns the Progress object extracted from the input arg list.
| RasterElement* RasterElementImporterShell::getRasterElement | ( | ) | const [protected] |
Returns the RasterElement object extracted from the input arg list.
| virtual int RasterElementImporterShell::getValidationTest | ( | const DataDescriptor * | pDescriptor | ) | const [protected, virtual] |
Returns the test that should be performed when validating the given data set for import.
This method is called by validate() to determine which tests should be performed to validate the import. This method should be overridden by derived importers to add additional tests or remove default tests.
| pDescriptor | The data descriptor for the data set that is being imported. |
Reimplemented from ImporterShell.
Reimplemented in HdfImporterShell, and Nitf::NitfImporterShell.
| virtual bool RasterElementImporterShell::performImport | ( | ) | const [protected, virtual] |
Perform the a default import.
This method performs a default import by creating a RasterPager if the processing location is ProcessingLocation::ON_DISK_READ_ONLY or by creating a separate RasterElement and RasterPager and copying the data into the original RasterElement.
parseInputArgList() must be called before calling this method. This method is called from the default implementation of execute().
true if the operation succeeded, or false otherwise. Failure may be due to an abort. In case of failure, the Progress will have an appropriate message. | virtual SpatialDataView* RasterElementImporterShell::createView | ( | ) | const [protected, virtual] |
Creates a view for the imported data set.
This method creates a view for the imported data set in interactive mode only. Prior to calling this method, the parseInputArgList() method must be called to extract the RasterElement. This method is called from the default implementation of execute() after the createGcpList() method.
A new message log step is created and the initially displayed bands and display mode are added as properties to the step.
Reimplemented in Nitf::NitfImporterShell.
| virtual RasterLayer* RasterElementImporterShell::createRasterLayer | ( | SpatialDataView * | pView, | |
| Step * | pStep | |||
| ) | const [protected, virtual] |
Creates a raster layer in the given view.
This method is called from the default implementation of createView() after the view is created.
| pView | The view in which to create the raster layer. | |
| pStep | The message log step for creating the view. |
| virtual GcpLayer* RasterElementImporterShell::createGcpLayer | ( | SpatialDataView * | pView, | |
| Step * | pStep | |||
| ) | const [protected, virtual] |
Creates a GCP layer in the given view.
This method is called from the default implementation of createView() after the raster layer is created.
| pView | The view in which to create the GCP layer. | |
| pStep | The message log step for creating the view. |
NULL, the default implementation does nothing.| virtual LatLonLayer* RasterElementImporterShell::createLatLonLayer | ( | SpatialDataView * | pView, | |
| Step * | pStep | |||
| ) | const [protected, virtual] |
Creates a latitude/longitude layer in the given view.
This method is called from the default implementation of createView() after the GCP layer is created. This method is not called if the Georeference::CreateLatLonLayer setting is false.
| pView | The view in which to create the latitude/longitude layer. | |
| pStep | The message log step for creating the view. |
| virtual GcpList* RasterElementImporterShell::createGcpList | ( | ) | const [protected, virtual] |
Creates a GcpList element for the GCPs contained in the raster element file descriptor.
Prior to calling this method, the parseInputArgList() method must be called to extract the raster element. This method is called from the default implementation of execute() after the performImport() method.
NULL is returned if the raster element has not been extracted from the input arg list.| GcpList* RasterElementImporterShell::getGcpList | ( | ) | const [protected] |
Returns the GcpList object returned from createGcpList().
NULL is returned if the createGcpList() method has not yet been called. | virtual PlugIn* RasterElementImporterShell::getGeoreferencePlugIn | ( | ) | const [protected, virtual] |
Creates a Georeference plug-in that can be used to georeference the raster data.
This method is called from within execute() if the configuration settings to auto-georeference and to get the georeference plug-in from the importer are enabled. The method is called after calling createGcpList(), regardless of whether a valid GCP list is returned.
The default implementation of this method creates an instance of the GCP Georeference plug-in and calls Georeference::canHandleRasterElement() to see if it can georeference the raster data. If the plug-in supports the raster data, it is returned. Otherwise the plug-in is destroyed and NULL is returned.
Derived importers should override this method if a better Georeference plug-in is available for the raster data.
true. Ownership of the plug-in is transferred to the shell and will be destroyed automatically. NULL is returned if no plug-in is available to georeference the raster data, or if the raster data does not contain georeference information.Reimplemented in Nitf::NitfImporterShell.
| virtual bool RasterElementImporterShell::createRasterPager | ( | RasterElement * | pRaster | ) | const [protected, virtual] |
Create and set a RasterPager for a given RasterElement.
Most importers should override this method instead of execute(). Overriding this method will allow the importer to get all of the copy and conversion capabilities provided by the default execute().
| pRaster | The RasterElement to create the RasterPager for. |
Reimplemented in HdfImporterShell, and Nitf::NitfImporterShell.
| bool RasterElementImporterShell::copyData | ( | const RasterElement * | pSrcElement | ) | const [protected] |
Copy data from the source element to the imported one.
| pSrcElement | The source element to copy from. The active rows, columns, and bands should be a superset of those being imported. |
Service<DesktopServices> RasterElementImporterShell::mpDesktop [protected] |
Definition at line 418 of file RasterElementImporterShell.h.
Service<ModelServices> RasterElementImporterShell::mpModel [protected] |
Definition at line 419 of file RasterElementImporterShell.h.
Definition at line 420 of file RasterElementImporterShell.h.
Definition at line 421 of file RasterElementImporterShell.h.