Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef FastReconstruction_H_
00009 #define FastReconstruction_H_
00010
00011 #include "../geometry/Vertex.hpp"
00012 #include "../geometry/BoundingBox.hpp"
00013 #include "../reconstruction/Reconstructor.hpp"
00014 #include "../reconstruction/LocalApproximation.hpp"
00015 #include "../reconstruction/FastBox.hpp"
00016 #include "../reconstruction/QueryPoint.hpp"
00017
00018 #include <ext/hash_map>
00019 using namespace __gnu_cxx;
00020
00021 namespace lssr
00022 {
00023
00029 template<typename VertexT, typename NormalT>
00030 class FastReconstruction : public Reconstructor<VertexT, NormalT>
00031 {
00032 public:
00033
00044 FastReconstruction(PointCloudManager<VertexT, NormalT> &manager, float resolution, bool isVoxelsize = false);
00045
00046
00050 virtual ~FastReconstruction() {};
00051
00057 virtual void getMesh(BaseMesh<VertexT, NormalT> &mesh);
00058
00059 private:
00060
00064 void calcIndices();
00065
00070 void createGrid();
00071
00075 void calcQueryPointValues();
00076
00088 uint findQueryPoint(const int &position,
00089 const int &i, const int &j, const int &k);
00090
00094 inline size_t hashValue(int i, int j, int k) const
00095 {
00096 return i * m_maxIndexSquare + j * m_maxIndex + k;
00097 }
00098
00102 inline int calcIndex(float f)
00103 {
00104 return f < 0 ? f-.5:f+.5;
00105 }
00106
00108 float m_voxelsize;
00109
00111 size_t m_maxIndex;
00112
00114 size_t m_maxIndexSquare;
00115
00117 size_t m_maxIndexX;
00118
00120 size_t m_maxIndexY;
00121
00123 size_t m_maxIndexZ;
00124
00126 hash_map<size_t, FastBox<VertexT, NormalT>* > m_cells;
00127
00129 vector<QueryPoint<VertexT> > m_queryPoints;
00130 };
00131
00132
00133 }
00134
00135
00136 #include "FastReconstruction.tcc"
00137
00138 #endif