HdfImporterShell.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef HDFIMPORTERSHELL_H
00011 #define HDFIMPORTERSHELL_H
00012 
00013 #include "ProgressTracker.h"
00014 #include "RasterElementImporterShell.h"
00015 
00016 #include <string>
00017 #include <vector>
00018 
00019 class RasterElement;
00020 
00021 /**
00022  *  \ingroup ShellModule
00023  *  The base class for all HDF Importers.
00024  *
00025  *  Requires linking against PlugInUtilities.
00026  */
00027 class HdfImporterShell : public RasterElementImporterShell
00028 {
00029 public:
00030    /**
00031     * Constructs the HdfImporterShell object.
00032     */
00033    HdfImporterShell();
00034 
00035    /**
00036     * Destroys the HdfImporterShell object.
00037     */
00038    virtual ~HdfImporterShell();
00039 
00040    /**
00041     *  @copydoc RasterElementImporterShell::validate()
00042     */
00043    virtual bool validate(const DataDescriptor* pDescriptor, std::string& errorMessage) const;
00044 
00045 protected:
00046    /**
00047     *  @copydoc RasterElementImporterShell::getValidationTest()
00048     *
00049     *  \par
00050     *  The following tests are added if the ::ProcessingLocation is
00051     *  ::ON_DISK_READ_ONLY:
00052     *  - \link ImporterShell::NO_BAND_FILES NO_BAND_FILES \endlink
00053     *  - \link ImporterShell::NO_ROW_SUBSETS NO_ROW_SUBSETS \endlink
00054     *  - \link ImporterShell::NO_COLUMN_SUBSETS NO_COLUMN_SUBSETS \endlink
00055     *
00056     *  \par
00057     *  The following test is removed if the ::ProcessingLocation is
00058     *  ::ON_DISK_READ_ONLY and the ::InterleaveFormatType is ::BSQ:
00059     *  - \link ImporterShell::NO_BAND_SUBSETS NO_BAND_SUBSETS \endlink
00060     */
00061    virtual int getValidationTest(const DataDescriptor* pDescriptor) const;
00062 
00063    /**
00064     *  Based on the plug-in name and a reference to an RasterElement,
00065     *  creates the RasterPager Plug-In by calling the private pure virtual function
00066     *  createRasterPager(RasterElement*).
00067     *
00068     *  The dataset loaded is the one specified in the location specified by
00069     *  FileDescriptor::getDatasetLocation().
00070     *
00071     *  @param  pagerName
00072     *          The name of the RasterPager plug-in. Passed to PlugInManagerServices::createPlugIn().
00073     *  @param  raster
00074     *          A reference to the RasterElement for setting the plug-in.
00075     *
00076     *  @return TRUE if the operation succeeds. FALSE otherwise.
00077     */
00078    bool createRasterPagerPlugIn(const std::string& pagerName,
00079                                    RasterElement& raster) const;
00080 
00081    /**
00082     *  Creates an RasterPager Plug-In and sets it in the RasterElement.
00083     *
00084     *  This method can be overridden for importers that do not have a one-to-one correspondence between
00085     *  an HDF dataset and an RasterElement (ie. MODIS). Those that load one HDF dataset as a RasterElement
00086     *  can use the default implementation provided.
00087     *
00088     *  Called from createrRasterPagerPlugIn(const string&, const string&, RasterElement&).
00089     *
00090     *  @param  pRaster
00091     *          A pointer to the RasterElement for placing the raster pager plug-in.
00092     *
00093     *  @return TRUE if the operation succeeds, FALSE otherwise.
00094     */
00095    virtual bool createRasterPager(RasterElement *pRaster) const = 0;
00096 
00097 protected:
00098    // This is mutable since it's an implementation detail
00099    // otherwise, any const member function that logs progress
00100    // will need to const_cast this
00101    mutable ProgressTracker mProgressTracker;
00102 };
00103 
00104 #endif

Software Development Kit - Opticks 4.9.0 Build 16218