HdfImporterShell Class Reference
[Plug-In Shells]

The base class for all HDF Importers. More...

#include <HdfImporterShell.h>

Inheritance diagram for HdfImporterShell:

Inheritance graph

List of all members.

Public Member Functions

 HdfImporterShell ()
virtual ~HdfImporterShell ()
virtual bool validate (const DataDescriptor *pDescriptor, std::string &errorMessage) const

Protected Member Functions

virtual int getValidationTest (const DataDescriptor *pDescriptor) const
bool createRasterPagerPlugIn (const std::string &pagerName, RasterElement &raster) const
virtual bool createRasterPager (RasterElement *pRaster) const =0

Protected Attributes

ProgressTracker mProgressTracker


Detailed Description

The base class for all HDF Importers.

Requires linking against PlugInUtilities.

Definition at line 27 of file HdfImporterShell.h.


Constructor & Destructor Documentation

HdfImporterShell::HdfImporterShell (  ) 

Constructs the HdfImporterShell object.

virtual HdfImporterShell::~HdfImporterShell (  )  [virtual]

Destroys the HdfImporterShell object.


Member Function Documentation

virtual bool HdfImporterShell::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.

Parameters:
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.
Returns:
Returns true if the importer can successfully import the given data descriptor; otherwise returns false.
See also:
DataDescriptor, FileDescriptor

Default Implementation:
The default implementation calls the base class implementation and provides better error messages where appropriate based on the test conditions in getValidationTest(). If the base class implementation validates successfully, the gray, red, green, and blue display bands in the RasterDataDescriptor are checked against the loaded bands. If the display band will not be loaded, a warning is added to errorMessage and the method returns true.

Reimplemented from RasterElementImporterShell.

virtual int HdfImporterShell::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.

Parameters:
pDescriptor The data descriptor for the data set that is being imported.
Returns:
Returns the test that should be used to validate the import. The value should be an OR'd combination of ValidationTest values.
Default Implementation:
The default implementation of this method returns the OR'd combination of the following tests:

The following raster-specific tests are added to the base class defaults listed above:
Additionally, the following test is added if the ProcessingLocation is IN_MEMORY:
The following tests are added if the ProcessingLocation is ON_DISK_READ_ONLY:
The following tests are added if the InterleaveFormatType is not BSQ:
The following test is added if multiple band files are present:

The following tests are added if the ProcessingLocation is ON_DISK_READ_ONLY:
The following test is removed if the ProcessingLocation is ON_DISK_READ_ONLY and the InterleaveFormatType is BSQ:

Reimplemented from RasterElementImporterShell.

bool HdfImporterShell::createRasterPagerPlugIn ( const std::string &  pagerName,
RasterElement raster 
) const [protected]

Based on the plug-in name and a reference to an RasterElement, creates the RasterPager Plug-In by calling the private pure virtual function createRasterPager(RasterElement*).

The dataset loaded is the one specified in the location specified by FileDescriptor::getDatasetLocation().

Parameters:
pagerName The name of the RasterPager plug-in. Passed to PlugInManagerServices::createPlugIn().
raster A reference to the RasterElement for setting the plug-in.
Returns:
TRUE if the operation succeeds. FALSE otherwise.

virtual bool HdfImporterShell::createRasterPager ( RasterElement pRaster  )  const [protected, pure virtual]

Creates an RasterPager Plug-In and sets it in the RasterElement.

This method can be overridden for importers that do not have a one-to-one correspondence between an HDF dataset and an RasterElement (ie. MODIS). Those that load one HDF dataset as a RasterElement can use the default implementation provided.

Called from createrRasterPagerPlugIn(const string&, const string&, RasterElement&).

Parameters:
pRaster A pointer to the RasterElement for placing the raster pager plug-in.
Returns:
TRUE if the operation succeeds, FALSE otherwise.

Reimplemented from RasterElementImporterShell.


Member Data Documentation

Definition at line 101 of file HdfImporterShell.h.


Software Development Kit - Opticks 4.9.0 Build 16218