Skip to content

Commit

Permalink
Keep calculateBounds in PointView but redirect to EigenUtils for now
Browse files Browse the repository at this point in the history
  • Loading branch information
chambbj committed Jun 11, 2019
1 parent a8b0bfb commit d668d6e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pdal/PointView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@
****************************************************************************/

#include <iomanip>
#include <numeric>

#include <pdal/EigenUtils.hpp>
#include <pdal/KDIndex.hpp>
#include <pdal/PointView.hpp>
#include <pdal/PointViewIter.hpp>
#include <pdal/util/Algorithm.hpp>

#include <Eigen/Dense>

namespace pdal
{

Expand Down Expand Up @@ -102,6 +99,18 @@ void PointView::setFieldInternal(Dimension::Id dim, PointId idx,
}


void PointView::calculateBounds(BOX2D& output) const
{
pdal::calculateBounds(const_cast<PointView&>(*this), output);
}


void PointView::calculateBounds(BOX3D& output) const
{
pdal::calculateBounds(const_cast<PointView&>(*this), output);
}


MetadataNode PointView::toMetadata() const
{
MetadataNode node;
Expand Down
13 changes: 13 additions & 0 deletions pdal/PointView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,19 @@ class PDAL_DLL PointView : public PointContainer
getFieldInternal(dim, idx, buf);
}

/*! @return a cumulated bounds of all points in the PointView.
\verbatim embed:rst
.. note::
This method requires that an `X`, `Y`, and `Z` dimension be
available, and that it can be casted into a *double* data
type using the :cpp:func:`pdal::Dimension::applyScaling`
method. Otherwise, an exception will be thrown.
\endverbatim
*/
void calculateBounds(BOX2D& box) const;
void calculateBounds(BOX3D& box) const;

void dump(std::ostream& ostr) const;
bool hasDim(Dimension::Id id) const
{ return layout()->hasDim(id); }
Expand Down

0 comments on commit d668d6e

Please sign in to comment.