Orfeo ToolBox  4.2
Orfeo ToolBox is not a black box
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
otb::VectorDataFileReader< TOutputVectorData > Class Template Reference

Data source that reads vector data from a single file. More...

#include <otbVectorDataFileReader.h>

+ Inheritance diagram for otb::VectorDataFileReader< TOutputVectorData >:
+ Collaboration diagram for otb::VectorDataFileReader< TOutputVectorData >:

Public Types

typedef itk::SmartPointer
< const Self
ConstPointer
 
typedef TOutputVectorData OutputVectorType
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::Point< double,
VDimension
PointType
 
typedef VectorDataFileReader Self
 
typedef itk::Vector< double,
VDimension
SpacingType
 
typedef VectorDataSource
< TOutputVectorData > 
Superclass
 
typedef VectorDataIOBase VectorDataIOBaseType
 
- Public Types inherited from otb::VectorDataSource< TOutputVectorData >
typedef itk::SmartPointer
< const Self
ConstPointer
 
typedef TOutputVectorData::Pointer OutputVectorDataPointer
 
typedef TOutputVectorData OutputVectorDataType
 
typedef itk::SmartPointer< SelfPointer
 
typedef VectorDataSource Self
 
typedef itk::ProcessObject Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual void GenerateData ()
 
virtual void GenerateOutputInformation (void)
 
virtual const char * GetFileName () const
 
virtual const char * GetNameOfClass () const
 
virtual VectorDataIOBaseTypeGetVectorDataIO ()
 
virtual void SetFileName (const char *_arg)
 
void SetVectorDataIO (VectorDataIOBaseType *vectorDataIO)
 
- Public Member Functions inherited from otb::VectorDataSource< TOutputVectorData >
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual OutputVectorDataTypeGetOutput (void)
 
virtual OutputVectorDataTypeGetOutput (unsigned int idx)
 
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *output)
 
virtual void GraftOutput (itk::DataObject *output)
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from otb::VectorDataSource< TOutputVectorData >
static Pointer New ()
 

Static Public Attributes

static const unsigned int VDimension = OutputVectorType::DataNodeType::Dimension
 

Protected Member Functions

 VectorDataFileReader ()
 
virtual ~VectorDataFileReader ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const
 
- Protected Member Functions inherited from otb::VectorDataSource< TOutputVectorData >
 VectorDataSource ()
 
virtual ~VectorDataSource ()
 
virtual void AllocateOutputs ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const
 

Protected Attributes

std::string m_ExceptionMessage
 
std::string m_FileName
 
bool m_UserSpecifiedVectorDataIO
 
VectorDataIOBaseType::Pointer m_VectorDataIO
 

Private Member Functions

 VectorDataFileReader (const Self &)
 
void operator= (const Self &)
 
void TestFileExistanceAndReadability ()
 

Detailed Description

template<class TOutputVectorData>
class otb::VectorDataFileReader< TOutputVectorData >

Data source that reads vector data from a single file.

This source object is a general filter to read data from a variety of vector data file formats. It works with a VectorDataIOBase subclass to actually do the reading of the data. Object factory machinery can be used to automatically create the VectorDataIOBase, or the VectorDataIOBase can be manually created and set. Note that this class reads data from a single file.

TOutputVectorData is the type expected by the external users of the filter. If data stored in the file is stored in a different format then specified by TOutputVectorData, than this filter converts data between the file type and the external expected type.

A Pluggable factory pattern is used this allows different kinds of readers to be registered (even at run time) without having to modify the code in this class. Normally just setting the FileName with the appropriate suffix is enough to get the reader to instantiate the correct VectorDataIO and read the file properly. However, some files (like raw binary format) have no accepted suffix, so you will have to manually create the VectorDataIO instance of the write type.

See Also
VectorDataIOBase
Examples:
Projections/VectorDataExtractROIExample.cxx, and Projections/VectorDataProjectionExample.cxx.

Definition at line 81 of file otbVectorDataFileReader.h.

Member Typedef Documentation

template<class TOutputVectorData >
typedef itk::SmartPointer<const Self> otb::VectorDataFileReader< TOutputVectorData >::ConstPointer

Definition at line 89 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
typedef TOutputVectorData otb::VectorDataFileReader< TOutputVectorData >::OutputVectorType

Definition at line 95 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
typedef itk::SmartPointer<Self> otb::VectorDataFileReader< TOutputVectorData >::Pointer

Definition at line 88 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
typedef itk::Point<double, VDimension> otb::VectorDataFileReader< TOutputVectorData >::PointType

Definition at line 102 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
typedef VectorDataFileReader otb::VectorDataFileReader< TOutputVectorData >::Self

Standard class typedefs.

Definition at line 86 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
typedef itk::Vector<double, VDimension> otb::VectorDataFileReader< TOutputVectorData >::SpacingType

Definition at line 101 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
typedef VectorDataSource<TOutputVectorData> otb::VectorDataFileReader< TOutputVectorData >::Superclass

Definition at line 87 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
typedef VectorDataIOBase otb::VectorDataFileReader< TOutputVectorData >::VectorDataIOBaseType

Definition at line 98 of file otbVectorDataFileReader.h.

Constructor & Destructor Documentation

template<class TOutputVectorData >
otb::VectorDataFileReader< TOutputVectorData >::VectorDataFileReader ( )
protected

Constructor

Definition at line 39 of file otbVectorDataFileReader.txx.

References NULL.

template<class TOutputVectorData >
otb::VectorDataFileReader< TOutputVectorData >::~VectorDataFileReader ( )
protectedvirtual

Destructor

Definition at line 51 of file otbVectorDataFileReader.txx.

template<class TOutputVectorData >
otb::VectorDataFileReader< TOutputVectorData >::VectorDataFileReader ( const Self )
private

Member Function Documentation

template<class TOutputVectorData >
virtual::itk::LightObject::Pointer otb::VectorDataFileReader< TOutputVectorData >::CreateAnother ( void  ) const
template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::GenerateData ( void  )
virtual

Does the real work.

Definition at line 189 of file otbVectorDataFileReader.txx.

template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::GenerateOutputInformation ( void  )
virtual

Prepare the allocation of the output vector data during the first back propagation of the pipeline.

Definition at line 119 of file otbVectorDataFileReader.txx.

References otb::VectorDataIOFactory::CreateVectorDataIO(), otb::VectorDataIOBase::GetNameOfClass(), and otb::VectorDataIOFactory::ReadMode.

template<class TOutputVectorData >
virtual const char* otb::VectorDataFileReader< TOutputVectorData >::GetFileName ( ) const
virtual
template<class TOutputVectorData >
virtual const char* otb::VectorDataFileReader< TOutputVectorData >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from otb::VectorDataSource< TOutputVectorData >.

template<class TOutputVectorData >
virtual VectorDataIOBaseType* otb::VectorDataFileReader< TOutputVectorData >::GetVectorDataIO ( )
virtual
template<class TOutputVectorData >
static Pointer otb::VectorDataFileReader< TOutputVectorData >::New ( )
static
template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::operator= ( const Self )
private
template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protected

Definition at line 230 of file otbVectorDataFileReader.txx.

template<class TOutputVectorData >
virtual void otb::VectorDataFileReader< TOutputVectorData >::SetFileName ( const char *  _arg)
virtual

Specify the file to read

template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::SetVectorDataIO ( VectorDataIOBaseType vectorDataIO)

Set/Get the VectorDataIO helper class. Often this is created via the object factory mechanism that determines whether a particular VectorDataIO can read a certain file. This method provides a way to get the VectorDataIO instance that is created. Or you can directly specify the VectorDataIO to use to read a particular file in case the factory mechanism will not work properly (e.g., unknown or unusual extension).

Definition at line 105 of file otbVectorDataFileReader.txx.

template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::TestFileExistanceAndReadability ( )
private

Test whether the given filename exist and it is readable. If the file doesn't exist or it is not readable, and exception with an appropriate message will be thrown.

Test whether the given filename exist and it is readable, this is intended to be called before attempting to use VectorDataIO classes for actually reading the file. If the file doesn't exist or it is not readable, and exception with an approriate message will be thrown.

Definition at line 63 of file otbVectorDataFileReader.txx.

Member Data Documentation

template<class TOutputVectorData >
std::string otb::VectorDataFileReader< TOutputVectorData >::m_ExceptionMessage
protected

Definition at line 127 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
std::string otb::VectorDataFileReader< TOutputVectorData >::m_FileName
protected

Definition at line 134 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
bool otb::VectorDataFileReader< TOutputVectorData >::m_UserSpecifiedVectorDataIO
protected

Definition at line 130 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
VectorDataIOBaseType::Pointer otb::VectorDataFileReader< TOutputVectorData >::m_VectorDataIO
protected

Definition at line 129 of file otbVectorDataFileReader.h.

template<class TOutputVectorData >
const unsigned int otb::VectorDataFileReader< TOutputVectorData >::VDimension = OutputVectorType::DataNodeType::Dimension
static

Definition at line 100 of file otbVectorDataFileReader.h.


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