te::rp::FeederConstRasterDirectory Class Reference

A feeder from an input directory name. More...

#include <FeedersRaster.h>

Inheritance diagram for te::rp::FeederConstRasterDirectory:
te::rp::FeederConstRaster te::rp::AbstractFeeder< const te::rst::Raster >

Public Member Functions

void applyGeometryRestriction (const te::gm::Geometry &restrictionGeom)
 Apply a new geometry intersect restriction selecting only those rasters intersecting the given geometry. More...
 
 FeederConstRasterDirectory (const std::string &directoryName, const bool recursive, const std::string &rType, const bool sortFileNames, const std::vector< std::string > &fileExtensions)
 Constructor from an input directory name. More...
 
 FeederConstRasterDirectory (const std::string &directoryName, const bool recursive, const std::string &rType, const bool sortFileNames, const std::vector< std::string > &fileExtensions, te::gm::Geometry const *const restrictionGeomPtr, const bool ignoreInvalidRasterFiles)
 Constructor from an input directory name with a restriction geometry. More...
 
te::rst::Raster const * getCurrentObj () const
 Return the current sequence object. More...
 
unsigned int getCurrentOffset () const
 Return the index of the current object. More...
 
const std::string & getCurrentRasterFileName ()
 Returns the current raster file name. More...
 
unsigned int getObjsCount () const
 Return the total number of feeder objects. More...
 
bool moveNext ()
 Advances to the next sequence obeject. More...
 
bool moveTo (const unsigned int index)
 Jump to the given object index. More...
 
void reset ()
 Reset the feeder to the first position (subsequent accesses will start from the first sequence obejct). More...
 
 ~FeederConstRasterDirectory ()
 

Protected Member Functions

 FeederConstRasterDirectory ()
 
bool initialize (const std::string &directoryName, const bool recursive, const std::string &rType, const bool sortFileNames, const std::vector< std::string > &fileExtensions, te::gm::Geometry const *const restrictionGeomPtr, const bool ignoreInvalidRasterFiles)
 Initialize this instance. More...
 

Protected Attributes

std::vector< std::string > m_allRasterFileNames
 
std::vector< te::gm::Polygonm_allRastersBoundingBoxes
 
std::auto_ptr< te::rst::Rasterm_currentRasterPtr
 
bool m_ignoreInvalidRasterFiles
 If true, invalid raster files will be ignored. More...
 
std::auto_ptr< te::gm::Geometrym_restrictionGeomPtr
 
std::string m_rType
 
std::vector< unsigned int >::size_type m_selectedRasterIndexesOffset
 
std::vector< unsigned int > m_selectedRastersIndexes
 

Detailed Description

A feeder from an input directory name.

Definition at line 141 of file FeedersRaster.h.

Constructor & Destructor Documentation

te::rp::FeederConstRasterDirectory::FeederConstRasterDirectory ( const std::string &  directoryName,
const bool  recursive,
const std::string &  rType,
const bool  sortFileNames,
const std::vector< std::string > &  fileExtensions 
)

Constructor from an input directory name.

Parameters
directoryNameThe directory full path name.
recursivetrue if a recursive search must be performed.
rTypeThe name of the specific driver to instantiate each raster ( See te::rst::RasterFactory dictionary for valid registered values ).
sortFileNamesIf true, the file names will be sorted.
fileExtensionsThe file extensions filter (example: ".tif"), or an empty vector if all extensions must be accepted.
te::rp::FeederConstRasterDirectory::FeederConstRasterDirectory ( const std::string &  directoryName,
const bool  recursive,
const std::string &  rType,
const bool  sortFileNames,
const std::vector< std::string > &  fileExtensions,
te::gm::Geometry const *const  restrictionGeomPtr,
const bool  ignoreInvalidRasterFiles 
)

Constructor from an input directory name with a restriction geometry.

Parameters
directoryNameThe directory full path name.
recursivetrue if a recursive search must be performed.
rTypeThe name of the specific driver to instantiate each raster.
sortFileNamesIf true, the file names will be sorted.
fileExtensionsThe file extensions filter (example: ".tif"), or an empty vector if all extensions must be accepted.
restrictionGeomPtrA pointer to a restriction geometry (only rasters intercepting this geomtry will be considered) or a null pointer if there is no restriction.
ignoreInvalidRasterFilesIf true, invalid raster files will be ignored.
te::rp::FeederConstRasterDirectory::~FeederConstRasterDirectory ( )
te::rp::FeederConstRasterDirectory::FeederConstRasterDirectory ( )
protected

