Program Listing for File LBKdTree.hpp

Return to documentation for file (include/lvr2/reconstruction/LBKdTree.hpp)

#pragma once

#include <memory>

#include "lvr2/geometry/LBPointArray.hpp"

namespace lvr2
{

class LBKdTree {
public:

    LBKdTree(const LBPointArray<float>& vertices, int numThreads = -1);

    ~LBKdTree() = default;

    std::shared_ptr<LBPointArray<float>> getKdTreeValues()
    {
        return m_values;
    }

    std::shared_ptr<LBPointArray<unsigned char>> getKdTreeSplits()
    {
        return m_splits;
    }

private:

    void generateKdTreeRecursive(uint position, uint* indicesStart, uint* indicesEnd, const LBPointArray<float>& vertices);

    std::shared_ptr<LBPointArray<unsigned char>> m_splits;
    std::shared_ptr<LBPointArray<float>> m_values;
};

}  /* namespace lvr2 */