Program Listing for File DualOctree.hpp

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

 /*
 * DualOctree.hpp
 *
 *  Created on: 18.01.2019
 *      Author: Benedikt Schumacher
 */

#ifndef DualOctree_HPP_
#define DualOctree_HPP_

#include <boost/thread.hpp>
#include "OctreeTables.hpp"

namespace lvr2
{

template<typename BaseVecT, typename BoxT>
class DualLeaf
{
public:

    DualLeaf(BaseVecT vertices[]);

    virtual ~DualLeaf(){};

    int getIndex(float distances[]);

    BaseVecT getIntersectionPoint(float intersection, BaseVecT corner_one, BaseVecT corner_two);
    BaseVecT getIntersectionPoint(BaseVecT corner_one, float intersection, BaseVecT corner_two);
    BaseVecT getIntersectionPoint(BaseVecT corner_one, BaseVecT corner_two, float intersection);

    void getIntersections(
            BaseVecT corners[],
            float distance[],
            BaseVecT positions[]);

    void getVertices(
            BaseVecT corners[]);

    uint getIntersection(char i);

    BaseVecT& getMiddle();

    void setIntersection(char i, uint value);

protected:

    float calcIntersection(float x1, float x2, float d1, float d2);

    // Vertices of the represented voxel.
    BaseVecT m_vertices[8];

    // Twelve possible intersections.
    uint m_intersections[12];
};

}

#include "DualOctree.tcc"

#endif /* DualOctree_HPP_ */