Member Function Documentation

void te::rp::FeederConstRasterDirectory::applyGeometryRestriction ( const te::gm::Geometry restrictionGeom)

Apply a new geometry intersect restriction selecting only those rasters intersecting the given geometry.

Parameters
restrictionGeomThe new restrigion geometry.
te::rst::Raster const* te::rp::FeederConstRasterDirectory::getCurrentObj ( ) const
virtual

Return the current sequence object.

Returns
A pointer to the current object or a null pointer if there are no object to return.

Implements te::rp::FeederConstRaster.

unsigned int te::rp::FeederConstRasterDirectory::getCurrentOffset ( ) const
virtual

Return the index of the current object.

Returns
The index of the current object.

Implements te::rp::FeederConstRaster.

const std::string& te::rp::FeederConstRasterDirectory::getCurrentRasterFileName ( )

Returns the current raster file name.

Returns
Returns the current raster file name.
unsigned int te::rp::FeederConstRasterDirectory::getObjsCount ( ) const
virtual

Return the total number of feeder objects.

Returns
The total number of feeder objects.

Implements te::rp::FeederConstRaster.

bool te::rp::FeederConstRasterDirectory::initialize ( const std::string &  directoryName,
const bool  recursive,
const std::string &  rType,
const bool  sortFileNames,
const std::vector< std::string > &  fileExtensions,
te::gm::Geometry const *const  restrictionGeomPtr,
const bool  ignoreInvalidRasterFiles 
)
protected

Initialize this instance.

Parameters
directoryNameThe directory full path name.
recursivetrue if a recursive search must be performed.
rTypeThe name of the specific driver to instantiate each raster.
sortFileNamesIf true, the file names will be sorted.
fileExtensionsThe file extensions filter (example: ".tif"), or an empty vector if all extensions must be accepted.
restrictionGeomPtrA pointer to a restriction geometry (only rasters intercepting this geomtry will be considered) or a null pointer if there is no restriction.
ignoreInvalidRasterFilesIf true, invalid raster files will be ignored.
bool te::rp::FeederConstRasterDirectory::moveNext ( )
virtual

Advances to the next sequence obeject.

Returns
true if the advance was completed or false if the objects sequence end was reached.
Note
This method can invalidate any pointer returned by getCurrentObj.

Implements te::rp::FeederConstRaster.

bool te::rp::FeederConstRasterDirectory::moveTo ( const unsigned int  index)
virtual

Jump to the given object index.

Returns
true if the jump was completed or false on errors.
Note
This method can invalidate any pointer returned by getCurrentObj.

Implements te::rp::FeederConstRaster.

void te::rp::FeederConstRasterDirectory::reset ( )
virtual

Reset the feeder to the first position (subsequent accesses will start from the first sequence obejct).

Note
This method can invalidate any pointer returned by getCurrentObj.

Implements te::rp::FeederConstRaster.

Member Data Documentation

std::vector< std::string > te::rp::FeederConstRasterDirectory::m_allRasterFileNames
protected

Definition at line 205 of file FeedersRaster.h.

std::vector< te::gm::Polygon > te::rp::FeederConstRasterDirectory::m_allRastersBoundingBoxes
protected

Definition at line 206 of file FeedersRaster.h.

std::auto_ptr< te::rst::Raster > te::rp::FeederConstRasterDirectory::m_currentRasterPtr
protected

Definition at line 207 of file FeedersRaster.h.

bool te::rp::FeederConstRasterDirectory::m_ignoreInvalidRasterFiles
protected

If true, invalid raster files will be ignored.

Definition at line 201 of file FeedersRaster.h.

std::auto_ptr< te::gm::Geometry > te::rp::FeederConstRasterDirectory::m_restrictionGeomPtr
protected

Definition at line 208 of file FeedersRaster.h.

std::string te::rp::FeederConstRasterDirectory::m_rType
protected

Definition at line 202 of file FeedersRaster.h.

std::vector< unsigned int >::size_type te::rp::FeederConstRasterDirectory::m_selectedRasterIndexesOffset
protected

Definition at line 204 of file FeedersRaster.h.

std::vector< unsigned int > te::rp::FeederConstRasterDirectory::m_selectedRastersIndexes
protected

Definition at line 203 of file FeedersRaster.h.


The documentation for this class was generated from the following file: