[Liblas-commits] hg: 2 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Aug 23 14:01:30 EDT 2010


changeset c16f6bdd04f0 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=c16f6bdd04f0
summary: boostify integer types

changeset 06ba842fc49e in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=06ba842fc49e
summary: merge

diffstat:

 CMakeLists.txt                              |    6 +-
 include/liblas/detail/index/indexcell.hpp   |   49 ++--
 include/liblas/detail/index/indexoutput.hpp |    8 +-
 include/liblas/lasindex.hpp                 |   74 ++++----
 src/detail/index/indexcell.cpp              |   38 ++--
 src/detail/index/indexoutput.cpp            |   74 ++++----
 src/lasindex.cpp                            |  258 ++++++++++++++--------------
 7 files changed, 255 insertions(+), 252 deletions(-)

diffs (truncated from 1433 to 300 lines):

diff -r 02499bc7f8fd -r 06ba842fc49e CMakeLists.txt
--- a/CMakeLists.txt	Mon Aug 23 11:53:39 2010 -0500
+++ b/CMakeLists.txt	Mon Aug 23 12:01:11 2010 -0600
@@ -289,9 +289,9 @@
     endif()
 endif()
 
-if (WIN32)
-    include(BuildOSGeo4W)
-endif(WIN32)
+#if (WIN32)
+#    include(BuildOSGeo4W)
+#endif(WIN32)
 
 
 
diff -r 02499bc7f8fd -r 06ba842fc49e include/liblas/detail/index/indexcell.hpp
--- a/include/liblas/detail/index/indexcell.hpp	Mon Aug 23 11:53:39 2010 -0500
+++ b/include/liblas/detail/index/indexcell.hpp	Mon Aug 23 12:01:11 2010 -0600
@@ -43,15 +43,18 @@
 #ifndef LIBLAS_DETAIL_INDEXCELL_HPP_INCLUDED
 #define LIBLAS_DETAIL_INDEXCELL_HPP_INCLUDED
 
