[Liblas-commits] hg-main-tree: removed bounds from read() calls

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Mar 17 15:26:53 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/274b836e6540
changeset: 347:274b836e6540
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Thu Mar 17 15:26:33 2011 -0400
description:
removed bounds from read() calls

diffstat:

 include/libpc/Stage.hpp                    |   4 ++--
 include/libpc/drivers/faux/Reader.hpp      |   2 +-
 include/libpc/drivers/las/Reader.hpp       |   2 +-
 include/libpc/drivers/liblas/Reader.hpp    |   2 +-
 include/libpc/filters/CacheFilter.hpp      |   2 +-
 include/libpc/filters/ColorFilter.hpp      |   2 +-
 include/libpc/filters/CropFilter.hpp       |   2 +-
 include/libpc/filters/DecimationFilter.hpp |   2 +-
 include/libpc/filters/MosaicFilter.hpp     |   2 +-
 src/Chipper.cpp                            |   3 +--
 src/Stage.cpp                              |   4 ++--
 src/Writer.cpp                             |   4 +---
 src/drivers/faux/Reader.cpp                |   4 ++--
 src/drivers/las/Reader.cpp                 |   5 ++---
 src/drivers/liblas/Reader.cpp              |   2 +-
 src/filters/CacheFilter.cpp                |   6 +++---
 src/filters/ColorFilter.cpp                |   4 ++--
 src/filters/CropFilter.cpp                 |   6 +++---
 src/filters/DecimationFilter.cpp           |   6 +++---
 src/filters/MosaicFilter.cpp               |   4 ++--
 test/unit/CacheFilterTest.cpp              |   8 +++-----
 test/unit/DecimationFilterTest.cpp         |   4 +---
 test/unit/FauxReaderTest.cpp               |   8 ++------
 test/unit/FauxWriterTest.cpp               |  18 +++++++++---------
 test/unit/LiblasReaderTest.cpp             |   7 +++----
 test/unit/MosaicFilterTest.cpp             |   4 +---
 26 files changed, 51 insertions(+), 66 deletions(-)

diffs (truncated from 484 to 300 lines):

diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/Stage.hpp
--- a/include/libpc/Stage.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/Stage.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -70,7 +70,7 @@
     // readBuffer function below, not this one.
     //
     // Returns the number of valid points read.
-    boost::uint32_t read(PointData&, const Bounds<double>& bounds);
+    boost::uint32_t read(PointData&);
 
     // advance (or retreat) to the Nth point in the file (absolute, 
     // not relative).  In some cases, this might be a very slow, painful
@@ -92,7 +92,7 @@
 
 protected:
     // Implement this to do the actual work to fill in a buffer of points.
-    virtual boost::uint32_t readBuffer(PointData& pointData, const Bounds<double>& bounds) = 0;
+    virtual boost::uint32_t readBuffer(PointData& pointData) = 0;
 
     // Each concrete stage is repsonsible for managing its own current
     // point index when a read or seek occurs.  Call this function to set
diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/drivers/faux/Reader.hpp
--- a/include/libpc/drivers/faux/Reader.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/drivers/faux/Reader.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -72,7 +72,7 @@
     Iterator* createIterator(const Bounds<double>& bounds);
 
 private:
-    boost::uint32_t readBuffer(PointData&, const Bounds<double>& bounds);
+    boost::uint32_t readBuffer(PointData&);
 
     Mode m_mode;
 
diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/drivers/las/Reader.hpp
--- a/include/libpc/drivers/las/Reader.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/drivers/las/Reader.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -59,7 +59,7 @@
     Iterator* createIterator(const Bounds<double>& bounds);
 
 protected:
-    boost::uint32_t readBuffer(PointData& data, const Bounds<double>& bounds);
+    boost::uint32_t readBuffer(PointData& data);
 
     LasHeader& getLasHeader();
     void setLasHeader(const LasHeader&);
diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/drivers/liblas/Reader.hpp
--- a/include/libpc/drivers/liblas/Reader.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/drivers/liblas/Reader.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -67,7 +67,7 @@
     Iterator* createIterator(const Bounds<double>& bounds);
 
 private:
-    virtual boost::uint32_t readBuffer(PointData& data, const Bounds<double>& bounds);
+    virtual boost::uint32_t readBuffer(PointData& data);
 
     LiblasHeader& getLiblasHeader();
     void setLiblasHeader(const LiblasHeader&);
diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/filters/CacheFilter.hpp
--- a/include/libpc/filters/CacheFilter.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/filters/CacheFilter.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -80,7 +80,7 @@
     Iterator* createIterator(const Bounds<double>& bounds);
 
 private:
-    boost::uint32_t readBuffer(PointData& data, const Bounds<double>& bounds);
+    boost::uint32_t readBuffer(PointData& data);
 
     boost::uint64_t m_numPointsRequested;
     boost::uint64_t m_numPointsRead;
diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/filters/ColorFilter.hpp
--- a/include/libpc/filters/ColorFilter.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/filters/ColorFilter.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -54,7 +54,7 @@
     Iterator* createIterator(const Bounds<double>& bounds);
 
 private:
-    boost::uint32_t readBuffer(PointData& data, const Bounds<double>& bounds);
+    boost::uint32_t readBuffer(PointData& data);
     void checkImpedance();
     void getColor(float value, boost::uint8_t& red, boost::uint8_t& green, boost::uint8_t& blue);
 
diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/filters/CropFilter.hpp
--- a/include/libpc/filters/CropFilter.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/filters/CropFilter.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -55,7 +55,7 @@
     Iterator* createIterator(const Bounds<double>& bounds);
 
 private:
-    boost::uint32_t readBuffer(PointData& data, const Bounds<double>& bounds);
+    boost::uint32_t readBuffer(PointData& data);
 
     Bounds<double> m_bounds;
 
diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/filters/DecimationFilter.hpp
--- a/include/libpc/filters/DecimationFilter.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/filters/DecimationFilter.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -55,7 +55,7 @@
     Iterator* createIterator(const Bounds<double>& bounds);
 
 private:
-    boost::uint32_t readBuffer(PointData& data, const Bounds<double>& bounds);
+    boost::uint32_t readBuffer(PointData& data);
 
     int m_step;
 
diff -r c0f0c4b82e52 -r 274b836e6540 include/libpc/filters/MosaicFilter.hpp
--- a/include/libpc/filters/MosaicFilter.hpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/include/libpc/filters/MosaicFilter.hpp	Thu Mar 17 15:26:33 2011 -0400
@@ -54,7 +54,7 @@
     Iterator* createIterator(const Bounds<double>& bounds);
 
 private:
-    boost::uint32_t readBuffer(PointData& data, const Bounds<double>& bounds);
+    boost::uint32_t readBuffer(PointData& data);
 
     std::vector<Stage*> m_prevStages;
 
diff -r c0f0c4b82e52 -r 274b836e6540 src/Chipper.cpp
--- a/src/Chipper.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/Chipper.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -136,8 +136,7 @@
 
         PointData buffer(schema, num_to_read);
 
-        const Bounds<double>& bounds = Bounds<double>::getDefaultSpatialExtent();
-        boost::uint32_t num_read =  m_stage.read(buffer, bounds);
+        boost::uint32_t num_read =  m_stage.read(buffer);
         
         if (num_read == 0) break;
         assert(num_read <= num_to_read);
diff -r c0f0c4b82e52 -r 274b836e6540 src/Stage.cpp
--- a/src/Stage.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/Stage.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -91,9 +91,9 @@
 }
 
 
-boost::uint32_t Stage::read(PointData& data, const Bounds<double>& bounds)
+boost::uint32_t Stage::read(PointData& data)
 {
-    const boost::uint32_t numPointsRead = readBuffer(data, bounds);
+    const boost::uint32_t numPointsRead = readBuffer(data);
     return numPointsRead;
 }
 
diff -r c0f0c4b82e52 -r 274b836e6540 src/Writer.cpp
--- a/src/Writer.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/Writer.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -73,8 +73,6 @@
 
 boost::uint64_t Writer::write(std::size_t targetNumPointsToWrite)
 {
-    const Bounds<double>& maxBounds = Bounds<double>::getDefaultSpatialExtent();
-
     m_targetNumPointsToWrite = targetNumPointsToWrite;
     m_actualNumPointsWritten = 0;
 
@@ -87,7 +85,7 @@
 
         PointData buffer(m_prevStage.getHeader().getSchema(), numPointsToReadThisChunk);
 
-        boost::uint32_t numPointsReadThisChunk = m_prevStage.read(buffer, maxBounds);
+        boost::uint32_t numPointsReadThisChunk = m_prevStage.read(buffer);
         assert(numPointsReadThisChunk <= numPointsToReadThisChunk);
 
         boost::uint32_t numPointsWrittenThisChunk = writeBuffer(buffer);
diff -r c0f0c4b82e52 -r 274b836e6540 src/drivers/faux/Reader.cpp
--- a/src/drivers/faux/Reader.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/drivers/faux/Reader.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -94,7 +94,7 @@
 }
 
 
-boost::uint32_t Reader::readBuffer(PointData& data, const Bounds<double>& userBounds)
+boost::uint32_t Reader::readBuffer(PointData& data)
 {
     if (data.getSchemaLayout().getSchema().getDimensions().size() != 4)
         throw not_yet_implemented("need to add ability to read from arbitrary fields");
@@ -166,7 +166,7 @@
 }
 
 
-Iterator* Reader::createIterator(const Bounds<double>& bounds)
+Iterator* Reader::createIterator(const Bounds<double>&)
 {
     throw not_yet_implemented("iterator");
 }
