ug4
ug::FileReaderASC Class Reference

#include <file_io_asc.h>

Public Member Functions

number at (size_t r, size_t c) const
 
number cell_size () const
 
const Field< number > & field () const
 
 FileReaderASC ()
 
void load_file (const char *filename)
 
number lower_left_corner_x () const
 
number lower_left_corner_y () const
 
number no_data_value () const
 
size_t num_columns () const
 
size_t num_rows () const
 
void set_field (Field< number > *field)
 set an external field in which the data will be loaded More...
 
 ~FileReaderASC ()
 

Private Attributes

number m_cellSize
 
Field< number > * m_field
 
vector2 m_llcorner
 
number m_noDataValue
 
SmartPtr< Field< number > > m_privateField
 

Constructor & Destructor Documentation

◆ FileReaderASC()

ug::FileReaderASC::FileReaderASC ( )

References m_field, m_privateField, and make_sp().

◆ ~FileReaderASC()

ug::FileReaderASC::~FileReaderASC ( )

Member Function Documentation

◆ at()

number ug::FileReaderASC::at ( size_t  r,
size_t  c 
) const
inline

References ug::Field< T >::at(), and m_field.

◆ cell_size()

number ug::FileReaderASC::cell_size ( ) const
inline

◆ field()

const Field<number>& ug::FileReaderASC::field ( ) const
inline

References m_field.

Referenced by load_file(), ug::LoadGridFromASC(), and set_field().

◆ load_file()

◆ lower_left_corner_x()

number ug::FileReaderASC::lower_left_corner_x ( ) const
inline

◆ lower_left_corner_y()

number ug::FileReaderASC::lower_left_corner_y ( ) const
inline

◆ no_data_value()

number ug::FileReaderASC::no_data_value ( ) const
inline

◆ num_columns()

size_t ug::FileReaderASC::num_columns ( ) const
inline

References m_field, and ug::Field< T >::width().

◆ num_rows()

size_t ug::FileReaderASC::num_rows ( ) const
inline

◆ set_field()

void ug::FileReaderASC::set_field ( Field< number > *  field)

set an external field in which the data will be loaded

By default data is loaded into the internal field of the FileReader. If you want to provide a field into which the data shall be loaded, e.g. to avoid memory duplication and copying, you may use this method. In this case you should make sure that the provided field instance outlives the FileReaders instance. Call this method with NULL to indicate that the internal field shall be used again.

Note
When an external field-pointer is set or unset, no data will be copied between the internal and external fields. Unless a new load_file has been executed, the provided data may not be of any use.

References field(), m_field, and m_privateField.

Referenced by ug::LoadHeightfieldFromASC().

Member Data Documentation

◆ m_cellSize

number ug::FileReaderASC::m_cellSize
private

Referenced by cell_size(), and load_file().

◆ m_field

Field<number>* ug::FileReaderASC::m_field
private

◆ m_llcorner

vector2 ug::FileReaderASC::m_llcorner
private

◆ m_noDataValue

number ug::FileReaderASC::m_noDataValue
private

Referenced by load_file(), and no_data_value().

◆ m_privateField

SmartPtr<Field<number> > ug::FileReaderASC::m_privateField
private

Referenced by FileReaderASC(), and set_field().


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