Skip to content

Commit

Permalink
Merge pull request #1836 from alicevision/build/nanoflann
Browse files Browse the repository at this point in the history
[src] Comply with nanoflann >= 1.6.0 changes
  • Loading branch information
cbentejac authored Mar 4, 2025
2 parents b9269ec + 94cd032 commit 1c86600
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/aliceVision/fuseCut/Kdtree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ struct PointVectorAdaptator
typedef nanoflann::L2_Simple_Adaptor<double, PointVectorAdaptator> KdTreeDist;
typedef nanoflann::KDTreeSingleIndexAdaptor<KdTreeDist, PointVectorAdaptator, 3> KdTree;

template<typename DistanceType, typename IndexType = size_t>
template<typename _DistanceType, typename IndexType = size_t>
class SmallerPixSizeInRadius
{
public:
// Necessary since nanoflann 1.7.0: https://github.com/jlblancoc/nanoflann/commit/9c84c4c32c2bfa7077cc8873dd3b5bcbb557da90
using DistanceType = _DistanceType;
const DistanceType radius;

const std::vector<double>& m_pixSizePrepare;
Expand Down Expand Up @@ -95,6 +97,9 @@ class SmallerPixSizeInRadius
}

inline DistanceType worstDist() const { return radius; }

// Necessary since nanoflann 1.6.0: https://github.com/jlblancoc/nanoflann/commit/a74fc3b5b359c941d9a00eb9d92c2202c22eca3a
inline void sort() {}
};

class Tree
Expand Down
7 changes: 6 additions & 1 deletion src/software/convert/main_importE57.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ struct PointInfoVectorAdaptator
using PointInfoKdTree =
nanoflann::KDTreeSingleIndexAdaptor<nanoflann::L2_Simple_Adaptor<double, PointInfoVectorAdaptator>, PointInfoVectorAdaptator, 3>;

template<typename DistanceType, typename IndexType = size_t>
template<typename _DistanceType, typename IndexType = size_t>
class BestPointInRadius
{
public:
// Necessary since nanoflann 1.7.0: https://github.com/jlblancoc/nanoflann/commit/9c84c4c32c2bfa7077cc8873dd3b5bcbb557da90
using DistanceType = _DistanceType;
const DistanceType m_radius;
const std::vector<dataio::E57Reader::PointInfo>& m_points;
const std::map<int, Eigen::Vector3d>& m_cameras;
Expand Down Expand Up @@ -122,6 +124,9 @@ class BestPointInRadius

// Upper bound on distance
inline DistanceType worstDist() const { return m_radius; }

// Necessary since nanoflann 1.6.0: https://github.com/jlblancoc/nanoflann/commit/a74fc3b5b359c941d9a00eb9d92c2202c22eca3a
inline void sort() {}
};

// convert from a SfMData format to another
Expand Down

0 comments on commit 1c86600

Please sign in to comment.