snark
Public Types | Public Member Functions | Static Public Member Functions | List of all members
voxel_map< V, D, P > Class Template Reference

#include <voxel_map.h>

Inherits unordered_map< boost::array< comma::int32, D >, V, snark::array_hash< boost::array< comma::int32, D >, D > >.

Public Types

enum  
 number of dimensions
typedef boost::unordered_map
< index_type, voxel_type,
snark::array_hash< index_type,
D > > 
base_type
 base class type
typedef base_type::const_iterator const_iterator
 const iterator type (otherwise it does not build on windows...)
typedef boost::array
< comma::int32, D > 
index_type
 index type
typedef base_type::iterator iterator
 iterator type (otherwise it does not build on windows...)
typedef P point_type
 point type
typedef V voxel_type
 voxel type

Public Member Functions

iterator find (const point_type &point)
 find voxel by point
const_iterator find (const point_type &point) const
 find voxel by point
iterator find (const index_type &index)
 find voxel by index
const_iterator find (const index_type &index) const
 find voxel by index
index_type index_of (const point_type &point) const
 return index of the point, always rounds it down (does floor for given resolution)
std::pair< iterator, bool > insert (const point_type &point, const voxel_type &voxel)
 add voxel at the given point, if it does not exist
const point_typeorigin () const
 return origin
const point_typeresolution () const
 return resolution
iterator touch_at (const point_type &point)
 add voxel at the given point, if it does not exist
 voxel_map (const point_type &origin, const point_type &resolution)
 constructor
 voxel_map (const point_type &resolution)
 constructor for default origin of all zeroes

Static Public Member Functions

static index_type index_of (const point_type &point, const point_type &origin, const point_type &resolution)
 same as index_of( point ), but static
static index_type index_of (const point_type &point, const point_type &resolution)
 same as index_of( point ), but static

Detailed Description

template<typename V, unsigned int D, typename P = Eigen::Matrix< double, D, 1 >>
class snark::voxel_map< V, D, P >

unordered voxel map

it may be a much better choice than voxel grid, whenever operations on a voxel do not depend on its neighbours, and also when the grid extents are not known beforehand


The documentation for this class was generated from the following file: