 |
Voxomap
A C++11 voxel container.
|
Go to the documentation of this file. 1 #ifndef _VOXOMAP_ARRAYSUPERCONTAINER_HPP_
2 #define _VOXOMAP_ARRAYSUPERCONTAINER_HPP_
7 #include "../iterator.hpp"
18 template <
class Container>
class VoxelNode;
29 template <
class T_Container>
41 const static uint32_t
VOXEL_MASK = Container::VOXEL_MASK;
76 template <
typename Iterator>
83 template <
typename Iterator>
130 template <
typename Iterator,
typename... Args>
138 template <
typename Iterator,
typename... Args>
145 template <
typename Iterator,
typename... Args>
153 template <
typename Iterator,
typename... Args>
174 template <
typename Iterator>
175 void exploreVoxel(Iterator& it, std::function<
void(Iterator
const&)>
const& predicate)
const;
186 #include "ArraySuperContainer.ipp"
188 #endif // _VOXOMAP_ARRAYSUPERCONTAINER_HPP_
size_t unserialize(char const *str, size_t size)
Unserialize str inside this.
bool hasContainer(uint8_t x, uint8_t y, uint8_t z) const
Check if there is sub-container.
void serialize(std::string &str) const
Serialize the structure.
VoxelData const * findVoxel(Iterator &it) const
Find voxel.
Container const * findContainer(uint8_t x, uint8_t y, uint8_t z) const
Find sub-container.
~ArraySuperContainer()=default
Default destructor.
void putVoxel(Iterator &it, Args &&... args)
Add or update a voxel.
bool addVoxel(Iterator &it, Args &&... args)
Add a voxel, don't update an existing voxel.
static const uint32_t NB_SUPERCONTAINER
void init(VoxelNode< ArraySuperContainer< Container >> const &)
Initialization method, do nothing.
uint32_t getNbVoxel() const
Returns number of voxels.
ArraySuperContainer()=default
Default constructor.
static const uint32_t COORD_MASK
void exploreVoxelContainer(std::function< void(typename Container::VoxelContainer const &)> const &predicate) const
bool updateVoxel(Iterator &it, Args &&... args)
Update an existing voxel, don't create a new one.
std::unique_ptr< Container > _containerArray[NB_CONTAINERS][NB_CONTAINERS][NB_CONTAINERS]
Array of voxel containers.
Node optimized for voxel.
static const uint32_t NB_VOXELS
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.
bool hasContainer(uint8_t x) const
Check if there is sub-container.
ArraySuperContainer(ArraySuperContainer const &other)
Copy constructor.
typename Container::VoxelData VoxelData
Container * findContainer(uint8_t x, uint8_t y, uint8_t z)
Find sub-container.
static const uint32_t NB_CONTAINERS
static const uint32_t VOXEL_MASK
static const uint32_t CONTAINER_MASK
VoxelData * findVoxel(Iterator &it)
Find voxel.
uint32_t _nbVoxels
Number of voxels.
bool removeVoxel(Iterator const &it, Args &&... args)
Remove an existing voxel.
Super container used in leaves of the VoxelOctree. Based on a fixed size 3D array,...
ArraySuperContainer(ArraySuperContainer &&other)=default
Default move constructor.
static const uint32_t SUPERCONTAINER_ID
bool hasContainer(uint8_t x, uint8_t y) const
Check if there is sub-container.
typename Container::VoxelContainer VoxelContainer