OTB  7.2.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
otb::VectorDataIOBase Class Referenceabstract

#include <otbVectorDataIOBase.h>

+ Inheritance diagram for otb::VectorDataIOBase:
+ Collaboration diagram for otb::VectorDataIOBase:

Public Types

enum  ByteOrder {
  BigEndian,
  LittleEndian,
  OrderNotApplicable
}
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::Point< double, VDimensionPointType
 
typedef VectorDataIOBase Self
 
typedef std::streamoff SizeType
 
typedef itk::Vector< double, VDimensionSpacingType
 
typedef itk::LightProcessObject Superclass
 

Public Member Functions

virtual bool CanReadFile (const char *) const =0
 
virtual bool CanStreamRead () const
 
virtual bool CanStreamWrite () const
 
virtual bool CanWriteFile (const char *) const =0
 
std::string GetByteOrderAsString (ByteOrder) const
 
virtual const char * GetNameOfClass () const
 
virtual void Read (itk::DataObject *data)=0
 
virtual void Write (const itk::DataObject *data, char **papszOptions=nullptr)=0
 
virtual void SetFileName (const char *_arg)
 
virtual const char * GetFileName () const
 
virtual void SetByteOrder (const ByteOrder _arg)
 
virtual ByteOrder GetByteOrder () const
 
void SetByteOrderToBigEndian ()
 
void SetByteOrderToLittleEndian ()
 

Static Public Attributes

static const unsigned int VDimension = 3
 

Protected Member Functions

void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
virtual void Reset (const bool freeDynamic=true)
 
 VectorDataIOBase ()
 
 ~VectorDataIOBase () override
 

Protected Attributes

ByteOrder m_ByteOrder
 
std::string m_FileName
 
bool m_Initialized
 

Private Member Functions

void operator= (const Self &)=delete
 
 VectorDataIOBase (const Self &)=delete
 

Detailed Description

Abstract superclass defines VectorData IO interface.

VectorDataIOBase is a class that reads and/or writes VectorData data of a particular format (such as shapefile or kml). The VectorDataIOBase encapsulates both the reading and writing of data. The VectorDataIOBase is used by the VectorDataFileReader class (to read data) and the VectorDataFileWriter (to write data) into a single file. Normally the user does not directly manipulate this class other than to instantiate it, set the FileName, and assign it to a VectorDataFileReader/VectorDataFileWriter.

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.

See also
VectorDataFileWriter
VectorDataFileReader

Definition at line 60 of file otbVectorDataIOBase.h.

Member Typedef Documentation

◆ Pointer

typedef itk::SmartPointer<Self> otb::VectorDataIOBase::Pointer

Definition at line 66 of file otbVectorDataIOBase.h.

◆ PointType

typedef itk::Point<double, VDimension> otb::VectorDataIOBase::PointType

Definition at line 73 of file otbVectorDataIOBase.h.

◆ Self

Standard class typedefs.

Definition at line 64 of file otbVectorDataIOBase.h.

◆ SizeType

typedef std::streamoff otb::VectorDataIOBase::SizeType

Type for representing size of bytes, and or positions along a file

Definition at line 112 of file otbVectorDataIOBase.h.

◆ SpacingType

typedef itk::Vector<double, VDimension> otb::VectorDataIOBase::SpacingType

Definition at line 72 of file otbVectorDataIOBase.h.

◆ Superclass

typedef itk::LightProcessObject otb::VectorDataIOBase::Superclass

Definition at line 65 of file otbVectorDataIOBase.h.

Member Enumeration Documentation

◆ ByteOrder

Enums used to specify byte order; whether Big Endian or Little Endian. Some subclasses use this, some ignore it.

Enumerator
BigEndian 
LittleEndian 
OrderNotApplicable 

Definition at line 82 of file otbVectorDataIOBase.h.

Constructor & Destructor Documentation

◆ VectorDataIOBase() [1/2]

otb::VectorDataIOBase::VectorDataIOBase ( )
protected

◆ ~VectorDataIOBase()

otb::VectorDataIOBase::~VectorDataIOBase ( )
overrideprotected

◆ VectorDataIOBase() [2/2]

otb::VectorDataIOBase::VectorDataIOBase ( const Self )
privatedelete

Member Function Documentation

◆ CanReadFile()

virtual bool otb::VectorDataIOBase::CanReadFile ( const char *  ) const
pure virtual

Determine the file type. Returns true if this VectorDataIO can read the file specified.

Implemented in otb::OGRVectorDataIO.

◆ CanStreamRead()

virtual bool otb::VectorDataIOBase::CanStreamRead ( ) const
inlinevirtual

