| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef _IMGREADERLAS_H_ |
| 22 |
#define _IMGREADERLAS_H_ |
| 23 |
|
| 24 |
#include <string> |
| 25 |
#include <vector> |
| 26 |
#include "liblas/liblas.hpp" |
| 27 |
|
| 28 |
|
| 29 |
class LastReturnFilter: public liblas::FilterI |
| 30 |
{ |
| 31 |
public: |
| 32 |
LastReturnFilter(); |
| 33 |
bool filter(const liblas::Point& point); |
| 34 |
|
| 35 |
private: |
| 36 |
LastReturnFilter(LastReturnFilter const& other); |
| 37 |
LastReturnFilter& operator=(LastReturnFilter const& rhs); |
| 38 |
}; |
| 39 |
|
| 40 |
class FileReaderLas |
| 41 |
{ |
| 42 |
public: |
| 43 |
FileReaderLas(void); |
| 44 |
FileReaderLas(const std::string& filename); |
| 45 |
~FileReaderLas(void); |
| 46 |
void open(const std::string& filename); |
| 47 |
void close(void); |
| 48 |
liblas::Header const& getHeader() const; |
| 49 |
bool isCompressed() const; |
| 50 |
unsigned long int getPointCount() const; |
| 51 |
void las2ascii(const std::string& filename, bool verbose=false) const; |
| 52 |
template<typename T> liblas::Bounds<T> getExtent() const {return getHeader().GetExtent();}; |
| 53 |
void getExtent(double& ulx, double& uly, double& lrx, double& lry) const; |
| 54 |
double getMinZ() const; |
| 55 |
double getMaxZ() const; |
| 56 |
liblas::Reader* getReader(){return m_reader;}; |
| 57 |
void resetReader(){m_reader->Reset();}; |
| 58 |
void setFilter(std::vector<liblas::FilterPtr> const& filters); |
| 59 |
bool const& readNextPoint(){return(m_reader->ReadNextPoint());}; |
| 60 |
bool const& readNextPoint(liblas::Point& thePoint); |
| 61 |
liblas::Point const& getPoint(){return m_reader->GetPoint();}; |
| 62 |
liblas::Point const& readPointAt(std::size_t n){m_reader->ReadPointAt(n);return m_reader->GetPoint();}; |
| 63 |
|
| 64 |
void addReturnsFilter(std::vector<unsigned short> const& returns); |
| 65 |
void addClassFilter(std::vector<unsigned short> const& classes); |
| 66 |
void setFilters(const std::vector<liblas::FilterPtr>& filters){m_filters=filters;setFilters();}; |
| 67 |
void setFilters(){m_reader->SetFilters(m_filters);}; |
| 68 |
protected: |
| 69 |
void setCodec(const std::string& filename); |
| 70 |
std::string m_filename; |
| 71 |
std::ifstream *m_ifstream; |
| 72 |
liblas::Reader* m_reader; |
| 73 |
std::vector<liblas::FilterPtr> m_filters; |
| 74 |
}; |
| 75 |
|
| 76 |
#endif |