[Liblas-commits] hg-main-tree: the user must always keep track of the point count...

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Mar 17 10:29:49 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/19c40fb42dfb
changeset: 315:19c40fb42dfb
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Mar 17 09:28:33 2011 -0500
description:
the user must always keep track of the point count when doing copyPoint(s)
Subject: hg-main-tree: keep track of point count when adding points to the PointData

details:   http://hg.libpc.orghg-main-tree/rev/f64f4890c07e
changeset: 316:f64f4890c07e
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Mar 17 09:28:59 2011 -0500
description:
keep track of point count when adding points to the PointData
Subject: hg-main-tree: keep track of point count when adding points to the mosaic and use the capacity of the PointData to inform how many points we might be reading instead of PointData::getNumPoints()

details:   http://hg.libpc.orghg-main-tree/rev/be5c03fb6a62
changeset: 317:be5c03fb6a62
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Mar 17 09:29:42 2011 -0500
description:
keep track of point count when adding points to the mosaic and use the capacity of the PointData to inform how many points we might be reading instead of PointData::getNumPoints()

diffstat:

 src/PointData.cpp            |  4 +---
 src/filters/ColorFilter.cpp  |  1 +
 src/filters/MosaicFilter.cpp |  3 ++-
 3 files changed, 4 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 0ee55bbcac4b -r be5c03fb6a62 src/PointData.cpp
--- a/src/PointData.cpp	Thu Mar 17 08:57:14 2011 -0500
+++ b/src/PointData.cpp	Thu Mar 17 09:29:42 2011 -0500
@@ -85,7 +85,7 @@
     std::size_t len = getSchemaLayout().getByteSize();
 
     memcpy(dest, src, len);
-    m_numPoints++;
+
     assert(m_numPoints <= m_capacity);
 
     return;
@@ -102,8 +102,6 @@
 
     memcpy(dest, src, len * numPoints);
     
-    // FIXME: This needs to be smarter
-    m_numPoints = m_numPoints + numPoints;
     assert(m_numPoints <= m_capacity);
 
     return;
diff -r 0ee55bbcac4b -r be5c03fb6a62 src/filters/ColorFilter.cpp
--- a/src/filters/ColorFilter.cpp	Thu Mar 17 08:57:14 2011 -0500
+++ b/src/filters/ColorFilter.cpp	Thu Mar 17 09:29:42 2011 -0500
@@ -111,6 +111,7 @@
         data.setField<boost::uint8_t>(pointIndex, fieldIndexR, red);
         data.setField<boost::uint8_t>(pointIndex, fieldIndexG, green);
         data.setField<boost::uint8_t>(pointIndex, fieldIndexB, blue);
+        data.setNumPoints(pointIndex+1);
 
     }
 
diff -r 0ee55bbcac4b -r be5c03fb6a62 src/filters/MosaicFilter.cpp
--- a/src/filters/MosaicFilter.cpp	Thu Mar 17 08:57:14 2011 -0500
+++ b/src/filters/MosaicFilter.cpp	Thu Mar 17 09:29:42 2011 -0500
@@ -99,7 +99,7 @@
 
     // BUG: this doesn't account for isValid()
 
-    boost::uint32_t totalNumPointsToRead = destData.getNumPoints();
+    boost::uint32_t totalNumPointsToRead = destData.getCapacity();
     boost::uint32_t totalNumPointsRead = 0;
 
     boost::uint64_t currentPointIndex = getCurrentPointIndex();
@@ -128,6 +128,7 @@
             {
                 destData.copyPointFast(destPointIndex, idx, srcData);
                 destPointIndex++;
+                destData.setNumPoints(idx+1);
             }
 
             totalNumPointsRead += pointsGotten;


More information about the Liblas-commits mailing list