Program Listing for File PointsetSurface.hpp

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

#ifndef LVR2_RECONSTRUCTION_POINTSETSURFACE_HPP_
#define LVR2_RECONSTRUCTION_POINTSETSURFACE_HPP_

#include <memory>
#include <utility>

#include "lvr2/reconstruction/SearchTree.hpp"
#include "lvr2/geometry/Normal.hpp"
#include "lvr2/types/PointBuffer.hpp"
#include "lvr2/geometry/BoundingBox.hpp"


using std::pair;

namespace lvr2
{


template<typename BaseVecT>
class PointsetSurface
{
public:
    virtual pair<typename BaseVecT::CoordType, typename BaseVecT::CoordType>
        distance(BaseVecT v) const = 0;
    virtual void calculateSurfaceNormals() = 0;

    virtual Normal<float> getInterpolatedNormal(const BaseVecT& position) const;

    virtual PointBufferPtr pointBuffer() const;

    std::shared_ptr<SearchTree<BaseVecT>> searchTree() const;

    const BoundingBox<BaseVecT>& getBoundingBox() const;

    void setKi(int k) { m_ki = k; }

    void setKn(int k) { m_kn = k; }

    void setKd(int k) { m_kd = k; }

    void setFlipPoint(const BaseVecT &flipPoint)
    {
        m_flipPoint = flipPoint;
    }

protected:

    PointsetSurface(PointBufferPtr pointcloud);

    PointsetSurface() = delete;

    PointBufferPtr m_pointBuffer;
    const Channel<float>& m_points;
    // Channel<float>* m_normals;

    std::shared_ptr<SearchTree<BaseVecT>> m_searchTree;

    BoundingBox<BaseVecT> m_boundingBox;

    int m_kn;

    int m_ki;

    int m_kd;

    BaseVecT m_flipPoint;
};

template <typename BaseVecT>
using PointsetSurfacePtr = std::shared_ptr<PointsetSurface<BaseVecT>>;

} // namespace lvr2

#include "PointsetSurface.tcc"

#endif /* LVR2_RECONSTRUCTION_POINTSETSURFACE_HPP_ */