Skip to content

Commit

Permalink
Don't copy point refs.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jul 9, 2020
1 parent 072229a commit b99583c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion plugins/e57/io/E57Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,11 @@ bool E57Reader::fillPoint(PointRef& point)
point_count_t E57Reader::read(PointViewPtr view, point_count_t count)
{
point_count_t numPoints = e57plugin::numPoints(*m_data3D);
PointRef point(*view);
for (PointId counter = 0, nextId = view->size(); counter < numPoints;
++counter, ++nextId)
{
PointRef point(view->point(nextId));
point.setPointId(nextId);
fillPoint(point);
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/e57/io/Scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool Scan::hasPose() const
return m_hasPose;
}

void Scan::transformPoint(pdal::PointRef pt) const
void Scan::transformPoint(pdal::PointRef& pt) const
{
auto x = pt.getFieldAs<double>(pdal::Dimension::Id::X);
auto y = pt.getFieldAs<double>(pdal::Dimension::Id::Y);
Expand Down
2 changes: 1 addition & 1 deletion plugins/e57/io/Scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PDAL_DLL Scan
std::set<std::string> getDimensions() const;
e57::CompressedVectorNode getPoints() const;
bool hasPose() const;
void transformPoint(pdal::PointRef pt) const;
void transformPoint(pdal::PointRef& pt) const;
pdal::BOX3D getBoundingBox() const;
double rescale(pdal::Dimension::Id dim, double value);
StructureNode getPointPrototype();
Expand Down

0 comments on commit b99583c

Please sign in to comment.