[Liblas-commits] hg: Added <boost/cstdint.hpp> header and using
namespace boost; ...
liblas-commits at liblas.org
liblas-commits at liblas.org
Mon Aug 2 12:46:36 EDT 2010
changeset 8c3cc1a87d67 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=8c3cc1a87d67
summary: Added <boost/cstdint.hpp> header and using namespace boost; directive missing for Visual C++.
diffstat:
include/liblas/detail/pointrecord.hpp | 18 ++++----
include/liblas/detail/reader/point.hpp | 6 +-
include/liblas/detail/reader/reader.hpp | 2 +-
include/liblas/detail/utility.hpp | 10 ++--
include/liblas/lasclassification.hpp | 4 +-
include/liblas/lasheader.hpp | 68 ++++++++++++++++----------------
include/liblas/lasvariablerecord.hpp | 35 ++++++++--------
src/detail/reader/reader.cpp | 20 +++++----
src/lasheader.cpp | 2 +
src/laspoint.cpp | 2 +
src/lasschema.cpp | 4 +
src/lasvariablerecord.cpp | 45 +++++++++++----------
12 files changed, 115 insertions(+), 101 deletions(-)
diffs (truncated from 559 to 300 lines):
diff -r d0cfd54c9995 -r 8c3cc1a87d67 include/liblas/detail/pointrecord.hpp
--- a/include/liblas/detail/pointrecord.hpp Mon Aug 02 11:39:02 2010 -0500
+++ b/include/liblas/detail/pointrecord.hpp Mon Aug 02 17:50:18 2010 +0100
@@ -61,15 +61,15 @@
, point_source_id(0)
{}
- int32_t x;
- int32_t y;
- int32_t z;
- uint16_t intensity;
- uint8_t flags; // TODO: Replace with portable std::bitset<8>
- uint8_t classification;
- int8_t scan_angle_rank;
- uint8_t user_data; // 1.0: File Marker / 1.1: User Data
- uint16_t point_source_id; // 1.0: User Bit field / 1.1: Point Source ID
+ boost::int32_t x;
+ boost::int32_t y;
+ boost::int32_t z;
+ boost::uint16_t intensity;
+ boost::uint8_t flags; // TODO: Replace with portable std::bitset<8>
+ boost::uint8_t classification;
+ boost::int8_t scan_angle_rank;
+ boost::uint8_t user_data; // 1.0: File Marker / 1.1: User Data
+ boost::uint16_t point_source_id; // 1.0: User Bit field / 1.1: Point Source ID
};
}} // namespace liblas::detail
diff -r d0cfd54c9995 -r 8c3cc1a87d67 include/liblas/detail/reader/point.hpp
--- a/include/liblas/detail/reader/point.hpp Mon Aug 02 11:39:02 2010 -0500
+++ b/include/liblas/detail/reader/point.hpp Mon Aug 02 17:50:18 2010 +0100
@@ -48,8 +48,8 @@
#include <liblas/lasheader.hpp>
#include <liblas/laspoint.hpp>
#include <liblas/lasschema.hpp>
-
-
+// boost
+#include <boost/cstdint.hpp>
// std
#include <iosfwd>
@@ -80,7 +80,7 @@
std::istream& m_ifs;
HeaderPtr m_header;
PointPtr m_point;
- std::vector<uint8_t> m_raw_data;
+ std::vector<boost::uint8_t> m_raw_data;
void setup();
void fill(PointRecord& record);
diff -r d0cfd54c9995 -r 8c3cc1a87d67 include/liblas/detail/reader/reader.hpp
--- a/include/liblas/detail/reader/reader.hpp Mon Aug 02 11:39:02 2010 -0500
+++ b/include/liblas/detail/reader/reader.hpp Mon Aug 02 17:50:18 2010 +0100
@@ -119,7 +119,7 @@
void CacheData(boost::uint32_t position, HeaderPtr header);
- typedef std::vector<uint8_t> cache_mask_type;
+ typedef std::vector<boost::uint8_t> cache_mask_type;
cache_mask_type m_mask;
cache_mask_type::size_type m_cache_size;
cache_mask_type::size_type m_cache_start_position;
diff -r d0cfd54c9995 -r 8c3cc1a87d67 include/liblas/detail/utility.hpp
--- a/include/liblas/detail/utility.hpp Mon Aug 02 11:39:02 2010 -0500
+++ b/include/liblas/detail/utility.hpp Mon Aug 02 17:50:18 2010 +0100
@@ -147,11 +147,11 @@
/// Definition of variable-length record header.
struct VLRHeader
{
- uint16_t reserved;
- char userId[16];
- uint16_t recordId;
- uint16_t recordLengthAfterHeader;
- char description[32];
+ boost::uint16_t reserved;
+ char userId[16]; // TODO: replace wtih boost::array --mloskot
+ boost::uint16_t recordId;
+ boost::uint16_t recordLengthAfterHeader;
+ char description[32]; // TODO: replace wtih boost::array --mloskot
};
template <typename T>
diff -r d0cfd54c9995 -r 8c3cc1a87d67 include/liblas/lasclassification.hpp
--- a/include/liblas/lasclassification.hpp Mon Aug 02 11:39:02 2010 -0500
+++ b/include/liblas/lasclassification.hpp Mon Aug 02 17:50:18 2010 +0100
@@ -144,7 +144,7 @@
std::string GetClassName() const;
/// Returns index of ASPRS classification as defined in the lookup table.
- uint8_t GetClass() const;
+ boost::uint8_t GetClass() const;
/// Updates index of ASPRS classification as defined in the lookup table.
/// Valid index is in range from 0 to class_table_size - 1.
@@ -155,7 +155,7 @@
/// table is supported.
/// @exception Theoretically, may throw std::out_of_range in case index
/// value is not in range between 0 and class_table_size - 1.
- void SetClass(uint8_t index);
+ void SetClass(boost::uint8_t index);
/// Sets if this point was created by a technique other than LIDAR
/// collection such as digitized from a photogrammetric stereo model.
diff -r d0cfd54c9995 -r 8c3cc1a87d67 include/liblas/lasheader.hpp
--- a/include/liblas/lasheader.hpp Mon Aug 02 11:39:02 2010 -0500
+++ b/include/liblas/lasheader.hpp Mon Aug 02 17:50:18 2010 +0100
@@ -190,38 +190,38 @@
/// Set day of year of file creation date.
/// \exception std::out_of_range - given value is higher than number 366.
/// \todo TODO: Use full date structure instead of Julian date number.
- void SetCreationDOY(uint16_t v);
+ void SetCreationDOY(boost::uint16_t v);
/// Set year of file creation date.
/// \todo TODO: Remove if full date structure is used.
- uint16_t GetCreationYear() const;
+ boost::uint16_t GetCreationYear() const;
/// Get year of file creation date.
/// \exception std::out_of_range - given value is higher than number 9999.
/// \todo TODO: Remove if full date structure is used.
- void SetCreationYear(uint16_t v);
+ void SetCreationYear(boost::uint16_t v);
/// Get number of bytes of generic verion of public header block storage.
/// Standard version of the public header block is 227 bytes long.
- uint16_t GetHeaderSize() const;
+ boost::uint16_t GetHeaderSize() const;
/// Sets the header size. Note that this is not the same as the offset to
/// point data.
- void SetHeaderSize(uint16_t v);
+ void SetHeaderSize(boost::uint16_t v);
/// Get number of bytes from the beginning to the first point record.
- uint32_t GetDataOffset() const;
+ boost::uint32_t GetDataOffset() const;
/// Set number of bytes from the beginning to the first point record.
/// \exception std::out_of_range - if given offset is bigger than 227+2 bytes
/// for the LAS 1.0 format and 227 bytes for the LAS 1.1 format.
- void SetDataOffset(uint32_t v);
+ void SetDataOffset(boost::uint32_t v);
/// Get number of variable-length records.
- uint32_t GetRecordsCount() const;
+ boost::uint32_t GetRecordsCount() const;
/// Set number of variable-length records.
- void SetRecordsCount(uint32_t v);
+ void SetRecordsCount(boost::uint32_t v);
/// Get identifier of point data (record) format.
PointFormatName GetDataFormatId() const;
@@ -230,18 +230,18 @@
void SetDataFormatId(PointFormatName v);
/// \todo To be documented
- uint16_t GetDataRecordLength() const;
+ boost::uint16_t GetDataRecordLength() const;
/// Set the length of the point format. Evidently, there are
/// LAS files in the wild that contain point formats of sizes that
/// are different than the prescribed set specified in the specification.
- void SetDataRecordLength(uint16_t v);
+ void SetDataRecordLength(boost::uint16_t v);
/// Get total number of point records stored in the LAS file.
- uint32_t GetPointRecordsCount() const;
+ boost::uint32_t GetPointRecordsCount() const;
/// Set number of point records that will be stored in a new LAS file.
- void SetPointRecordsCount(uint32_t v);
+ void SetPointRecordsCount(boost::uint32_t v);
/// Get array of the total point records per return.
RecordsByReturnArray const& GetPointRecordsByReturnCount() const;
@@ -250,7 +250,7 @@
/// \exception std::out_of_range - if index is bigger than 4.
/// \param index - subscript (0-4) of array element being updated.
/// \param v - new value to assign to array element identified by index.
- void SetPointRecordsByReturnCount(std::size_t index, uint32_t v);
+ void SetPointRecordsByReturnCount(std::size_t index, boost::uint32_t v);
/// Get scale factor for X coordinate.
double GetScaleX() const;
@@ -304,13 +304,13 @@
void AddVLR(VariableRecord const& v);
/// Returns a VLR
- VariableRecord const& GetVLR(uint32_t index) const;
+ VariableRecord const& GetVLR(boost::uint32_t index) const;
/// Returns all of the VLRs
const std::vector<VariableRecord>& GetVLRs() const;
/// Removes a VLR from the the header.
- void DeleteVLR(uint32_t index);
+ void DeleteVLR(boost::uint32_t index);
/// Rewrite variable-length record with georeference infomation, if available.
void SetGeoreference();
@@ -357,25 +357,25 @@
//
// Private data members
//
- char m_signature[eFileSignatureSize];
- uint16_t m_sourceId;
- uint16_t m_reserved;
- uint32_t m_projectId1;
- uint16_t m_projectId2;
- uint16_t m_projectId3;
- uint8_t m_projectId4[eProjectId4Size];
- uint8_t m_versionMajor;
- uint8_t m_versionMinor;
- char m_systemId[eSystemIdSize];
+ char m_signature[eFileSignatureSize]; // TODO: replace with boost::array --mloskot
+ boost::uint16_t m_sourceId;
+ boost::uint16_t m_reserved;
+ boost::uint32_t m_projectId1;
+ boost::uint16_t m_projectId2;
+ boost::uint16_t m_projectId3;
+ boost::uint8_t m_projectId4[eProjectId4Size];
+ boost::uint8_t m_versionMajor;
+ boost::uint8_t m_versionMinor;
+ char m_systemId[eSystemIdSize]; // TODO: replace with boost::array --mloskot
char m_softwareId[eSoftwareIdSize];
- uint16_t m_createDOY;
- uint16_t m_createYear;
- uint16_t m_headerSize;
- uint32_t m_dataOffset;
- uint32_t m_recordsCount;
- uint8_t m_dataFormatId;
- uint16_t m_dataRecordLen;
- uint32_t m_pointRecordsCount;
+ boost::uint16_t m_createDOY;
+ boost::uint16_t m_createYear;
+ boost::uint16_t m_headerSize;
+ boost::uint32_t m_dataOffset;
+ boost::uint32_t m_recordsCount;
+ boost::uint8_t m_dataFormatId;
+ boost::uint16_t m_dataRecordLen;
+ boost::uint32_t m_pointRecordsCount;
RecordsByReturnArray m_pointRecordsByReturn;
PointScales m_scales;
PointOffsets m_offsets;
diff -r d0cfd54c9995 -r 8c3cc1a87d67 include/liblas/lasvariablerecord.hpp
--- a/include/liblas/lasvariablerecord.hpp Mon Aug 02 11:39:02 2010 -0500
+++ b/include/liblas/lasvariablerecord.hpp Mon Aug 02 17:50:18 2010 +0100
@@ -44,7 +44,8 @@
#define LIBLAS_LASVARIABLERECORD_HPP_INCLUDED
#include <liblas/detail/utility.hpp>
-
+// boost
+#include <boost/cstdint.hpp>
// std
#include <string>
#include <vector>
@@ -77,48 +78,48 @@
/// Get record signature (LAS 1.0) or reserved bytes (LAS 1.1).
/// \exception No throw
- uint16_t GetReserved() const;
+ boost::uint16_t GetReserved() const;
- void SetReserved(uint16_t);
+ void SetReserved(boost::uint16_t data);
/// Get identifier of user which created the record.
/// The character data is up to 16 bytes long.
/// \exception No throw
std::string GetUserId(bool pad /*= false*/) const;
- void SetUserId(std::string const&);
+ void SetUserId(std::string const& id);
/// Get identifier of record.
/// The record ID is closely related to the user ID.
/// \exception No throw
- uint16_t GetRecordId() const;
+ boost::uint16_t GetRecordId() const;
- void SetRecordId(uint16_t);
+ void SetRecordId(boost::uint16_t id);
/// Get record length after the header.
/// \exception No throw
- uint16_t GetRecordLength() const;
+ boost::uint16_t GetRecordLength() const;
- void SetRecordLength(uint16_t);
+ void SetRecordLength(boost::uint16_t length);
/// Get text description of data in the record.
/// The character data is up to 32 bytes long.
/// \exception No throw
std::string GetDescription(bool pad /*= false*/) const;
More information about the Liblas-commits
mailing list