| chipper.hpp | | chipper.hpp | |
| #ifndef LIBLAS_CHIPPER_H | | #ifndef LIBLAS_CHIPPER_H | |
| #define LIBLAS_CHIPPER_H | | #define LIBLAS_CHIPPER_H | |
| | | | |
| #include <liblas/liblas.hpp> | | #include <liblas/liblas.hpp> | |
| #include <liblas/export.hpp> | | #include <liblas/export.hpp> | |
|
| | | #include <liblas/detail/opt_allocator.hpp> | |
| | | | |
| #include <vector> | | #include <vector> | |
| | | | |
| namespace liblas | | namespace liblas | |
| { | | { | |
| | | | |
| namespace chipper | | namespace chipper | |
| { | | { | |
| | | | |
| enum Direction | | enum Direction | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 33 | |
| class LAS_DLL PtRef | | class LAS_DLL PtRef | |
| { | | { | |
| public: | | public: | |
| double m_pos; | | double m_pos; | |
| boost::uint32_t m_ptindex; | | boost::uint32_t m_ptindex; | |
| boost::uint32_t m_oindex; | | boost::uint32_t m_oindex; | |
| | | | |
| bool operator < (const PtRef& pt) const | | bool operator < (const PtRef& pt) const | |
| { return m_pos < pt.m_pos; } | | { return m_pos < pt.m_pos; } | |
| }; | | }; | |
|
| | | typedef std::vector<PtRef, detail::opt_allocator<PtRef> > PtRefVec; | |
| | | | |
| struct LAS_DLL RefList | | struct LAS_DLL RefList | |
| { | | { | |
| public: | | public: | |
|
| std::vector<PtRef> m_vec; | | PtRefVec *m_vec_p; | |
| Direction m_dir; | | Direction m_dir; | |
| | | | |
|
| RefList(Direction dir = DIR_NONE) : m_dir(dir) | | RefList(Direction dir = DIR_NONE) : m_vec_p(NULL), m_dir(dir) | |
| {} | | {} | |
|
| std::vector<PtRef>::size_type size() const | | ~RefList() | |
| { return m_vec.size(); } | | { | |
| void reserve(std::vector<PtRef>::size_type n) | | delete m_vec_p; | |
| { m_vec.reserve(n); } | | } | |
| void resize(std::vector<PtRef>::size_type n) | | | |
| { m_vec.resize(n); } | | PtRefVec::size_type size() const | |
| | | { return m_vec_p->size(); } | |
| | | void reserve(PtRefVec::size_type n) | |
| | | { m_vec_p->reserve(n); } | |
| | | void resize(PtRefVec::size_type n) | |
| | | { m_vec_p->resize(n); } | |
| void push_back(const PtRef& ref) | | void push_back(const PtRef& ref) | |
|
| { m_vec.push_back(ref); } | | { m_vec_p->push_back(ref); } | |
| std::vector<PtRef>::iterator begin() | | PtRefVec::iterator begin() | |
| { return m_vec.begin(); } | | { return m_vec_p->begin(); } | |
| std::vector<PtRef>::iterator end() | | PtRefVec::iterator end() | |
| { return m_vec.end(); } | | { return m_vec_p->end(); } | |
| PtRef& operator[](boost::uint32_t pos) | | PtRef& operator[](boost::uint32_t pos) | |
|
| { return m_vec[pos]; } | | { return (*m_vec_p)[pos]; } | |
| std::string Dir() | | std::string Dir() | |
| { | | { | |
| if (m_dir == DIR_X) | | if (m_dir == DIR_X) | |
| return "X"; | | return "X"; | |
| else if (m_dir == DIR_Y) | | else if (m_dir == DIR_Y) | |
| return "Y"; | | return "Y"; | |
| else | | else | |
| return "NONE"; | | return "NONE"; | |
| } | | } | |
|
| | | void SortByOIndex(boost::uint32_t left, boost::uint32_t center, | |
| | | boost::uint32_t right); | |
| | | void SetAllocator(detail::opt_allocator<PtRef> *alloc_p ) | |
| | | { | |
| | | m_vec_p = new PtRefVec( *alloc_p ); | |
| | | } | |
| }; | | }; | |
| | | | |
| class LAS_DLL Chipper; | | class LAS_DLL Chipper; | |
| | | | |
| class LAS_DLL Block | | class LAS_DLL Block | |
| { | | { | |
| friend class Chipper; | | friend class Chipper; | |
| | | | |
| private: | | private: | |
| RefList *m_list_p; | | RefList *m_list_p; | |
| boost::uint32_t m_left; | | boost::uint32_t m_left; | |
| boost::uint32_t m_right; | | boost::uint32_t m_right; | |
| liblas::Bounds<double> m_bounds; | | liblas::Bounds<double> m_bounds; | |
|
| // double m_xmin; | | | |
| // double m_ymin; | | | |
| // double m_xmax; | | | |
| // double m_ymax; | | | |
| | | | |
| public: | | public: | |
| std::vector<boost::uint32_t> GetIDs() const; | | std::vector<boost::uint32_t> GetIDs() const; | |
|
| liblas::Bounds<double> const& GetBounds() const {return m_bounds;} | | Bounds<double> const& GetBounds() const | |
| void SetBounds(liblas::Bounds<double> const& bounds) {m_bounds = bounds | | {return m_bounds;} | |
| ;} | | void SetBounds(liblas::Bounds<double> const& bounds) | |
| // double GetXmin() const | | {m_bounds = bounds;} | |
| // { return m_xmin; } | | }; | |
| // double GetYmin() const | | | |
| // { return m_ymin; } | | // Options that can be used to modify the behavior of the chipper. | |
| // double GetXmax() const | | class LAS_DLL Options | |
| // { return m_xmax; } | | { | |
| // double GetYmax() const | | public: | |
| // { return m_ymax; } | | Options() : m_threshold( 1000 ), m_use_sort( false ), | |
| | | m_use_maps( false ) | |
| | | {} | |
| | | | |
| | | // Maximum number of pointer per output block. | |
| | | boost::uint32_t m_threshold; | |
| | | // If true, use sorting instead of copying to reduce memory. | |
| | | bool m_use_sort; | |
| | | // If true, use memory mapped files instead of main memory | |
| | | bool m_use_maps; | |
| | | // Map file to use if m_use_maps is true. | |
| | | std::string m_map_file; | |
| }; | | }; | |
| | | | |
| class LAS_DLL Chipper | | class LAS_DLL Chipper | |
| { | | { | |
| public: | | public: | |
|
| | | Chipper(Reader *reader, Options *options ); | |
| Chipper(Reader *reader, boost::uint32_t max_partition_size) : | | Chipper(Reader *reader, boost::uint32_t max_partition_size) : | |
|
| m_reader(reader), m_threshold(max_partition_size), | | m_reader(reader), m_xvec(DIR_X), m_yvec(DIR_Y), m_spare(DIR_NONE) | |
| m_xvec(DIR_X), m_yvec(DIR_Y), m_spare(DIR_NONE) | | { | |
| {} | | m_options.m_threshold = max_partition_size; | |
| | | } | |
| | | | |
| void Chip(); | | void Chip(); | |
| std::vector<Block>::size_type GetBlockCount() | | std::vector<Block>::size_type GetBlockCount() | |
| { return m_blocks.size(); } | | { return m_blocks.size(); } | |
| const Block& GetBlock(std::vector<Block>::size_type i) | | const Block& GetBlock(std::vector<Block>::size_type i) | |
| { return m_blocks[i]; } | | { return m_blocks[i]; } | |
| | | | |
| private: | | private: | |
|
| void Load(RefList& xvec, RefList& yvec, RefList& spare); | | int Allocate(); | |
| | | int Load(); | |
| void Partition(boost::uint32_t size); | | void Partition(boost::uint32_t size); | |
| void Split(RefList& xvec, RefList& yvec, RefList& spare); | | void Split(RefList& xvec, RefList& yvec, RefList& spare); | |
| void DecideSplit(RefList& v1, RefList& v2, RefList& spare, | | void DecideSplit(RefList& v1, RefList& v2, RefList& spare, | |
| boost::uint32_t left, boost::uint32_t right); | | boost::uint32_t left, boost::uint32_t right); | |
|
| | | void RearrangeNarrow(RefList& wide, RefList& narrow, RefList& spare, | |
| | | boost::uint32_t left, boost::uint32_t center, boost::uint32_t right | |
| | | ); | |
| void Split(RefList& wide, RefList& narrow, RefList& spare, | | void Split(RefList& wide, RefList& narrow, RefList& spare, | |
| boost::uint32_t left, boost::uint32_t right); | | boost::uint32_t left, boost::uint32_t right); | |
| void FinalSplit(RefList& wide, RefList& narrow, | | void FinalSplit(RefList& wide, RefList& narrow, | |
| boost::uint32_t pleft, boost::uint32_t pcenter); | | boost::uint32_t pleft, boost::uint32_t pcenter); | |
| void Emit(RefList& wide, boost::uint32_t widemin, boost::uint32_t widem
ax, | | void Emit(RefList& wide, boost::uint32_t widemin, boost::uint32_t widem
ax, | |
|
| RefList& narrow, boost::uint32_t narrowmin, boost::uint32_t narrowm
ax ); | | RefList& narrow, boost::uint32_t narrowmin, boost::uint32_t narrowm
ax); | |
| | | | |
| Reader *m_reader; | | Reader *m_reader; | |
|
| boost::uint32_t m_threshold; | | | |
| std::vector<Block> m_blocks; | | std::vector<Block> m_blocks; | |
| std::vector<boost::uint32_t> m_partitions; | | std::vector<boost::uint32_t> m_partitions; | |
|
| | | // Note, order is important here, as the allocator must be destroyed | |
| | | // after the RefLists. | |
| | | boost::shared_ptr<detail::opt_allocator<PtRef> > m_allocator; | |
| RefList m_xvec; | | RefList m_xvec; | |
| RefList m_yvec; | | RefList m_yvec; | |
| RefList m_spare; | | RefList m_spare; | |
|
| | | Options m_options; | |
| }; | | }; | |
| | | | |
| } // namespace chipper | | } // namespace chipper | |
| | | | |
| } // namespace liblas | | } // namespace liblas | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 18 change blocks. |
| 35 lines changed or deleted | | 64 lines changed or added | |
|
| factory.hpp | | factory.hpp | |
| | | | |
| skipping to change at line 59 | | skipping to change at line 59 | |
| // boost | | // boost | |
| #include <boost/cstdint.hpp> | | #include <boost/cstdint.hpp> | |
| // std | | // std | |
| | | | |
| namespace liblas { | | namespace liblas { | |
| | | | |
| class LAS_DLL ReaderFactory | | class LAS_DLL ReaderFactory | |
| { | | { | |
| public: | | public: | |
| | | | |
|
| ReaderFactory() {}; | | ReaderFactory() {} | |
| | | | |
| ReaderFactory(ReaderFactory const& other); | | ReaderFactory(ReaderFactory const& other); | |
| ReaderFactory& operator=(ReaderFactory const& rhs); | | ReaderFactory& operator=(ReaderFactory const& rhs); | |
| | | | |
| Reader CreateWithImpl(ReaderIPtr r); | | Reader CreateWithImpl(ReaderIPtr r); | |
| | | | |
| Reader CreateCached(std::istream& stream, boost::uint32_t cache_size); | | Reader CreateCached(std::istream& stream, boost::uint32_t cache_size); | |
| Reader CreateWithStream(std::istream& stream); | | Reader CreateWithStream(std::istream& stream); | |
| | | | |
| // help function to create an input stream | | // help function to create an input stream | |
| // returns NULL if failed to open | | // returns NULL if failed to open | |
| // static std::istream* FileOpen(std::string const& filename, std::ios:
:openmode mode); | | // static std::istream* FileOpen(std::string const& filename, std::ios:
:openmode mode); | |
| // static void FileClose(std::istream*); | | // static void FileClose(std::istream*); | |
| | | | |
| /// Destructor. | | /// Destructor. | |
| /// @exception nothrow | | /// @exception nothrow | |
|
| ~ReaderFactory() {}; | | ~ReaderFactory() {} | |
| | | | |
| private: | | private: | |
| | | | |
| }; | | }; | |
| | | | |
| class LAS_DLL WriterFactory | | class LAS_DLL WriterFactory | |
| { | | { | |
| public: | | public: | |
| enum FileType | | enum FileType | |
| { | | { | |
| FileType_Unknown, | | FileType_Unknown, | |
| FileType_LAS, | | FileType_LAS, | |
| FileType_LAZ | | FileType_LAZ | |
| }; | | }; | |
| | | | |
|
| WriterFactory() {}; | | WriterFactory() {} | |
| | | | |
| WriterFactory(WriterFactory const& other); | | WriterFactory(WriterFactory const& other); | |
| WriterFactory& operator=(WriterFactory const& rhs); | | WriterFactory& operator=(WriterFactory const& rhs); | |
| | | | |
| Writer CreateWithImpl(WriterIPtr w); | | Writer CreateWithImpl(WriterIPtr w); | |
| | | | |
| // makes a WriterImpl or a ZipWriterImpl, depending on header type | | // makes a WriterImpl or a ZipWriterImpl, depending on header type | |
| static WriterIPtr CreateWithStream(std::ostream& stream, Header const&
header); | | static WriterIPtr CreateWithStream(std::ostream& stream, Header const&
header); | |
| | | | |
| /// Destructor. | | /// Destructor. | |
| /// @exception nothrow | | /// @exception nothrow | |
|
| ~WriterFactory() {}; | | ~WriterFactory() {} | |
| | | | |
| // returns Unknown, unless we find a .laz or .las extension | | // returns Unknown, unless we find a .laz or .las extension | |
| static FileType InferFileTypeFromExtension(const std::string&); | | static FileType InferFileTypeFromExtension(const std::string&); | |
| | | | |
| // | | // | |
| private: | | private: | |
| | | | |
| }; | | }; | |
| } // namespace liblas | | } // namespace liblas | |
| | | | |
| | | | |
End of changes. 4 change blocks. |
| 4 lines changed or deleted | | 4 lines changed or added | |
|
| index.hpp | | index.hpp | |
| | | | |
| skipping to change at line 491 | | skipping to change at line 491 | |
| double LowFilterZ, double HighFilterZ, boost::uint32_t Chunk
Size); | | double LowFilterZ, double HighFilterZ, boost::uint32_t Chunk
Size); | |
| IndexIterator(Index *IndexSrc, IndexData const& IndexDataSrc, boost:
:uint32_t ChunkSize); | | IndexIterator(Index *IndexSrc, IndexData const& IndexDataSrc, boost:
:uint32_t ChunkSize); | |
| IndexIterator(Index *IndexSrc, Bounds<double> const& BoundsSrc, boos
t::uint32_t ChunkSize); | | IndexIterator(Index *IndexSrc, Bounds<double> const& BoundsSrc, boos
t::uint32_t ChunkSize); | |
| /// Copy constructor. | | /// Copy constructor. | |
| IndexIterator(IndexIterator const& other); | | IndexIterator(IndexIterator const& other); | |
| /// Assignment operator. | | /// Assignment operator. | |
| IndexIterator& operator=(IndexIterator const& rhs); | | IndexIterator& operator=(IndexIterator const& rhs); | |
| private: | | private: | |
| void Copy(IndexIterator const& other); | | void Copy(IndexIterator const& other); | |
| void ResetPosition(void); | | void ResetPosition(void); | |
|
| boost::uint8_t MinMajorVersion(void) {return(1);}; | | boost::uint8_t MinMajorVersion(void) {return(1);} | |
| boost::uint8_t MinMinorVersion(void) {return(2);}; | | boost::uint8_t MinMinorVersion(void) {return(2);} | |
| | | | |
| public: | | public: | |
| /// n=0 or n=1 gives next sequence with no gap, n>1 skips n-1 filter
-compliant points, n<0 jumps backwards n compliant points | | /// n=0 or n=1 gives next sequence with no gap, n>1 skips n-1 filter
-compliant points, n<0 jumps backwards n compliant points | |
| const std::vector<boost::uint32_t>& advance(boost::int32_t n); | | const std::vector<boost::uint32_t>& advance(boost::int32_t n); | |
| /// returns filter-compliant points as though the first point returned
is element n in a zero-based array | | /// returns filter-compliant points as though the first point returned
is element n in a zero-based array | |
| const std::vector<boost::uint32_t>& operator()(boost::int32_t n); | | const std::vector<boost::uint32_t>& operator()(boost::int32_t n); | |
| /// returns next set of filter-compliant points with no skipped poin
ts | | /// returns next set of filter-compliant points with no skipped poin
ts | |
| inline const std::vector<boost::uint32_t>& operator++() {return (adv
ance(1));} | | inline const std::vector<boost::uint32_t>& operator++() {return (adv
ance(1));} | |
| /// returns next set of filter-compliant points with no skipped poin
ts | | /// returns next set of filter-compliant points with no skipped poin
ts | |
| inline const std::vector<boost::uint32_t>& operator++(int) {ret
urn (advance(1));} | | inline const std::vector<boost::uint32_t>& operator++(int) {ret
urn (advance(1));} | |
| | | | |
| skipping to change at line 518 | | skipping to change at line 518 | |
| inline const std::vector<boost::uint32_t>& operator+=(boost::int32_t
n) {return (advance(n));} | | inline const std::vector<boost::uint32_t>& operator+=(boost::int32_t
n) {return (advance(n));} | |
| /// returns next set of filter-compliant points with n-1 skipped poi
nts, for n<0 acts like -() | | /// returns next set of filter-compliant points with n-1 skipped poi
nts, for n<0 acts like -() | |
| inline const std::vector<boost::uint32_t>& operator+(boost::int32_t
n) {return (advance(n));} | | inline const std::vector<boost::uint32_t>& operator+(boost::int32_t
n) {return (advance(n));} | |
| /// returns set of filter-compliant points beginning n points backwa
rds from the end of the last set, for n<0 acts like +=() | | /// returns set of filter-compliant points beginning n points backwa
rds from the end of the last set, for n<0 acts like +=() | |
| inline const std::vector<boost::uint32_t>& operator-=(boost::int32_t
n) {return (advance(-n));} | | inline const std::vector<boost::uint32_t>& operator-=(boost::int32_t
n) {return (advance(-n));} | |
| /// returns set of filter-compliant points beginning n points backwa
rds from the end of the last set, for n<0 acts like +() | | /// returns set of filter-compliant points beginning n points backwa
rds from the end of the last set, for n<0 acts like +() | |
| inline const std::vector<boost::uint32_t>& operator-(boost::int32_t
n) {return (advance(-n));} | | inline const std::vector<boost::uint32_t>& operator-(boost::int32_t
n) {return (advance(-n));} | |
| /// returns filter-compliant points as though the first point returned
is element n in a zero-based array | | /// returns filter-compliant points as though the first point returned
is element n in a zero-based array | |
| inline const std::vector<boost::uint32_t>& operator[](boost::int32_t
n) {return ((*this)(n));} | | inline const std::vector<boost::uint32_t>& operator[](boost::int32_t
n) {return ((*this)(n));} | |
| /// tests viability of index for filtering with iterator | | /// tests viability of index for filtering with iterator | |
|
| bool ValidateIndexVersion(boost::uint8_t VersionMajor, boost::uint8_
t VersionMinor) {return (VersionMajor > MinMajorVersion() || (VersionMa
jor == MinMajorVersion() && VersionMinor >= MinMinorVersion()));}; | | bool ValidateIndexVersion(boost::uint8_t VersionMajor, boost::uint8_
t VersionMinor) {return (VersionMajor > MinMajorVersion() || (VersionMa
jor == MinMajorVersion() && VersionMinor >= MinMinorVersion()));} | |
| }; | | }; | |
| | | | |
| template <typename T, typename Q> | | template <typename T, typename Q> | |
| inline void ReadVLRData_n(T& dest, IndexVLRData const& src, Q& pos) | | inline void ReadVLRData_n(T& dest, IndexVLRData const& src, Q& pos) | |
| { | | { | |
| // error if reading past array end | | // error if reading past array end | |
| if (static_cast<size_t>(pos) + sizeof(T) > src.size()) | | if (static_cast<size_t>(pos) + sizeof(T) > src.size()) | |
| throw std::out_of_range("liblas::detail::ReadVLRData_n: arra
y index out of range"); | | throw std::out_of_range("liblas::detail::ReadVLRData_n: arra
y index out of range"); | |
| // copy sizeof(T) bytes to destination | | // copy sizeof(T) bytes to destination | |
| memcpy(&dest, &src[pos], sizeof(T)); | | memcpy(&dest, &src[pos], sizeof(T)); | |
| | | | |
End of changes. 2 change blocks. |
| 3 lines changed or deleted | | 3 lines changed or added | |
|
| indexoutput.hpp | | indexoutput.hpp | |
| | | | |
| skipping to change at line 80 | | skipping to change at line 80 | |
| | | | |
| }; | | }; | |
| | | | |
| template <typename T, typename Q> | | template <typename T, typename Q> | |
| inline void WriteVLRData_n(IndexVLRData& dest, T& src, Q& pos) | | inline void WriteVLRData_n(IndexVLRData& dest, T& src, Q& pos) | |
| { | | { | |
| // Fix little-endian | | // Fix little-endian | |
| LIBLAS_SWAP_BYTES_N(src, sizeof(T)); | | LIBLAS_SWAP_BYTES_N(src, sizeof(T)); | |
| // error if writing past array end | | // error if writing past array end | |
| if (static_cast<size_t>(pos) + sizeof(T) > dest.size()) | | if (static_cast<size_t>(pos) + sizeof(T) > dest.size()) | |
|
| throw std::out_of_range("liblas::detail::WriteVLRData_n: array inde
x out of range"); | | dest.resize(dest.size() + (std::numeric_limits<unsigned short>::max
)()); | |
| // copy sizeof(T) bytes to destination | | // copy sizeof(T) bytes to destination | |
| memcpy(&dest[pos], &src, sizeof(T)); | | memcpy(&dest[pos], &src, sizeof(T)); | |
| // increment the write position to end of written data | | // increment the write position to end of written data | |
| pos += sizeof(T); | | pos += sizeof(T); | |
| } | | } | |
| | | | |
| template <typename T, typename Q> | | template <typename T, typename Q> | |
| inline void WriteVLRDataNoInc_n(IndexVLRData& dest, T& src, Q const& pos) | | inline void WriteVLRDataNoInc_n(IndexVLRData& dest, T& src, Q const& pos) | |
| { | | { | |
| // Fix little-endian | | // Fix little-endian | |
| LIBLAS_SWAP_BYTES_N(src, sizeof(T)); | | LIBLAS_SWAP_BYTES_N(src, sizeof(T)); | |
| // error if writing past array end | | // error if writing past array end | |
| if (static_cast<size_t>(pos) + sizeof(T) > dest.size()) | | if (static_cast<size_t>(pos) + sizeof(T) > dest.size()) | |
|
| throw std::out_of_range("liblas::detail::WriteVLRDataNoInc_n: array
index out of range"); | | dest.resize(dest.size() + (std::numeric_limits<unsigned short>::max
)()); | |
| // copy sizeof(T) bytes to destination | | // copy sizeof(T) bytes to destination | |
| memcpy(&dest[pos], &src, sizeof(T)); | | memcpy(&dest[pos], &src, sizeof(T)); | |
| } | | } | |
| | | | |
| template <typename T, typename Q> | | template <typename T, typename Q> | |
| inline void WriteVLRData_str(IndexVLRData& dest, char * const src, T const
srclen, Q& pos) | | inline void WriteVLRData_str(IndexVLRData& dest, char * const src, T const
srclen, Q& pos) | |
| { | | { | |
| // copy srclen bytes to destination | | // copy srclen bytes to destination | |
| std::memcpy(&dest[pos], src, srclen); | | std::memcpy(&dest[pos], src, srclen); | |
| // error if writing past array end | | // error if writing past array end | |
| if (static_cast<size_t>(pos) + static_cast<size_t>(srclen) > dest.size(
)) | | if (static_cast<size_t>(pos) + static_cast<size_t>(srclen) > dest.size(
)) | |
|
| throw std::out_of_range("liblas::detail::WriteVLRData_str: array in
dex out of range"); | | dest.resize(dest.size() + (std::numeric_limits<unsigned short>::max
)()); | |
| // increment the write position to end of written data | | // increment the write position to end of written data | |
| pos += srclen; | | pos += srclen; | |
| } | | } | |
| | | | |
| template <typename T, typename Q> | | template <typename T, typename Q> | |
| inline void WriteVLRDataNoInc_str(IndexVLRData& dest, char * const src, T c
onst srclen, Q pos) | | inline void WriteVLRDataNoInc_str(IndexVLRData& dest, char * const src, T c
onst srclen, Q pos) | |
| { | | { | |
| // error if writing past array end | | // error if writing past array end | |
| if (static_cast<size_t>(pos) + static_cast<size_t>(srclen) > dest.size(
)) | | if (static_cast<size_t>(pos) + static_cast<size_t>(srclen) > dest.size(
)) | |
|
| throw std::out_of_range("liblas::detail::WriteVLRDataNoInc_str: arr
ay index out of range"); | | dest.resize(dest.size() + (std::numeric_limits<unsigned short>::max
)()); | |
| // copy srclen bytes to destination | | // copy srclen bytes to destination | |
| memcpy(&dest[pos], src, srclen); | | memcpy(&dest[pos], src, srclen); | |
| } | | } | |
| | | | |
| }} // namespace liblas::detail | | }} // namespace liblas::detail | |
| | | | |
| #endif // LIBLAS_DETAIL_INDEXOUTPUT_HPP_INCLUDED | | #endif // LIBLAS_DETAIL_INDEXOUTPUT_HPP_INCLUDED | |
| | | | |
End of changes. 4 change blocks. |
| 4 lines changed or deleted | | 4 lines changed or added | |
|
| las_version.h | | las_version.h | |
| | | | |
| skipping to change at line 47 | | skipping to change at line 47 | |
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |
| * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | |
| * OF SUCH DAMAGE. | | * OF SUCH DAMAGE. | |
| **************************************************************************
**/ | | **************************************************************************
**/ | |
| | | | |
| #ifndef LAS_VERSION_H_INCLUDED | | #ifndef LAS_VERSION_H_INCLUDED | |
| #define LAS_VERSION_H_INCLUDED | | #define LAS_VERSION_H_INCLUDED | |
| | | | |
| #ifndef LIBLAS_VERSION_MAJOR | | #ifndef LIBLAS_VERSION_MAJOR | |
| #define LIBLAS_VERSION_MAJOR 1 | | #define LIBLAS_VERSION_MAJOR 1 | |
|
| #define LIBLAS_VERSION_MINOR 6 | | #define LIBLAS_VERSION_MINOR 7 | |
| #define LIBLAS_VERSION_REV 1 | | #define LIBLAS_VERSION_REV 0 | |
| #define LIBLAS_VERSION_BUILD 0 | | #define LIBLAS_VERSION_BUILD 0 | |
| #endif | | #endif | |
| | | | |
| #ifndef LIBLAS_VERSION_NUM | | #ifndef LIBLAS_VERSION_NUM | |
| #define LIBLAS_VERSION_NUM (LIBLAS_VERSION_MAJOR*1000+LIBLAS_VERSION_M
INOR*100+LIBLAS_VERSION_REV*10+LIBLAS_VERSION_BUILD) | | #define LIBLAS_VERSION_NUM (LIBLAS_VERSION_MAJOR*1000+LIBLAS_VERSION_M
INOR*100+LIBLAS_VERSION_REV*10+LIBLAS_VERSION_BUILD) | |
| #endif | | #endif | |
| | | | |
| #ifndef LIBLAS_RELEASE_DATE | | #ifndef LIBLAS_RELEASE_DATE | |
|
| #define LIBLAS_RELEASE_DATE 20100405 | | #define LIBLAS_RELEASE_DATE 20120105 | |
| #endif | | #endif | |
| | | | |
| #ifndef LIBLAS_RELEASE_NAME | | #ifndef LIBLAS_RELEASE_NAME | |
|
| #define LIBLAS_RELEASE_NAME "1.6.1" | | #define LIBLAS_RELEASE_NAME "1.7.0" | |
| #endif | | #endif | |
| | | | |
| #endif /* LAS_VERSION_H_INCLUDED */ | | #endif /* LAS_VERSION_H_INCLUDED */ | |
| | | | |
End of changes. 3 change blocks. |
| 4 lines changed or deleted | | 4 lines changed or added | |
|
| liblas.h | | liblas.h | |
| | | | |
| skipping to change at line 207 | | skipping to change at line 207 | |
| LAS_DLL LASError LASReader_SetOutputSRS(LASReaderH hReader, const LASSRSH h
SRS); | | LAS_DLL LASError LASReader_SetOutputSRS(LASReaderH hReader, const LASSRSH h
SRS); | |
| | | | |
| /** Seeks to the specified point for the next LASReader_GetNextPoint | | /** Seeks to the specified point for the next LASReader_GetNextPoint | |
| * operation to start from. If an error is returned, the seek failed | | * operation to start from. If an error is returned, the seek failed | |
| * for some reason. | | * for some reason. | |
| * @param hReader the LASReaderH instance | | * @param hReader the LASReaderH instance | |
| * @return a LASError defaulting to LE_None upon success. | | * @return a LASError defaulting to LE_None upon success. | |
| */ | | */ | |
| LAS_DLL LASError LASReader_Seek(LASReaderH hReader, unsigned int position); | | LAS_DLL LASError LASReader_Seek(LASReaderH hReader, unsigned int position); | |
| | | | |
|
| | | LAS_DLL char* LASReader_GetSummaryXML(const LASReaderH hReader); | |
| | | | |
| /**************************************************************************
**/ | | /**************************************************************************
**/ | |
| /* Point operations
*/ | | /* Point operations
*/ | |
| /**************************************************************************
**/ | | /**************************************************************************
**/ | |
| | | | |
| /** Returns the X value for the point. This value is scaled by any header | | /** Returns the X value for the point. This value is scaled by any header | |
| * information that is present for the point. Use GetRawX if you want uns
caled | | * information that is present for the point. Use GetRawX if you want uns
caled | |
| * data. | | * data. | |
| * header values after the value is read. | | * header values after the value is read. | |
| * @param hPoint the opaque pointer to the LASPointH instance | | * @param hPoint the opaque pointer to the LASPointH instance | |
| * @return the X value for the LASPointH | | * @return the X value for the LASPointH | |
| | | | |
| skipping to change at line 523 | | skipping to change at line 525 | |
| | | | |
| /** Sets the data stream for the Point as an array of bytes. The length of
this | | /** Sets the data stream for the Point as an array of bytes. The length of
this | |
| * array should be the same as LASPoint_GetHeader(LASHeader_GetDataRecordL
ength()). The data are copied into | | * array should be the same as LASPoint_GetHeader(LASHeader_GetDataRecordL
ength()). The data are copied into | |
| * the Point . | | * the Point . | |
| * @param hPoint the LASPointH instance | | * @param hPoint the LASPointH instance | |
| * @param data a pointer to your array. It must be LASPoint_GetHeader(LAS
Header_GetDataRecordLength()) in size | | * @param data a pointer to your array. It must be LASPoint_GetHeader(LAS
Header_GetDataRecordLength()) in size | |
| * @return LASErrorEnum | | * @return LASErrorEnum | |
| */ | | */ | |
| LAS_DLL LASError LASPoint_SetData(LASPointH hPoint, unsigned char* data); | | LAS_DLL LASError LASPoint_SetData(LASPointH hPoint, unsigned char* data); | |
| | | | |
|
| | | /** Returns an XMLized representation of the point | |
| | | * @param hPoint the LASPointH instance | |
| | | */ | |
| | | LAS_DLL char* LASPoint_GetXML(const LASPointH hPoint); | |
| | | | |
| /**************************************************************************
**/ | | /**************************************************************************
**/ | |
| /* Header operations
*/ | | /* Header operations
*/ | |
| /**************************************************************************
**/ | | /**************************************************************************
**/ | |
| | | | |
| /** Copies a LASHeaderH instance | | /** Copies a LASHeaderH instance | |
| * @param hHeader the LASHeaderH to copy | | * @param hHeader the LASHeaderH to copy | |
| * @return a LASHeaderH instance or NULL on error | | * @return a LASHeaderH instance or NULL on error | |
| */ | | */ | |
| LAS_DLL LASHeaderH LASHeader_Copy(const LASHeaderH hHeader); | | LAS_DLL LASHeaderH LASHeader_Copy(const LASHeaderH hHeader); | |
| | | | |
| | | | |
| skipping to change at line 702 | | skipping to change at line 709 | |
| LAS_DLL unsigned int LASHeader_GetDataOffset(const LASHeaderH hHeader); | | LAS_DLL unsigned int LASHeader_GetDataOffset(const LASHeaderH hHeader); | |
| | | | |
| /** Sets the location in number of bytes to start writing point data. Any | | /** Sets the location in number of bytes to start writing point data. Any | |
| * space between the end of the LASVLRHs and this value will be written wi
th 0's. | | * space between the end of the LASVLRHs and this value will be written wi
th 0's. | |
| * @param hHeader LASHeaderH instance | | * @param hHeader LASHeaderH instance | |
| * @param value the long integer to set for byte location determining the
end of the header | | * @param value the long integer to set for byte location determining the
end of the header | |
| * @return LASError enum | | * @return LASError enum | |
| */ | | */ | |
| LAS_DLL LASError LASHeader_SetDataOffset(const LASHeaderH hHeader, unsigne
d int value); | | LAS_DLL LASError LASHeader_SetDataOffset(const LASHeaderH hHeader, unsigne
d int value); | |
| | | | |
|
| | | /** Returns the number of bytes between the end of the VLRs on the header t | |
| | | o the data offset | |
| | | * @param hHeader LASHeaderH instance | |
| | | * @return the number of bytes between the end of the VLRs on the header t | |
| | | o the data offset | |
| | | */ | |
| | | LAS_DLL unsigned int LASHeader_GetHeaderPadding(const LASHeaderH hHeader); | |
| | | | |
| | | /** Sets the number of bytes between the end of the VLRs on the header to t | |
| | | he data offset | |
| | | * @param hHeader LASHeaderH instance | |
| | | * @param value the long integer to set for the number of bytes between th | |
| | | e end of the VLRs and the data offset | |
| | | * @return LASError enum | |
| | | */ | |
| | | LAS_DLL LASError LASHeader_SetHeaderPadding(const LASHeaderH hHeader, unsi | |
| | | gned int value); | |
| | | | |
| /** Returns the number of variable length records in the header | | /** Returns the number of variable length records in the header | |
| * @param hHeader LASHeaderH instance | | * @param hHeader LASHeaderH instance | |
| * @return the number of variable length records in the header | | * @return the number of variable length records in the header | |
| */ | | */ | |
| LAS_DLL unsigned int LASHeader_GetRecordsCount(const LASHeaderH hHeader); | | LAS_DLL unsigned int LASHeader_GetRecordsCount(const LASHeaderH hHeader); | |
| | | | |
| /** Returns the record length for the points based on their data format id
in bytes | | /** Returns the record length for the points based on their data format id
in bytes | |
| * @param hHeader LASHeaderH instance | | * @param hHeader LASHeaderH instance | |
| * @return the record length for the points based on their data format id
in bytes | | * @return the record length for the points based on their data format id
in bytes | |
| */ | | */ | |
| | | | |
| skipping to change at line 896 | | skipping to change at line 916 | |
| */ | | */ | |
| LAS_DLL LASError LASHeader_DeleteVLR(LASHeaderH hHeader, unsigned int index
); | | LAS_DLL LASError LASHeader_DeleteVLR(LASHeaderH hHeader, unsigned int index
); | |
| | | | |
| /** Adds a VLR record to the header. | | /** Adds a VLR record to the header. | |
| * @param hHeader the LASHeaderH instance | | * @param hHeader the LASHeaderH instance | |
| * @param hVLR the VLR to add to the header | | * @param hVLR the VLR to add to the header | |
| * @return LASErrorEnum | | * @return LASErrorEnum | |
| */ | | */ | |
| LAS_DLL LASError LASHeader_AddVLR(LASHeaderH hHeader, const LASVLRH hVLR); | | LAS_DLL LASError LASHeader_AddVLR(LASHeaderH hHeader, const LASVLRH hVLR); | |
| | | | |
|
| | | /** Returns an XMLized representation of the header | |
| | | * @param hHeader the LASHeader instance | |
| | | */ | |
| | | LAS_DLL char* LASHeader_GetXML(const LASHeaderH hHeader); | |
| | | | |
| /**************************************************************************
**/ | | /**************************************************************************
**/ | |
| /* Writer Operations
*/ | | /* Writer Operations
*/ | |
| /**************************************************************************
**/ | | /**************************************************************************
**/ | |
| | | | |
| /** Creates a new LASWriterH for write operations on LAS files. The file m
ay | | /** Creates a new LASWriterH for write operations on LAS files. The file m
ay | |
| * be opened in either LAS_MODE_APPEND or LAS_MODE_WRITE, but the file can
not | | * be opened in either LAS_MODE_APPEND or LAS_MODE_WRITE, but the file can
not | |
| * be open by another other operations (another LASReaderH or LASWriterH). | | * be open by another other operations (another LASReaderH or LASWriterH). | |
| * @param filename The filename to open to write | | * @param filename The filename to open to write | |
| * @param hHeader an opaque pointer to a LASHeaderH that will be written t
o | | * @param hHeader an opaque pointer to a LASHeaderH that will be written t
o | |
| * the file as part of the opening for write operation. | | * the file as part of the opening for write operation. | |
| | | | |
End of changes. 4 change blocks. |
| 0 lines changed or deleted | | 30 lines changed or added | |
|
| spatialreference.hpp | | spatialreference.hpp | |
| | | | |
| skipping to change at line 100 | | skipping to change at line 100 | |
| | | | |
| /// Constructor creating SpatialReference instance from given Variable-
Length Record. | | /// Constructor creating SpatialReference instance from given Variable-
Length Record. | |
| SpatialReference(std::vector<VariableRecord> const& vlrs); | | SpatialReference(std::vector<VariableRecord> const& vlrs); | |
| | | | |
| /// Copy constryctor. | | /// Copy constryctor. | |
| SpatialReference(SpatialReference const& other); | | SpatialReference(SpatialReference const& other); | |
| | | | |
| /// Assignment operator. | | /// Assignment operator. | |
| SpatialReference& operator=(SpatialReference const& rhs); | | SpatialReference& operator=(SpatialReference const& rhs); | |
| | | | |
|
| | | bool operator==(const SpatialReference& other) const; | |
| | | bool operator!=(const SpatialReference& other) const { return !(*this = | |
| | | = other); } | |
| | | | |
| /// Returns a pointer to the internal GTIF*. Only available if | | /// Returns a pointer to the internal GTIF*. Only available if | |
| /// you have libgeotiff linked in. | | /// you have libgeotiff linked in. | |
| const GTIF* GetGTIF(); | | const GTIF* GetGTIF(); | |
| | | | |
| void SetGTIF(GTIF* pgtiff, ST_TIFF* ptiff); | | void SetGTIF(GTIF* pgtiff, ST_TIFF* ptiff); | |
| | | | |
| /// Returns the OGC WKT describing Spatial Reference System. | | /// Returns the OGC WKT describing Spatial Reference System. | |
| /// If GDAL is linked, it uses GDAL's operations and methods to determi
ne | | /// If GDAL is linked, it uses GDAL's operations and methods to determi
ne | |
| /// the WKT. If GDAL is not linked, no WKT is returned. | | /// the WKT. If GDAL is not linked, no WKT is returned. | |
| /// \param mode_flag May be eHorizontalOnly indicating the WKT will not | | /// \param mode_flag May be eHorizontalOnly indicating the WKT will not | |
| | | | |
| skipping to change at line 196 | | skipping to change at line 199 | |
| /// Reset the VLRs of the SpatialReference using the existing GTIF* and
ST_TIF* | | /// Reset the VLRs of the SpatialReference using the existing GTIF* and
ST_TIF* | |
| /// Until this method is called, | | /// Until this method is called, | |
| /// the SpatialReference will only contain a SRS description using the
VLRs | | /// the SpatialReference will only contain a SRS description using the
VLRs | |
| /// that it was first instantiated with. SetWKT and SetProj4 can | | /// that it was first instantiated with. SetWKT and SetProj4 can | |
| /// be used to change the GTIF* | | /// be used to change the GTIF* | |
| void ResetVLRs(); | | void ResetVLRs(); | |
| }; | | }; | |
| | | | |
| } // namespace liblas | | } // namespace liblas | |
| | | | |
|
| | | LAS_DLL std::ostream& operator<<(std::ostream& ostr, const liblas::SpatialR | |
| | | eference& srs); | |
| | | | |
| LAS_C_START | | LAS_C_START | |
| #if defined(__geotiff_h_) | | #if defined(__geotiff_h_) | |
| #if defined(GEO_NORMALIZE_H_INCLUDED) | | #if defined(GEO_NORMALIZE_H_INCLUDED) | |
| char LAS_DLL * GTIFGetOGISDefn(GTIF*, GTIFDefn*); | | char LAS_DLL * GTIFGetOGISDefn(GTIF*, GTIFDefn*); | |
| #endif | | #endif | |
| | | | |
| int LAS_DLL GTIFSetFromOGISDefn(GTIF*, const char*); | | int LAS_DLL GTIFSetFromOGISDefn(GTIF*, const char*); | |
| void SetLinearUnitCitation(GTIF* psGTIF, char* pszLinearUOMName); | | void SetLinearUnitCitation(GTIF* psGTIF, char* pszLinearUOMName); | |
| | | | |
| #if defined(_OGR_SRS_API_H_INCLUDED) | | #if defined(_OGR_SRS_API_H_INCLUDED) | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 7 lines changed or added | |
|
| transform.hpp | | transform.hpp | |
| | | | |
| skipping to change at line 75 | | skipping to change at line 75 | |
| virtual ~TransformI() {} | | virtual ~TransformI() {} | |
| }; | | }; | |
| | | | |
| typedef boost::shared_ptr<liblas::TransformI> TransformPtr; | | typedef boost::shared_ptr<liblas::TransformI> TransformPtr; | |
| | | | |
| class LAS_DLL ReprojectionTransform: public TransformI | | class LAS_DLL ReprojectionTransform: public TransformI | |
| { | | { | |
| public: | | public: | |
| | | | |
| ReprojectionTransform(const SpatialReference& inSRS, const SpatialRefer
ence& outSRS); | | ReprojectionTransform(const SpatialReference& inSRS, const SpatialRefer
ence& outSRS); | |
|
| ReprojectionTransform(const SpatialReference& inSRS, const SpatialRefer
ence& outSRS, liblas::HeaderPtr new_header); | | ReprojectionTransform(const SpatialReference& inSRS, const SpatialRefer
ence& outSRS, Header const* new_header); | |
| ~ReprojectionTransform(); | | ~ReprojectionTransform(); | |
| | | | |
| bool transform(Point& point); | | bool transform(Point& point); | |
|
| void SetHeaderPtr(liblas::HeaderPtr header) {m_new_header = header;} | | void SetHeader(Header* header) {m_new_header = header;} | |
| bool ModifiesHeader() { return true; } | | bool ModifiesHeader() { return true; } | |
| | | | |
| private: | | private: | |
| | | | |
|
| liblas::HeaderPtr m_new_header; | | Header const* m_new_header; | |
| | | | |
| typedef boost::shared_ptr<void> ReferencePtr; | | typedef boost::shared_ptr<void> ReferencePtr; | |
| typedef boost::shared_ptr<void> TransformPtr; | | typedef boost::shared_ptr<void> TransformPtr; | |
| ReferencePtr m_in_ref_ptr; | | ReferencePtr m_in_ref_ptr; | |
| ReferencePtr m_out_ref_ptr; | | ReferencePtr m_out_ref_ptr; | |
| TransformPtr m_transform_ptr; | | TransformPtr m_transform_ptr; | |
| | | | |
| ReprojectionTransform(ReprojectionTransform const& other); | | ReprojectionTransform(ReprojectionTransform const& other); | |
| ReprojectionTransform& operator=(ReprojectionTransform const& rhs); | | ReprojectionTransform& operator=(ReprojectionTransform const& rhs); | |
| | | | |
| | | | |
| skipping to change at line 150 | | skipping to change at line 150 | |
| | | | |
| class LAS_DLL ColorFetchingTransform: public TransformI | | class LAS_DLL ColorFetchingTransform: public TransformI | |
| { | | { | |
| public: | | public: | |
| | | | |
| ColorFetchingTransform( std::string const& datasource, | | ColorFetchingTransform( std::string const& datasource, | |
| std::vector<boost::uint32_t> bands | | std::vector<boost::uint32_t> bands | |
| ); | | ); | |
| ColorFetchingTransform( std::string const& datasource, | | ColorFetchingTransform( std::string const& datasource, | |
| std::vector<boost::uint32_t> bands, | | std::vector<boost::uint32_t> bands, | |
|
| HeaderPtr header); | | Header const* header); | |
| | | | |
| void SetScaleFactor(boost::uint32_t v) {m_scale = v; } | | void SetScaleFactor(boost::uint32_t v) {m_scale = v; } | |
| ~ColorFetchingTransform(); | | ~ColorFetchingTransform(); | |
| | | | |
| bool transform(Point& point); | | bool transform(Point& point); | |
| bool ModifiesHeader() { return true; } | | bool ModifiesHeader() { return true; } | |
| | | | |
| private: | | private: | |
| | | | |
|
| liblas::HeaderPtr m_new_header; | | Header const* m_new_header; | |
| | | | |
| typedef boost::shared_ptr<void> DataSourcePtr; | | typedef boost::shared_ptr<void> DataSourcePtr; | |
| | | | |
| DataSourcePtr m_ds; | | DataSourcePtr m_ds; | |
| std::string m_datasource; | | std::string m_datasource; | |
| std::vector<boost::uint32_t> m_bands; | | std::vector<boost::uint32_t> m_bands; | |
| boost::array<double, 6> m_forward_transform; | | boost::array<double, 6> m_forward_transform; | |
| boost::array<double, 6> m_inverse_transform; | | boost::array<double, 6> m_inverse_transform; | |
| boost::uint32_t m_scale; | | boost::uint32_t m_scale; | |
| | | | |
| | | | |
End of changes. 5 change blocks. |
| 5 lines changed or deleted | | 5 lines changed or added | |
|
| utility.hpp | | utility.hpp | |
| | | | |
| skipping to change at line 78 | | skipping to change at line 78 | |
| | | | |
| Summary(); | | Summary(); | |
| Summary(Summary const& other); | | Summary(Summary const& other); | |
| Summary& operator=(Summary const& rhs); | | Summary& operator=(Summary const& rhs); | |
| bool filter(const Point& point); | | bool filter(const Point& point); | |
| | | | |
| void AddPoint(liblas::Point const& p); | | void AddPoint(liblas::Point const& p); | |
| ptree GetPTree() const; | | ptree GetPTree() const; | |
| void SetHeader(liblas::Header const& h); | | void SetHeader(liblas::Header const& h); | |
| | | | |
|
| ~Summary() {}; | | ~Summary() {} | |
| private: | | private: | |
| | | | |
| classes_type classes; | | classes_type classes; | |
| boost::uint32_t synthetic; | | boost::uint32_t synthetic; | |
| boost::uint32_t withheld; | | boost::uint32_t withheld; | |
| boost::uint32_t keypoint; | | boost::uint32_t keypoint; | |
| boost::uint32_t count; | | boost::uint32_t count; | |
| boost::array<boost::uint32_t, 8> points_by_return; | | boost::array<boost::uint32_t, 8> points_by_return; | |
| boost::array<boost::uint32_t, 8> returns_of_given_pulse; | | boost::array<boost::uint32_t, 8> returns_of_given_pulse; | |
| bool first; | | bool first; | |
| | | | |
| skipping to change at line 110 | | skipping to change at line 110 | |
| | | | |
| CoordinateSummary(); | | CoordinateSummary(); | |
| CoordinateSummary(CoordinateSummary const& other); | | CoordinateSummary(CoordinateSummary const& other); | |
| CoordinateSummary& operator=(CoordinateSummary const& rhs); | | CoordinateSummary& operator=(CoordinateSummary const& rhs); | |
| bool filter(const Point& point); | | bool filter(const Point& point); | |
| | | | |
| void AddPoint(liblas::Point const& p); | | void AddPoint(liblas::Point const& p); | |
| ptree GetPTree() const; | | ptree GetPTree() const; | |
| void SetHeader(liblas::Header const& h); | | void SetHeader(liblas::Header const& h); | |
| | | | |
|
| ~CoordinateSummary() {}; | | ~CoordinateSummary() {} | |
| | | | |
| private: | | private: | |
| | | | |
| boost::uint32_t count; | | boost::uint32_t count; | |
| boost::array<boost::uint32_t, 8> points_by_return; | | boost::array<boost::uint32_t, 8> points_by_return; | |
| boost::array<boost::uint32_t, 8> returns_of_given_pulse; | | boost::array<boost::uint32_t, 8> returns_of_given_pulse; | |
| bool first; | | bool first; | |
| liblas::Point minimum; | | liblas::Point minimum; | |
| liblas::Point maximum; | | liblas::Point maximum; | |
| liblas::Header m_header; | | liblas::Header m_header; | |
| | | | |
End of changes. 2 change blocks. |
| 2 lines changed or deleted | | 2 lines changed or added | |
|
| zippoint.hpp | | zippoint.hpp | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 51 | |
| | | | |
| #ifndef LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED | | #ifndef LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED | |
| #define LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED | | #define LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED | |
| | | | |
| #include <liblas/detail/fwd.hpp> | | #include <liblas/detail/fwd.hpp> | |
| #include <liblas/liblas.hpp> | | #include <liblas/liblas.hpp> | |
| | | | |
| // boost | | // boost | |
| #include <boost/cstdint.hpp> | | #include <boost/cstdint.hpp> | |
| #include <boost/shared_ptr.hpp> | | #include <boost/shared_ptr.hpp> | |
|
| | | #include <boost/scoped_ptr.hpp> | |
| | | #include <boost/scoped_array.hpp> | |
| | | | |
| // liblaszip | | // liblaszip | |
| class LASzipper; | | class LASzipper; | |
|
| class LASitem; | | class LASzip; | |
| | | | |
| namespace liblas { namespace detail { | | namespace liblas { namespace detail { | |
| | | | |
| class ZipPoint | | class ZipPoint | |
| { | | { | |
| public: | | public: | |
|
| ZipPoint(PointFormatName); | | ZipPoint(PointFormatName, const std::vector<VariableRecord>& vlrs); | |
| ~ZipPoint(); | | ~ZipPoint(); | |
| | | | |
| void ConstructVLR(VariableRecord&) const; | | void ConstructVLR(VariableRecord&) const; | |
| | | | |
| // these will return false iff we find a laszip VLR and it doesn't matc
h | | // these will return false iff we find a laszip VLR and it doesn't matc
h | |
| // the point format this object wasd constructed with | | // the point format this object wasd constructed with | |
| bool ValidateVLR(std::vector<VariableRecord> const& vlrs) const; | | bool ValidateVLR(std::vector<VariableRecord> const& vlrs) const; | |
| bool ValidateVLR(const VariableRecord& vlr) const; | | bool ValidateVLR(const VariableRecord& vlr) const; | |
| | | | |
| bool IsZipVLR(const VariableRecord& vlr) const; | | bool IsZipVLR(const VariableRecord& vlr) const; | |
| | | | |
|
| | | LASzip* GetZipper() const { return m_zip.get(); } | |
| | | | |
| private: | | private: | |
|
| void ConstructItems(PointFormatName); | | void ConstructItems(); | |
| | | | |
| public: // for now | | public: // for now | |
|
| unsigned int m_num_items; | | // LASzip::pack() allocates/sets vlr_data and vlr_num for us, and delet | |
| LASitem* m_items; | | es it for us ["his"] | |
| | | // LASzip::unpack() just reads from the vlr_data we give it (we allocat | |
| | | e and delete) ["our"] | |
| | | int his_vlr_num; | |
| | | unsigned char* his_vlr_data; | |
| | | | |
| | | boost::scoped_ptr<LASzip> m_zip; | |
| | | | |
| unsigned char** m_lz_point; | | unsigned char** m_lz_point; | |
|
| unsigned char* m_lz_point_data; | | boost::scoped_array<boost::uint8_t> m_lz_point_data; | |
| unsigned int m_lz_point_size; | | unsigned int m_lz_point_size; | |
| }; | | }; | |
| | | | |
| }} // namespace liblas::detail | | }} // namespace liblas::detail | |
| | | | |
| #endif // LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED | | #endif // LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED | |
| | | | |
End of changes. 7 change blocks. |
| 6 lines changed or deleted | | 17 lines changed or added | |
|
| zipreader.hpp | | zipreader.hpp | |
| | | | |
| skipping to change at line 54 | | skipping to change at line 54 | |
| | | | |
| #include <liblas/detail/fwd.hpp> | | #include <liblas/detail/fwd.hpp> | |
| #include <liblas/detail/reader/header.hpp> | | #include <liblas/detail/reader/header.hpp> | |
| // boost | | // boost | |
| #include <boost/cstdint.hpp> | | #include <boost/cstdint.hpp> | |
| // std | | // std | |
| #include <iosfwd> | | #include <iosfwd> | |
| #include <boost/shared_ptr.hpp> | | #include <boost/shared_ptr.hpp> | |
| | | | |
| // liblaszip | | // liblaszip | |
|
| class LASitem; | | | |
| class LASunzipper; | | class LASunzipper; | |
|
| | | class LASzip; | |
| | | | |
| namespace liblas { namespace detail { | | namespace liblas { namespace detail { | |
| | | | |
| class ZipPoint; | | class ZipPoint; | |
| typedef boost::shared_ptr< reader::Header > HeaderReaderPtr; | | typedef boost::shared_ptr< reader::Header > HeaderReaderPtr; | |
| | | | |
| class ZipReaderImpl : public ReaderI | | class ZipReaderImpl : public ReaderI | |
| { | | { | |
| public: | | public: | |
| ZipReaderImpl(std::istream& ifs); | | ZipReaderImpl(std::istream& ifs); | |
| | | | |
| skipping to change at line 110 | | skipping to change at line 110 | |
| HeaderReaderPtr m_header_reader; | | HeaderReaderPtr m_header_reader; | |
| | | | |
| HeaderPtr m_header; | | HeaderPtr m_header; | |
| | | | |
| PointPtr m_point; | | PointPtr m_point; | |
| | | | |
| std::vector<liblas::FilterPtr> m_filters; | | std::vector<liblas::FilterPtr> m_filters; | |
| std::vector<liblas::TransformPtr> m_transforms; | | std::vector<liblas::TransformPtr> m_transforms; | |
| | | | |
| private: | | private: | |
|
| void ReadIdiom(bool recordPoint); | | void ReadIdiom(); | |
| void ResetUnzipper(); | | | |
| | | // boost::scoped_ptr<LASzip> m_zip; | |
| | | boost::scoped_ptr<ZipPoint> m_zipPoint; | |
| | | boost::scoped_ptr<LASunzipper> m_unzipper; | |
| | | | |
|
| LASunzipper* m_unzipper; | | | |
| ZipPoint* m_zipPoint; | | | |
| bool bNeedHeaderCheck; | | bool bNeedHeaderCheck; | |
|
| | | std::streampos m_zipReadStartPosition; | |
| | | | |
| // Blocked copying operations, declared but not defined. | | // Blocked copying operations, declared but not defined. | |
| ZipReaderImpl(ZipReaderImpl const& other); | | ZipReaderImpl(ZipReaderImpl const& other); | |
| ZipReaderImpl& operator=(ZipReaderImpl const& rhs); | | ZipReaderImpl& operator=(ZipReaderImpl const& rhs); | |
| }; | | }; | |
| | | | |
| }} // namespace liblas::detail | | }} // namespace liblas::detail | |
| | | | |
| #endif // LIBLAS_DETAIL_ZIPREADERIMPL_HPP_INCLUDED | | #endif // LIBLAS_DETAIL_ZIPREADERIMPL_HPP_INCLUDED | |
| | | | |
End of changes. 5 change blocks. |
| 5 lines changed or deleted | | 7 lines changed or added | |
|
| zipwriter.hpp | | zipwriter.hpp | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| #ifndef LIBLAS_DETAIL_ZIPWRITER_HPP_INCLUDED | | #ifndef LIBLAS_DETAIL_ZIPWRITER_HPP_INCLUDED | |
| #define LIBLAS_DETAIL_ZIPWRITER_HPP_INCLUDED | | #define LIBLAS_DETAIL_ZIPWRITER_HPP_INCLUDED | |
| | | | |
| #include <liblas/detail/fwd.hpp> | | #include <liblas/detail/fwd.hpp> | |
| #include <liblas/liblas.hpp> | | #include <liblas/liblas.hpp> | |
| #include <liblas/detail/writer/point.hpp> | | #include <liblas/detail/writer/point.hpp> | |
| #include <liblas/detail/writer/header.hpp> | | #include <liblas/detail/writer/header.hpp> | |
| // boost | | // boost | |
| #include <boost/cstdint.hpp> | | #include <boost/cstdint.hpp> | |
| #include <boost/shared_ptr.hpp> | | #include <boost/shared_ptr.hpp> | |
|
| | | #include <boost/scoped_ptr.hpp> | |
| | | | |
| // liblaszip | | // liblaszip | |
|
| | | class LASzip; | |
| class LASzipper; | | class LASzipper; | |
|
| class LASitem; | | | |
| | | | |
| namespace liblas { namespace detail { | | namespace liblas { namespace detail { | |
| | | | |
| class ZipPoint; | | class ZipPoint; | |
| typedef boost::shared_ptr< writer::Point > PointWriterPtr; | | typedef boost::shared_ptr< writer::Point > PointWriterPtr; | |
| typedef boost::shared_ptr< writer::Header > HeaderWriterPtr; | | typedef boost::shared_ptr< writer::Header > HeaderWriterPtr; | |
| | | | |
| class ZipWriterImpl : public WriterI | | class ZipWriterImpl : public WriterI | |
| { | | { | |
| public: | | public: | |
| | | | |
| skipping to change at line 99 | | skipping to change at line 100 | |
| HeaderWriterPtr m_header_writer; | | HeaderWriterPtr m_header_writer; | |
| | | | |
| std::vector<liblas::FilterPtr> m_filters; | | std::vector<liblas::FilterPtr> m_filters; | |
| std::vector<liblas::TransformPtr> m_transforms; | | std::vector<liblas::TransformPtr> m_transforms; | |
| | | | |
| HeaderPtr m_header; | | HeaderPtr m_header; | |
| | | | |
| private: | | private: | |
| boost::uint32_t m_pointCount; | | boost::uint32_t m_pointCount; | |
| | | | |
|
| LASzipper* m_zipper; | | boost::scoped_ptr<LASzipper> m_zipper; | |
| ZipPoint* m_zipPoint; | | boost::scoped_ptr<ZipPoint> m_zipPoint; | |
| | | | |
| // block copying operations | | // block copying operations | |
| ZipWriterImpl(ZipWriterImpl const& other); | | ZipWriterImpl(ZipWriterImpl const& other); | |
| ZipWriterImpl& operator=(ZipWriterImpl const& other); | | ZipWriterImpl& operator=(ZipWriterImpl const& other); | |
| }; | | }; | |
| | | | |
| }} // namespace liblas::detail | | }} // namespace liblas::detail | |
| | | | |
| #endif // LIBLAS_DETAIL_ZIPWRITER_HPP_INCLUDED | | #endif // LIBLAS_DETAIL_ZIPWRITER_HPP_INCLUDED | |
| | | | |
End of changes. 4 change blocks. |
| 3 lines changed or deleted | | 4 lines changed or added | |
|