35 #ifndef _LVR2_RECONSTRUCTION_HASHGRID_H_ 36 #define _LVR2_RECONSTRUCTION_HASHGRID_H_ 38 #include <unordered_map> 49 using std::unordered_map;
70 virtual void addLatticePoint(
int i,
int j,
int k,
float distance = 0.0) = 0;
93 template<
typename BaseVecT,
typename BoxT>
103 typedef unordered_map<size_t, size_t>
qp_map;
106 typedef typename unordered_map<size_t, BoxT*>::iterator
box_map_it;
166 HashGrid(std::vector<PointBufferPtr> chunks,
179 virtual void addLatticePoint(
int i,
int j,
int k,
float distance = 0.0);
193 void saveCells(
string file);
195 virtual void serialize(
string file);
235 void setCoordinateScaling(
float x,
float y,
float z);
254 return i * m_maxIndexSquare + j * m_maxIndex + k;
266 unsigned int findQueryPoint(
283 return f < 0 ? f - .5 : f + .5;
327 #include "HashGrid.tcc"
unordered_map< size_t, size_t > qp_map
size_t m_maxIndexSquare
The squared maximal index of the reconstruction grid.
box_map m_cells
Map to handle the boxes in the grid.
float m_voxelsize
The voxelsize used for reconstruction.
size_t getNumberOfCells()
unsigned int m_globalIndex
The maximum used cell index within the grid.
size_t m_maxIndexX
The maximal index in x direction.
query_point_it firstQueryPoint()
A dynamic bounding box class.
BoundingBox< BaseVecT > & getBoundingBox()
unordered_map< size_t, BoxT * > box_map
Typedef to alias box map.
size_t m_maxIndexZ
The maximal index in z direction.
vector< QueryPoint< BaseVecT > > m_queryPoints
A vector containing the query points for the reconstruction.
virtual void setExtrusion(bool extrude)
query_point_it lastQueryPoint()
BoundingBox< BaseVecT > qp_bb
vector< QueryPoint< BaseVecT > >::iterator query_point_it
Typedef to alias iterators to query points.
vector< QueryPoint< BaseVecT > > & getQueryPoints()
size_t hashValue(int i, int j, int k) const
Calculates the hash value for the given index triple.
BoundingBox< BaseVecT > m_boundingBox
Bounding box of the covered volume.
GridBase(bool extrude=true)
virtual void addLatticePoint(int i, int j, int k, float distance=0.0)=0
virtual void saveGrid(string file)=0
Saves a representation of the grid to the given file.
BaseVecT m_coordinateScales
Save scaling factors (i.e., -1 or +1) to mapp different coordinate systems.
size_t m_maxIndex
The absolute maximal index of the reconstruction grid.
unordered_map< size_t, BoxT * >::iterator box_map_it
Typedef to alias iterators for box maps.
string m_boxType
True if a local tetraeder decomposition is used for reconstruction.
size_t m_maxIndexY
The maximal index in y direction.