 |
Voxomap
A C++11 voxel container.
|
Go to the documentation of this file. 1 #ifndef _VOXOMAP_SPARSECONTAINER_HPP_
2 #define _VOXOMAP_SPARSECONTAINER_HPP_
6 #include "../iterator.hpp"
7 #include "../SparseIDArray.hpp"
12 template <
typename T_Area>
class VoxelNode;
31 template <
class T_Voxel,
template<
class...>
class T_Container = std::vector>
82 bool hasVoxel(uint8_t x, uint8_t y, uint8_t z)
const;
105 template <
typename Iterator>
112 template <
typename Iterator>
121 template <
typename Iterator,
typename... Args>
129 template <
typename Iterator,
typename... Args>
136 template <
typename Iterator,
typename... Args>
144 template <
typename Iterator>
152 template <
typename Iterator>
153 void exploreVoxel(Iterator& it, std::function<
void(Iterator
const&)>
const& predicate)
const;
176 #include "SparseContainer.ipp"
178 #endif // _VOXOMAP_SPARSECONTAINER_HPP_
static const uint32_t VOXEL_MASK
void putVoxel(Iterator &it, Args &&... args)
Add or update a voxel.
void init(VoxelNode< VoxelContainer > const &)
Initialization method, do nothing.
void exploreVoxelContainer(std::function< void(SparseContainer const &)> const &predicate) const
SparseContainer(SparseContainer const &other)=default
Default copy constructor.
uint16_t getNbVoxel() const
Returns number of voxels.
VoxelData * findVoxel(uint8_t x, uint8_t y, uint8_t z)
Find voxel.
bool hasVoxel(uint8_t x, uint8_t y) const
Check if there is voxel inside.
size_t unserialize(char const *str, size_t size)
Unserialize str inside this.
Node optimized for voxel.
VoxelData const * findVoxel(Iterator &it) const
Find voxel.
SparseContainer()=default
Default constructor.
SparseIDArray< T_Voxel, NB_VOXELS, T_Container > _sparseArray
bool hasVoxel(uint8_t x, uint8_t y, uint8_t z) const
Check if voxel exist.
static const uint32_t NB_SUPERCONTAINER
void exploreVoxel(Iterator &it, std::function< void(Iterator const &)> const &predicate) const
Go through all voxels of the container and call the predicate for each.
static const uint32_t COORD_MASK
bool updateVoxel(Iterator &it, Args &&... args)
Update an existing voxel, don't create a new one.
bool removeVoxel(Iterator const &it, VoxelData *voxel=nullptr)
Remove an existing voxel.
bool hasVoxel(uint8_t x) const
Check if there is voxel inside.
void serialize(std::string &str) const
Serialize the structure.
static const uint32_t NB_VOXELS
VoxelData * findVoxel(Iterator &it)
Find voxel.
Voxel container used in leaves of the VoxelOctree. Mix between a fixed size 3D array (like in ArrayCo...
VoxelData const * findVoxel(uint8_t x, uint8_t y, uint8_t z) const
Find voxel.
bool addVoxel(Iterator &it, Args &&... args)
Add a voxel, don't update an existing voxel.