[Liblas-commits] hg-main-tree: keep track of point count when
adding points to th...
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Mar 17 10:42:22 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/e8eb76ff7d24
changeset: 318:e8eb76ff7d24
user: Howard Butler <hobu.inc at gmail.com>
date: Thu Mar 17 09:42:09 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/filters/DecimationFilter.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (23 lines):
diff -r be5c03fb6a62 -r e8eb76ff7d24 src/filters/DecimationFilter.cpp
--- a/src/filters/DecimationFilter.cpp Thu Mar 17 09:29:42 2011 -0500
+++ b/src/filters/DecimationFilter.cpp Thu Mar 17 09:42:09 2011 -0500
@@ -64,16 +64,17 @@
boost::uint32_t DecimationFilter::readBuffer(PointData& dstData)
{
// naive implementation: read a buffer N times larger, then pull out what we need
- PointData srcData(dstData.getSchemaLayout(), dstData.getNumPoints() * m_step);
+ PointData srcData(dstData.getSchemaLayout(), dstData.getCapacity() * m_step);
boost::uint32_t numSrcPointsRead = m_prevStage.read(srcData);
- boost::uint32_t numPoints = dstData.getNumPoints();
+ boost::uint32_t numPoints = dstData.getCapacity();
boost::uint32_t srcIndex = 0;
boost::uint32_t dstIndex = 0;
for (dstIndex=0; dstIndex<numPoints; dstIndex++)
{
dstData.copyPointFast(dstIndex, srcIndex, srcData);
+ dstData.setNumPoints(dstIndex+1);
srcIndex += m_step;
if (srcIndex > numSrcPointsRead) break;
}
More information about the Liblas-commits
mailing list