#include <Importer.h>

Public Member Functions | |
| virtual std::string | getDefaultExtensions () const =0 |
| virtual bool | isProcessingLocationSupported (ProcessingLocation location) const =0 |
| virtual std::vector < ImportDescriptor * > | getImportDescriptors (const std::string &filename)=0 |
| virtual unsigned char | getFileAffinity (const std::string &filename)=0 |
| virtual QWidget * | getPreview (const DataDescriptor *pDescriptor, Progress *pProgress)=0 |
| virtual bool | validate (const DataDescriptor *pDescriptor, std::string &errorMessage) const =0 |
| virtual QWidget * | getImportOptionsWidget (DataDescriptor *pDescriptor)=0 |
| virtual void | polishDataDescriptor (DataDescriptor *pDescriptor)=0 |
Static Public Member Functions | |
| static std::string | ImportElementArg () |
Static Public Attributes | |
| static const unsigned char | CAN_NOT_LOAD = 0 |
| static const unsigned char | CAN_LOAD_WITH_USER_INPUT = 64 |
| static const unsigned char | CAN_LOAD_FILE_TYPE = 128 |
| static const unsigned char | CAN_LOAD = 192 |
Protected Member Functions | |
| virtual | ~Importer () |
Defines the importer specific interface to all importer plug-ins. This interface contains all importer specific operations.
Definition at line 29 of file Importer.h.
| virtual Importer::~Importer | ( | ) | [protected, virtual] |
Since the Importer interface is usually used in conjunction with the PlugIn and Executable interfaces, this should be destroyed by casting to the PlugIn interface and calling PlugInManagerServices::destroyPlugIn().
Definition at line 258 of file Importer.h.
| static std::string Importer::ImportElementArg | ( | ) | [static] |
The name for an import element argument.
Input arguments with this name will be automatically populated with the created DataElement whose data should be populated by the importer when the plug-in is executed with an ImportAgent. Arguments with this name should be of the type DataElement or one of its subclasses.
Definition at line 42 of file Importer.h.
| virtual std::string Importer::getDefaultExtensions | ( | ) | const [pure virtual] |
Returns the default file extensions recognized by the importer.
Implemented in ImporterShell.
| virtual bool Importer::isProcessingLocationSupported | ( | ProcessingLocation | location | ) | const [pure virtual] |
Queries whether the user can select the given processing location.
| location | The processing location being queried to determine if it is supported. |
Implemented in ImporterShell, and RasterElementImporterShell.
| virtual std::vector<ImportDescriptor*> Importer::getImportDescriptors | ( | const std::string & | filename | ) | [pure virtual] |
Returns import descriptors for each valid data element in a given file.
This method is called for the importer to parse a given file and create valid import descriptors for each data element in the file that can be used to import the data. The import descriptor objects can be created by calling ModelServices::createImportDescriptor().
| filename | Full path and name of the file to parse for data elements to import. |
Implemented in Nitf::NitfImporterShell.
| virtual unsigned char Importer::getFileAffinity | ( | const std::string & | filename | ) | [pure virtual] |
Returns a value indicating if this importer can load this file and how well it can load this file.
The Importer should look at as little of the file as required as quickly as possible when determining the affinity.
| filename | Full path and name of the file. |
Implemented in Nitf::NitfImporterShell.
| virtual QWidget* Importer::getPreview | ( | const DataDescriptor * | pDescriptor, | |
| Progress * | pProgress | |||
| ) | [pure 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. |
Implemented in ImporterShell, and RasterElementImporterShell.
| virtual bool Importer::validate | ( | const DataDescriptor * | pDescriptor, | |
| std::string & | errorMessage | |||
| ) | const [pure 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.Implemented in ImporterShell, RasterElementImporterShell, HdfImporterShell, and Nitf::NitfImporterShell.
| virtual QWidget* Importer::getImportOptionsWidget | ( | DataDescriptor * | pDescriptor | ) | [pure virtual] |
Returns a widget to display custom import option values.
This method provides an interface for which specialized import options for a data set can be displayed to the user. The method returns a Qt widget that is added to the default import options dialog. The importer should create the widget with a NULL parent, and should destroy the widget when the importer itself is destroyed.
Importers should call QWidget::setWindowTitle() on the widget that is returned to set the name that appears on the tab in the import options dialog. If the window title is not set, the importer name is displayed.
| pDescriptor | The data set for which to set the current values in the widget. |
Implemented in ImporterShell.
| virtual void Importer::polishDataDescriptor | ( | DataDescriptor * | pDescriptor | ) | [pure virtual] |
Modifies a data descriptor before it is imported.
This method is called after the user has made changes to the data descriptor contained in an ImportDescriptor returned in getImportDescriptors() and before the element is created for import.
| pDescriptor | The data set to modify before import. |
Implemented in ImporterShell.
const unsigned char Importer::CAN_NOT_LOAD = 0 [static] |
When an importer returns this value from getFileAffinity() it means the importer can not load any data from the given file.
Definition at line 114 of file Importer.h.
const unsigned char Importer::CAN_LOAD_WITH_USER_INPUT = 64 [static] |
When an importer returns this value from getFileAffinity() it means the importer may be able to load data from the file if provided additional user input.
The given Importer should return a non-empty vector of a single default constructed Data Descriptor from getImportDescriptors() if given the same filename. For example, the "Generic Importer" will load raw data from any file as long as it formatted BIP, BSQ, or BIL, but will still require additional information from the user.
Definition at line 126 of file Importer.h.
const unsigned char Importer::CAN_LOAD_FILE_TYPE = 128 [static] |
When an importer returns this value from getFileAffinity() it means the importer may be able to load data from the file if provided additional user input.
The given Importer should return a non-empty vector of DataDescriptors that are partially completed from getImportDescriptors() if given the same filename that will require additional user input. For example, the "Generic Hdf5 Importer" will locate all data within a Hdf5 file it could possibly load and return DataDescriptors for each, but will still require additional information from the user.
Definition at line 139 of file Importer.h.
const unsigned char Importer::CAN_LOAD = 192 [static] |
When an importer returns this value from getFileAffinity() it means the importer can load data from the given file and the Importer will return a non-empty vector from getImportDescriptors() if given the same filename.
An importer can return a value greater than Importer::CAN_LOAD if it wishes to override a particular importer. For example, a specialized NITF importer may know details of how to load NITF files from a particular source.
Definition at line 152 of file Importer.h.