Determine if the VectorDataIO can stream reading from this file. Default is false.

Definition at line 122 of file otbVectorDataIOBase.h.

References otb::Wrapper::XML::Read().

◆ CanStreamWrite()

virtual bool otb::VectorDataIOBase::CanStreamWrite ( ) const
inlinevirtual

Determine if the ImageIO can stream writing to this file. Default is false.

Definition at line 142 of file otbVectorDataIOBase.h.

References otb::Wrapper::XML::Write().

◆ CanWriteFile()

virtual bool otb::VectorDataIOBase::CanWriteFile ( const char *  ) const
pure virtual

Determine the file type. Returns true if this VectorDataIO can read the file specified.

Implemented in otb::OGRVectorDataIO.

◆ GetByteOrder()

virtual ByteOrder otb::VectorDataIOBase::GetByteOrder ( ) const
virtual

These methods indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. Note: most UNIX machines are BigEndian while PC's and VAX's are LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetByteOrderToLittleEndian() otherwise SetByteOrderToBigEndian(). Some ImageIOBase subclasses ignore these methods.

◆ GetByteOrderAsString()

std::string otb::VectorDataIOBase::GetByteOrderAsString ( ByteOrder  ) const

Convenience method returns the ByteOrder as a string. This can be used for writing output files.

◆ GetFileName()

virtual const char* otb::VectorDataIOBase::GetFileName ( ) const
virtual

Set/Get the name of the file to be read.

◆ GetNameOfClass()

virtual const char* otb::VectorDataIOBase::GetNameOfClass ( ) const
virtual

◆ operator=()

void otb::VectorDataIOBase::operator= ( const Self )
privatedelete

◆ PrintSelf()

void otb::VectorDataIOBase::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

◆ Read()

virtual void otb::VectorDataIOBase::Read ( itk::DataObject *  data)
pure virtual

Reads the data from disk into the memory buffer provided.

Implemented in otb::OGRVectorDataIO.

◆ Reset()

virtual void otb::VectorDataIOBase::Reset ( const bool  freeDynamic = true)
protectedvirtual

Return the object to an initialized state, ready to be used

◆ SetByteOrder()

virtual void otb::VectorDataIOBase::SetByteOrder ( const ByteOrder  _arg)
virtual

These methods indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. Note: most UNIX machines are BigEndian while PC's and VAX's are LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetByteOrderToLittleEndian() otherwise SetByteOrderToBigEndian(). Some ImageIOBase subclasses ignore these methods.

◆ SetByteOrderToBigEndian()

void otb::VectorDataIOBase::SetByteOrderToBigEndian ( )
inline

These methods indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. Note: most UNIX machines are BigEndian while PC's and VAX's are LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetByteOrderToLittleEndian() otherwise SetByteOrderToBigEndian(). Some ImageIOBase subclasses ignore these methods.

Definition at line 97 of file otbVectorDataIOBase.h.

◆ SetByteOrderToLittleEndian()

void otb::VectorDataIOBase::SetByteOrderToLittleEndian ( )
inline

These methods indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. Note: most UNIX machines are BigEndian while PC's and VAX's are LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetByteOrderToLittleEndian() otherwise SetByteOrderToBigEndian(). Some ImageIOBase subclasses ignore these methods.

Definition at line 101 of file otbVectorDataIOBase.h.

◆ SetFileName()

virtual void otb::VectorDataIOBase::SetFileName ( const char *  _arg)
virtual

Set/Get the name of the file to be read.

◆ Write()

virtual void otb::VectorDataIOBase::Write ( const itk::DataObject *  data,
char **  papszOptions = nullptr 
)
pure virtual

Writes the data to disk from the memory buffer provided. Make sure that the IORegions has been set properly. The buffer is cast to a pointer to the beginning of the image data.

Implemented in otb::OGRVectorDataIO.

Member Data Documentation

◆ m_ByteOrder

ByteOrder otb::VectorDataIOBase::m_ByteOrder
protected

Big or Little Endian, and the type of the file. (May be ignored.)

Definition at line 163 of file otbVectorDataIOBase.h.

◆ m_FileName

std::string otb::VectorDataIOBase::m_FileName
protected

Filename to read

Definition at line 169 of file otbVectorDataIOBase.h.

◆ m_Initialized

bool otb::VectorDataIOBase::m_Initialized
protected

Does the VectorDataIOBase object have enough info to be of use?

Definition at line 166 of file otbVectorDataIOBase.h.

◆ VDimension

const unsigned int otb::VectorDataIOBase::VDimension = 3
static

Definition at line 71 of file otbVectorDataIOBase.h.


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