diff -r c0f0c4b82e52 -r 274b836e6540 src/drivers/las/Reader.cpp
--- a/src/drivers/las/Reader.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/drivers/las/Reader.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -81,15 +81,14 @@
 
     // BUG: we can move the stream a constant amount
     PointData pointData(getHeader().getSchema(), chunk);
-    const Bounds<double>& maxBounds = Bounds<double>::getDefaultSpatialExtent();
-    read(pointData, maxBounds);
+    read(pointData);
 
     // just drop the points on the floor and return
     return;
 }
 
 
-boost::uint32_t LasReader::readBuffer(PointData& pointData, const Bounds<double>&)
+boost::uint32_t LasReader::readBuffer(PointData& pointData)
 {
     boost::uint32_t numPoints = pointData.getCapacity();
 
diff -r c0f0c4b82e52 -r 274b836e6540 src/drivers/liblas/Reader.cpp
--- a/src/drivers/liblas/Reader.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/drivers/liblas/Reader.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -233,7 +233,7 @@
 }
 
 
-boost::uint32_t LiblasReader::readBuffer(PointData& pointData, const Bounds<double>&)
+boost::uint32_t LiblasReader::readBuffer(PointData& pointData)
 {
     boost::uint32_t numPoints = pointData.getCapacity();
     boost::uint32_t i = 0;
diff -r c0f0c4b82e52 -r 274b836e6540 src/filters/CacheFilter.cpp
--- a/src/filters/CacheFilter.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/filters/CacheFilter.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -113,7 +113,7 @@
 }
 
 
-boost::uint32_t CacheFilter::readBuffer(PointData& data, const Bounds<double>& bounds)
+boost::uint32_t CacheFilter::readBuffer(PointData& data)
 {
     const boost::uint64_t currentPointIndex = getCurrentPointIndex();
 
@@ -122,7 +122,7 @@
     // cached block to satisfy it)
     if (data.getCapacity() != 1)
     {
-        const boost::uint32_t numRead = m_prevStage.read(data, bounds);
+        const boost::uint32_t numRead = m_prevStage.read(data);
 
         // if they asked for a full block and we got a full block,
         // and the block we got is properly aligned and not already cached,
@@ -161,7 +161,7 @@
     }
 
     // Not in the cache, so do a normal read :-(
-    const boost::uint32_t numRead = m_prevStage.read(data, bounds);
+    const boost::uint32_t numRead = m_prevStage.read(data);
     m_numPointsRead += numRead;
     m_numPointsRequested += numRead;
     incrementCurrentPointIndex(numRead);
diff -r c0f0c4b82e52 -r 274b836e6540 src/filters/ColorFilter.cpp
--- a/src/filters/ColorFilter.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/filters/ColorFilter.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -87,9 +87,9 @@
 }
 
 
-boost::uint32_t ColorFilter::readBuffer(PointData& data, const Bounds<double>& bounds)
+boost::uint32_t ColorFilter::readBuffer(PointData& data)
 {
-    m_prevStage.read(data, bounds);
+    m_prevStage.read(data);
 
     boost::uint32_t numPoints = data.getNumPoints();
 
diff -r c0f0c4b82e52 -r 274b836e6540 src/filters/CropFilter.cpp
--- a/src/filters/CropFilter.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/filters/CropFilter.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -62,10 +62,10 @@
 }
 
 
-boost::uint32_t CropFilter::readBuffer(PointData& data, const Bounds<double>& bounds)
+boost::uint32_t CropFilter::readBuffer(PointData& data)
 {
     PointData srcData(data.getSchemaLayout(), data.getCapacity());
-    boost::uint32_t numSrcPointsRead = m_prevStage.read(srcData, bounds);
+    boost::uint32_t numSrcPointsRead = m_prevStage.read(srcData);
 
     const SchemaLayout& schemaLayout = data.getSchemaLayout();
     const Schema& schema = schemaLayout.getSchema();
@@ -103,7 +103,7 @@
 }
 
 
-Iterator* CropFilter::createIterator(const Bounds<double>& bounds)
+Iterator* CropFilter::createIterator(const Bounds<double>&)
 {
     throw not_yet_implemented("iterator");
 }
diff -r c0f0c4b82e52 -r 274b836e6540 src/filters/DecimationFilter.cpp
--- a/src/filters/DecimationFilter.cpp	Thu Mar 17 15:11:02 2011 -0400
+++ b/src/filters/DecimationFilter.cpp	Thu Mar 17 15:26:33 2011 -0400
@@ -62,11 +62,11 @@
 }
 
 
-boost::uint32_t DecimationFilter::readBuffer(PointData& dstData, const Bounds<double>& bounds)
+boost::uint32_t DecimationFilter::readBuffer(PointData& dstData)
 {


More information about the Liblas-commits mailing list