OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
otb::VectorDataFileReader< TOutputVectorData > Class Template Reference

#include <otbVectorDataFileReader.h>

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

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef TOutputVectorData OutputVectorType
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::Point< double, VDimensionPointType
 
typedef VectorDataFileReader Self
 
typedef itk::Vector< double, VDimensionSpacingType
 
typedef VectorDataSource< TOutputVectorData > Superclass
 
typedef VectorDataIOBase VectorDataIOBaseType
 
- Public Types inherited from otb::VectorDataSource< TOutputVectorData >
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
 
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 const char * GetNameOfClass () const
 
- Public Member Functions inherited from otb::VectorDataSource< TOutputVectorData >
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual void GraftOutput (itk::DataObject *output)
 
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *output)
 
virtual OutputVectorDataTypeGetOutput (void)
 
virtual OutputVectorDataTypeGetOutput (DataObjectPointerArraySizeType idx)
 

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
 
std::string m_ExceptionMessage
 
VectorDataIOBaseType::Pointer m_VectorDataIO
 
bool m_UserSpecifiedVectorDataIO
 
std::string m_FileName
 
virtual void SetFileName (const char *_arg)
 
virtual const char * GetFileName () const
 
void SetVectorDataIO (VectorDataIOBaseType *vectorDataIO)
 
 itkGetObjectMacro (VectorDataIO, VectorDataIOBaseType)
 
void GenerateOutputInformation (void) override
 
void GenerateData () override
 
 VectorDataFileReader ()
 
 ~VectorDataFileReader () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 VectorDataFileReader (const Self &)=delete
 
void operator= (const Self &)=delete
 
void TestFileExistenceAndReadability ()
 

Additional Inherited Members

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

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 87 of file otbVectorDataFileReader.h.

Member Typedef Documentation

◆ ConstPointer

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

Definition at line 94 of file otbVectorDataFileReader.h.

◆ OutputVectorType

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

Definition at line 100 of file otbVectorDataFileReader.h.

◆ Pointer

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

Definition at line 93 of file otbVectorDataFileReader.h.

◆ PointType

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

Definition at line 107 of file otbVectorDataFileReader.h.

◆ Self

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

Standard class typedefs.

Definition at line 91 of file otbVectorDataFileReader.h.

◆ SpacingType

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

Definition at line 106 of file otbVectorDataFileReader.h.

◆ Superclass

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

Definition at line 92 of file otbVectorDataFileReader.h.

◆ VectorDataIOBaseType

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

Definition at line 103 of file otbVectorDataFileReader.h.

Constructor & Destructor Documentation

◆ VectorDataFileReader() [1/2]

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

Constructor

Definition at line 41 of file otbVectorDataFileReader.hxx.

◆ ~VectorDataFileReader()

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

Destructor

Definition at line 49 of file otbVectorDataFileReader.hxx.

◆ VectorDataFileReader() [2/2]

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

Specify the file to read

Member Function Documentation

◆ CreateAnother()

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

◆ GenerateData()

template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::GenerateData
override

Does the real work.

Definition at line 171 of file otbVectorDataFileReader.hxx.

◆ GenerateOutputInformation()

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

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

Definition at line 107 of file otbVectorDataFileReader.hxx.

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

◆ GetFileName()

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

Specify the file to read

◆ GetNameOfClass()

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

Run-time type information (and related methods).

Reimplemented from otb::VectorDataSource< TOutputVectorData >.

◆ itkGetObjectMacro()

template<class TOutputVectorData >
otb::VectorDataFileReader< TOutputVectorData >::itkGetObjectMacro ( VectorDataIO  ,
VectorDataIOBaseType   
)

Specify the file to read

◆ New()

template<class TOutputVectorData >
static Pointer otb::VectorDataFileReader< TOutputVectorData >::New ( )
static

Method for creation through the object factory.

◆ operator=()

template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::operator= ( const Self )
privatedelete

Specify the file to read

◆ PrintSelf()

template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

Specify the file to read

Definition at line 210 of file otbVectorDataFileReader.hxx.

◆ SetFileName()

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

Specify the file to read

◆ SetVectorDataIO()

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 95 of file otbVectorDataFileReader.hxx.

◆ TestFileExistenceAndReadability()

template<class TOutputVectorData >
void otb::VectorDataFileReader< TOutputVectorData >::TestFileExistenceAndReadability
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 appropriate message will be thrown.

Definition at line 59 of file otbVectorDataFileReader.hxx.

Member Data Documentation

◆ m_ExceptionMessage

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

Specify the file to read

Definition at line 134 of file otbVectorDataFileReader.h.

◆ m_FileName

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

Specify the file to read

Definition at line 141 of file otbVectorDataFileReader.h.

◆ m_UserSpecifiedVectorDataIO

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

Specify the file to read

Definition at line 137 of file otbVectorDataFileReader.h.

◆ m_VectorDataIO

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

Specify the file to read

Definition at line 136 of file otbVectorDataFileReader.h.

◆ VDimension

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

Definition at line 105 of file otbVectorDataFileReader.h.


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