+// boost
+#include <boost/cstdint.hpp>
+
 #include <map>
 
 namespace liblas { namespace detail {
 
-typedef int16_t ElevExtrema;
-typedef uint32_t ElevRange;
-typedef uint8_t	ConsecPtAccumulator;
-typedef std::map<uint32_t, ConsecPtAccumulator> IndexCellData;
-typedef std::map<uint32_t, IndexCellData> IndexSubCellData;
+typedef boost::int16_t ElevExtrema;
+typedef boost::uint32_t ElevRange;
+typedef boost::uint8_t	ConsecPtAccumulator;
+typedef std::map<boost::uint32_t, ConsecPtAccumulator> IndexCellData;
+typedef std::map<boost::uint32_t, IndexCellData> IndexSubCellData;
 
 class IndexCell
 {
@@ -59,36 +62,36 @@
 	IndexCell();
 	
 private:
-	uint32_t m_FileOffset;
-	uint32_t m_NumPoints;
+	boost::uint32_t m_FileOffset;
+	boost::uint32_t m_NumPoints;
 	ElevExtrema m_MinZ, m_MaxZ;
 	IndexCellData m_PtRecords;
 	IndexSubCellData m_ZCellRecords;
 	IndexSubCellData m_SubCellRecords;
 
 public:
-	void SetFileOffset(uint32_t fos);
-	void SetNumPoints(uint32_t nmp);
-	uint32_t GetFileOffset(void) const;
-	uint32_t GetNumRecords(void) const;
-	uint32_t GetNumPoints(void) const;
-	uint32_t GetNumSubCellRecords(void) const;
-	uint32_t GetNumZCellRecords(void) const;
+	void SetFileOffset(boost::uint32_t fos);
+	void SetNumPoints(boost::uint32_t nmp);
+	boost::uint32_t GetFileOffset(void) const;
+	boost::uint32_t GetNumRecords(void) const;
+	boost::uint32_t GetNumPoints(void) const;
+	boost::uint32_t GetNumSubCellRecords(void) const;
+	boost::uint32_t GetNumZCellRecords(void) const;
 	ElevExtrema GetMinZ(void) const {return m_MinZ;};
 	ElevExtrema GetMaxZ(void) const {return m_MaxZ;};
-	bool RoomToAdd(uint32_t a);
-	void AddPointRecord(uint32_t a);
-	void AddPointRecord(uint32_t a, uint8_t b);
-	bool IncrementPointRecord(uint32_t a);
+	bool RoomToAdd(boost::uint32_t a);
+	void AddPointRecord(boost::uint32_t a);
+	void AddPointRecord(boost::uint32_t a, boost::uint8_t b);
+	bool IncrementPointRecord(boost::uint32_t a);
 	void RemoveMainRecords(void);
 	void RemoveAllRecords(void);
 	void UpdateZBounds(double TestZ);
 	ElevRange GetZRange(void) const;
-	void AddZCell(uint32_t a, uint32_t b);
-	bool IncrementZCell(uint32_t a, uint32_t b);
-	void AddSubCell(uint32_t a, uint32_t b);
-	bool IncrementSubCell(uint32_t a, uint32_t b);
-	uint8_t GetPointRecordCount(uint32_t a);
+	void AddZCell(boost::uint32_t a, boost::uint32_t b);
+	bool IncrementZCell(boost::uint32_t a, boost::uint32_t b);
+	void AddSubCell(boost::uint32_t a, boost::uint32_t b);
+	bool IncrementSubCell(boost::uint32_t a, boost::uint32_t b);
+	boost::uint8_t GetPointRecordCount(boost::uint32_t a);
 	const IndexCellData::iterator GetFirstRecord(void);
 	const IndexCellData::iterator GetEnd(void);
 	const IndexSubCellData::iterator GetFirstSubCellRecord(void);
diff -r 02499bc7f8fd -r 06ba842fc49e include/liblas/detail/index/indexoutput.hpp
--- a/include/liblas/detail/index/indexoutput.hpp	Mon Aug 23 11:53:39 2010 -0500
+++ b/include/liblas/detail/index/indexoutput.hpp	Mon Aug 23 12:01:11 2010 -0600
@@ -58,14 +58,14 @@
 	liblas::Index *m_index;
 	liblas::VariableRecord m_indexVLRHeaderRecord, m_indexVLRCellRecord;
 	IndexVLRData m_indexVLRHeaderData, m_indexVLRCellPointData, m_indexVLRTempData;
-	uint32_t m_VLRCommonDataSize, m_VLRDataSizeLocation, m_FirstCellLocation, m_LastCellLocation;
-	uint32_t  m_DataRecordSize, m_TempWritePos;
+	boost::uint32_t m_VLRCommonDataSize, m_VLRDataSizeLocation, m_FirstCellLocation, m_LastCellLocation;
+	boost::uint32_t  m_DataRecordSize, m_TempWritePos;
 	bool m_FirstCellInVLR, m_SomeDataReadyToWrite;
 	
 protected:
 	bool InitiateOutput(void);
-	bool OutputCell(liblas::detail::IndexCell *CellBlock, uint32_t CurCellX, uint32_t CurCellY);
-	bool InitializeVLRData(uint32_t CurCellX, uint32_t CurCellY);
+	bool OutputCell(liblas::detail::IndexCell *CellBlock, boost::uint32_t CurCellX, boost::uint32_t CurCellY);
+	bool InitializeVLRData(boost::uint32_t CurCellX, boost::uint32_t CurCellY);
 	bool FinalizeOutput(void);
 	
 };
diff -r 02499bc7f8fd -r 06ba842fc49e include/liblas/lasindex.hpp
--- a/include/liblas/lasindex.hpp	Mon Aug 23 11:53:39 2010 -0500
+++ b/include/liblas/lasindex.hpp	Mon Aug 23 12:01:11 2010 -0600
@@ -70,7 +70,7 @@
 // when saved and reloaded from index or las file.
 #define LIBLAS_INDEX_PADLASTVLR
 
-typedef std::vector<uint8_t> IndexVLRData;
+typedef std::vector<boost::uint8_t> IndexVLRData;
 typedef std::vector<liblas::detail::IndexCell> IndexCellRow;
 typedef std::vector<IndexCellRow>	IndexCellDataBlock;
 
@@ -108,7 +108,7 @@
 //		the z dimension may be slower in that event but no less successful.
 
 // A filter operation is invoked with the command:
-//		const std::vector<uint32_t>& Filter(IndexData const& ParamSrc);
+//		const std::vector<boost::uint32_t>& Filter(IndexData const& ParamSrc);
 // The return value is a vector of point ID's. The points can be accessed from the LAS file in the standard way
 //		as the index in no way modifies them or their sequential order.
 // Currently only one, two or three dimensional spatial window filters are supported. See IndexData below for 
@@ -136,11 +136,11 @@
 	Bounds<double> m_bounds;
 	bool m_indexBuilt, m_tempFileStarted, m_readerCreated, m_readOnly, m_writestandaloneindex, m_forceNewIndex;
 	int m_debugOutputLevel;
-    uint32_t m_pointRecordsCount, m_maxMemoryUsage, m_cellsX, m_cellsY, m_cellsZ, m_totalCells, 
+    boost::uint32_t m_pointRecordsCount, m_maxMemoryUsage, m_cellsX, m_cellsY, m_cellsZ, m_totalCells, 
 		m_tempFileWrittenBytes, m_DataVLR_ID;
-    int32_t m_LowXCellCompletelyIn, m_HighXCellCompletelyIn, m_LowYCellCompletelyIn, m_HighYCellCompletelyIn,
+    boost::int32_t m_LowXCellCompletelyIn, m_HighXCellCompletelyIn, m_LowYCellCompletelyIn, m_HighYCellCompletelyIn,
 		m_LowZCellCompletelyIn, m_HighZCellCompletelyIn;
-    int32_t m_LowXBorderCell, m_HighXBorderCell, m_LowYBorderCell, m_HighYBorderCell,
+    boost::int32_t m_LowXBorderCell, m_HighXBorderCell, m_LowYBorderCell, m_HighYBorderCell,
 		m_LowZBorderCell, m_HighZBorderCell;
     double m_rangeX, m_rangeY, m_rangeZ, m_cellSizeZ, m_cellSizeX, m_cellSizeY;
 	double m_filterMinXCell, m_filterMaxXCell, m_filterMinYCell, m_filterMaxYCell, m_filterMinZCell, m_filterMaxZCell,
@@ -149,7 +149,7 @@
 	std::string m_indexAuthor;
 	std::string m_indexComment;
 	std::string m_indexDate;
-	std::vector<uint32_t> m_filterResult;
+	std::vector<boost::uint32_t> m_filterResult;
 	std::ostream *m_ofs;
     FILE *m_tempFile, *m_outputFile;
     FILE *m_debugger;
@@ -161,25 +161,25 @@
 	bool Validate(void);
 	bool LoadIndexVLR(VariableRecord const& vlr);
 	void SetCellFilterBounds(IndexData const& ParamSrc);
-	bool FilterOneVLR(VariableRecord const& vlr, uint32_t& i, IndexData const& ParamSrc);
-	bool VLRInteresting(int32_t MinCellX, int32_t MinCellY, int32_t MaxCellX, int32_t MaxCellY, 
+	bool FilterOneVLR(VariableRecord const& vlr, boost::uint32_t& i, IndexData const& ParamSrc);
+	bool VLRInteresting(boost::int32_t MinCellX, boost::int32_t MinCellY, boost::int32_t MaxCellX, boost::int32_t MaxCellY, 
 		IndexData const& ParamSrc);
-	bool CellInteresting(int32_t x, int32_t y, IndexData const& ParamSrc);
-	bool SubCellInteresting(int32_t SubCellID, int32_t XCellID, int32_t YCellID, IndexData const& ParamSrc);
-	bool ZCellInteresting(int32_t ZCellID, IndexData const& ParamSrc);
-	bool FilterOnePoint(int32_t x, int32_t y, int32_t z, int32_t PointID, int32_t LastPointID, bool &LastPtRead,
+	bool CellInteresting(boost::int32_t x, boost::int32_t y, IndexData const& ParamSrc);
+	bool SubCellInteresting(boost::int32_t SubCellID, boost::int32_t XCellID, boost::int32_t YCellID, IndexData const& ParamSrc);
+	bool ZCellInteresting(boost::int32_t ZCellID, IndexData const& ParamSrc);
+	bool FilterOnePoint(boost::int32_t x, boost::int32_t y, boost::int32_t z, boost::int32_t PointID, boost::int32_t LastPointID, bool &LastPtRead,
 		IndexData const& ParamSrc);
 	// Determines what X/Y cell in the basic cell matrix a point falls in
-	bool IdentifyCell(Point const& CurPt, uint32_t& CurCellX, uint32_t& CurCellY) const;
+	bool IdentifyCell(Point const& CurPt, boost::uint32_t& CurCellX, boost::uint32_t& CurCellY) const;
 	// determines what Z cell a point falls in
-	bool IdentifyCellZ(Point const& CurPt, uint32_t& CurCellZ) const;
+	bool IdentifyCellZ(Point const& CurPt, boost::uint32_t& CurCellZ) const;
 	// Determines what quadrant sub-cell a point falls in
-	bool IdentifySubCell(Point const& CurPt, uint32_t x, uint32_t y, uint32_t& CurSubCell) const;
+	bool IdentifySubCell(Point const& CurPt, boost::uint32_t x, boost::uint32_t y, boost::uint32_t& CurSubCell) const;
 	// Offloads binned cell data while building Index when cell data in memory exceeds maximum set by user
 	bool PurgePointsToTempFile(IndexCellDataBlock& CellBlock);
 	// Reloads and examines one cell of data from temp file
 	bool LoadCellFromTempFile(liblas::detail::IndexCell *CellBlock, 
-		uint32_t CurCellX, uint32_t CurCellY);
+		boost::uint32_t CurCellX, boost::uint32_t CurCellY);
 	// temp file is used to store sorted data while building index
 	FILE *OpenTempFile(void);
 	// closes and removes the temp file
@@ -207,7 +207,7 @@
 
 	// debugging
 	bool OutputCellStats(IndexCellDataBlock& CellBlock)  const;
-	bool OutputCellGraph(std::vector<uint32_t> CellPopulation, uint32_t MaxPointsPerCell)  const;
+	bool OutputCellGraph(std::vector<boost::uint32_t> CellPopulation, boost::uint32_t MaxPointsPerCell)  const;
 	
 public:
 	// IndexFailed and IndexReady can be used to tell if an Index is ready for a filter operation
@@ -216,7 +216,7 @@
     // Prep takes the input data and initializes Index values and then either builds or examines the Index
     bool Prep(IndexData const& ParamSrc);
     // Filter performs a point filter using the bounds in ParamSrc
-    const std::vector<uint32_t>& Filter(IndexData const& ParamSrc);
+    const std::vector<boost::uint32_t>& Filter(IndexData const& ParamSrc);
     // Return the bounds of the current Index
 	double GetMinX(void) const	{return m_bounds.min(0);};
 	double GetMaxX(void) const	{return m_bounds.max(0);};
@@ -230,15 +230,15 @@
 	double GetRangeZ(void) const	{return m_rangeZ;};
 	Bounds<double> const& GetBounds(void) const	{return m_bounds;};
 	// Return the number of points used to build the Index
-	uint32_t GetPointRecordsCount(void) const	{return m_pointRecordsCount;};
+	boost::uint32_t GetPointRecordsCount(void) const	{return m_pointRecordsCount;};
 	// Return the number of cells in the Index
-	uint32_t GetCellsX(void) const	{return m_cellsX;};
-	uint32_t GetCellsY(void) const	{return m_cellsY;};
+	boost::uint32_t GetCellsX(void) const	{return m_cellsX;};
+	boost::uint32_t GetCellsY(void) const	{return m_cellsY;};
 	// Return the number of Z-dimension cells in the Index. Value is 1 if no Z-cells were created during Index building
-	uint32_t GetCellsZ(void) const	{return m_cellsZ;};
+	boost::uint32_t GetCellsZ(void) const	{return m_cellsZ;};
 	// 42 is the ID for the Index header VLR and 43 is the normal ID for the Index data VLR's
 	// For future expansion, multiple indexes could assign data VLR ID's of their own choosing
-	uint32_t GetDataVLR_ID(void) const	{return m_DataVLR_ID;};
+	boost::uint32_t GetDataVLR_ID(void) const	{return m_DataVLR_ID;};
 	// Since the user can define a Z cell size it is useful to examine that for an existing index
 	double GetCellSizeZ(void) const	{return m_cellSizeZ;};
 	// Return values used in building or examining index
@@ -246,7 +246,7 @@
 	bool GetReadOnly(void) const	{return m_readOnly;};
 	bool GetStandaloneIndex(void) const	{return m_writestandaloneindex;};
 	bool GetForceNewIndex(void) const	{return m_forceNewIndex;};
-	uint32_t GetMaxMemoryUsage(void) const	{return m_maxMemoryUsage;};
+	boost::uint32_t GetMaxMemoryUsage(void) const	{return m_maxMemoryUsage;};
 	int GetDebugOutputLevel(void) const {return m_debugOutputLevel;};
 	// Not sure if these are more useful than dangerous
 	Header *GetPointHeader(void) {return &m_pointheader;};
@@ -260,7 +260,7 @@
 	const char *GetIndexDateStr(void)  const;
 	// Methods for setting values used when reading index from file to facilitate moving reading function into
 	// separate IndexInput object at a future time to provide symmetry with IndexOutput
-	void SetDataVLR_ID(uint32_t DataVLR_ID)	{m_DataVLR_ID = DataVLR_ID;};
+	void SetDataVLR_ID(boost::uint32_t DataVLR_ID)	{m_DataVLR_ID = DataVLR_ID;};
 	void SetIndexAuthorStr(const char *ias)	{m_indexAuthor = ias;};
 	void SetIndexCommentStr(const char *ics)	{m_indexComment = ics;};
 	void SetIndexDateStr(const char *ids)	{m_indexDate = ids;};
@@ -270,10 +270,10 @@
 	void SetMaxY(double maxY)	{m_bounds.max(1, maxY);};
 	void SetMinZ(double minZ)	{m_bounds.min(2, minZ);};
 	void SetMaxZ(double maxZ)	{m_bounds.max(2, maxZ);};
-	void SetPointRecordsCount(uint32_t prc)	{m_pointRecordsCount = prc;};
-	void SetCellsX(uint32_t cellsX)	{m_cellsX = cellsX;};
-	void SetCellsY(uint32_t cellsY)	{m_cellsY = cellsY;};
-	void SetCellsZ(uint32_t cellsZ)	{m_cellsZ = cellsZ;};
+	void SetPointRecordsCount(boost::uint32_t prc)	{m_pointRecordsCount = prc;};
+	void SetCellsX(boost::uint32_t cellsX)	{m_cellsX = cellsX;};
+	void SetCellsY(boost::uint32_t cellsY)	{m_cellsY = cellsY;};
+	void SetCellsZ(boost::uint32_t cellsZ)	{m_cellsZ = cellsZ;};
 	
 }; 
 
@@ -347,18 +347,18 @@
 	bool SetInitialValues(std::istream *ifs = 0, Reader *reader = 0, std::ostream *ofs = 0, Reader *idxreader = 0, 
 		const char *tmpfilenme = 0, const char *indexauthor = 0, 
 		const char *indexcomment = 0, const char *indexdate = 0, double zbinht = 0.0, 
-		uint32_t maxmem = LIBLAS_INDEX_MAXMEMDEFAULT, int debugoutputlevel = 0, bool readonly = 0, 
+		boost::uint32_t maxmem = LIBLAS_INDEX_MAXMEMDEFAULT, int debugoutputlevel = 0, bool readonly = 0, 
 		bool writestandaloneindex = 0, bool forcenewindex = 0, FILE *debugger = 0);
 
 	// set the values needed for building an index embedded in existing las file, overriding any existing index
 	bool SetBuildEmbedValues(Reader *reader, std::ostream *ofs, const char *tmpfilenme, const char *indexauthor = 0, 
 		const char *indexcomment = 0, const char *indexdate = 0, double zbinht = 0.0, 
-		uint32_t maxmem = LIBLAS_INDEX_MAXMEMDEFAULT, int debugoutputlevel = 0, FILE *debugger = 0);
+		boost::uint32_t maxmem = LIBLAS_INDEX_MAXMEMDEFAULT, int debugoutputlevel = 0, FILE *debugger = 0);
 
 	// set the values needed for building an index in a standalone file, overriding any existing index
 	bool SetBuildAloneValues(Reader *reader, std::ostream *ofs, const char *tmpfilenme, const char *indexauthor = 0, 
 		const char *indexcomment = 0, const char *indexdate = 0, double zbinht = 0.0, 
-		uint32_t maxmem = LIBLAS_INDEX_MAXMEMDEFAULT, int debugoutputlevel = 0, FILE *debugger = 0);
+		boost::uint32_t maxmem = LIBLAS_INDEX_MAXMEMDEFAULT, int debugoutputlevel = 0, FILE *debugger = 0);
 
 	// set the values needed for filtering with an existing index in an las file
 	bool SetReadEmbedValues(Reader *reader, int debugoutputlevel = 0, FILE *debugger = 0);
@@ -370,13 +370,13 @@
 	// otherwise, prepare the existing index for filtering
 	bool SetReadOrBuildEmbedValues(Reader *reader, std::ostream *ofs, const char *tmpfilenme, const char *indexauthor = 0, 
 		const char *indexcomment = 0, const char *indexdate = 0, double zbinht = 0.0, 
-		uint32_t maxmem = LIBLAS_INDEX_MAXMEMDEFAULT, int debugoutputlevel = 0, FILE *debugger = 0);


More information about the Liblas-commits mailing list