Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef FastBox_H_
00009 #define FastBox_H_
00010
00011 #include "../geometry/Vertex.hpp"
00012 #include "../geometry/Normal.hpp"
00013 #include "../reconstruction/QueryPoint.hpp"
00014 #include "../reconstruction/MCTable.hpp"
00015 #include "../reconstruction/FastBoxTables.hpp"
00016 #include <vector>
00017 #include <limits>
00018
00019 using std::vector;
00020 using std::numeric_limits;
00021
00022 namespace lssr
00023 {
00024
00029 template<typename VertexT, typename NormalT>
00030 class FastBox
00031 {
00032 public:
00033
00038 FastBox(VertexT ¢er);
00039
00043 virtual ~FastBox() {};
00044
00053 void setVertex(int index, uint value);
00054
00063 void setNeighbor(int index, FastBox<VertexT, NormalT>* cell);
00064
00071 uint getVertex(int index);
00072
00073
00074 FastBox<VertexT, NormalT>* getNeighbor(int index);
00075
00087 void getSurface(BaseMesh<VertexT, NormalT> &mesh, vector<QueryPoint<VertexT> > &query_points, uint &globalIndex);
00088
00090 static float m_voxelsize;
00091
00093 static uint INVALID_INDEX;
00094 private:
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 float calcIntersection(float x1, float x2, float d1, float d2);
00106
00110 int getIndex(vector<QueryPoint<VertexT> > &query_points);
00111
00118 void getCorners(VertexT corners[], vector<QueryPoint<VertexT> > &query_points);
00119
00126 void getDistances(float distances[], vector<QueryPoint<VertexT> > &query_points);
00127
00136 void getIntersections(VertexT corners[], float distance[], VertexT positions[]);
00137
00139 VertexT m_center;
00140
00142 uint m_vertices[8];
00143
00145 uint m_intersections[12];
00146
00148 FastBox<VertexT, NormalT>* m_neighbors[27];
00149
00150 };
00151
00152 }
00153
00154 #include "FastBox.tcc"
00155
00156 #endif