 |
Voxomap
A C++11 voxel container.
|
Go to the documentation of this file. 1 #ifndef _VOXOMAP_SPARSESUPERCONTAINER_HPP_
2 #define _VOXOMAP_SPARSESUPERCONTAINER_HPP_
9 #include "../iterator.hpp"
10 #include "../SparseIDArray.hpp"
21 template <
class Container>
class VoxelNode;
40 template <
class T_Container,
template <
class...>
class T_InternalContainer = std::vector>
52 const static uint32_t
VOXEL_MASK = Container::VOXEL_MASK;
87 template <
typename Iterator>
94 template <
typename Iterator>
141 template <
typename Iterator,
typename... Args>
149 template <
typename Iterator,
typename... Args>
156 template <
typename Iterator,
typename... Args>
164 template <
typename Iterator,
typename... Args>
185 template <
typename Iterator>
186 void exploreVoxel(Iterator& it, std::function<
void(Iterator
const&)>
const& predicate)
const;
188 void exploreVoxelContainer(std::function<
void(
typename T_Container::VoxelContainer
const&)>
const& predicate)
const;
197 #include "SparseSuperContainer.ipp"
199 #endif // _VOXOMAP_SPARSESUPERCONTAINER_HPP_
uint32_t _nbVoxels
Number of voxels.
SparseSuperContainer()=default
Default constructor.
Super container used in leaves of the VoxelOctree. Mix between a fixed size 3D array (like in ArraySu...
static const uint32_t NB_SUPERCONTAINER
bool removeVoxel(Iterator const &it, Args &&... args)
Remove an existing voxel.
~SparseSuperContainer()=default
Default destructor.
void exploreVoxelContainer(std::function< void(typename T_Container::VoxelContainer const &)> const &predicate) const
typename Container::VoxelData VoxelData
Container * findContainer(uint8_t x, uint8_t y, uint8_t z)
Find sub-container.
uint32_t getNbVoxel() const
Returns number of voxels.
static const uint32_t NB_CONTAINERS
bool hasContainer(uint8_t x) const
Check if there is sub-container.
bool hasContainer(uint8_t x, uint8_t y) const
Check if there is sub-container.
static const uint32_t SUPERCONTAINER_ID
bool updateVoxel(Iterator &it, Args &&... args)
Update an existing voxel, don't create a new one.
bool addVoxel(Iterator &it, Args &&... args)
Add a voxel, don't update an existing voxel.
Node optimized for voxel.
SparseSuperContainer(SparseSuperContainer &&other)=default
Default move constructor.
SparseIDArray< std::unique_ptr< Container >, NB_CONTAINERS, T_InternalContainer > _sparseArray
static const uint32_t VOXEL_MASK
bool hasContainer(uint8_t x, uint8_t y, uint8_t z) const
Check if there is sub-container.
typename Container::VoxelContainer VoxelContainer
static const uint32_t COORD_MASK
Container const * findContainer(uint8_t x, uint8_t y, uint8_t z) const
Find sub-container.
static const uint32_t CONTAINER_MASK
void init(VoxelNode< SparseSuperContainer< Container, T_InternalContainer >> const &)
Initialization method, do nothing.
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.
size_t unserialize(char const *str, size_t size)
Unserialize str inside this.
void putVoxel(Iterator &it, Args &&... args)
Add or update a voxel.
void serialize(std::string &str) const
Serialize the structure.
SparseSuperContainer(SparseSuperContainer const &other)=default
Default Copy constructor.
VoxelData * findVoxel(Iterator &it)
Find voxel.
VoxelData const * findVoxel(Iterator &it) const
Find voxel.
static const uint32_t NB_VOXELS